[libgetdata] 01/03: Imported Upstream version 0.8.9

Steven Benton sbenton-guest at moszumanska.debian.org
Wed Sep 2 03:55:59 UTC 2015


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

sbenton-guest pushed a commit to branch master
in repository libgetdata.

commit 1b600b7331703b407dae097912d553b05b2f85a9
Author: Steven Benton <sbenton at princeton.edu>
Date:   Tue Sep 1 23:12:55 2015 -0400

    Imported Upstream version 0.8.9
---
 AUTHORS                                         |    36 +
 COPYING                                         |   504 +
 COPYING.DOC                                     |   397 +
 ChangeLog                                       |  6016 ++++
 INSTALL                                         |   238 +
 Makefile.am                                     |   176 +
 Makefile.in                                     |  1111 +
 NEWS                                            |  1696 +
 README                                          |   280 +
 TODO                                            |     5 +
 aclocal.m4                                      |  1418 +
 bindings/Makefile.am                            |    63 +
 bindings/Makefile.in                            |   821 +
 bindings/cxx/Makefile.am                        |    59 +
 bindings/cxx/Makefile.in                        |   961 +
 bindings/cxx/bitentry.cpp                       |   117 +
 bindings/cxx/carrayentry.cpp                    |    51 +
 bindings/cxx/constentry.cpp                     |    42 +
 bindings/cxx/dirfile.cpp                        |   573 +
 bindings/cxx/divideentry.cpp                    |    52 +
 bindings/cxx/entry.cpp                          |   213 +
 bindings/cxx/fragment.cpp                       |   116 +
 bindings/cxx/getdata/bitentry.h                 |    62 +
 bindings/cxx/getdata/carrayentry.h              |    57 +
 bindings/cxx/getdata/constentry.h               |    52 +
 bindings/cxx/getdata/dirfile.h                  |   291 +
 bindings/cxx/getdata/divideentry.h              |    52 +
 bindings/cxx/getdata/entry.h                    |   255 +
 bindings/cxx/getdata/fragment.h                 |    94 +
 bindings/cxx/getdata/indexentry.h               |    40 +
 bindings/cxx/getdata/lincomentry.h              |    94 +
 bindings/cxx/getdata/linterpentry.h             |    53 +
 bindings/cxx/getdata/mplexentry.h               |    74 +
 bindings/cxx/getdata/multiplyentry.h            |    52 +
 bindings/cxx/getdata/phaseentry.h               |    58 +
 bindings/cxx/getdata/polynomentry.h             |    75 +
 bindings/cxx/getdata/rawentry.h                 |    66 +
 bindings/cxx/getdata/recipentry.h               |    69 +
 bindings/cxx/getdata/sbitentry.h                |    62 +
 bindings/cxx/getdata/stringentry.h              |    45 +
 bindings/cxx/getdata/windowentry.h              |    66 +
 bindings/cxx/indexentry.cpp                     |    21 +
 bindings/cxx/internal.h                         |    61 +
 bindings/cxx/lincomentry.cpp                    |   221 +
 bindings/cxx/linterpentry.cpp                   |    65 +
 bindings/cxx/mplexentry.cpp                     |   126 +
 bindings/cxx/multiplyentry.cpp                  |    52 +
 bindings/cxx/phaseentry.cpp                     |    75 +
 bindings/cxx/polynomentry.cpp                   |   160 +
 bindings/cxx/rawentry.cpp                       |    82 +
 bindings/cxx/recipentry.cpp                     |   106 +
 bindings/cxx/sbitentry.cpp                      |   118 +
 bindings/cxx/stringentry.cpp                    |    30 +
 bindings/cxx/test/Makefile.am                   |    48 +
 bindings/cxx/test/Makefile.in                   |   823 +
 bindings/cxx/test/big_test.cpp                  |  1809 ++
 bindings/cxx/windowentry.cpp                    |   126 +
 bindings/f77/Makefile.am                        |   114 +
 bindings/f77/Makefile.in                        |   996 +
 bindings/f77/fgetdata.c                         |  4046 +++
 bindings/f77/fgetdata.h                         |   753 +
 bindings/f77/getdata.f.in                       |   378 +
 bindings/f77/getdata.f90.in                     |  2886 ++
 bindings/f77/test/Makefile.am                   |    71 +
 bindings/f77/test/Makefile.in                   |   868 +
 bindings/f77/test/big_test.f                    |  2182 ++
 bindings/f77/test/big_test95.f90                |  2596 ++
 bindings/f77/test/gdcopn.f                      |   111 +
 bindings/f77/test/test_getdata.f.in             |     2 +
 bindings/idl/Makefile.am                        |    95 +
 bindings/idl/Makefile.in                        |   959 +
 bindings/idl/getdata.c                          |  5903 ++++
 bindings/idl/makedlm.sh.in                      |    79 +
 bindings/idl/test/Makefile.am                   |    40 +
 bindings/idl/test/Makefile.in                   |   673 +
 bindings/idl/test/big_test.pro                  |  1402 +
 bindings/idl/test/getdata_idl_test_routines.pro |    70 +
 bindings/make_parameters.c                      |   556 +
 bindings/matlab/Contents.m.head                 |    95 +
 bindings/matlab/Makefile.am                     |   115 +
 bindings/matlab/Makefile.in                     |  1038 +
 bindings/matlab/doc.tail                        |    20 +
 bindings/matlab/gd_add.c                        |    56 +
 bindings/matlab/gd_add_alias.c                  |    58 +
 bindings/matlab/gd_add_bit.m                    |    41 +
 bindings/matlab/gd_add_carray.c                 |    63 +
 bindings/matlab/gd_add_const.c                  |    63 +
 bindings/matlab/gd_add_divide.m                 |    39 +
 bindings/matlab/gd_add_lincom.m                 |    41 +
 bindings/matlab/gd_add_linterp.m                |    40 +
 bindings/matlab/gd_add_mplex.m                  |    43 +
 bindings/matlab/gd_add_multiply.m               |    39 +
 bindings/matlab/gd_add_phase.m                  |    39 +
 bindings/matlab/gd_add_polynom.m                |    40 +
 bindings/matlab/gd_add_raw.m                    |    41 +
 bindings/matlab/gd_add_recip.m                  |    40 +
 bindings/matlab/gd_add_sbit.m                   |    41 +
 bindings/matlab/gd_add_spec.c                   |    56 +
 bindings/matlab/gd_add_string.c                 |    58 +
 bindings/matlab/gd_add_window.m                 |    44 +
 bindings/matlab/gd_alias_target.c               |    54 +
 bindings/matlab/gd_aliases.c                    |    55 +
 bindings/matlab/gd_alter_affixes.c              |    61 +
 bindings/matlab/gd_alter_bit.m                  |    39 +
 bindings/matlab/gd_alter_carray.m               |    40 +
 bindings/matlab/gd_alter_const.m                |    40 +
 bindings/matlab/gd_alter_divide.m               |    39 +
 bindings/matlab/gd_alter_encoding.c             |    60 +
 bindings/matlab/gd_alter_endianness.c           |    63 +
 bindings/matlab/gd_alter_entry.c                |    66 +
 bindings/matlab/gd_alter_frameoffset.c          |    57 +
 bindings/matlab/gd_alter_lincom.m               |    41 +
 bindings/matlab/gd_alter_linterp.m              |    41 +
 bindings/matlab/gd_alter_mplex.m                |    41 +
 bindings/matlab/gd_alter_multiply.m             |    39 +
 bindings/matlab/gd_alter_phase.m                |    39 +
 bindings/matlab/gd_alter_polynom.m              |    39 +
 bindings/matlab/gd_alter_protection.c           |    55 +
 bindings/matlab/gd_alter_raw.m                  |    42 +
 bindings/matlab/gd_alter_recip.m                |    39 +
 bindings/matlab/gd_alter_sbit.m                 |    39 +
 bindings/matlab/gd_alter_spec.c                 |    58 +
 bindings/matlab/gd_alter_window.m               |    40 +
 bindings/matlab/gd_bof.c                        |    56 +
 bindings/matlab/gd_carray_len.c                 |    56 +
 bindings/matlab/gd_carrays.c                    |    61 +
 bindings/matlab/gd_close.c                      |    52 +
 bindings/matlab/gd_constants.c                  |    66 +
 bindings/matlab/gd_delete.c                     |    57 +
 bindings/matlab/gd_delete_alias.c               |    57 +
 bindings/matlab/gd_desync.c                     |    59 +
 bindings/matlab/gd_dirfile_standards.c          |    56 +
 bindings/matlab/gd_dirfilename.c                |    51 +
 bindings/matlab/gd_discard.c                    |    52 +
 bindings/matlab/gd_encoding.c                   |    55 +
 bindings/matlab/gd_endianness.c                 |    56 +
 bindings/matlab/gd_entry.c                      |    59 +
 bindings/matlab/gd_entry_list.c                 |    69 +
 bindings/matlab/gd_entry_type.c                 |    57 +
 bindings/matlab/gd_eof.c                        |    56 +
 bindings/matlab/gd_error.c                      |    54 +
 bindings/matlab/gd_error_string.c               |    55 +
 bindings/matlab/gd_field_list.m                 |    30 +
 bindings/matlab/gd_field_list_by_type.m         |    30 +
 bindings/matlab/gd_flags.c                      |    57 +
 bindings/matlab/gd_flush.c                      |    57 +
 bindings/matlab/gd_fragment_affixes.c           |    60 +
 bindings/matlab/gd_fragment_index.c             |    56 +
 bindings/matlab/gd_fragmentname.c               |    54 +
 bindings/matlab/gd_framenum.c                   |    64 +
 bindings/matlab/gd_frameoffset.c                |    54 +
 bindings/matlab/gd_get_carray.c                 |    70 +
 bindings/matlab/gd_get_carray_slice.c           |    71 +
 bindings/matlab/gd_get_constant.m               |    37 +
 bindings/matlab/gd_get_string.c                 |    64 +
 bindings/matlab/gd_getdata.c                    |    75 +
 bindings/matlab/gd_hidden.c                     |    55 +
 bindings/matlab/gd_hide.c                       |    52 +
 bindings/matlab/gd_include.c                    |    69 +
 bindings/matlab/gd_invalid_dirfile.c            |    45 +
 bindings/matlab/gd_linterp_tablename.c          |    55 +
 bindings/matlab/gd_madd.c                       |    59 +
 bindings/matlab/gd_madd_alias.c                 |    58 +
 bindings/matlab/gd_madd_bit.m                   |    39 +
 bindings/matlab/gd_madd_carray.c                |    62 +
 bindings/matlab/gd_madd_const.c                 |    62 +
 bindings/matlab/gd_madd_divide.m                |    38 +
 bindings/matlab/gd_madd_lincom.m                |    40 +
 bindings/matlab/gd_madd_linterp.m               |    39 +
 bindings/matlab/gd_madd_mplex.m                 |    42 +
 bindings/matlab/gd_madd_multiply.m              |    38 +
 bindings/matlab/gd_madd_phase.m                 |    39 +
 bindings/matlab/gd_madd_polynom.m               |    39 +
 bindings/matlab/gd_madd_recip.m                 |    39 +
 bindings/matlab/gd_madd_sbit.m                  |    39 +
 bindings/matlab/gd_madd_spec.c                  |    55 +
 bindings/matlab/gd_madd_string.c                |    58 +
 bindings/matlab/gd_madd_window.m                |    43 +
 bindings/matlab/gd_malter_spec.c                |    60 +
 bindings/matlab/gd_matlab.h                     |   113 +
 bindings/matlab/gd_mcarrays.c                   |    65 +
 bindings/matlab/gd_mconstants.c                 |    69 +
 bindings/matlab/gd_metaflush.c                  |    50 +
 bindings/matlab/gd_mfield_list.m                |    30 +
 bindings/matlab/gd_mfield_list_by_type.m        |    30 +
 bindings/matlab/gd_move.c                       |    59 +
 bindings/matlab/gd_move_alias.c                 |    55 +
 bindings/matlab/gd_mplex_lookback.c             |    54 +
 bindings/matlab/gd_mstrings.c                   |    57 +
 bindings/matlab/gd_mvector_list.m               |    34 +
 bindings/matlab/gd_naliases.c                   |    55 +
 bindings/matlab/gd_native_type.c                |    57 +
 bindings/matlab/gd_nentries.c                   |    67 +
 bindings/matlab/gd_nfields.m                    |    30 +
 bindings/matlab/gd_nfields_by_type.m            |    30 +
 bindings/matlab/gd_nfragments.c                 |    51 +
 bindings/matlab/gd_nframes.c                    |    51 +
 bindings/matlab/gd_nmfields.m                   |    30 +
 bindings/matlab/gd_nmfields_by_type.m           |    30 +
 bindings/matlab/gd_nmvectors.m                  |    34 +
 bindings/matlab/gd_nvectors.m                   |    34 +
 bindings/matlab/gd_open.c                       |    62 +
 bindings/matlab/gd_parent_fragment.c            |    54 +
 bindings/matlab/gd_protection.c                 |    55 +
 bindings/matlab/gd_put_carray.m                 |    31 +
 bindings/matlab/gd_put_carray_slice.c           |    60 +
 bindings/matlab/gd_put_constant.m               |    31 +
 bindings/matlab/gd_put_string.c                 |    54 +
 bindings/matlab/gd_putdata.c                    |    64 +
 bindings/matlab/gd_raw_close.c                  |    55 +
 bindings/matlab/gd_raw_filename.c               |    55 +
 bindings/matlab/gd_reference.c                  |    57 +
 bindings/matlab/gd_rename.c                     |    58 +
 bindings/matlab/gd_rewrite_fragment.c           |    54 +
 bindings/matlab/gd_seek.c                       |    66 +
 bindings/matlab/gd_spf.c                        |    54 +
 bindings/matlab/gd_strings.c                    |    53 +
 bindings/matlab/gd_strtok.c                     |    69 +
 bindings/matlab/gd_sync.c                       |    56 +
 bindings/matlab/gd_tell.c                       |    56 +
 bindings/matlab/gd_unhide.c                     |    52 +
 bindings/matlab/gd_uninclude.c                  |    56 +
 bindings/matlab/gd_validate.c                   |    55 +
 bindings/matlab/gd_vector_list.m                |    34 +
 bindings/matlab/gd_verbose_prefix.c             |    53 +
 bindings/matlab/getdata_constants.m             |   221 +
 bindings/matlab/make_contents.sh.in             |    55 +
 bindings/matlab/matlab.c                        |  1541 +
 bindings/matlab/test/Makefile.am                |    41 +
 bindings/matlab/test/Makefile.in                |   672 +
 bindings/matlab/test/big_test.m                 |  2241 ++
 bindings/matlab/test/test.sh                    |    10 +
 bindings/perl/Build.PL.in                       |    57 +
 bindings/perl/GetData.pm.in                     |  1239 +
 bindings/perl/GetData.xs                        |  2098 ++
 bindings/perl/MANIFEST.in                       |     2 +
 bindings/perl/Makefile.am                       |   103 +
 bindings/perl/Makefile.in                       |   772 +
 bindings/perl/funclist.pl                       |    19 +
 bindings/perl/simple_funcs.pl                   |   160 +
 bindings/perl/simple_funcs.xsin                 |   157 +
 bindings/perl/t/big_test.t                      |  1739 +
 bindings/perl/t/callback.t                      |    37 +
 bindings/perl/typemap                           |   148 +
 bindings/python/Makefile.am                     |    54 +
 bindings/python/Makefile.in                     |   912 +
 bindings/python/pydirfile.c                     |  3538 ++
 bindings/python/pyentry.c                       |  2485 ++
 bindings/python/pyfragment.c                    |   540 +
 bindings/python/pygetdata.c                     |   673 +
 bindings/python/pygetdata.h                     |   146 +
 bindings/python/test/Makefile.am                |    40 +
 bindings/python/test/Makefile.in                |   673 +
 bindings/python/test/big_test.py                |  2045 ++
 bindings/python/test/callback.py                |    51 +
 compile                                         |   347 +
 config.guess                                    |  1568 +
 config.sub                                      |  1793 ++
 configure                                       | 37261 ++++++++++++++++++++++
 configure.ac                                    |  1134 +
 depcomp                                         |   791 +
 doc/Makefile.am                                 |    56 +
 doc/Makefile.in                                 |   614 +
 doc/README.cxx                                  |   852 +
 doc/README.f77                                  |  2202 ++
 doc/README.f95                                  |   931 +
 doc/README.idl                                  |   954 +
 doc/README.matlab                               |    19 +
 doc/README.perl                                 |    16 +
 doc/README.python                               |    23 +
 doc/unclean_database_recovery.txt               |   184 +
 install-sh                                      |   527 +
 ltmain.sh                                       | 11147 +++++++
 m4/ax_compare_version.m4                        |   174 +
 m4/compiler.m4                                  |   203 +
 m4/encoding.m4                                  |   140 +
 m4/floatordering.m4                             |    69 +
 m4/idl.m4                                       |   134 +
 m4/libtool.m4                                   |  8369 +++++
 m4/ltoptions.m4                                 |   437 +
 m4/ltsugar.m4                                   |   124 +
 m4/ltversion.m4                                 |    23 +
 m4/lt~obsolete.m4                               |    99 +
 m4/matlab.m4                                    |   161 +
 m4/perl.m4                                      |   196 +
 m4/python.m4                                    |   166 +
 m4/version.m4                                   |    45 +
 m4/win32.m4                                     |    43 +
 man/GD_SIZE.3                                   |    59 +
 man/Makefile.am                                 |   129 +
 man/Makefile.in                                 |   834 +
 man/checkdirfile.1                              |    67 +
 man/dirfile-encoding.5                          |   276 +
 man/dirfile-format.5                            |  1557 +
 man/dirfile.5                                   |   135 +
 man/dirfile2ascii.1                             |   163 +
 man/gd_add.3                                    |   230 +
 man/gd_add_alias.3                              |   101 +
 man/gd_add_bit.3                                |   395 +
 man/gd_add_spec.3                               |   164 +
 man/gd_alias_target.3                           |    81 +
 man/gd_aliases.3                                |    84 +
 man/gd_alter_affixes.3                          |   112 +
 man/gd_alter_bit.3                              |   353 +
 man/gd_alter_encoding.3.in                      |   153 +
 man/gd_alter_endianness.3.in                    |   163 +
 man/gd_alter_entry.3                            |   278 +
 man/gd_alter_frameoffset.3.in                   |   141 +
 man/gd_alter_protection.3                       |   103 +
 man/gd_alter_spec.3                             |   175 +
 man/gd_bof.3                                    |   117 +
 man/gd_bof64.3                                  |    54 +
 man/gd_carray_len.3                             |    88 +
 man/gd_carrays.3                                |   144 +
 man/gd_cbopen.3                                 |   741 +
 man/gd_close.3                                  |   115 +
 man/gd_constants.3                              |   110 +
 man/gd_delete.3                                 |   165 +
 man/gd_desync.3                                 |   129 +
 man/gd_dirfile_standards.3                      |   119 +
 man/gd_dirfilename.3                            |    59 +
 man/gd_encoding.3                               |    92 +
 man/gd_endianness.3                             |    78 +
 man/gd_entry.3                                  |   953 +
 man/gd_entry_list.3                             |   210 +
 man/gd_entry_type.3                             |   102 +
 man/gd_eof.3                                    |   143 +
 man/gd_eof64.3                                  |    54 +
 man/gd_error.3                                  |    44 +
 man/gd_error_count.3                            |    58 +
 man/gd_error_string.3                           |    71 +
 man/gd_flags.3                                  |    93 +
 man/gd_flush.3                                  |   120 +
 man/gd_fragment_affixes.3                       |    88 +
 man/gd_fragment_index.3                         |    75 +
 man/gd_fragmentname.3                           |    78 +
 man/gd_framenum_subset.3                        |   174 +
 man/gd_framenum_subset64.3                      |    57 +
 man/gd_frameoffset.3                            |    71 +
 man/gd_frameoffset64.3                          |    65 +
 man/gd_free_entry_strings.3                     |    70 +
 man/gd_get_carray_slice.3                       |   216 +
 man/gd_get_string.3                             |   112 +
 man/gd_getdata.3                                |   375 +
 man/gd_getdata64.3                              |    57 +
 man/gd_hidden.3                                 |    77 +
 man/gd_hide.3                                   |    89 +
 man/gd_include_affix.3                          |   354 +
 man/gd_invalid_dirfile.3                        |    73 +
 man/gd_linterp_tablename.3                      |    97 +
 man/gd_madd_bit.3                               |   334 +
 man/gd_mcarrays.3                               |   147 +
 man/gd_mconstants.3                             |   107 +
 man/gd_metaflush.3                              |    81 +
 man/gd_move.3                                   |   143 +
 man/gd_mplex_lookback.3                         |   124 +
 man/gd_mstrings.3                               |    98 +
 man/gd_naliases.3                               |    62 +
 man/gd_native_type.3                            |   155 +
 man/gd_nentries.3                               |   194 +
 man/gd_nfragments.3                             |    63 +
 man/gd_nframes.3                                |    88 +
 man/gd_nframes64.3                              |    54 +
 man/gd_parent_fragment.3                        |    66 +
 man/gd_parser_callback.3                        |    57 +
 man/gd_protection.3                             |    70 +
 man/gd_put_carray_slice.3                       |   213 +
 man/gd_put_string.3                             |   113 +
 man/gd_putdata.3                                |   267 +
 man/gd_putdata64.3                              |    57 +
 man/gd_raw_filename.3                           |    92 +
 man/gd_reference.3                              |    93 +
 man/gd_rename.3                                 |   122 +
 man/gd_rewrite_fragment.3                       |    86 +
 man/gd_seek.3                                   |   212 +
 man/gd_seek64.3                                 |    55 +
 man/gd_spf.3                                    |    90 +
 man/gd_strings.3                                |    95 +
 man/gd_strtok.3                                 |    97 +
 man/gd_tell.3                                   |   110 +
 man/gd_tell64.3                                 |    54 +
 man/gd_uninclude.3                              |   123 +
 man/gd_validate.3                               |    89 +
 man/gd_verbose_prefix.3                         |    82 +
 missing                                         |   215 +
 src/Makefile.am                                 |   177 +
 src/Makefile.in                                 |  1203 +
 src/add.c                                       |  2171 ++
 src/ascii.c                                     |   393 +
 src/bzip.c                                      |   286 +
 src/close.c                                     |   134 +
 src/common.c                                    |  1425 +
 src/compat.c                                    |   469 +
 src/constant.c                                  |   303 +
 src/debug.c                                     |    55 +
 src/del.c                                       |   555 +
 src/encoding.c                                  |  1022 +
 src/endian.c                                    |   213 +
 src/entry.c                                     |   871 +
 src/errors.c                                    |   364 +
 src/field_list.c                                |   662 +
 src/flimits.c                                   |   585 +
 src/flush.c                                     |  1207 +
 src/fpos.c                                      |   402 +
 src/fragment.c                                  |   411 +
 src/gd_config.h.in                              |   725 +
 src/getdata.c                                   |  2083 ++
 src/getdata.h.in                                |  1216 +
 src/getdata.pc.in                               |    13 +
 src/getdata_legacy.h                            |   130 +
 src/globals.c                                   |   173 +
 src/gzip.c                                      |   220 +
 src/include.c                                   |   565 +
 src/index.c                                     |   297 +
 src/internal.h                                  |  1332 +
 src/legacy.c                                    |   651 +
 src/lzma.c                                      |   336 +
 src/mod.c                                       |  1826 ++
 src/move.c                                      |   542 +
 src/name.c                                      |   738 +
 src/nan.h                                       |    34 +
 src/native.c                                    |   182 +
 src/nfields.c                                   |   149 +
 src/nframes.c                                   |    84 +
 src/open.c                                      |   671 +
 src/parse.c                                     |  2444 ++
 src/protect.c                                   |    90 +
 src/putdata.c                                   |   846 +
 src/raw.c                                       |   150 +
 src/sie.c                                       |   683 +
 src/slim.c                                      |   142 +
 src/spf.c                                       |   120 +
 src/string.c                                    |   120 +
 src/types.c                                     |   688 +
 src/zzip.c                                      |   222 +
 src/zzslim.c                                    |   181 +
 test/Makefile.am                                |   418 +
 test/Makefile.in                                | 10986 +++++++
 test/add.c                                      |    75 +
 test/add_affix.c                                |   105 +
 test/add_alias.c                                |    57 +
 test/add_alias_affix.c                          |    66 +
 test/add_alias_meta.c                           |    57 +
 test/add_bit.c                                  |    67 +
 test/add_bit_bitnum.c                           |    56 +
 test/add_bit_bitsize.c                          |    56 +
 test/add_bit_invalid.c                          |    46 +
 test/add_bit_numbits.c                          |    56 +
 test/add_bit_scalars.c                          |    81 +
 test/add_carray.c                               |    72 +
 test/add_clincom.c                              |    88 +
 test/add_code.c                                 |    54 +
 test/add_const.c                                |    67 +
 test/add_cpolynom.c                             |    80 +
 test/add_crecip.c                               |    71 +
 test/add_crecip89.c                             |    68 +
 test/add_dangle_dup.c                           |    51 +
 test/add_divide.c                               |    65 +
 test/add_divide_invalid.c                       |    44 +
 test/add_duplicate.c                            |    70 +
 test/add_format.c                               |    54 +
 test/add_invalid.c                              |    45 +
 test/add_lincom.c                               |    76 +
 test/add_lincom_affix.c                         |    86 +
 test/add_lincom_invalid.c                       |    48 +
 test/add_lincom_nfields.c                       |    58 +
 test/add_linterp.c                              |    65 +
 test/add_linterp_invalid.c                      |    44 +
 test/add_meta.c                                 |    76 +
 test/add_meta_alias.c                           |    79 +
 test/add_mplex.c                                |    58 +
 test/add_mplex_scalars.c                        |    64 +
 test/add_multiply.c                             |    65 +
 test/add_multiply_invalid.c                     |    44 +
 test/add_phase.c                                |    65 +
 test/add_phase_invalid.c                        |    44 +
 test/add_polynom.c                              |    70 +
 test/add_polynom_scalar.c                       |    79 +
 test/add_protect.c                              |    69 +
 test/add_raw.c                                  |    69 +
 test/add_raw_include.c                          |    71 +
 test/add_raw_invalid.c                          |    44 +
 test/add_raw_spf.c                              |    55 +
 test/add_raw_spf_scalar.c                       |    77 +
 test/add_raw_type.c                             |    55 +
 test/add_rdonly.c                               |    69 +
 test/add_recip.c                                |    65 +
 test/add_resolv.c                               |    57 +
 test/add_sbit.c                                 |    66 +
 test/add_scalar.c                               |    71 +
 test/add_scalar_carray.c                        |    73 +
 test/add_scalar_carray_bad.c                    |    73 +
 test/add_sort.c                                 |   102 +
 test/add_spec.c                                 |    68 +
 test/add_spec_directive.c                       |    59 +
 test/add_spec_invalid.c                         |    45 +
 test/add_spec_meta.c                            |    70 +
 test/add_spec_resolv.c                          |    57 +
 test/add_string.c                               |    67 +
 test/add_string_affix.c                         |    62 +
 test/add_type.c                                 |    53 +
 test/add_window.c                               |    60 +
 test/add_window_op.c                            |    54 +
 test/alias_list.c                               |    71 +
 test/alias_list_alias.c                         |    71 +
 test/alias_list_missing.c                       |    57 +
 test/alias_num.c                                |    57 +
 test/alias_num_alias.c                          |    57 +
 test/alias_num_missing.c                        |    56 +
 test/alias_target.c                             |    52 +
 test/alias_target_alias.c                       |    52 +
 test/alias_target_missing.c                     |    52 +
 test/alter_bit_bitnum.c                         |    77 +
 test/alter_bit_numbits.c                        |    77 +
 test/alter_carray_len.c                         |    69 +
 test/alter_carray_type.c                        |    69 +
 test/alter_const.c                              |    65 +
 test/alter_const_c2r.c                          |    65 +
 test/alter_cpolynom.c                           |    94 +
 test/alter_crecip.c                             |    83 +
 test/alter_crecip89.c                           |    81 +
 test/alter_crecip_zero.c                        |    78 +
 test/alter_divide.c                             |    78 +
 test/alter_entry.c                              |    78 +
 test/alter_entry_affix.c                        |    75 +
 test/alter_entry_hidden.c                       |    69 +
 test/alter_entry_recode.c                       |    94 +
 test/alter_entry_scalar2a.c                     |    72 +
 test/alter_entry_scalar2n.c                     |    80 +
 test/alter_entry_scalar3.c                      |    71 +
 test/alter_entry_scalar4.c                      |    72 +
 test/alter_lincom_23.c                          |    81 +
 test/alter_lincom_32.c                          |    81 +
 test/alter_lincom_affix.c                       |    89 +
 test/alter_lincom_input.c                       |    79 +
 test/alter_lincom_offset.c                      |    80 +
 test/alter_lincom_slope.c                       |    80 +
 test/alter_linterp.c                            |    99 +
 test/alter_linterp_move.c                       |    92 +
 test/alter_mplex.c                              |    79 +
 test/alter_mspec.c                              |    77 +
 test/alter_mspec_affix.c                        |    73 +
 test/alter_multiply.c                           |    78 +
 test/alter_phase.c                              |    77 +
 test/alter_polynom_coeff.c                      |    91 +
 test/alter_polynom_input.c                      |    80 +
 test/alter_polynom_ord.c                        |    80 +
 test/alter_raw_spf.c                            |    89 +
 test/alter_raw_type.c                           |    89 +
 test/alter_recip.c                              |    78 +
 test/alter_recip_zero.c                         |    78 +
 test/alter_scalar_affix.c                       |    91 +
 test/alter_spec.c                               |    89 +
 test/alter_spec_affix.c                         |    70 +
 test/alter_spec_meta.c                          |    77 +
 test/alter_window.c                             |    79 +
 test/ascii_add.c                                |    69 +
 test/ascii_get.c                                |    72 +
 test/ascii_get_get.c                            |    79 +
 test/ascii_nframes.c                            |    67 +
 test/ascii_put.c                                |    88 +
 test/bof.c                                      |    64 +
 test/bof_lincom.c                               |    82 +
 test/bof_phase.c                                |    85 +
 test/bzip_get.c                                 |    95 +
 test/bzip_get_get.c                             |    85 +
 test/bzip_move_from.c                           |   126 +
 test/bzip_nframes.c                             |    92 +
 test/close.c                                    |    50 +
 test/close_bad.c                                |    33 +
 test/close_discard.c                            |    58 +
 test/close_null.c                               |    32 +
 test/convert_complex128_complex64.c             |    92 +
 test/convert_complex128_float64.c               |    74 +
 test/convert_complex128_int64.c                 |    73 +
 test/convert_complex128_uint64.c                |    73 +
 test/convert_complex64_complex128.c             |    91 +
 test/convert_complex64_float64.c                |    74 +
 test/convert_complex64_int64.c                  |    73 +
 test/convert_complex64_uint64.c                 |    73 +
 test/convert_float32_complex128.c               |    85 +
 test/convert_float32_complex64.c                |    85 +
 test/convert_float32_float64.c                  |    75 +
 test/convert_float32_int16.c                    |    74 +
 test/convert_float32_int32.c                    |    74 +
 test/convert_float32_int64.c                    |    74 +
 test/convert_float32_int8.c                     |    74 +
 test/convert_float32_uint16.c                   |    74 +
 test/convert_float32_uint32.c                   |    74 +
 test/convert_float32_uint64.c                   |    74 +
 test/convert_float32_uint8.c                    |    74 +
 test/convert_float64_complex128.c               |    85 +
 test/convert_float64_complex64.c                |    85 +
 test/convert_float64_float32.c                  |    75 +
 test/convert_float64_int16.c                    |    75 +
 test/convert_float64_int32.c                    |    75 +
 test/convert_float64_int64.c                    |    75 +
 test/convert_float64_int8.c                     |    75 +
 test/convert_float64_uint16.c                   |    75 +
 test/convert_float64_uint32.c                   |    75 +
 test/convert_float64_uint64.c                   |    75 +
 test/convert_float64_uint8.c                    |    75 +
 test/convert_int16_complex128.c                 |    85 +
 test/convert_int16_complex64.c                  |    85 +
 test/convert_int16_float32.c                    |    75 +
 test/convert_int16_float64.c                    |    75 +
 test/convert_int16_int32.c                      |    74 +
 test/convert_int16_int64.c                      |    74 +
 test/convert_int16_int8.c                       |    74 +
 test/convert_int16_uint16.c                     |    74 +
 test/convert_int16_uint32.c                     |    74 +
 test/convert_int16_uint64.c                     |    74 +
 test/convert_int16_uint8.c                      |    74 +
 test/convert_int32_complex128.c                 |    85 +
 test/convert_int32_complex64.c                  |    85 +
 test/convert_int32_float32.c                    |    75 +
 test/convert_int32_float64.c                    |    75 +
 test/convert_int32_int16.c                      |    75 +
 test/convert_int32_int64.c                      |    75 +
 test/convert_int32_int8.c                       |    75 +
 test/convert_int32_uint16.c                     |    75 +
 test/convert_int32_uint32.c                     |    75 +
 test/convert_int32_uint64.c                     |    75 +
 test/convert_int32_uint8.c                      |    75 +
 test/convert_int64_complex128.c                 |    85 +
 test/convert_int64_complex64.c                  |    85 +
 test/convert_int64_float32.c                    |    75 +
 test/convert_int64_float64.c                    |    75 +
 test/convert_int64_int16.c                      |    75 +
 test/convert_int64_int32.c                      |    75 +
 test/convert_int64_int8.c                       |    75 +
 test/convert_int64_uint16.c                     |    75 +
 test/convert_int64_uint32.c                     |    75 +
 test/convert_int64_uint64.c                     |    75 +
 test/convert_int64_uint8.c                      |    75 +
 test/convert_int8_complex128.c                  |    85 +
 test/convert_int8_complex64.c                   |    85 +
 test/convert_int8_float32.c                     |    75 +
 test/convert_int8_float64.c                     |    75 +
 test/convert_int8_int16.c                       |    74 +
 test/convert_int8_int32.c                       |    74 +
 test/convert_int8_int64.c                       |    74 +
 test/convert_int8_uint16.c                      |    74 +
 test/convert_int8_uint32.c                      |    74 +
 test/convert_int8_uint64.c                      |    74 +
 test/convert_int8_uint8.c                       |    74 +
 test/convert_uint16_complex128.c                |    85 +
 test/convert_uint16_complex64.c                 |    85 +
 test/convert_uint16_float32.c                   |    75 +
 test/convert_uint16_float64.c                   |    75 +
 test/convert_uint16_int16.c                     |    74 +
 test/convert_uint16_int32.c                     |    74 +
 test/convert_uint16_int64.c                     |    74 +
 test/convert_uint16_int8.c                      |    74 +
 test/convert_uint16_uint32.c                    |    74 +
 test/convert_uint16_uint64.c                    |    74 +
 test/convert_uint16_uint8.c                     |    74 +
 test/convert_uint32_complex128.c                |    85 +
 test/convert_uint32_complex64.c                 |    85 +
 test/convert_uint32_float32.c                   |    75 +
 test/convert_uint32_float64.c                   |    75 +
 test/convert_uint32_int16.c                     |    75 +
 test/convert_uint32_int32.c                     |    75 +
 test/convert_uint32_int64.c                     |    75 +
 test/convert_uint32_int8.c                      |    75 +
 test/convert_uint32_uint16.c                    |    75 +
 test/convert_uint32_uint64.c                    |    75 +
 test/convert_uint32_uint8.c                     |    75 +
 test/convert_uint64_complex128.c                |    85 +
 test/convert_uint64_complex64.c                 |    85 +
 test/convert_uint64_float32.c                   |    75 +
 test/convert_uint64_float64.c                   |    75 +
 test/convert_uint64_int16.c                     |    75 +
 test/convert_uint64_int32.c                     |    75 +
 test/convert_uint64_int64.c                     |    75 +
 test/convert_uint64_int8.c                      |    75 +
 test/convert_uint64_uint16.c                    |    75 +
 test/convert_uint64_uint32.c                    |    75 +
 test/convert_uint64_uint8.c                     |    75 +
 test/convert_uint8_complex128.c                 |    85 +
 test/convert_uint8_complex64.c                  |    85 +
 test/convert_uint8_float32.c                    |    75 +
 test/convert_uint8_float64.c                    |    75 +
 test/convert_uint8_int16.c                      |    74 +
 test/convert_uint8_int32.c                      |    74 +
 test/convert_uint8_int64.c                      |    74 +
 test/convert_uint8_int8.c                       |    74 +
 test/convert_uint8_uint16.c                     |    75 +
 test/convert_uint8_uint32.c                     |    75 +
 test/convert_uint8_uint64.c                     |    75 +
 test/creat.c                                    |    51 +
 test/creat_excl.c                               |    51 +
 test/creat_rdonly.c                             |    51 +
 test/cvlist.c                                   |    69 +
 test/cvlist_array.c                             |    75 +
 test/cvlist_array_hidden.c                      |    67 +
 test/cvlist_array_meta.c                        |    76 +
 test/cvlist_array_meta_hidden.c                 |    68 +
 test/cvlist_hidden.c                            |    60 +
 test/cvlist_invalid.c                           |    47 +
 test/cvlist_meta.c                              |    68 +
 test/cvlist_meta_hidden.c                       |    60 +
 test/cvlist_meta_invalid.c                      |    47 +
 test/del.c                                      |    76 +
 test/del_carray.c                               |    60 +
 test/del_carray_deref.c                         |    63 +
 test/del_const.c                                |    60 +
 test/del_const_deref.c                          |    63 +
 test/del_const_force.c                          |    65 +
 test/del_data.c                                 |    74 +
 test/del_derived.c                              |    59 +
 test/del_derived_after.c                        |    59 +
 test/del_derived_force.c                        |    59 +
 test/del_meta.c                                 |    65 +
 test/del_meta_force.c                           |    68 +
 test/desync.c                                   |    67 +
 test/desync_flush.c                             |    60 +
 test/desync_reopen.c                            |    68 +
 test/desync_reopen_inv.c                        |    68 +
 test/dfes_bit.c                                 |    57 +
 test/dfes_divide.c                              |    56 +
 test/dfes_lincom.c                              |    57 +
 test/dfes_linterp.c                             |    57 +
 test/dfes_multiply.c                            |    57 +
 test/dfes_null.c                                |    36 +
 test/dfes_phase.c                               |    57 +
 test/dfes_raw.c                                 |    57 +
 test/dfes_recip.c                               |    56 +
 test/dfes_zero.c                                |    38 +
 test/elist_alias.c                              |    78 +
 test/elist_hidden.c                             |    75 +
 test/elist_noalias.c                            |    75 +
 test/elist_scalar.c                             |    70 +
 test/encode_alter.c                             |    84 +
 test/encode_get.c                               |    71 +
 test/encode_move.c                              |    82 +
 test/endian_alter.c                             |    97 +
 test/endian_alter_sie.c                         |    97 +
 test/endian_get.c                               |    88 +
 test/endian_move.c                              |    97 +
 test/entry_bad_code.c                           |    60 +
 test/entry_bit.c                                |    69 +
 test/entry_bit_scalar.c                         |    70 +
 test/entry_divide.c                             |    65 +
 test/entry_invalid.c                            |    45 +
 test/entry_lincom.c                             |    75 +
 test/entry_lincom_scalar.c                      |    88 +
 test/entry_linterp.c                            |    65 +
 test/entry_mplex.c                              |    59 +
 test/entry_mplex_scalar.c                       |    66 +
 test/entry_multiply.c                           |    65 +
 test/entry_phase.c                              |    65 +
 test/entry_phase_scalar.c                       |    67 +
 test/entry_polynom.c                            |    69 +
 test/entry_polynom_scalar.c                     |    81 +
 test/entry_raw.c                                |    65 +
 test/entry_raw_scalar.c                         |    67 +
 test/entry_raw_scalar_code.c                    |    60 +
 test/entry_raw_scalar_type.c                    |    60 +
 test/entry_recip.c                              |    67 +
 test/entry_scalar_repr.c                        |    74 +
 test/entry_type.c                               |    60 +
 test/entry_type_alias.c                         |    54 +
 test/entry_window.c                             |    67 +
 test/entry_window_scalar.c                      |    69 +
 test/eof.c                                      |    65 +
 test/eof_index.c                                |    81 +
 test/eof_lincom.c                               |    79 +
 test/eof_phase.c                                |    65 +
 test/error.c                                    |    54 +
 test/error_error.c                              |    40 +
 test/error_num.c                                |    54 +
 test/error_short.c                              |    52 +
 test/error_verbose.c                            |    79 +
 test/error_verbose_prefix.c                     |    90 +
 test/file.c                                     |    78 +
 test/file_code.c                                |    70 +
 test/file_type.c                                |    70 +
 test/flist.c                                    |    83 +
 test/flist_hidden.c                             |    73 +
 test/flist_invalid.c                            |    47 +
 test/flist_meta.c                               |    79 +
 test/flist_meta_hidden.c                        |    71 +
 test/flist_meta_invalid.c                       |    47 +
 test/flist_type.c                               |    83 +
 test/flist_type_hidden.c                        |    75 +
 test/flist_type_invalid.c                       |    47 +
 test/flist_type_meta.c                          |    82 +
 test/flist_type_meta_hidden.c                   |    74 +
 test/flist_type_meta_invalid.c                  |    47 +
 test/flush.c                                    |    88 +
 test/flush_all.c                                |    88 +
 test/flush_bad_code.c                           |    58 +
 test/flush_hex.c                                |    54 +
 test/flush_invalid.c                            |    45 +
 test/flush_meta.c                               |    60 +
 test/flush_ref.c                                |    73 +
 test/flush_spec.c                               |    89 +
 test/foffs_alter.c                              |    75 +
 test/foffs_get.c                                |    70 +
 test/foffs_move.c                               |    75 +
 test/fragment_affix.c                           |    63 +
 test/fragment_affix_alter.c                     |    69 +
 test/fragment_affix_alter2.c                    |    67 +
 test/fragment_affix_dup.c                       |    66 +
 test/fragment_index.c                           |    66 +
 test/fragment_index_alias.c                     |    58 +
 test/fragment_name.c                            |    77 +
 test/fragment_name_oor.c                        |    70 +
 test/fragment_num.c                             |    55 +
 test/fragment_parent.c                          |    64 +
 test/get64.c                                    |    75 +
 test/get_affix.c                                |    78 +
 test/get_bad_code.c                             |    60 +
 test/get_bit.c                                  |    71 +
 test/get_carray.c                               |    63 +
 test/get_carray_c2r.c                           |    62 +
 test/get_carray_len.c                           |    61 +
 test/get_carray_slice.c                         |    63 +
 test/get_char.c                                 |    71 +
 test/get_clincom.c                              |    78 +
 test/get_complex128.c                           |    90 +
 test/get_complex64.c                            |    90 +
 test/get_const.c                                |    62 +
 test/get_const_complex.c                        |    72 +
 test/get_const_repr.c                           |    62 +
 test/get_cpolynom.c                             |    78 +
 test/get_cpolynom1.c                            |    75 +
 test/get_cpolynom_int.c                         |    72 +
 test/get_divide.c                               |    73 +
 test/get_divide_ccin.c                          |    79 +
 test/get_divide_crin.c                          |    79 +
 test/get_divide_crinr.c                         |    77 +
 test/get_divide_rcin.c                          |    79 +
 test/get_divide_s.c                             |    71 +
 test/get_endian16.c                             |    87 +
 test/get_endian32.c                             |    87 +
 test/get_endian64.c                             |    87 +
 test/get_endian8.c                              |    87 +
 test/get_endian_complex128_arm.c                |   226 +
 test/get_endian_complex128_big.c                |   225 +
 test/get_endian_complex128_little.c             |   225 +
 test/get_endian_complex64_arm.c                 |   161 +
 test/get_endian_complex64_big.c                 |   161 +
 test/get_endian_complex64_little.c              |   161 +
 test/get_endian_float32_arm.c                   |   143 +
 test/get_endian_float32_big.c                   |   143 +
 test/get_endian_float32_little.c                |   143 +
 test/get_endian_float64_arm.c                   |   207 +
 test/get_endian_float64_big.c                   |   207 +
 test/get_endian_float64_little.c                |   207 +
 test/get_ff.c                                   |    73 +
 test/get_float32.c                              |    74 +
 test/get_float64.c                              |    74 +
 test/get_foffs.c                                |    71 +
 test/get_foffs2.c                               |    79 +
 test/get_fs.c                                   |    74 +
 test/get_here.c                                 |    76 +
 test/get_here_foffs.c                           |    85 +
 test/get_heres.c                                |    76 +
 test/get_int16.c                                |    75 +
 test/get_int32.c                                |    75 +
 test/get_int64.c                                |    76 +
 test/get_int8.c                                 |    73 +
 test/get_invalid.c                              |    48 +
 test/get_lincom1.c                              |    71 +
 test/get_lincom2.c                              |    71 +
 test/get_lincom3.c                              |    71 +
 test/get_lincom_noin.c                          |    61 +
 test/get_lincom_non.c                           |    71 +
 test/get_lincom_null.c                          |    68 +
 test/get_lincom_spf.c                           |    82 +
 test/get_linterp.c                              |    80 +
 test/get_linterp_noin.c                         |    69 +
 test/get_linterp_notab.c                        |    75 +
 test/get_linterp_sort.c                         |    79 +
 test/get_mplex.c                                |    76 +
 test/get_mplex_bof.c                            |    76 +
 test/get_mplex_lb.c                             |    76 +
 test/get_mplex_lball.c                          |    81 +
 test/get_mplex_nolb.c                           |    79 +
 test/get_multiply.c                             |    71 +
 test/get_multiply_ccin.c                        |    79 +
 test/get_multiply_crin.c                        |    79 +
 test/get_multiply_crinr.c                       |    75 +
 test/get_multiply_noin.c                        |    71 +
 test/get_multiply_rcin.c                        |    79 +
 test/get_multiply_s.c                           |    71 +
 test/get_nonexistent.c                          |    61 +
 test/get_null.c                                 |    69 +
 test/get_off64.c                                |    83 +
 test/get_phase.c                                |    72 +
 test/get_phase_affix.c                          |    73 +
 test/get_polynom.c                              |    72 +
 test/get_polynom_cmpin.c                        |    81 +
 test/get_polynom_noin.c                         |    61 +
 test/get_recip.c                                |    73 +
 test/get_recip_const.c                          |    74 +
 test/get_recurse.c                              |    61 +
 test/get_rofs.c                                 |    83 +
 test/get_sbit.c                                 |    75 +
 test/get_sf.c                                   |    73 +
 test/get_ss.c                                   |    73 +
 test/get_type.c                                 |    72 +
 test/get_uint16.c                               |    74 +
 test/get_uint32.c                               |    76 +
 test/get_uint64.c                               |    75 +
 test/get_window.c                               |    73 +
 test/get_window_clr.c                           |    73 +
 test/get_window_ge.c                            |    73 +
 test/get_window_gt.c                            |    73 +
 test/get_window_le.c                            |    73 +
 test/get_window_lt.c                            |    73 +
 test/get_window_ne.c                            |    73 +
 test/get_window_set.c                           |    73 +
 test/get_zero.c                                 |    74 +
 test/global_flags.c                             |    88 +
 test/global_name.c                              |    62 +
 test/global_ref.c                               |    62 +
 test/global_ref_empty.c                         |    61 +
 test/global_ref_set.c                           |    63 +
 test/gzip_add.c                                 |    84 +
 test/gzip_get.c                                 |    96 +
 test/gzip_get_get.c                             |    95 +
 test/gzip_get_get2.c                            |    92 +
 test/gzip_get_put.c                             |   160 +
 test/gzip_move_from.c                           |   126 +
 test/gzip_move_to.c                             |   116 +
 test/gzip_nframes.c                             |    89 +
 test/gzip_put.c                                 |   121 +
 test/gzip_put_get.c                             |    92 +
 test/header_complex.c                           |    93 +
 test/hide.c                                     |    54 +
 test/hide_hidden.c                              |    57 +
 test/hide_unhide.c                              |    54 +
 test/include.c                                  |    67 +
 test/include_accmode.c                          |    55 +
 test/include_affix.c                            |    59 +
 test/include_auto.c                             |    77 +
 test/include_cb.c                               |    74 +
 test/include_creat.c                            |    58 +
 test/include_ignore.c                           |    74 +
 test/include_index.c                            |    57 +
 test/include_invalid.c                          |    57 +
 test/include_nonexistent.c                      |    57 +
 test/include_pc.c                               |    75 +
 test/include_ref.c                              |    74 +
 test/include_sub.c                              |    77 +
 test/include_syntax.c                           |    65 +
 test/index.c                                    |    75 +
 test/index_domain.c                             |    71 +
 test/index_range.c                              |    71 +
 test/legacy_get.c                               |    72 +
 test/legacy_get_put.c                           |    77 +
 test/legacy_get_rofs.c                          |    73 +
 test/legacy_nframes.c                           |    65 +
 test/legacy_nonexistent.c                       |    45 +
 test/legacy_put.c                               |    82 +
 test/legacy_spf.c                               |    58 +
 test/lzma_get.c                                 |    87 +
 test/lzma_nframes.c                             |    90 +
 test/madd.c                                     |    70 +
 test/madd_affix.c                               |    84 +
 test/madd_alias.c                               |    57 +
 test/madd_alias_affix.c                         |    75 +
 test/madd_bit.c                                 |    67 +
 test/madd_bit_invalid.c                         |    45 +
 test/madd_carray.c                              |    71 +
 test/madd_clincom.c                             |    82 +
 test/madd_const.c                               |    68 +
 test/madd_cpolynom.c                            |    79 +
 test/madd_crecip.c                              |    70 +
 test/madd_crecip89.c                            |    68 +
 test/madd_divide.c                              |    64 +
 test/madd_index.c                               |    72 +
 test/madd_lincom.c                              |    75 +
 test/madd_lincom_invalid.c                      |    47 +
 test/madd_linterp.c                             |    65 +
 test/madd_linterp_invalid.c                     |    44 +
 test/madd_mplex.c                               |    59 +
 test/madd_multiply.c                            |    65 +
 test/madd_multiply_invalid.c                    |    44 +
 test/madd_phase.c                               |    65 +
 test/madd_phase_invalid.c                       |    44 +
 test/madd_polynom.c                             |    71 +
 test/madd_recip.c                               |    65 +
 test/madd_sbit.c                                |    66 +
 test/madd_spec.c                                |    70 +
 test/madd_spec_directive.c                      |    57 +
 test/madd_spec_invalid.c                        |    44 +
 test/madd_spec_resolv.c                         |    58 +
 test/madd_string.c                              |    67 +
 test/madd_window.c                              |    70 +
 test/move.c                                     |    71 +
 test/move_affix.c                               |    71 +
 test/move_affix_dup.c                           |    59 +
 test/move_alias.c                               |    64 +
 test/move_data_enc_ar.c                         |   101 +
 test/move_data_enc_ra.c                         |   106 +
 test/move_data_endian.c                         |   100 +
 test/move_data_foffs.c                          |    90 +
 test/move_data_nop.c                            |    81 +
 test/move_index.c                               |    71 +
 test/move_meta.c                                |    72 +
 test/move_protect.c                             |    71 +
 test/move_subdir.c                              |    84 +
 test/name.c                                     |   133 +
 test/name_affix.c                               |    63 +
 test/name_affix_bad.c                           |    58 +
 test/name_alias.c                               |   173 +
 test/name_dup.c                                 |    51 +
 test/name_move.c                                |    82 +
 test/name_move_alias.c                          |    82 +
 test/name_updb.c                                |    86 +
 test/name_updb_alias.c                          |   119 +
 test/name_updb_const.c                          |    86 +
 test/name_updb_const_alias.c                    |    87 +
 test/nentries_alias.c                           |    61 +
 test/nentries_hidden.c                          |    66 +
 test/nentries_noalias.c                         |    66 +
 test/nentries_scalar.c                          |    66 +
 test/nfields.c                                  |    72 +
 test/nfields_hidden.c                           |    66 +
 test/nfields_invalid.c                          |    48 +
 test/nfields_type.c                             |    72 +
 test/nfields_type_hidden.c                      |    65 +
 test/nfields_type_invalid.c                     |    47 +
 test/nfields_vector.c                           |    65 +
 test/nfields_vector_hidden.c                    |    66 +
 test/nfields_vector_invalid.c                   |    40 +
 test/nframes.c                                  |    66 +
 test/nframes64.c                                |    66 +
 test/nframes_empty.c                            |    54 +
 test/nframes_invalid.c                          |    47 +
 test/nframes_off64.c                            |    74 +
 test/nframes_spf.c                              |    76 +
 test/nmeta.c                                    |    72 +
 test/nmeta_hidden.c                             |    65 +
 test/nmeta_invalid.c                            |    47 +
 test/nmeta_parent.c                             |    72 +
 test/nmeta_type.c                               |    72 +
 test/nmeta_type_hidden.c                        |    65 +
 test/nmeta_type_invalid.c                       |    47 +
 test/nmeta_type_parent.c                        |    72 +
 test/nmeta_vectors.c                            |    72 +
 test/nmeta_vectors_del.c                        |    81 +
 test/nmeta_vectors_hidden.c                     |    65 +
 test/nmeta_vectors_invalid.c                    |    47 +
 test/nmeta_vectors_parent.c                     |    72 +
 test/open.c                                     |    50 +
 test/open_abs.c                                 |    53 +
 test/open_cb_abort.c                            |    70 +
 test/open_cb_cont.c                             |    69 +
 test/open_cb_ignore.c                           |    66 +
 test/open_cb_invalid.c                          |    70 +
 test/open_cb_rescan.c                           |    72 +
 test/open_eaccess.c                             |    60 +
 test/open_nonexistent.c                         |    34 +
 test/open_notdirfile.c                          |    47 +
 test/open_rofs.c                                |    68 +
 test/open_sym_a.c                               |    66 +
 test/open_sym_al.c                              |    66 +
 test/open_sym_at.c                              |    66 +
 test/open_sym_c.c                               |    57 +
 test/open_sym_cl.c                              |    57 +
 test/open_sym_ct.c                              |    57 +
 test/open_sym_p.c                               |    57 +
 test/open_sym_pl.c                              |    57 +
 test/open_sym_pt.c                              |    57 +
 test/parse_alias.c                              |    48 +
 test/parse_alias_code.c                         |    48 +
 test/parse_alias_dup.c                          |    51 +
 test/parse_alias_meta.c                         |    51 +
 test/parse_alias_missing.c                      |    48 +
 test/parse_badline.c                            |    55 +
 test/parse_bit.c                                |    55 +
 test/parse_bit4.c                               |    55 +
 test/parse_bit_bitnum.c                         |    55 +
 test/parse_bit_bitsize.c                        |    55 +
 test/parse_bit_ncols.c                          |    55 +
 test/parse_bit_numbits.c                        |    55 +
 test/parse_bit_scalar.c                         |    55 +
 test/parse_carray.c                             |    55 +
 test/parse_carray_long.c                        |    55 +
 test/parse_const.c                              |    55 +
 test/parse_const_complex.c                      |    74 +
 test/parse_const_ncols.c                        |    55 +
 test/parse_divide.c                             |    55 +
 test/parse_double.c                             |    86 +
 test/parse_duplicate.c                          |    55 +
 test/parse_duplicate_ignore.c                   |    55 +
 test/parse_endian_bad.c                         |    55 +
 test/parse_endian_big.c                         |    55 +
 test/parse_endian_force.c                       |    55 +
 test/parse_endian_little.c                      |    55 +
 test/parse_endian_slash.c                       |    55 +
 test/parse_eol.c                                |    55 +
 test/parse_foffs.c                              |    55 +
 test/parse_foffs_include.c                      |   101 +
 test/parse_foffs_slash.c                        |    55 +
 test/parse_hex.c                                |    81 +
 test/parse_hidden.c                             |    48 +
 test/parse_hidden_field.c                       |    48 +
 test/parse_hidden_meta.c                        |    51 +
 test/parse_include.c                            |    63 +
 test/parse_include_absolute.c                   |    76 +
 test/parse_include_absrel.c                     |    83 +
 test/parse_include_affix_ref.c                  |    65 +
 test/parse_include_dir.c                        |    58 +
 test/parse_include_loop.c                       |    55 +
 test/parse_include_nonexistent.c                |    55 +
 test/parse_include_prefix.c                     |    57 +
 test/parse_include_prefix_dup.c                 |    54 +
 test/parse_include_preprefix.c                  |    66 +
 test/parse_include_ref.c                        |    66 +
 test/parse_include_relabs.c                     |    86 +
 test/parse_include_relrel.c                     |    74 +
 test/parse_include_slash.c                      |    63 +
 test/parse_include_suffix.c                     |    57 +
 test/parse_include_sufsuffix.c                  |    66 +
 test/parse_index.c                              |    55 +
 test/parse_lincom.c                             |    55 +
 test/parse_lincom_ncols1.c                      |    55 +
 test/parse_lincom_ncols2.c                      |    55 +
 test/parse_lincom_nfields.c                     |    55 +
 test/parse_lincom_nofields.c                    |    55 +
 test/parse_lincom_non.c                         |    55 +
 test/parse_lincom_non_ncols.c                   |    55 +
 test/parse_lincom_scalar.c                      |    57 +
 test/parse_linterp.c                            |    55 +
 test/parse_linterp_ncols.c                      |    55 +
 test/parse_malias.c                             |    51 +
 test/parse_malias_dup.c                         |    52 +
 test/parse_malias_meta.c                        |    53 +
 test/parse_meta.c                               |    57 +
 test/parse_meta_affix.c                         |    56 +
 test/parse_meta_alias.c                         |    58 +
 test/parse_meta_implicit.c                      |    64 +
 test/parse_meta_implicit2.c                     |    57 +
 test/parse_meta_implicit_affix.c                |    56 +
 test/parse_meta_index.c                         |    56 +
 test/parse_meta_index2.c                        |    57 +
 test/parse_meta_jump.c                          |    52 +
 test/parse_meta_malias.c                        |    52 +
 test/parse_meta_meta.c                          |    51 +
 test/parse_meta_parent.c                        |    55 +
 test/parse_meta_raw.c                           |    57 +
 test/parse_mplex.c                              |    47 +
 test/parse_mplex_ncols.c                        |    47 +
 test/parse_mplex_nomax.c                        |    53 +
 test/parse_mplex_scalar.c                       |    47 +
 test/parse_multiply.c                           |    55 +
 test/parse_multiply_ncols.c                     |    55 +
 test/parse_name.c                               |    55 +
 test/parse_name_dot.c                           |    55 +
 test/parse_name_ext.c                           |    57 +
 test/parse_name_pedantic.c                      |    55 +
 test/parse_ncols.c                              |    55 +
 test/parse_phase.c                              |    55 +
 test/parse_phase_ncols.c                        |    55 +
 test/parse_phase_scalar.c                       |    55 +
 test/parse_polynom.c                            |    55 +
 test/parse_polynom_ncols1.c                     |    55 +
 test/parse_polynom_ncols2.c                     |    55 +
 test/parse_polynom_scalar.c                     |    57 +
 test/parse_protect_all.c                        |    55 +
 test/parse_protect_bad.c                        |    55 +
 test/parse_protect_data.c                       |    55 +
 test/parse_protect_format.c                     |    55 +
 test/parse_protect_none.c                       |    55 +
 test/parse_quote.c                              |    55 +
 test/parse_quote_mismatch.c                     |    55 +
 test/parse_raw.c                                |    55 +
 test/parse_raw_char.c                           |    55 +
 test/parse_raw_ncols.c                          |    55 +
 test/parse_raw_scalar.c                         |    55 +
 test/parse_raw_spf.c                            |    55 +
 test/parse_raw_type.c                           |    55 +
 test/parse_recip.c                              |    55 +
 test/parse_ref.c                                |    55 +
 test/parse_ref_nonexistent.c                    |    55 +
 test/parse_sbit.c                               |    55 +
 test/parse_sort.c                               |    96 +
 test/parse_string.c                             |    55 +
 test/parse_string_ncols.c                       |    55 +
 test/parse_string_null.c                        |    55 +
 test/parse_utf8.c                               |    71 +
 test/parse_utf8_invalid.c                       |    55 +
 test/parse_utf8_zero.c                          |    55 +
 test/parse_version.c                            |    56 +
 test/parse_version_89.c                         |    62 +
 test/parse_version_98.c                         |    62 +
 test/parse_version_include.c                    |    62 +
 test/parse_version_p8.c                         |    61 +
 test/parse_version_p9.c                         |    61 +
 test/parse_version_permissive.c                 |    56 +
 test/parse_version_slash.c                      |    56 +
 test/parse_whitespace.c                         |    55 +
 test/parse_window.c                             |    55 +
 test/parse_window_ncols.c                       |    55 +
 test/parse_window_op.c                          |    55 +
 test/parse_window_scalar.c                      |    55 +
 test/protect_alter.c                            |    72 +
 test/protect_get.c                              |    69 +
 test/put64.c                                    |    89 +
 test/put_bad_code.c                             |    59 +
 test/put_bit.c                                  |    84 +
 test/put_bof.c                                  |    60 +
 test/put_carray.c                               |    53 +
 test/put_carray_slice.c                         |    66 +
 test/put_char.c                                 |    63 +
 test/put_complex128.c                           |   115 +
 test/put_complex64.c                            |   111 +
 test/put_const.c                                |    61 +
 test/put_const_protect.c                        |    61 +
 test/put_divide.c                               |    71 +
 test/put_endian16.c                             |    84 +
 test/put_endian32.c                             |    84 +
 test/put_endian64.c                             |    84 +
 test/put_endian8.c                              |    83 +
 test/put_endian_complex128_arm.c                |    86 +
 test/put_endian_complex128_big.c                |    86 +
 test/put_endian_complex128_little.c             |    86 +
 test/put_endian_complex64_arm.c                 |    85 +
 test/put_endian_complex64_big.c                 |    85 +
 test/put_endian_complex64_little.c              |    85 +
 test/put_endian_float32_arm.c                   |    75 +
 test/put_endian_float32_big.c                   |    75 +
 test/put_endian_float32_little.c                |    75 +
 test/put_endian_float64_arm.c                   |    77 +
 test/put_endian_float64_big.c                   |    77 +
 test/put_endian_float64_little.c                |    77 +
 test/put_ff.c                                   |    90 +
 test/put_float32.c                              |    87 +
 test/put_float64.c                              |    87 +
 test/put_foffs.c                                |    86 +
 test/put_fs.c                                   |    86 +
 test/put_here.c                                 |    88 +
 test/put_heres.c                                |    88 +
 test/put_int16.c                                |    86 +
 test/put_int32.c                                |    86 +
 test/put_int64.c                                |    86 +
 test/put_int8.c                                 |    86 +
 test/put_invalid.c                              |    48 +
 test/put_lincom1.c                              |    86 +
 test/put_lincom2.c                              |    71 +
 test/put_lincom_noin.c                          |    64 +
 test/put_linterp.c                              |    95 +
 test/put_linterp_noin.c                         |    73 +
 test/put_linterp_nomono.c                       |    76 +
 test/put_linterp_notab.c                        |    66 +
 test/put_linterp_reverse.c                      |    95 +
 test/put_mplex.c                                |    81 +
 test/put_multiply.c                             |    71 +
 test/put_null.c                                 |    59 +
 test/put_off64.c                                |    96 +
 test/put_phase.c                                |    86 +
 test/put_phase_noin.c                           |    64 +
 test/put_polynom1.c                             |    86 +
 test/put_polynom2.c                             |    71 +
 test/put_polynom_noin.c                         |    64 +
 test/put_protect.c                              |    65 +
 test/put_rdonly.c                               |    63 +
 test/put_recip.c                                |    86 +
 test/put_recurse.c                              |    60 +
 test/put_repr.c                                 |    69 +
 test/put_rofs.c                                 |    73 +
 test/put_sbit.c                                 |    84 +
 test/put_sf.c                                   |    86 +
 test/put_ss.c                                   |    86 +
 test/put_string.c                               |    59 +
 test/put_string_protect.c                       |    60 +
 test/put_type.c                                 |    59 +
 test/put_uint16.c                               |    87 +
 test/put_uint32.c                               |    86 +
 test/put_uint64.c                               |    86 +
 test/put_window.c                               |    71 +
 test/put_zero.c                                 |    60 +
 test/ref.c                                      |    85 +
 test/ref_none.c                                 |    84 +
 test/ref_two.c                                  |    86 +
 test/repr_a.c                                   |    85 +
 test/repr_float32.c                             |    84 +
 test/repr_float64.c                             |    84 +
 test/repr_i.c                                   |    85 +
 test/repr_int16.c                               |    84 +
 test/repr_int32.c                               |    83 +
 test/repr_int64.c                               |    83 +
 test/repr_int8.c                                |    83 +
 test/repr_m.c                                   |    85 +
 test/repr_r.c                                   |    85 +
 test/repr_real_a.c                              |    74 +
 test/repr_real_i.c                              |    74 +
 test/repr_real_m.c                              |    74 +
 test/repr_real_r.c                              |    74 +
 test/repr_uint16.c                              |    83 +
 test/repr_uint32.c                              |    83 +
 test/repr_uint64.c                              |    83 +
 test/repr_uint8.c                               |    83 +
 test/seek64.c                                   |    76 +
 test/seek_cur.c                                 |    75 +
 test/seek_end.c                                 |    74 +
 test/seek_foffs.c                               |    74 +
 test/seek_foffs2.c                              |    73 +
 test/seek_neg.c                                 |    70 +
 test/seek_set.c                                 |    74 +
 test/sie_get_big.c                              |    68 +
 test/sie_get_little.c                           |    68 +
 test/sie_move_from.c                            |    84 +
 test/sie_move_to.c                              |    84 +
 test/sie_nframes_big.c                          |    62 +
 test/sie_nframes_little.c                       |    62 +
 test/sie_put_append.c                           |    84 +
 test/sie_put_append2.c                          |    82 +
 test/sie_put_back.c                             |    88 +
 test/sie_put_big.c                              |    83 +
 test/sie_put_little.c                           |    83 +
 test/sie_put_many.c                             |    66 +
 test/sie_put_newo.c                             |    69 +
 test/sie_put_newo0.c                            |    84 +
 test/sie_put_pad.c                              |    81 +
 test/sie_put_pad0.c                             |    84 +
 test/sie_put_trunc.c                            |    78 +
 test/sie_put_trunc2.c                           |    80 +
 test/sie_put_trunc_nf.c                         |    60 +
 test/sie_sync.c                                 |    69 +
 test/slim_get.c                                 |   100 +
 test/slim_nframes.c                             |    92 +
 test/spf.c                                      |    58 +
 test/spf_alias.c                                |    50 +
 test/spf_alias_meta.c                           |    53 +
 test/spf_alias_missing.c                        |    50 +
 test/spf_divide.c                               |    58 +
 test/spf_lincom.c                               |    59 +
 test/spf_multiply.c                             |    59 +
 test/spf_polynom.c                              |    58 +
 test/spf_recip.c                                |    57 +
 test/spf_recurse.c                              |    61 +
 test/svlist.c                                   |    81 +
 test/svlist_hidden.c                            |    73 +
 test/svlist_invalid.c                           |    46 +
 test/svlist_meta.c                              |    85 +
 test/svlist_meta_hidden.c                       |    77 +
 test/svlist_meta_invalid.c                      |    46 +
 test/table.c                                    |    67 +
 test/table_code.c                               |    59 +
 test/table_type.c                               |    59 +
 test/tell.c                                     |    73 +
 test/tell64.c                                   |    75 +
 test/tell_multidiv.c                            |    70 +
 test/test.h                                     |   161 +
 test/tok_arg.c                                  |    56 +
 test/tok_escape.c                               |    72 +
 test/tok_quote.c                                |    72 +
 test/trunc.c                                    |    65 +
 test/trunc_dir.c                                |    70 +
 test/trunc_rdonly.c                             |    60 +
 test/trunc_rofs.c                               |    63 +
 test/trunc_truncsub.c                           |    70 +
 test/unclude.c                                  |    80 +
 test/unclude_del.c                              |    80 +
 test/unclude_move.c                             |    82 +
 test/version_0.c                                |    83 +
 test/version_0_write.c                          |    63 +
 test/version_1.c                                |    84 +
 test/version_1_write.c                          |    63 +
 test/version_2.c                                |    86 +
 test/version_2_write.c                          |    66 +
 test/version_3.c                                |    91 +
 test/version_3_write.c                          |    70 +
 test/version_4.c                                |    90 +
 test/version_4_write.c                          |    70 +
 test/version_5.c                                |    91 +
 test/version_5_strict.c                         |   105 +
 test/version_5_write.c                          |    67 +
 test/version_6.c                                |    84 +
 test/version_6_strict.c                         |   108 +
 test/version_6_write.c                          |    62 +
 test/version_7.c                                |    84 +
 test/version_7_strict.c                         |    98 +
 test/version_7_write.c                          |    63 +
 test/version_8.c                                |    87 +
 test/version_8_strict.c                         |    97 +
 test/version_8_write.c                          |    67 +
 test/version_9.c                                |    89 +
 test/version_9_strict.c                         |   121 +
 test/version_9_write.c                          |   104 +
 test/vlist.c                                    |    79 +
 test/vlist_alias.c                              |    83 +
 test/vlist_hidden.c                             |    69 +
 test/vlist_invalid.c                            |    46 +
 test/vlist_meta.c                               |    82 +
 test/vlist_meta_hidden.c                        |    74 +
 test/vlist_meta_invalid.c                       |    47 +
 test/xz_get.c                                   |    88 +
 test/xz_nframes.c                               |    90 +
 test/zzip_data.c                                |    93 +
 test/zzip_get.c                                 |    91 +
 test/zzip_get_get.c                             |    88 +
 test/zzip_nframes.c                             |    93 +
 test/zzslim_get.c                               |    98 +
 test/zzslim_nframes.c                           |    98 +
 util/Makefile.am                                |    39 +
 util/Makefile.in                                |   752 +
 util/checkdirfile.c                             |   247 +
 util/dirfile2ascii.c                            |   538 +
 1406 files changed, 275909 insertions(+)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..6787106
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,36 @@
+C. B. Netterfield <netterfield at astro.utoronto.ca> developed the original
+dirfile standard and created the first GetData library.
+
+D. V. Wiebe <dvw at ketiltrout.net> developed the "large dirfile extension"
+(AKA Standards Version 3) and currently maintains GetData and the dirfile
+standards.
+
+Ted Kisner <tskisner.public at gmail.com> wrote the PutData library
+(libdirfile).
+
+Sean Bryan <sean.bryan at case.edu> provided code which was adapted to create
+the MATLAB bindings.
+
+Eli Fidler <eli at staikos.net> ported PutData to this version of the GetData
+library.
+
+Joseph Fowler <jfowler at princeton.edu> provided code which was adapted to
+create the slimlib encoding support.
+
+Adam D Hincks <adam.hincks at utoronto.ca> provided code whic was adapted to
+create the zzip encoding support.  The original zzip encoding (ZIRFILE) was
+developed by Mike Nolta <nolta at cita.utoronto.ca>.
+
+Peter Kümmel <syntheticpp at gmx.net> ported GetData to MSVC (Windows).
+
+George Staikos <staikos at kde.org> maintained the GetData library as part of
+kst.
+
+Adam Treat <treat at kde.org> wrote the code for the PHASE field type.
+
+Matthew Truch <matt at truch.net> wrote the dirfile2ascii conversion utility.
+
+Andrew Walker <arwalker at sumusltd.com> maintained the GetData library as
+part of kst.
+
+vi: tw=75
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..602bfc9
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+

+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+

+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+

+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+

+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+

+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+

+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+

+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+

+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/COPYING.DOC b/COPYING.DOC
new file mode 100644
index 0000000..4a0fe1c
--- /dev/null
+++ b/COPYING.DOC
@@ -0,0 +1,397 @@
+		GNU Free Documentation License
+		  Version 1.2, November 2002
+
+
+ Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
+     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The "Document", below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as "you".  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject.  (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+   from that of the Document, and from those of previous versions
+   (which should, if there were any, be listed in the History section
+   of the Document).  You may use the same title as a previous version
+   if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+   responsible for authorship of the modifications in the Modified
+   Version, together with at least five of the principal authors of the
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+   Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+   adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+   giving the public permission to use the Modified Version under the
+   terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+   and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
+   publisher of the Modified Version as given on the Title Page.  If
+   there is no section Entitled "History" in the Document, create one
+   stating the title, year, authors, and publisher of the Document as
+   given on its Title Page, then add an item describing the Modified
+   Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+   public access to a Transparent copy of the Document, and likewise
+   the network locations given in the Document for previous versions
+   it was based on.  These may be placed in the "History" section.
+   You may omit a network location for a work that was published at
+   least four years before the Document itself, or if the original
+   publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
+   and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+   unaltered in their text and in their titles.  Section numbers
+   or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements".  Such a section
+   may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+   or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications".  You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License.  Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License.  However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time.  Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.  See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+    Copyright (c)  YEAR  YOUR NAME.
+    Permission is granted to copy, distribute and/or modify this document
+    under the terms of the GNU Free Documentation License, Version 1.2
+    or any later version published by the Free Software Foundation;
+    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+    A copy of the license is included in the section entitled "GNU
+    Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+    with the Invariant Sections being LIST THEIR TITLES, with the
+    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..16fb79d
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,6016 @@
+2015-07-24   D. V. Wiebe <getdata at ketiltrout.net> svn:980
+	* src/sie.c (_GD_SampIndSize): Fix return value.
+
+	* 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.
+
+	* 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/python/pyfragment.c (gdpy_fragment_getprefix
+	gdpy_fragment_getsuffix): Fix memory leaks.
+
+	* 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.
+
+	* src/common.c (_GD_GetRepr): Only set field_code to field_code_in if
+	necessary.
+
+	* src/entry.c (gd_linterp_tablename): Fix error reporting.
+
+	* src/flush.c (_GD_StringEscapeise): Fix upper nibble of hex encoding.
+	* test/flush_hex.c: Added.
+
+	* src/getdata.c (_GD_DoBit): Fix sign mask.
+
+	* src/mod.c (_GD_AlterScalar): Remove duplicate case.
+
+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.
+
+	* src/raw.c (_GD_RawSeek): Handle landing in the middle of a sample.
+
+	* src/raw.c (_GD_RawSeek): Remember the actual position, not the
+	requested position.
+
+	* bindings/idl/test/Makefile.am bindings/matlab/test/Makefile.am
+	bindings/perl/Makefile.am bindings/python/test/Makefile.am: Fix
+	DL_LIBRARY_PATH ordering.
+
+	* bindings/perl/GetData.pm.in: Fix perldoc markup.
+
+2015-05-20   D. V. Wiebe <getdata at ketiltrout.net> svn:976
+	* cmake/test/CMakeLists.txt: blacklist gzip tests.
+
+	* src/getdata.h.in: Don't attempt to use __nonnull.
+
+	* configure.ac: Fix cygwin check.
+
+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.
+
+2015-05-13   D. V. Wiebe <getdata at ketiltrout.net> svn:969
+	GetData-0.8.8 released:
+
+	* src/getdata.h.in: Delete all the __REDIRECTs.
+
+	* test/get_uint32.c test/get_uint64.c: Fix signed integer overflow.
+
+	* 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.
+
+	* Makefile.am: Don't run matlabdistcheck and idldistcheck against an
+	installed GetData.
+
+2015-05-11   D. V. Wiebe <getdata at ketiltrout.net> svn:966
+	GetData-0.8.7 released.
+
+2015-05-08   D. V. Wiebe <getdata at ketiltrout.net> svn:965
+	GetData-0.8.7rc3:
+
+	* 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
+
+	* m4/python.m4: dnl the simple module check.
+
+2015-05-07   D. V. Wiebe <getdata at ketiltrout.net> svn:964
+	GetData-0.8.7rc2.
+
+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.
+
+2015-05-06   D. V. Wiebe <getdata at ketiltrout.net> svn:962
+	GetData-0.8.7rc1:
+
+	Backport build system fixes from trunk, rev 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.
+
+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.
+
+2015-05-01   D. V. Wiebe <getdata at ketiltrout.net> svn:960
+	Steve's SIE fixes:
+
+	* src/sie.c (_GD_SampIndSeek): Behave when seeking on an empty file.
+
+	* src/sie.c (_GD_SampIndWrite): Update cur_end when reallocing p.
+
+	* src/sie.c (_GD_SampIndWrite): Fix fence-post error in memcpy.
+
+	* test/sie_put_steve.c: Added.
+
+	Also:
+
+	* src/sie.c (_GD_SampIndDoOpen): Initialise fd from fdin.
+
+2015-04-30   D. V. Wiebe <getdata at ketiltrout.net> svn:959
+	Backport SIE fixes from trunk:
+
+	* 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)
+
+	* src/sie.c (_GD_SampIndWrite): Deallocate buffers on error. (r877)
+
+	* 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)
+
+	* src/sie.c (_GD_Advance): remember the previous record in f->l.  Also set
+	f->bof. (r867)
+
+	* src/sie.c (_GD_SampIndSeek): check stdio calls for failure.  Correctly
+	format a padding record when write seeking past the EOF. (r867)
+
+	* 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)
+
+2015-04-30   D. V. Wiebe <getdata at ketiltrout.net> svn:956
+	* bindings/f77/fgetdata.c (GDREFE): Convert a passed empty string to NULL.
+
+	* bindings/f77/getdata.f90.in (fgd_reference): Handle empty string from
+	GDREFE.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getreference): Handle NULL from
+	gd_reference.
+
+	* 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.
+
+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
+	gdpy_dirfile_getmvectorlist gdpy_dirfile_aliaslist gdpy_dirfile_entrylist(:
+	Call gdpy_to_pystringlist();
+	* bindings/python/pygetdata.c (gdpy_convert_to_pylist)
+	bindings/python/pydirfile.c (gdpy_dirfile_carrays gdpy_dirfile_getconstants
+	gdpy_dirfile_mcarrays gdpy_dirfile_getstrings): Call gdpylist_append().
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getstring): Fix clean-up on
+	error.
+
+	* test/add_raw_spf_scalar.c: Initialise E.
+	* test/open_sym_a.c test/open_sym_al.c test/open_sym_at.c test/tok_escape.c
+	test/tok_quote.c: Free strings.
+
+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.
+
+2014-12-07   D. V. Wiebe <getdata at ketiltrout.net> svn:935
+	GetData-0.8.6 released.
+
+2014-12-06   D. V. Wiebe <getdata at ketiltrout.net> svn:932
+	Backport more bugfixes from trunk:
+
+	* src/native.c (_GD_NativeType): Don't always return GD_FLOAT64 for LINCOMs.
+	(r867)
+
+	* src/putdata.c (_GD_MplexOutData): Fix computation of complex data. (r867)
+
+	* src/open.c (_GD_CreateDirfile _GD_Open): Close descriptors on error.
+	(r877)
+
+	* src/types.c (_GD_ConvertType): Add missing break. (r877)
+
+	* 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/parse.c (_GD_ParseCarray): Return on error. (r877)
+
+	* src/parse.c (_GD_ParseFieldSpec): Only resize the dot_list when necessary.
+	Also, clean up if the resize doesn't work. (r877)
+
+	* src/getdata.h.in: Remove __nonnull__ from parameter two of
+	gd_verbose_prefix. (r877)
+
+	* 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)
+
+	* bindings/python/pyentry.c (gdpy_entry_seta): Set a[i] if the pyobj is
+	complex. (r877)
+
+	* bindings/cxx/entry.cpp (Entry::Entry): Zero E if gd_entry call fails.
+	(r877)
+
+	* bindings/cxx/fragment.cpp (Fragment::Fragment): Handle error in
+	gd_fragment_affixes call. (r877)
+
+	* bindings/f77/fgetdata.c (GDASCA): Handle error in gd_entry call. (r877)
+
+	* util/dirfile2ascii.c (main): Fix check for too many fields. (r877)
+
+2014-12-06   D. V. Wiebe <getdata at ketiltrout.net> svn:931
+	Backport more bugfixes from trunk:
+
+	* 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)
+
+	* 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/mod.c (_GD_Change): Fix MPLEX scalar modifying. (r848)
+
+2014-12-05   D. V. Wiebe <getdata at ketiltrout.net> svn:930
+	Backport bugfixes from trunk:
+
+	* bindings/cxx/rawentry.cpp (RawEntry::RawEntry): Initialise filename.
+	Patch from S. J. Benton. (r863)
+
+	* src/add.c (_GD_Add): Set the right suberror (GD_E_ENTRY_POLYORD) for
+	poly_ord out of range. (r867)
+
+	* 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/fpos.c (_GD_Seek): Fix sign on PHASE shift. (r867)
+
+	* src/fpos.c (gd_seek64): Pass index_pos=-1 to _GD_GetFilePos. (r867)
+
+	* src/getdata.c (_GD_CDivideData): Fix computation of complex division.
+	(r867)
+
+	* src/index.c (_GD_GetIndex): Fix extrapolations performed when required to
+	search for the EOF. (r867)
+	* src/index.c (gd_framenum_subset64): Fix conversion of field_end from
+	frames to samples. (r867)
+
+	* 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. (r867)
+
+	* src/mod.c (gd_alter_spec gd_malter_spec): Set move flags for POLYNOM
+	entries to ensure co-efficients are updated. (r867)
+
+	* src/parse.c (_GD_Tokenise): Fix parsing of \x and \u.  Don't unnecessarily
+	overwrite earlier errors with GD_E_FORMAT_UNTERM. (r867)
+
+	* bindings/idl/getdata.c (gdidl_rename): Fix handling of UPDATEDB. (r867)
+
+	* bindings/cxx/getdata/entry.h (Entry::CompScal): Allow non-zero for
+	RECIP, too. (r868)
+
+	* 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/internal.h: Fix pointer arithmetic in C89 gd_cap_ macro. (r872)
+
+	* bindings/python/pyfragment.c (gdpy_fragment_init): Fix typo in keyword
+	names. (r876)
+
+	* Makefile.am: Auotmake version bumped to 1.13. (r915)
+	* configure.ac: Autoconf version bumped to 2.65. (r915)
+
+2013-09-05   D. V. Wiebe <getdata at ketiltrout.net> svn:845
+	GetData-0.8.5 released.
+
+	* src/zzslim.c: Fix for rename of gd_raw_file_.
+
+2013-07-17   D. V. Wiebe <getdata at ketiltrout.net> svn:835
+	
+	* bindings/python/pydirfile.c: Remove spurious debug printf.
+
+	* bindings/doc/Makefile.am: Fix make clean
+
+	* bindings/bindings/perl/Makefile.am: Fix make clean
+
+2013-05-14   D. V. Wiebe <getdata at ketiltrout.net> svn:832
+	GetData-0.8.4 released.
+
+2013-04-11   D. V. Wiebe <getdata at ketiltrout.net> svn:830
+	GetData-0.8.4rc2:
+
+	* bindings/perl/Build.PL.in: make include_dirs an array.  Reported by Seth.
+
+	* bindings/idl/package/configure.ac bindings/matlab/package/configure.ac:
+	Require GetData >= 0.8.4.
+
+2013-04-10   D. V. Wiebe <getdata at ketiltrout.net> svn:829
+	GetData-0.8.4rc1.
+
+2013-04-06   D. V. Wiebe <getdata at ketiltrout.net> svn:827
+	* bindings/cxx/getdata/entry.h (Entry::CountMax)
+	bindings/cxx/getdata/mplexentry.h (MplexEntry::CountMax
+	MplexEntry::SetCountMax): Added (but marked deprecated) for backwards
+	compatibility.
+
+2013-04-05   D. V. Wiebe <getdata at ketiltrout.net> svn:826
+	* bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+	bindings/perl/t/big_test.t: Fix test 231.
+
+2013-04-05   D. V. Wiebe <getdata at ketiltrout.net> svn:825
+	* src/getdata.h.in: Renamed gd_entry_t.count_max to gd_entry_t.period.
+
+	* bindings/cxx/getdata/entry.h (Entry::Period)
+	bindings/cxx/getdata/mplexentry.h (NplexEntry::Period): Renamed from CountMax.
+	* bindings/cxx/mplexentry.cpp (MplexEntry::SetPeriod): Renamed from
+	SetCountMax.
+	* bindings/cxx/mplexentry.cpp (MplexEntry::MplexEntry)
+	bindings/f77/fgetdata.c (GDGEMX) bindings/f77/getdata.f90.in (fgd_entry
+	fgd_add fgd_madd fgd_alter_entry fgd_add_mplex fgd_madd_mplex
+	fgd_alter_mplex) bindings/idl/getdata.c (gdidl_make_idl_entry
+	gdidl_alter_mplex) bindings/matlab/gd_add_mplex.m
+	bindings/matlab/gd_alter_mplex.m bindings/matlab/gd_madd_mplex.m
+	bindings/matlab/matlab.c (gdmx_from_entry gdmx_to_entry)
+	bindings/perl/GetData.xs (gdp_to_entry entry) bindings/python/pyentry.c
+	(gdpy_set_entry_from_tuple gdpy_entry_getperiod gdpy_entry_setperiod
+	gdpy_entry_getparms): Rename count_max to period.
+
+	* src/add.c (_GD_Add): Fix range checks on MPLEX parameters.
+
+	* src/getdata.c (_GD_DoMplex): The default period is 2n+1, not 2n.
+
+	* src/internal.h: Rename GD_E_ENTRY_CNTMAX to GD_E_ENTRY_PERIOD.
+	* src/errors.c: Update GD_E_ENTRY_PERIOD and GD_E_FORMAT_MPLEXVAL messages.
+
+	* src/mod.c (_GD_Change): mplex.count_val = -1 is not a magic value.
+
+	* src/parse.c (_GD_ParseMplex): Remove incorrect restrictions count_val <=
+	period and count_val >= 0.
+
+	* bindings/idl/getdata.c (gdidl_read_idl_entry): Properly convert an IDL
+	MPLEX entry object.
+
+	* bindings/idl/getdata.c (gdidl_alter_mplex): Handle missing COUNT_VAL.
+
+	* man/dirfile-format.5: Fix and clarify MPLEX specification.
+
+2013-03-13   D. V. Wiebe <getdata at ketiltrout.net> svn:819
+	* src/flush.c (_GD_FlushFragment): Strip affixes from field codes in
+	/REFERENCE directives.
+	* test/flush_ref.c test/parse_include_affix_ref.c: Added.
+
+2013-03-12   D. V. Wiebe <getdata at ketiltrout.net> svn:818
+	* bindings/python/pydirfile.c (gdpy_dirfile_getdata): Resize the ndarray
+	before returning it, if necessary.  Also, don't try to read past the EOF in
+	read-to-end mode.
+
+	* src/fpos.c (_GD_GetFilePos): Fix computation of two input field derived
+	types to properly return MULTIPOS when necessary.
+	* test/tell_multidiv.c: Added.
+
+	* src/fpos.c (_GD_Seek): Return error if trying to place the I/O pointer
+	before sample zero.
+	* test/seek_neg.c: Added.
+
+	* src/gzip.c (_GD_GzipSeek): Allow seeking to sample zero.
+	* test/gzip_get_get2.c: Added.
+
+2013-03-12   D. V. Wiebe <getdata at ketiltrout.net> svn:815
+	GetData-0.8.3 released.
+
+2013-03-09   D. V. Wiebe <getdata at ketiltrout.net> svn:807
+	* src/flush.c: C89-ify the GD_VERS_... constants.
+
+2013-03-08   D. V. Wiebe <getdata at ketiltrout.net> svn:806
+	GetData-0.8.3rc1.
+
+2013-03-08   D. V. Wiebe <getdata at ketiltrout.net> svn:803
+	* src/internal.h (gd_put_unalinged64): Fix spelling.
+
+	* src/encoding.c (_GD_FiniRawIO): Don't pass NULL to gd_UnlinkAt.
+
+	* man/GD_SIZE.3: Added.
+
+	* configure.ac: Turn on fast unaligned access for armv[6789] per Dinar
+	Valeev.  Also add add --enable-fast-unaligned to allow users to override the
+	check.
+
+2013-02-15   D. V. Wiebe <getdata at ketiltrout.net> svn:795
+	* bindings/matlab/package: Added.
+	* Makefile.am: Add matlabdist and matlabdistcheck
+
+	* doc/README.matlab bindings/matlab/make_contents.sh.in
+	bindings/matlab/Contents.m.head bindings/matlab/doc.tail: Added.
+
+	* bindinag/matlab/matlab.c (gdmx_from_carrays): Added.
+	* bindings/matlab/gd_mcarrays.c: Added.
+	* bindings/matlab/test/big_test.m: Add test 243.
+
+	* bindings/matlab/gd_include.c: Renamed from gd_include_affix.c
+	* bindings/matlab/gd_include.m: Deleted.
+
+2013-02-13   D. V. Wiebe <getdata at ketiltrout.net> svn:794
+	* bindings/cxx/test/big_test.cpp bindings/perl/t/big_test.t
+	bindings/python/test/big_test.py: Add test 243.
+
+2013-02-06   D. V. Wiebe <getdata at ketiltrout.net> svn:793
+	* src/parse.c (_GD_Tokenise): Don't falsely report an unterminated token when
+	stopping a partial tokenisation on top of a " or \.
+	* test/tok_arg.c test/tok_escape.c test/tok_quote.c: Added.
+
+2013-02-02   D. V. Wiebe <getdata at ketiltrout.net> svn:792
+	* src/string.c (gd_get_string): Handle string retrieval directly instead of
+	calling _GD_DoField.
+	* src/string.c (_GD_DoStringOut): Moved from putdata.c.
+	* src/string.c (gd_put_string) src/add.c (gd_add_string gd_madd_string): Call
+	_GD_DoStringOut directly instead of _GD_DoFieldOut.
+	* src/getdata.c (_GD_DoString): Deleted.
+	* src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut): Remove string
+	processing.
+
+2013-02-02   D. V. Wiebe <getdata at ketiltrout.net> svn:790
+	* bindings/matlab/matlab.c: ANSI C.
+
+2013-02-02   D. V. Wiebe <getdata at ketiltrout.net> svn:789
+	* bindings/python/pyentry.c (gdpy_set_scalar_from_pyobj): Add missing data
+	types.
+	* bindings/python/pyentry.c (gdpy_set_entry_from_tuple gdpy_entry_setspf
+	gdpy_entry_setbitnum gdpy_entry_setnumbits gdpy_entry_setcountval
+	gdpy_entry_setcountmax): Fix data type in gdpy_set_scalar_from_pyobj calls.
+
+	* src/entry.c (_GD_GetScalar): Handle bogus CARRAY indices.
+
+	* src/mod.c (_GD_Change): Fix floating point CONST conversions.
+
+	* test/add_scalar_carray_bad.c test/alter_const_c2r.c: Added.
+
+	* bindings/python/test/big_test.py: Fix the part of test 35 that the
+	previous fix broke.
+
+2013-02-02   D. V. Wiebe <getdata at ketiltrout.net> svn:788
+	* src/debug.c (gd_colclear): Added.
+
+	* src/protect.c (gd_protection gd_alter_protection): Fix error reporting for
+	GD_E_BAD_INDEX.
+
+	* m4/matlab.m4 bindings/matlab: Added.
+	* configure.ac bindings/Makefile.am: Added MATLAB config.
+	* bindings/make_parameters.c (MatLab): Added.
+
+	* bindings/python/test/big_test.py: Fixed tests 35 and 67.
+
+2013-01-26   D. V. Wiebe <getdata at ketiltrout.net> svn:787
+	* src/del.c (_GD_DeReference) src/entry.c (_GD_CalculateEntry) src/flush.c
+	(_GD_FieldSpec)	 src/mod.c (_GD_Change): Fix data type (size) of
+	EN(raw,spf) in function calls.
+
+2013-01-15   D. V. Wiebe <getdata at ketiltrout.net> svn:785
+	* m4/floatordering.m4: Split from m4/compiler.m4
+
+	* src/parse.c (_GD_ParseRaw _GD_ParseMplex): Fix types in _GD_SetScalar
+	calls.
+
+2013-01-04   D. V. Wiebe <getdata at ketiltrout.net> svn:783
+	* configure.ac: powerpc64 also supports fast unaligned access.  Reported by
+	Dinar Valeev.
+
+2012-12-13   D. V. Wiebe <getdata at ketiltrout.net> svn:775
+	GetData-0.8.2 released.
+
+2012-12-12   D. V. Wiebe <getdata at ketiltrout.net> svn:773
+	* src/common.c (_GD_CanonicalPath): Don't bail early when encountering a
+	trailing absolute symlink.
+
+	* src/common.c (_GD_CanonicalPath): Strip DIRSEP along with a symlink name
+	from res when necessary.
+
+	* test/test.h test/parse_include_absolute.c test/parse_include_absrel.c
+	test/parse_include_relabs.c: Abstract getcwd in the header.
+	* test/open_sym_a.c test/open_sym_al.c test/open_sym_at.c test/open_sym_c.c
+	test/open_sym_cl.c test/open_sym_ct.c test/open_sym_p.c test/open_sym_pl.c
+	test/open_sym_pt.c: Added.
+
+2012-11-22   D. V. Wiebe <getdata at ketiltrout.net> svn:772
+	* src/encoding.c (_GD_WriteOut): Remove unnecessary DIRFILE parameter.
+
+2012-10-10   D. V. Wiebe <getdata at ketiltrout.net> svn:771
+	* src/getdata.c (_GD_DoMplex): Check we're at the BOF before trying to do a
+	lookback.
+
+	* src/internal.h: Only export gd_MakeFullPathOnly when using modules.
+
+2012-08-20   D. V. Wiebe <getdata at ketiltrout.net> svn:767
+	GetData-0.8.1 released.
+
+2012-08-15   D. V. Wiebe <getdata at ketiltrout.net> svn:760
+	* src/internal (_GD_IsDirSep): Added.
+	* src/common.c (_GD_CanonicalPath): Call _GD_IsDirSep
+
+2012-08-15   D. V. Wiebe <getdata at ketiltrout.net> svn:759
+	GetData-0.8.1rc1:
+
+	* src/parse.c (_GD_ParseDirective _GD_ParseFragment): Remove inappropriate
+	restrict keywords.  Reported by Daniel Flanigan.
+
+2012-08-14   D. V. Wiebe <getdata at ketiltrout.net> svn:757
+	* src/include.c (_GD_Include): Return the correct fragment index, not just
+	D->n_fragment - 1.
+	* test/include_sub.c: Added.
+
+2012-08-04   D. V. Wiebe <getdata at ketiltrout.net> svn:755
+	* src/parse.c (_GD_ParseFragment): Don't resize instring unnecessarily.
+
+2012-08-04   D. V. Wiebe <getdata at ketiltrout.net> svn:754
+	* src/parse.c (_GD_ParseDirective): Delete free reference on encountered
+	one in a subfragment.
+
+2012-08-02   D. V. Wiebe <getdata at ketiltrout.net> svn:753
+	* src/include.c (_GD_Include): Reject non-regular files as fragments.
+
+2012-08-02   D. V. Wiebe <getdata at ketiltrout.net> svn:752
+	* src/globals.c (gd_dirfilename): Return the full path.
+	* test/global_name.c: Update.
+
+	* src/add.c (_GD_Add): Properly compute filebase.
+
+	* src/entry.c (gd_linterp_tablename): Added.
+	* test/table.c test/table_code. test/table_type.c: Added.
+	* bindings/cxx/dirfile.cpp (Dirfile::LinterpTableName)
+	bindings/perl/simple_funcs.xsin (linterp_tablename)
+	bindings/f77/getdata.f90.in (fgd_linterp_tablename) bindings/f77/fgetdata.c
+	(GDLTTN) bindings/idl/getdata.c (gdidl_get_linterp_tablename)
+	bindings/python/pydirfile.c (gdpy_dirfile_linterptablename): Added.
+	* bindings/perl/simple_funcs.pl: Handle returning malloc'd string.
+
+	* bindings/cxx/test/big_test.cpp bindings/perl/test/big_test.t
+	bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+	bindings/idl/test/big_test.pro bindings/python/test/big_test.py: Add test
+	241.  Update tests 21 and 80.
+
+2012-07-26   D. V. Wiebe <getdata at ketiltrout.net> svn:751
+	* src/flush.c (_GD_FieldSpec): Write /HIDDEN directives for /ALIASes.
+
+2012-07-26   D. V. Wiebe <getdata at ketiltrout.net> svn:749
+	* src/parse.c (_GD_SetScalar _GD_ParseLincom _GD_ParseLinterp
+	_GD_ParseMultiply _GD_ParseRecip _GD_ParseWindow _GD_ParseMplex
+	_GD_ParseDivide _GD_ParseBit _GD_ParsePhase _GD_ParsePolynom
+	_GD_ParseAlias): Store munged input fields.
+	* src/entry.c (_GD_GetScalar) src/common.c (_GD_BadInput) src/parse.c
+	(_GD_ResolveAlias): Don't (re-)munge field codes.
+
+	* src/name.c (_GD_MungeCode): Take an additional parameter, err_ok,
+	indicating whether missing affixes indicate an internal error or not.
+
+	* src/mod.c (_GD_AlterInField) src/name.c (_GD_CheckCodeAffixes): Added.
+	* src/mod.c (_GD_AlterScalar) src/add.c (_GD_FixName _GD_Add _GD_AddAlias):
+	Call _GD_CheckCodeAffixes.
+	* src/mod.c (_GD_Change): Call _GD_AlterInField to modify in_fields.
+
+	* src/flush.c (_GD_WriteFieldCode): Added.
+	* src/flush.c (_GD_PadField _GD_WriteConst _GD_FieldSpec): Call
+	_GD_WriteFieldCode.
+
+	* test/get_affix.c test/add_alias_affix.c test/add_alias_affix.c
+	test/add_spec_affix.c test/madd_alias_affix.c test/alter_lincom_affix.c
+	test/add_lincom_affix.c test/alter_scalar_affix.c: Added.
+
+	* test/add_string_affix.c test/madd_affix.c test/add_affix.c: Update for new
+	affix semantics.
+
+	* src/mod.c (gd_alter_entry) src/add.c (gd_madd_alias): Clear error when
+	starting.
+
+2012-07-12   D. V. Wiebe <getdata at ketiltrout.net> svn:743
+	* bindings/f77/fgetdata.c (GDALLC): Delete unnecessary malloc.
+	* src/fragment.c (_GD_CheckAffixes): Free subaffixes on error.
+	* src/fragment.c (gd_desync): Free old name after reopen.
+	* src/include.c (_GD_Include): Free sname on error.
+	* src/add.c (_GD_Add): Free temp_buffer on error.
+	* src/close.c (_GD_FreeD): Free tok_base and error_prefix.
+	* src/move.c (_GD_Move): Free new_code on error.
+	* src/parse.c (gd_strtok): Cache the string per documentation.
+
+	* test/valgrind.suppressions: Added.
+	* bindings/cxx/test/big_test.cpp test/add_affix.c test/add_meta_alias.c
+	test/add_scalar_carray.c test/name_updb_alias.c test/name_updb_const.c
+	test/name_updb_const_alias.c test/name_alias.c test/name_updb.c
+	test/madd_affix.c test/add_meta.c test/add_scalar.c test/name.c test/add.c
+	test/parse_mplex_nomax.c: Deal with memory.
+
+2012-07-10   D. V. Wiebe <getdata at ketiltrout.net> svn:740
+	* src/common.c (_GD_CanonicalPath): Fix pointer arithmetic
+
+	* src/compat.c (gd_strtod): Drop octal (not in POSIX); handle hex floating
+	point; don't zero errno.
+
+2012-07-04   D. V. Wiebe <getdata at ketiltrout.net> svn:737
+	GetData-0.8.0 released.
+
+2012-07-04   D. V. Wiebe <getdata at ketiltrout.net> svn:736
+	* src/constant.c (gd_get_carray_slice gd_get_carray gd_carray_len
+	gd_put_carray_slice gd_put_carray): Handle both CONST and CARRAY.
+	* src/constant.c (gd_get_constant gd_put_constant): Just call the
+	corresponding carray_slice function.
+
+2012-06-30   D. V. Wiebe <getdata at ketiltrout.net> svn:732
+	* src/getdata.h.in configure.ac cmake/CMakeLists.txt: Fix definition of
+	gd_off64_t.
+
+	* bindings/perl/Build.PL.in: make getdata.h a dependency of lib/GetData.xs.
+
+2012-06-29   D. V. Wiebe <getdata at ketiltrout.net> svn:728
+	* src/getdata.h.in src/internal.h src/errors.c: Merge GD_E_BAD_VERSION into
+	GD_E_ARGUMENT.
+
+2012-06-28   D. V. Wiebe <getdata at ketiltrout.net> svn:725,726
+	* util/checkdirfile.c: Find and report dangling aliases.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_nentries gdpy_dirfile_entrylist)
+	bindings/cxx/dirfile.cpp (Dirfile::NEntries Dirfile::EntryList)
+	bindings/perl/GetData.xs (entry_list) : Fix signedness of "type".
+	* bindings/idl/getdata.c (gdidl_get_field_list gdidl_get_nfields): Deal with
+	/ALIASES.
+	* bindings/make_parameters.c: Add GD_ALIAS_ENTRIES.
+
+	* test/nentries_noalias.c test/elist_noalias.c: Renamed from ..._alias.c.
+	* test/nentries_alias.c test/elist_alias.c: Added.
+
+	* src/internal.h getdata.h.in: Move GD_ALIAS_ENTRY to public header.
+	* src/getdata.h.in: Define GD_ALIAS_ENTRIES.
+	* src/field_list.c (_GD_EntryIndex _GD_ListEntry) src/nfields.c
+	(_GD_NEntries): Handle GD_ALIAS_ENTRIES.
+
+	* src/common.c (_GD_CanonicalPath): Sidestep GCC warning.
+
+2012-06-27   D. V. Wiebe <getdata at ketiltrout.net> svn:724
+	* src/name.c (_GD_UpdateScalar _GD_InvalidateConst _GD_UpdateInField
+	_GD_InvalidateVect): Handle aliases.
+	* src/name.c (gd_rename): Don't dereference aliases.
+	* src/name.c (gd_rename_alias): Deleted.
+	* test/name.c test/name_updb_const.c test/name_updb.c: Updated.
+	* test/name_updb_const_alias.c test/name_move_alias.c test/name_alias.c
+	test/name_updb_alias.c: Added.
+	* test/name_after_const.c test/name_after.c: Deleted.
+
+	* src/parse.c (_GD_ResolveAlias): Reset aliases if requested.
+
+	* man/make_html.pl: Don't eat "**" in synopses.
+
+2012-06-25   D. V. Wiebe <getdata at ketiltrout.net> svn:723
+	* src/flush.c (_GD_FindVersion): ALIAS means >= 9.
+
+	* util/checkdirfile.c: Grammar.
+
+2012-06-13   D. V. Wiebe <getdata at ketiltrout.net> svn:721
+	GetData-0.8.0rc2.
+
+2012-06-04   D. V. Wiebe <getdata at ketiltrout.net> svn:720
+	* bindings/cxx/dirfile.cpp bindings/cxx/fragment.cpp
+	bindings/cxx/getdata/dirfile.h bindings/cxx/getdata/fragment.h: off_t
+	-> gd_off64_t.
+
+2012-06-02   D. V. Wiebe <getdata at ketiltrout.net> svn:717
+	* src/internal.h (_GD_AbsPath): Allow s == NULL.
+
+2012-05-25   D. V. Wiebe <getdata at ketiltrout.net> svn:712
+	* bindings/cxx/fragment.cpp (Fragment::Fragment Fragment::SetEndianness)
+	bindings/cxx/dirfile.cpp (Dirfile::NFrames Dirfile::EoF Dirfile::BoF
+	Dirfile::GetData Dirfile::PutData Dirfile::FrameNum Dirfile::Seek
+	Dirfile::Tell): Call the 64-bit API.
+
+	* src/getdata.h.in: Support GD_64BIT_API and use configure to define
+	gd_off64_t.
+	* src/internal.h bindings/cxx/getdata/dirfile.h: Define GD_64BIT_API before
+	including getdata.h.
+
+	* test/Makefile.am man/Makefile.am: Remove LFS_TRANSITIONAL_API (always
+	enabled).
+
+	* confihure.ac: Figure out a suitable type for gd_off64_t.  Remove
+	LFS_TRANSITIONAL_API conditional.
+
+2012-05-23   D. V. Wiebe <getdata at ketiltrout.net> svn:710
+	* test/test.h: Don't redefine isnan if it's okay as-is.
+
+	* src/open.c (_GD_CreateDirfile): Don't unnecessarily disable mtime
+	acquisition.
+	* cmake/test/CMakeLists.txt: enable desync checks.
+
+	* src/compat.c (gd_strtod): Fix sign check.
+
+2012-05-22   D. V. Wiebe <getdata at ketiltrout.net> svn:709
+	* cmake/CMakeLists.txt: Update definitons.  Support GD_UTIL.
+	* cmake/test/CMakeLists.txt: Update the list of excluded tests.
+	* cmake/src/CMakeLists.txt: Support GD_DEBUG and conditionally build debug.c.
+	* cmake/bindings/cxx/CMakeLists.txt: Support GD_TEST.
+	* cmake/util/CMakeLists.txt cmake/bindings/cxx/test/CMakeLists.txt: Added.
+
+	* src/internal.h: Define PRNsize_t and PRNssize_t to get around printf()s
+	which don't recognise the "z" length modifier.  Changed everywhere.  Handle
+	basename, offsetof, strtod.
+
+	* src/compat.c (basename gd_strtod): Added.
+	* src/parse.c (_GD_SetScalar) src/nan.h: Call gd_strtod.
+
+	* README.win: Update.
+
+	* bindings/cxx/test/big_test.cpp: Tweak includes to allow compilation with
+	MSVC.
+
+	* bindings/cxx/getdata/entry.h bindings/cxx/getdata/fragment.h: Include
+	dirfile.h.
+
+	* test/include_cb.c test/madd_window.c test/open_cb_cont.c
+	test/open_cb_invalid.c test/include_pc.c test/test.h test/open_cb_rescan.c
+	test/open_cb_abort.c test/open_cb_ignore.c: Tweak for compilation with MSVC.
+
+	* test/add_meta_alias.c test/madd_affix.c test/parse_mplex_nomax.c
+	test/add_meta.c: Fix gd_entry_t access.
+
+	* util/checkdirfile.c: Preprocessor fixes for compilation with MSVC.
+
+2012-04-21   D. V. Wiebe <getdata at ketiltrout.net> svn:706
+	GetData-0.8.0rc1:
+
+	* bindings/cxx/test/big_test.cpp bindings/perl/test/big_test.t: Fix
+	mplex_lookback checks.
+
+2012-04-21   D. V. Wiebe <getdata at ketiltrout.net> svn:705
+	* man/make_html.pl: Improvements. 
+
+	* src/globals.c (gd_mplex_lookback): Always succeed; return void.
+
+	* bindings/perl/simple_funcs.pl: Handle returning void.
+
+2012-04-19   D. V. Wiebe <getdata at ketiltrout.net> svn:701
+	* src/add.c (_GD_Add): Don't check protection level before figuring out the
+	fragment index.
+
+	* bindings/perl/GetData.xs bindings/perl/typemap
+	bindings/perl/simple_funcs.pl: gdpu_spf_t -> gdpu_uint_t.
+
+	* bindings/perl/GetData.xs (gdp_to_entry entry): Use "in_fields" everywhere
+	to be consistent with the C API.
+
+	* bindings/perl/GetData.xs (mcarrays): Remove unpacked.  Use GIMME_V
+	instead.
+
+	* bindings/perl/simple_funcs.xsin (reference alter_phase add_window
+	alter_window alter_affixes add_mplex alter_mplex desync flags
+	verbose_prefix): Fix parameter defaults and types.
+
+	* bindings/perl/Build.PL.in: Install GetData.pm
+
+	* bindings/perl/simple_funcs.xsin (include include_affex): Deleted.
+	* bindings/perl/GetData.xs (include): Added.
+
+	* doc/README.perl: Added.
+	* bindings/perl/GetData.pm.in: POD.
+
+	* bindings/cxx/test/Makefile.am bindings/f77/Makefile.am test/Makefile.am
+	test/error_verbose.c test/error_verbose_prefix.c: Remove GNUisms.
+
+2012-04-13   D. V. Wiebe <getdata at ketiltrout.net> svn:699
+	* src/common.c (_GD_CanonicalPath): Terminate and don't clobber string
+	from realpath().
+
+	* bindings/make_parameters.c: Add GD_SIE_ENCODED.
+
+	* bindings/cxx/getdata/fragment.h: Update encodings.
+
+	* bindings/f77/fgetdata.c (GDTOKE) bindings/f77/getdata.f90.in (fgd_strtok):
+	Drop the 'n' parameter: just do what the C API does.
+
+	* bindings/idl/getdata.c (gdidl_getdata gdidl_putdata): Drop /HERE: just use
+	the absense of FIRST_FRAME and FIRST_SAMPLE.
+
+	* bindings/idl/getdata.c (gdidl_add_mplex): Make the MAX parameter optional.
+
+2012-04-01   D. V. Wiebe <getdata at ketiltrout.net> svn:696
+	* src/compat.c (_GD_ReadDir): Renamed from gd_readdir().
+
+2012-04-01   D. V. Wiebe <getdata at ketiltrout.net> svn:694
+	* src/getdata.h.in: Deprecate gd_bit_t and gd_spf_t.  Remove gd_count_t.
+	* src/getdata.h.in bindings/make_parameters.c: Remove GD_COUNT_MAX.
+	* cmake/CMakeLists.txt: Remove DEFINE_gd_int16_t and DEFINE_gd_uint16_t.
+	* src/internal.h: Calculate GD_INT_TYPE and GD_UINT_TYPE.
+
+	* src/entry.c (_GD_CalculateEntry) src/flush.c (_GD_FieldSpec) src/getdata.c
+	(_GD_DoMplex) src/putdata.c (_GD_DoMplexOut gd_putdata64) src/del.c
+	(_GD_DeReference) src/parse.c (_GD_ParseMplex _GD_ParseBit) src/mod.c
+	(_GD_Change): Use GD_INT_TYPE when dealing with bitnum, numbits, count_max,
+	and count_val.
+	* src/add.c (gd_add_bit gd_add_sbit gd_add_mplex gd_madd_bit gd_madd_sbit
+	gd_madd_mplex) src/mod.c (gd_alter_bit gd_alter_sbit gd_alter_mplex)
+	bindings/python/pyentry.c (gdpy_entry_setnumbits gdpy_entry_setbitnum
+	gdpy_entry_setcountval gdpy_entry_setcountmax) bindings/cxx/mplexentry.cpp
+	(MplexEntry::MplexEntry MplexEntry::SetCountVal MplexEntry::SetCountMax)
+	bindings/cxx/sbitentry.cpp (SBitEntry::SBitEntry SBitEntry::SetFirstBit
+	SBitEntry::SetNumBits) bindings/cxx/test/big_test.cpp
+	bindings/cxx/bitentry.cpp (BitEntry::BitEntry BitEntry::SetFirstBit
+	BitEntry::SetNumBits) bindings/cxx/getdata/bitentry.h (FirstBit NumBits)
+	bindings/cxx/getdata/entry.h (FirstBit NumBits CountVal CountMax)
+	bindings/cxx/getdata/mplexentry.h (CountVal CountMax)
+	bindings/cxx/getdata/sbitentry.h (FirstBit NumBits) bindings/perl/GetData.xs
+	bindings/perl/typemap bindings/perl/simple_funcs.pl bindings/f77/fgetdata.c
+	(GDADBT GDADSB GDMDBT GDMDSB GDALBT GDALSB) bindings/idl/getdata.c
+	(gdidl_make_idl_entry gdidl_read_idl_entry gdidl_add_mplex gdidl_alter_mplex):
+	gd_bit_t, gd_count_t -> int.
+	* src/fpos.c (_GD_Seek) src/getdata.c (_GD_MultiplyData _GD_CMultiplyData
+	_GD_DivideData _GD_CDivideData _GD_WindowData _GD_CDivideData _GD_MplexData
+	_GD_DoLincom _GD_DoMultiply _GD_DoDivide _GD_DoWindow _GD_DoMplex
+	gd_getdata64) src/putdata.c (_GD_MplexOutData gd_putdata64) src/flimits.c
+	(_GD_GetEOF _GD_GetBOF gd_bof64) src/common.c (_GD_LinterpData
+	_GD_LincomData) src/add.c (gd_add_raw) src/spf.c (_GD_GetSPF gd_spf)
+	src/mod.c (_GD_SPFConvert) src/mod.c (gd_alter_entry) src/index.c
+	(gd_framenum_subset64) bindings/python/pyentry.c (gdpy_entry_setspf)
+	bindings/python/pydirfile.c (gdpy_dirfile_getdata) bindings/cxx/rawentry.cpp
+	(RawEntry::RawEntry RawEntry::SetSamplesPerFrame)
+	bindings/cxx/getdata/rawentry.h (SamplesPerFrame) bindings/perl/GetData.xs
+	bindings/perl/typemap bindings/perl/simple_funcs.pl bindings/f77/fgetdata.c
+	(GDADRW GDALRW) util/dirfile2ascii.c: gd_spf_t -> unsigned int.
+	* src/flush.c (_GD_WriteConst) src/mod.c (_GD_AlterScalar): Add missing
+	integer types.
+
+	* src/parse.c (_GD_ParseMplex): Make count_max optional.
+	* src/getdata.c (_GD_DoMplex) src/add.c (_GD_Add): Handle count_max == 0.
+
+	* src/getdata.h.in: Mark GD_FLOAT and GD_DOUBLE as deprecated.
+
+	* src/encoding.c (_GD_FiniRawIO): Handle short writes and IO errors.
+
+	* src/getdata.c (_GD_DoMplex): use D->lookback to determine how far to
+	search backwards.  Also, read data in chunks of size GD_BUFFER_SIZE.
+	* src/open.c (_GD_Open): Initialise D->lookback.
+	* src/globals.c (gd_mplex_lookback): Added.
+	* bindings/cxx/dirfile.cpp (Dirfile::MplexLookback)
+	bindings/perl/simple_funcs.xsin (mplex_lookback) bindings/f77/getdata.f90.in
+	(fgd_mplex_lookback) bindings/f77/fgetdata.c (GDMXLB) bindings/idl/getdata.c
+	(gdidl_mplex_lookback): Added.
+
+	* src/parse.c (gd_strtok): Renamed from gd_tokenise to avoid regional
+	spelling variations.  Bindings renamed accordingly (except for the F77
+	bindings).
+
+	* bindings/python/pygetdata.c: Add GD_E_EXISTS exception.
+
+	* bindings/python/pydirfile.h: Add mplex_lookback and verbose_prefix to
+	gdpy_constant_t.
+	* bindings/python/pydirfile.c (gdpy_dirfile_delete): Delete verbose_prefix.
+	* bindings/python/pydirfile.c (gdpy_dirfile_create): Initialise
+	mplex_lookback and verbose_prefix.
+	* bindings/python/pydirfile.c (gdpy_dirfile_verbose_prefix): Deleted.
+	* bindings/python/pydirfile.c (gdpy_dirfile_getverboseprefix
+	gdpy_dirfile_setverboseprefix gdpy_dirfile_getmplexlookback
+	gdpy_dirfile_setmplexlookback): Added.
+
+	* bindings/Makefile.am: add src/gd_config.h to the prerequisites of
+	make_parameters.
+
+	* src/flush.c (_GD_FlushFragment): Write /ENCODING for zzip and zzslim.
+
+	* src/meta_list.c: Merged into src/field_list.c
+	* src/nmeta.c: Merged into src/nfields.c
+
+	* src/add.c (_GD_InvalidEntype): Added.
+	* src/internal.h: Add entry_list and entry_list_flags to DIRFILE and
+	private_entry.
+	* src/internal.h (_GD_EntryIndex): Deleted.
+	* src/field_list.c (_GD_EntryIndex _GD_EntryList gd_entry_list): Added.
+	* src/field_list.c (_GD_ListEntry): Handle GD_ENTRIES_... flags.
+	* src/field_list.c (gd_field_list_by_type gd_vector_list gd_field_list
+	gd_mfield_list_by_type gd_mfield_list): Reimplement via gd_entry_list().
+
+	* src/nfields.c (_GD_NEntries gd_nentries): Added.
+	* src/nfields.c (gd_nfields gd_nvectors gd_nfields_by_type gd_nmfields
+	gd_nmvectors gd_nmfields_by_type): Reimplement via gd_nentries().
+
+	* src/field_list.c (gd_constants gd_carrays gd_strings gd_mconstants
+	gd_mcarrays gd_mstrings): Call _GD_NEntries for counts.
+
+	* src/entry.c (gd_hide gd_unhide) src/del.c (_GD_Delete) src/include.c
+	(gd_uninclude) src/add.c (_GD_Add): Delete count updates.
+
+	* src/name.c (_GD_Rename) src/del.c (_GD_Delete) src/include.c
+	(gd_uninclude) src/add.c (_GD_Add _GD_AddAlias): Invalidate metafield lists
+	too.
+	
+	* src/entry.c (_GD_FreeE) src/close.c (_GD_FreeD): Delete entry_lists.
+
+	* src/globals.c (gd_flags): Don't check GD_INVALID.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_nentries
+	gdpy_dirfile_entrylist) bindings/perl/GetData.xs (entry_list)
+	bindings/cxx/dirfile.cpp (Dirfile::NEntries Dirfile::EntryList)
+	bindings/f77/getdata.f90.in (fgd_nentries fgd_entry_name_max fgd_entry_list)
+	bindings/f77/fgetdata.c (GDNENT GDENTX GDENTN): Added.
+	* bindings/idl/getdata.c (gdidl_get_field_list gdidl_get_nfields)): Convert to
+	bindings for gd_entry_list and gd_nentries.
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/perl/test/big_test.t bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add tests
+	237 through 240.
+
+	* test/elist_alias.c test/elist_hidden.c test/elist_scalar.c
+	test/get_lincom_null.c test/get_mplex_lball.c test/get_mplex_nolb.c
+	test/nentries_alias.c test/nentries_hidden.c test/nentries_scalar.c
+	test/parse_malias_meta.c test/parse_mplex_nomax.c: Added.
+
+	* man/: Updated.
+
+2012-03-28   D. V. Wiebe <getdata at ketiltrout.net> svn:691
+	* src/flush.c (_GD_FieldSpec) src/parse.c (_GD_ParseMplex): Swap order of
+	fields in MPLEX specification.
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/perl/test/big_test.t bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+	test/entry_mplex_scalar.c test/get_mplex.c test/alter_mplex.c
+	test/put_mplex.c  test/get_mplex_lb.ctest/entry_mplex.c: Update for
+	Standards change.
+
+2012-03-28   D. V. Wiebe <getdata at ketiltrout.net> svn:690
+	* m4/compiler.m4 (GD_C_RESTRICT_ARRAY): Fix test program.
+	* bindings/idl/getdata.c (gdidl_alter_mplex): Fix uninitialised variable.
+
+2012-03-28   D. V. Wiebe <getdata at ketiltrout.net> svn:689
+	* m4/compiler.m4 (GD_C_RESTRICT_ARRAY): Added.
+	* src/parse.c src/internal.h: Work around deficiencies in the GCC-3.4 C99
+	compliance.
+
+2012-03-22   D. V. Wiebe <getdata at ketiltrout.net> svn:683
+	* src/sie.c (_GD_SampIndWrite): Fix file size calculation during truncation.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getdata): Make return_type and
+	num_<foo> optional.
+
+2012-03-16   D. V. Wiebe <getdata at ketiltrout.net> svn:680
+	* src/globals.c (gd_flags gd_verbose_prefix): Added.
+	* src/errors.c (_GD_SetError): Print verbose prefix, if present.
+
+	* make_parameters.c: Promote GD_VERBOSE and GD_PRETTY_PRINT.
+	* bindings/cxx/dirfile.cpp (Dirfile::Flags Dirfile::VerbosePrefix)
+	bindings/python/pydirfile.c (gdpy_dirfile_getflags gdpy_dirfile_setflags
+	gdpy_dirfile_verbose_prefix) bindings/perl/simple_funcs.xsin (flags
+	verbose_prefix) bindings/f77/fgetdata.c (GDFLAG GDVBPX)
+	bindings/f77/getdata.f90.in (fgd_flags fgd_verbose_prefix)
+	bindings/idl/getdata.c (gdidl_flags gdidl_verbose_prefix): Added.
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/perl/test/big_test.t bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add tests
+	235, 236.
+
+	* src/open.c (_GD_Open): Reset errno to prevent spurious error messages.
+
+	* src/flush.c (_GD_FlushFragment): Avoid FPE.
+
+	* test/global_flags.c test/error_verbose.c test/error_verbose_prefix.c:
+	Added. 
+
+	* bindings/idl/getdata.c (gdidl_open): Add missing IGNORE_REFS,
+	PRETTY_PRINT, TRUNCSUB.
+
+	* bindings/f77/fgetdata.c (_GDF_CString): Take care of the malloc'ing rather
+	than forcing the caller to do it.
+
+2012-03-16   D. V. Wiebe <getdata at ketiltrout.net> svn:678
+	* src/errors.c src/getdata.h.in: Add GD_E_EXISTS
+	* src/open.c (_GD_CreateDirfile): Replace GD_E_CREAT:GD_E_CREAT_EXCL with
+	GD_E_EXISTS.
+
+2012-03-16   D. V. Wiebe <getdata at ketiltrout.net> svn:676
+	* configure.ac bindings/idl/package/configure.ac src/include.h
+	bindings/make_parameters.c bindings/cxx/internal.h bindings/idl/getdata.c
+	test/test.h util/dirfile2ascii.c util/checkdirfile.c: Renamed config.h to
+	gd_config.h to get around lossage in the Perl CORE public headers.
+	
+	* bindings/perl/test: Renamed from t.
+	* bindings/perl/MANIFEST.in: Renamed from MANIFEST.
+	* bindings/perl Makefile.am bindings/f77/test/Makefile.am: VPATH fixes.
+
+	* src/fragment.c (gd_desync): dup the dirfile fd before closing.
+	* test/desync_reopen.c test/desync_reopen_inv.c: Added.
+
+	* bindings/idl/package/configure.ac bindings/idl/package/README: Bump
+	GetData min version.
+
+2012-03-15   D. V. Wiebe <getdata at ketiltrout.net> svn:675
+	* src/internal.h: Add fragment->mtime, dirfile->open_flags.  Deconst
+	fragment->sname.
+	* src/close.c (_GD_FreeD _GD_ShutdownDirfile): Add new parameter
+	(keep_dirfile) to prohibit deallocating the dirfile struct itself.
+	De-staticked _GD_ShutdownDirfile.
+	* src/include.c (_GD_Include): Compute the path relative to the parent of
+	fragment and store it in fragment->sname.  Store mtime.
+	* src/close.c (_GD_FreeD): Free fragment->sname.
+	* src/flush.c (_GD_FlushFragment): Remove unnecessary strdup: we already
+	cache the basename.  Update mtime.
+	* src/open.c (_GD_CreateDirfile): Return mtime.
+	* src/open.c (_GD_Open): Renamed from gd_cbopen; optionally take an existing
+	dirfd and DIRFILE pointer.  Fix the dirfd/dirfile race condition by
+	canonicalising dirfile first.
+	* src/fragment.c (gd_desync) src/open.c (gd_cbopen): Added.
+	* src/getdata.h.in: Added GD_DESYNC_PATHCHECK GD_DESYNC_REOPEN.
+	* test/desync.c test/desync_flush.c: Added.
+
+	* src/internal.h (offsetof): Added.
+	* src/compat.c (gd_readdir): Added.
+	* src/open.c (_GD_TruncDir): Use a thread-safe readdir where possible.
+
+	* src/include.c (gd_include_affix): Don't call do stuff before validating
+	the dirfile.
+
+	* bindings/make_parameters.c: Add desync flags.
+	* bindings/python/pydirfile.c (gdpy_dirfile_desync) bindings/cxx/dirfile.cpp
+	(Dirfile::DeSync) bindings/perl/simple_funcs.xsin (desync)
+	bindings/f77/getdata.f90.in (fgd_desync) bindings/f77/fgetdata.c (GDDSYN)
+	bindings/idl/getdata.c (gdidl_desync): Added.
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/perl/t/big_test.t bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Added test
+	234.
+
+	* bindings/cxx/test/big_test.cpp: Functionise to reduce compilation work.
+
+	* bindings/perl/Makefile.am: Tweak yet some more.
+
+2012-03-14   D. V. Wiebe <getdata at ketiltrout.net> svn:674
+	* src/open.c (gd_cbopen): Handle failure of _GD_CanonicalPath better.
+
+2012-03-14   D. V. Wiebe <getdata at ketiltrout.net> svn:671
+	* src/flush.c (_GD_FlushFragment): Write SIE encoding directives.
+
+	* src/sie.c (_GD_SampIndOpen): Initialise file->pos to 0 to avoid issues
+	with _GD_GetFilePos.
+	* src/sie.c (_GD_SampIndSeek): Don't short circuit if no record is loaded.
+
+	* src/flush.c (_GD_Flush _GD_SyncOrClose): Make syncing optional with a new
+	parameter (syn).
+	* src/flush.c (gd_raw_close): Added.
+	* src/clsoe.c (_GD_ShutdownDirfile) src/include.c (gd_uninclude): Don't
+	sync, just close raw files.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_raw_close)
+	bindings/cxx/dirfile.cpp (Dirfile::RawClose) bindings/perl/simple_funcs.xsin
+	(raw_close) bindings/f77/fgetdata.c (GDRCLO) bindings/f77/getdata.f90.in
+	(fgd_raw_close): Added.
+	* bindings/idl/getdata.c (gdidl_flush): Add /NOSYNC.
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/perl/t/big_test.t bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90: Added test 233.
+
+	* bindings/perl/Build.PL.in: subclass Module::Build to properly handle
+	simple_funcs.xs dependency tracking.
+
+2012-03-06   D. V. Wiebe <getdata at ketiltrout.net> svn:667
+	* src/errors.c: Change prefix on verbose output to "libgetdata".
+
+	* src/add.c (_GD_FixName): Added.
+	* src/add.c (_GD_Add _GD_AddAlias): Call _GD_FixName.
+	* test/add_alias_meta.c: Added.
+
+	* src/open.c (_GD_TruncDir): Fix subdirectory truncation.
+	* src/internal.h: Remove conditional defition of AT_SYMLINK_NOFOLLOW.
+	* src/compat.c (gd_StatAt): Check for definition of AT_SYMLINK_NOFOLLOW
+	before use.
+
+2012-03-03   D. V. Wiebe <getdata at ketiltrout.net> svn:665
+	* src/getdata.h.in bindings/make_parameters.c: Added GD_TRUNCSUB open flag.
+	* src/open.c (_GD_TruncDir): Added.
+	* src/open.c (_GD_CreateDirfile): Call _GD_TruncDir.
+	* test/trunc_dir.c test/trunc_truncsub.c: Added.
+
+	* src/fragment.c (gd_alter_affixes): Handle GD_E_ACCMODE and GD_E_PROTECTED
+	errors.
+
+	* bindings/f77/fgetdata.c (GDDELA): Correct call to gd_delete_alias.
+
+2012-03-02   D. V. Wiebe <getdata at ketiltrout.net> svn:664
+	* src/errors.c: Added GD_E_ARGUMENT:GD_E_ARG_NODATA.
+	* src/parse.c (_GD_Tokenise): Take number of columns to return.
+	* src/parse.c (gd_tokenise): Added.
+	* src/internal.h: Added _GD_DIRFILE->tok_pos.
+
+	* src/parse.c (_GD_CheckParent): Destatickify, and modify for use by
+	_GD_Add.
+	* src/add.c (_GD_Add): Call _GD_CheckParent to automatically allow
+	parent/meta style metafield addition via gd_add[_<whatever>]().
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_tokenise)
+	bindings/cxx/dirfile.cpp (Dirfile::Tokenise) bindings/perl/GetData.xs
+	(tokenise) bindings/f77/getdata.f90.in (fgd_tokenise)
+	bindings/f77/fgetdata.c (GDTOKE) bindings/idl/getdata.c (gdidl_tokenise):
+	Added.
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/perl/t/big_test.t bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add test
+	#232.
+
+	* bindings/f77/getdata.f90.in (fgd_fragment_affixes): Fix GDFRAF call.
+
+	* bindings/f77/fgetdata.c (_GDF_SetDirfile _GDF_Callback GDCOPN GDCLBK):
+	Don't cast between data and code pointers.  Encapsulate the F77 callback
+	function in a container.
+	* bindings/f77/fgetdata.c (GDNOCB): Added.
+	* bindings/f77/test/gdcopn.f: Add GDCLBK and GDNOCB tests.
+
+	* test/ascii_get.c test/ascii_put.c test/ascii_get_get.c
+	test/ascii_nframes.c: Delete FOPEN_TEXT.
+
+	* test/add_meta.c test/add_meta_alias.c: Added.
+
+2012-02-16   D. V. Wiebe <getdata at ketiltrout.net> svn:658
+	* src/getdata.c (_GD_DoLincom): Get the correct SPFs.
+	* test/get_lincom_spf.c: Added.
+
+	* src/open.c (_GD_CreateDirfile): When truncating, don't delete and then
+	recreate the format file; just truncate it.  (This helps kst not get
+	confused when monitoring a dirfile which gets truncated.)
+
+2012-02-14   D. V. Wiebe <getdata at ketiltrout.net> svn:656 svn:657
+	* src/putdata.c (gd_putdata): Return early if num_samp == 0.
+	* test/put_zero.c: Added.
+
+2012-02-01   D. V. Wiebe <getdata at ketiltrout.net> svn:652
+	* configure.ac: Figure out the directory separator (ie. '/' on POSIX).
+	
+	* src/open.c (_GD_CreateDirfile): Handle DIRSEP.
+	* src/internal.h (_GD_Root): Added.
+	* src/common.c (_GD_CanonicalPath): Handle WIN32/DOS paths.
+
+	* src/open.c (gd_cbopen): Temporarily store the full path in D->name so that
+	_GD_CreateDirfile can use it when needed.
+
+	* src/spf.c (_GD_GetSPF): De const-ify E.
+
+	* src/common.c (_GD_FindField): Fix buffer length calculation.
+
+	* test/file.c test/fragment_name.c bindings/cxx/test/big_test.cpp
+	bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90: Handle DIRSEP.
+	* bindings/f77/test/test_getdata.f.in: Added.
+
+2012-01-18   D. V. Wiebe <getdata at ketiltrout.net> svn:650
+	* src/getdata.h.in src/internal.h: Define GD_ENC_ZZSLIM GD_ZZSLIM_ENCODED.
+	* src/zzslim.c: Added.
+	* src/encoding.c: In the initialisation of _gd_ef, differentiate things
+	that are willing to use the Generic functions from those that aren't.  Added
+	zzslim.
+
+	* src/common.c (_GD_CanonicalPath): Don't truncate on ENOENT.
+
+	* src/slim.c (_GD_SlimOpen): The slimdopen in slimlib-2.6.5 doesn't interact
+	well with slim's own zzip support, so let's ignore it for now.
+
+	* bindings/make_parameters.c: Convert F77 encoding parameters to the form
+	GDE_xx.
+
+	* configure.ac: zzslim tests.  Always look for a C++ compiler.
+	* m4/encoding.m4: Separate LIBS from LDFLAGS; fix some underquoting.
+
+2012-01-11   D. V. Wiebe <getdata at ketiltrout.net> svn:644
+	* src/getdata.h.in: Added GD_MPLEX_ENTRY.  Updated gd_entry_t.  Defined
+	GD_COUNT_MAX.
+
+	* src/legacy.c (CopyMplexEntry) src/getdata.c (_GD_MplexData _GD_DoMplex)
+	src/putdata.c (_GD_MplexOutData _GD_DoMplexOut) src/parse.c (_GD_ParseMplex)
+	src/add.c (gd_add_mplex gd_madd_mplex) src/mod.c (gd_alter_mplex): Added.
+	* src/internal.h: Define GD_MPLEX_LOOKBACK
+
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry gd_validate)
+	src/flush.c (_GD_Flush _GD_FieldSpec _GD_FindVersion) src/fpos.c
+	(_GD_GetFilePos _GD_WriteSeek) src/legacy.c (GetFormat) src/getdata.c
+	(_GD_DoField) src/name.c (_GD_InvalidateConst _GD_InvalidateVect)
+	src/native.c (_GD_NativeType) src/putdata.c (_GD_DoFieldOut) src/del.c
+	(_GD_ClearDerived _GD_DeReference) src/flimits.c (_GD_GetEOF _GD_GetBOF)
+	src/parse.c (_GD_ParseFieldSpec) src/add.c (_GD_Add) src/spf.c (_GD_GetSPF)
+	src/mod.c (_GD_Change): Handle MPLEX.
+
+	* src/fpos.c (_GD_Seek): De-statickify.
+	* src/legacy.c (CopyWindowEntry): Report as MPLEX.
+	* src/getdata_legacy.h: Fix mplex list in FormatType.
+
+	* src/errors.c: Rename GD_E_BAD_ENTRY_* suberrors to GD_E_ENTRY_* for
+	brevity.  Added GD_E_FORMAT_MPLEXVAL, GD_E_ENTRY_CNTVAL, GD_E_ENTRY_CNTMAX.
+
+	* src/field_list.c (_GD_ListEntry): Move the alias check down so that hidden
+	and meta alias are handled properly.
+
+	* internal.h src/common.c (_GD_Malloc _GD_Realloc _GD_Strdup): Moved from
+	internal.h.
+
+	* bindings/make_parameters.c: Define MPLEX_ENTRY, E_FORMAT_MPLEXVAL,
+	COUNT_MAX.
+	* bindings/cxx/mplexentry.cpp bindings/cxx/getdata/mplexentry.h: Added.
+	* bindings/python/pyentry.c (gdpy_entry_getcountval gdpy_entry_setcountval
+	gdpy_entry_getcountmax gdpy_entry_setcountmax) bindings/cxx/getdata/entry.h
+	(Entry::CountVal Entry::CountMax) bindings/f77/getdata.f90.in (fgd_add_mplex
+	fgd_madd_mplex fgd_alter_mplex) bindings/f77/fgetdata.c (GDGEMX GDADMX
+	GDMDMX GDALMX) bindings/idl/getdata.c (gdidl_add_mplex gdidl_alter_mplex):
+	Added.
+
+	* bindings/python/pyentry.c (gdpy_set_entry_from_tuple
+	gdpy_set_entry_from_dict gdpy_entry_getinfields gdpy_entry_setinfields
+	gdpy_entry_getparms) bindings/cxx/entry.cpp (CheckIndex scalar_ok)
+	bindings/cxx/dirfile.cpp (Dirfile::Entry) bindings/cxx/getdata/dirfile.h
+	bindings/perl/GetData.xs (gdp_to_entry entry) bindings/f77/getdata.f90.in
+	(fgd_entry fgd_add fgd_madd) bindings/f77/fgetdata.c (GDASCA GDMDWD)
+	bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_read_idl_entry): MPLEX
+	bindings.
+
+	* bindings/perl/simple_funcs.xsin: Add add_mplex, alter_mplex, madd_mplex.
+	* bindings/perl/simple_funcs.pl: Handle gd_count_t.
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/perl/t/big_test.t bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add tests
+	228-231.
+
+	* bindings/cxx/windowentry.cpp bindings/cxx/getdata/windowentry.h
+	bindings/idl/getdata.c (gdidl_alter_window): Get rid of
+	Check stuff: just use Input, for consistency.
+
+	* test/add_mplex.c test/add_mplex_val.c test/alter_mplex.c
+	test/entry_mplex.c test/entry_mplex_scalar.c test/get_mplex.c
+	test/get_mplex_lb.c test/madd_mplex.c test/parse_mplex.c
+	test/parse_mplex_ncols.c test/parse_mplex_scalar.c test/put_mplex.c: Added.
+
+2011-12-31   D. V. Wiebe <getdata at ketiltrout.net> svn:643
+	* bindings/python/pyentry.c (gdpy_set_entry_from_dict): Add missing INCREF.
+
+2011-12-29   D. V. Wiebe <getdata at ketiltrout.net> svn:641
+	* src/internal.h src/encoding.c (_GD_GenericName): Added fragment->enc_data.
+	Pass enc_data to gd_ef->name.  Flag encodings that use enc_data with
+	GD_EF_EDAT.
+	* src/parse.c (_GD_ParseDirective): Allow an optional second parameter to
+	/ENCODING of encoding-specific data.
+	* src/entry.c (_GD_ResolveEncoding): Pass in enc_data.
+	* src/zzip.c (_GD_ZzipName): Use enc_data to specify archive name.
+
+2011-12-29   D. V. Wiebe <getdata at ketiltrout.net> svn:640
+	* configure.ac: zzip encoding check.
+	* src/getdata.h.in src/internal.h: GD_ZZIP_ENCODED / GD_ENC_ZZIP; Added name
+	to encoding_t.
+	* src/zzip.c: Added.
+	* src/encoding.c: Add Zzip encoding; gd_ef_name_t.
+	* src/encoding.c (_GD_GenericName): Renamed from _GD_SetEncodedName and
+	pushed down into the encoding framework.
+	* src/encoding.c (_GD_MissingFramework): Handle GD_EF_NAME.
+	* src/encoding.c (_GD_ResolveEncoding): Handle external name functions.
+	* src/entry.c (gd_raw_filename) src/encoding.c (_GD_InitRawIO
+	_GD_RecodeFragment) src/move.c (_GD_MogrifyFile) src/name.c (_GD_Rename)
+	src/del.c (_GD_Delete) src/flimits.c (_GD_GetEOF): Call _gd_ef->name.
+	* test/zzip_get.c test/zzip_get_get.c test/zzip_nframes.c: Added.
+
+2011-12-27   D. V. Wiebe <getdata at ketiltrout.net> svn:639
+	* src/add.c (gd_madd_lincom gd_madd_clincom gd_madd_linterp gd_madd_bit
+	gd_madd_sbit gd_madd_multiply gd_madd_phase gd_madd_polynom gd_madd_cpolynom
+	gd_madd_string gd_madd_const gd_madd_carray): Zero entry before
+	initialisation.
+
+	* src/fragment.c (gd_alter_affixes): Allow {pre,suf}fix == NULL to indicate
+	no change.
+
+	* src/entry.c (_GD_FreeE): Handle aliases.
+
+	* src/close.c (_GD_FreeD): Free fragment affixes.
+
+	* src/debug.c (gd_colnil gd_coladd gd_colsub): Export debugging symbols.
+
+	* src/field_list.c (_GD_ListEntry): Added.
+	* src/field_list.c (gd_constants gd_carrays gd_strings gd_field_list_by_type
+	gd_vector_list gd_field_list) src/meta_list.c (gd_mconstants gd_mcarrays
+	gd_mstrings gd_mfield_list_by_type gd_mvector_list gd_mfield_list): Call
+	_GD_ListEntry.
+
+	* bindings/python/pyentry.c bindings/python/pyfragment.c
+	bindings/python/pydirfile.c: Update for DSV9.
+	* bindings/cxx/fragment.cpp bindings/cxx/entry.cpp bindings/cxx/dirfile.cpp
+	bindings/cxx/getdata/entry.h bindings/cxx/getdata/dirfile.h: Update for
+	DSV9.
+	* bindings/cxx/windowentry.cpp bindings/cxx/getdata/windowentry.h: Added.
+	* bindings/perl/GetData.xs bindings/perl/simple_funcs.xsin: Update for DSV9.
+	* bindings/f77/fgetdata.c bindings/f77/getdata.f90.in: Update for DSV9.
+	* bindings/idl/getdata.c: Update for DSV9.  Removed most of the function
+	aliases.
+
+	* bindings/make_parameters.c: Update for DSV9.  Add missing
+	GD_E_UNKNWON_ENCODING.
+
+	* bindings/python/pygetdata.c (initpygetdata): Handle gaps in
+	gdpy_exception_list.  Fix exception list.
+
+	* bindings/python/pyentry.c (gdpy_entry_settable): Set correct parameter.
+
+	* test/vlist_alias.c: Added.
+
+2011-12-20   D. V. Wiebe <getdata at ketiltrout.net> svn:638
+	* src/entry.c (_GD_GetScalar _GD_CalculateEntry) src/common.c (_GD_GetRepr
+	_GD_BadInput _GD_FindFieldAndRepr: Optionally prohibit setting errors (for
+	use by the post-rename update stuff).
+	* src/errors.c: Added GD_E_FORMAT_ALIAS, GD_E_DEL_ALIAS.
+	* src/flush.c (_GD_FieldSpec): Write aliases.  Also tweaked to allow slashed
+	metafield specification with DSV7.
+	* src/del.c (_GD_ClearDerived): Handle aliases.
+	* src/parse.c (_GD_CheckParent _GD_ParseAlias _GD_ResolveAlias
+	_GD_UpdateAliases) src/add.c (_GD_AddAlias gd_add_alias gd_madd_alias): Added.
+	* src/parse.c (_GD_ParseFieldSpec): Call _GD_CheckParent.
+	* src/parse.c (_GD_ParseDirective): Use a switch to reduce the number of
+	strcmps done.  Handle /ALIAS.
+	* src/parse.c (_GD_ParseFragment): Optionally call _GD_UpdateAliases to
+	resolve aliases.
+	* src/add.c (_GD_Add gd_madd_spec gd_add_spec): Update aliases after addition.
+
+	* src/common.c (_GD_FindField): Optionally dealias names.
+
+	* src/del.c (_GD_Delete): Renamed from gd_delete().
+	* src/del.c (gd_delete gd_delete_alias): Added.
+
+	* src/name.c (_GD_UpdateScalar _GD_InvalidateConst _GD_UpdateInField
+	_GD_InvalidateVect): Added.
+	* src/name.c (_GD_Rename): Renamed from gd_rename().  Handle cleaning up
+	after the rename.
+
+	* src/move.c (_GD_Move): Renamed from gd_move().
+
+	* src/name.c (_GD_ValidateField): Permit is_dot = NULL.
+
+	* src/entry.c (gd_alias_target gd_aliases gd_naliases gd_hidden) src/move.c
+	(gd_move gd_move_alias) src/name.c (gd_rename gd_rename_alias): Added.
+
+	* src/alias.c (gd_fragment_index gd_hide gd_unhide): Call _GD_FindField
+	instead of _GD_FindFieldAndRepr to avoid resolving aliases.  As a side effect,
+	these function will no long ignore representation suffices.
+
+	* src/flush.c (_GD_StringEscapeise): Handle writing slashed meta-fields.
+
+	* src/spf.c (_GD_GetSPF): Ensure return is zero on error.
+
+	* test/alias_num_missing.c alias_target_missing.c spf_alias_missing.c
+	alias_list.c del_derived_after.c madd_spec_resolv.c parse_alias_meta.c
+	entry_type_alias.c spf_alias.c name_after_const.c parse_malias_dup.c
+	add_alias.c alias_target.c alias_list_alias.c add_resolv.c spf_alias_meta.c
+	move_alias.c name_after.c parse_meta_jump.c parse_alias_missing.c
+	name_update_const.c madd_alias.c parse_alias_dup.c fragment_index_alias.c
+	add_spec_resolv.c alias_target_alias.c name_update.c hide_hidden.c
+	alias_num_alias.c parse_malias.c parse_alias_code.c parse_alias.c
+	alias_num.c parse_meta_malias.c parse_meta_alias.c alias_list_missing.c:
+	Added.
+
+	* test/fragment_parent.c: Renamed from test/parent.c.
+	* test/fragment_num.c: Renamed from test/nfragments.c.
+
+	* test/version_9_write.c: Update.
+
+2011-12-13   D. V. Wiebe <getdata at ketiltrout.net> svn:637
+	* test/fragment_affix_alter2.c test/fragment_affix_alter.c
+	test/fragment_affix_dup.c test/fragment_affix.c test/include_affix.c: Added.
+
+	* src/move.c (_GD_StrCmpNull): Renamed from strcmpnull and de-statickified.
+
+	* src/name.c (_GD_MungeFromFrag): Added.
+	* src/name.c (_GD_MungeCode): Converted into a swiss army munger handling
+	both enmunging and demunging.  Most old, simple, uses of this function now
+	call _GD_MungeFromFrag (which calls this) instead.
+	* src/flush.c (_GD_DeMungeCode): Deleted in favour of the new _GD_MungeCode.
+
+	* src/fragment.c (gd_fragment_affixes _GD_CheckAffixes _GD_ChangeAffixes
+	gd_alter_affixes): Added.
+
+	* src/include.c (gd_include_affix): Renamed from gd_include.
+	* src/include.c (gd_include): Added.
+
+2011-12-11   D. V. Wiebe <getdata at ketiltrout.net> svn:635
+	* test/add_string_affix.c test/name_affix_bad.c test/move_affix.c
+	test/alter_entry_affix.c test/alter_entry_affix.c test/madd_affix.c
+	test/parse_meta_affix.c test/madd_index.c test/name_affix.c
+	test/alter_mspec_affix.c test/name_dup.c test/parse_meta_implicit_affix.c
+	test/add_affix.c test/alter_spec_affix.c: Added.
+
+	* test/version_9_strict.c test/version_9_write.c: Expanded.
+
+	* src/open.c (gd_cbopen): Set errors for _GD_CanonicalPath.
+
+	* src/errors.c: Distingish missing codes from invalid codes for
+	GD_E_BAD_CODE.
+
+	* src/name.c (gd_rename): Validate the new name first and then DeMunge it
+	if it's not a meta field.
+
+	* src/move.c (gd_move): Compose the new field name by remunging it for the
+	new fragment.  Also compose the new names of all its metafield early, if
+	necessary.
+	
+	* src/parse.c (_GD_ParseFieldSpec _GD_ParseDirective): Munge field codes
+	before lookup.  Also munge the reference field.
+
+	* src/mod.c (gd_alter_spec gd_malter_spec): The parser will end up
+	reapplying affixes to the field name, so undo that.
+
+	* src/add.c (_GD_Add gd_add_string gd_add_const gd_add_const gd_madd_string
+	gd_madd_const gd_madd_carray): _GD_Add() returns the added entry on success.
+	This saves a field lookup in the others.
+
+	* src/add.c (_GD_Add): Munge field name earlier.
+
+	* src/name.c (gd_rename): Flag fragment as modified.
+
+	* src/flush.c (_GD_FieldSpec): Properly write /HIDDEN directives.
+
+2011-12-09   D. V. Wiebe <getdata at ketiltrout.net> svn:634
+	* test/parse_include_preprefix.c test/version_9_strict.c test/version_9.c
+	test/parse_include_suffix.c test/parse_include_loop.c test/version_9_write.c
+	test/parse_include_sufsuffix.c test/parse_include_prefix.c
+	test/parse_include_prefix_dup.c test/get_phase_affix.c: Added.
+
+	* test/add_sort.c test/add_scalar_carray.c test/add_code.c test/add_type.c
+	test/add_invalid.c test/put_carray.c test/add_scalar.c test/madd.c
+	test/add_format.c: Remove dirfile before starting.
+
+	* test/version_8_strict.c: Fix initialisation.
+
+	* test/version_6_write.c: Test whitespace in field names.
+
+	* test/test.h: Armour plate macros.
+
+	* src/internal.h: Add prefix and suffix to gd_fragment_t.
+	* src/name.c (_GD_MungeCode) src/flush.c (_GD_DeMungeCode) src/include.c
+	(_GD_SetFieldAffixes): Added.
+	* src/flush.c (_GD_StringEscapeise): Handle null tokens.  Escape spaces
+	rather than assuming the caller will quote the token (which it wasn't
+	doing).
+	* src/entry.c (_GD_GetScalar) src/name.c (gd_rename) src/add.c (_GD_Add)
+	src/commonc. (_GD_BadInput): Munge field code before use.
+	* src/flush.c (_GD_PadField): Demunge field code before writing.
+	* src/flush.c (_GD_WriteConst): Properly demunge and escapeise scalar names.
+	* src/name.c (_GD_ValidateField): This function no longer takes care of
+	malloc'ing.  Modified to return integer true on error.
+	* src/name.c (_GD_FlushFragment): Add prefix and suffix to INCLUDE when
+	present.
+	* src/parse.c (_GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp
+	_GD_ParseMultiply _GD_ParseRecip _GD_ParseLincom _GD_ParseWindow
+	_GD_ParseDivide _GD_ParseBit _GD_ParsePhase _GD_ParsePolynom _GD_ParseConst
+	_GD_ParseCarray _GD_ParseString): Munge field code on parsing.
+	* include.c (_GD_Include): Handle affixes.
+
+	* src/common.c (_GD_EntryCmp): Moved from src/internal.h and deinlined,
+	destatickified.  Given that the only use of this function is to pass it to
+	qsort, making it static inline only ensured that it got replaced once per
+	translation unit that referred to it.
+
+	* include.c (_GD_Include): Replaced the old filename comparison stage with a
+	simple recursion counter.
+
+	* src/parse.c (_GD_Tokenise): Handle token-initial escaped character.
+	Handle "\[ux#]##\...".
+
+	* src/flush.c (_GD_FindVersion): Prefix or suffix implies DSV >= 9.
+
+	* src/parse.c (_GD_SetScalar): Handle bad malloc.
+
+	* src/name.c (_GD_FieldSpec): Properly escapeise input field codes.
+
+	* src/errors.c: Distinguish GD_E_RECURSE_CODE from GD_E_RECURSE_INCLUDE.
+
+	* src/internal.h (_GD_Malloc _GD_Realloc _GD_Strdup): Added.
+	* src/commonc. (_GD_MakeFullPath): Set error if requested.
+	* src/common.c (_GD_MakeFullPathOnly): Added.  This is a wrapper around
+	_GD_MakeFullPath which ensures the DIRFILE is not modified.  Used by the
+	compatibility functions and the slim encoding framework (ie. things that have
+	at best a tenuous connection to the DIRFILE object).
+
+	* src/internal.h: Define GD_MULTISTANDARD.
+	* src/include.c (_GD_Include): Set GD_MULTISTANDARD if moving into/out of 
+	DSV >= 9.
+	* src/open.c (gd_cbopen): If the metadata contain multiple standards, figure
+	out a single one for the whole dirfile.
+
+2011-12-08   D. V. Wiebe <getdata at ketiltrout.net> svn:633
+	* test/svlist_hidden.c test/svlist_meta_hidden.c test/hide.c
+	test/flist_hidden.c test/nfields_hidden.c test/parse_version_89.c
+	test/nmeta_type_hidden.c test/parse_version_98.c test/nmeta_vectors_hidden.c
+	test/nmeta_hidden.c test/alter_entry_hidden.c test/parse_version_p8.c
+	test/parse_version_p9.c test/hide_unhide.c test/cvlist_meta_hidden.c
+	test/nfields_type_hidden.c test/vlist_hidden.c test/flist_meta_hidden.c
+	test/vlist_meta_hidden.c test/flist_type_meta_hidden.c
+	test/parse_hidden_meta.c test/cvlist_array_hidden.c test/parse_meta_meta.c
+	test/nfields_vector_hidden.c test/parse_hidden.c test/parse_hidden_field.c
+	test/cvlist_hidden.c test/cvlist_array_meta_hidden.c
+	test/flist_type_hidden.c: Added.
+
+	* test/nfields_vector.c test/nfields_vector_invalid.c: Renamed from nvectors*
+
+	* src/parse.c (_GD_ParseDirective): Parse /HIDDEN directives.
+	* src/entry.c (gd_hide gd_unhide): Added.
+	* src/nmeta.c (gd_nmfields gd_nmvectors gd_nmfields_by_type) src/nfields.c
+	(gd_nfields gd_nvectors gd_nfields_by_type) src/field_list.c (gd_constants
+	gd_carrays gd_strings gd_field_list_by_type gd_vector_list gd_field_list)
+	src/meta_list (gd_mconstants gd_mcarrays gd_mstrings gd_mfield_list_by_type
+	gd_mvector_list gd_mfield_list): Compensate for hidden fields.
+	* src/flush.c (_GD_FieldSpec): Write /HIDDEN directives.
+	* src/flush.c (_GD_FindVersion): Consider hidden entries.
+	* src/mod.c (_GD_Change): Prohibit changing hiddenness via gd_alter_entry().
+
+	* src/parse.c (_GD_ParseDirective): Forbid a metafield code from appearing
+	as a parent in /META directives.
+
+	* src/internal.h: Record the number of each type of field, rather than just
+	for the scalar field types.
+	* src/internal.h (_GD_EntryIndex): Added.
+	* src/open.c (gd_cbopen): Initialise D->n[INDEX_ENTRY].
+	* src/nmeta.c (gd_nmvectors gd_nmfields_by_type) src/nfields.c (gd_nvectors
+	gd_nfields_by_type) src/field_list.c (gd_constants gd_carrays gd_strings
+	gd_field_list_by_type gd_vector_list) src/meta_list.c (gd_mconstants
+	gd_mcarrays gd_mstrings gd_mfield_list_by_type gd_mvector_list): Use type
+	counts.
+	* src/del.c (gd_delete) src/parse.c (_GD_ParseFieldSpec) src/include.c
+	(gd_uninclude) src/add.c (_GD_Add): Update type counts.
+	* src/field_list.c (_gd_entype_index): Deleted.
+
+	* src/include.c (_GD_Include): Remember incoming Standards Version and
+	parser mode, and restore them on exit if the new DSV >=9 or the old mode is
+	pedantic and the old DSV >= 9.  This is an attempt to stave the "version
+	leak" problem experienced in earlier DSVs.
+
+	* src/internal.h: Renamed GD_E_FORMAT_NO_PARENT to GD_E_FORMAT_NO_FIELD.
+
+2011-12-06   D. V. Wiebe <getdata at ketiltrout.net> svn:632
+	* test/get_window_ne.c test/get_window.c test/parse_window_scalar.c
+	test/alter_window.c test/parse_window.c test/madd_window.c
+	test/parse_window_ncols.c test/add_window.c test/put_window.c
+	test/get_window_set.c test/get_window_gt.c test/get_window_ge.c
+	test/parse_window_op.c test/entry_window.c test/entry_window_scalar.c
+	test/add_window_op.c test/get_window_lt.c test/get_window_clr.c
+	test/get_window_le.c: Added.
+
+	* test/madd_phase.c: Fix check.
+
+	* test/version_6.c test/version_7.c test/version_8.c: Update for Version 9.
+
+	* cmake/CMakeLists.txt configure.ac: Define gd_int64_t.
+
+	* src/getdata.h.in: Add GD_WINDOW_ENTRY, gd_windop_t, gd_triplet_t.
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry) legacy.c (GetFormat)
+	src/getdata.c (_GD_DoField) src/errors.c src/flush.c (_GD_Flush
+	_GD_FieldSpec) src/native.c (_GD_NativeType) src/spf.c (_GD_GetSPF)
+	src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_ClearDerived _GD_DeReference)
+	src/flimits.c (_GD_GetEOF _GD_GetBOF) src/fpos.c (_GD_GetFilePos _GD_Seek)
+	src/parse.c (_GD_ParseFieldSpec) src/field_list.c src/mod.c (_GD_Change)
+	src/add.c (_GD_Add): Update for WINDOW.
+	* src/legacy.c (CopyWindowEntry) src/getdata.c (_GD_WindowData _GD_DoWindow)
+	src/flush.c (_GD_WindopName) src/parse.c (_GD_WindOp _GD_ParseWindow)
+	src/mod.c (gd_alter_window) src/internal.h (_GD_BadWindop) src/add.c
+	(gd_add_window gd_madd_window): Added.
+	* src/flush.c (_GD_WriteConst): Write GD_UINT64.
+
+	* src/flush.c (_GD_WriteConst): Fix writing of RECIP fields.
+
+	* src/parse.c (_GD_ParseRecip _GD_ParsePhase): Fail if SetScalar fails.
+
+	* src/parse.c (_GD_SetScalar): Don't bother trying to decode an imaginary
+	part before failing if we're not interested in complex numbers.
+
+	* src/parse.c (_GD_SetScalar): Call strto[u]ll with base=0 for Version >= 9 to
+	allow automatic parsing of 0x[hex] and 0[octal] numbers in format files.
+
+	* src/getdata.h.in: Increment GD_DIRFILE_STANDARDS_VERSION.
+	* src/flush.c (_GD_FindVersion): Update for Version 9.
+
+2011-12-05   D. V. Wiebe <getdata at ketiltrout.net> svn:630
+	* python/test/callback.pl python/test/big_test.py cxx/test/big_test.cpp
+	f77/test/big_test.f f77/test/big_test95.f90: Fix path checks.
+
+	* f77/test/big_test.f f77/test/big_test95.f90: Use check functions.
+
+	* src/flush.c (_GD_Flush): Don't call sync on a file opened read-only.
+
+	* configure.ac: Look for Availability.h
+	* src/internal.h: Fix lstat64 on OS X 10.6+
+
+	* src/common.c (_GD_CanonicalPath): Don't run past the end of the work
+	buffer.
+
+2011-12-03   D. V. Wiebe <getdata at ketiltrout.net> svn:629
+	* test/test.h (CHECKEOS): Added.
+	* test/file.c test/fragment_name.c: Only check the end of the returned
+	string since we don't know what the full path is.
+
+	* src/internal.h: Define PATH_MAX, if necessary.
+	* src/common.c (_GD_CanonicalPath): Added.
+	* src/open.c (gd_cbopen): Canonicalise filedir.
+	* src/common.c (_GD_MakeFullPath): Canonicalise path.  Handle dirfd < 0.
+	* src/common.c (_GD_GrabDir): Let _GD_MakeFullPath hande canonicalising
+	absolute paths.
+
+	* configure.ac: Check for lstat(3).
+	* src/compat.c (gd_StatAt): Don't use lstat if the platform doesn't have it.
+
+	* src/internal.h: Move library includes into header.
+
+2011-12-01   D. V. Wiebe <getdata at ketiltrout.net> svn:628
+	* src/flush.c (_GD_FlushFragment): Write "/PROTECT data" when appropriate.
+	Bug report from Alexandra Rahlin.
+
+2011-11-13   D. V. Wiebe <getdata at ketiltrout.net> svn:626
+	* src/entry.c (gd_raw_filename): Revert r613 changes.
+	* src/gzip.c: Move OOP code out of gzip layer.
+	* src/encoding.c (_GD_FiniRawIO _GD_InitRawIO) src/fpos.c (_GD_WriteSeek):
+	Handle OOP writes.
+	* src/encoding.c (_GD_WriteOut): Added.
+	* src/mod.c (_GD_Change) src/putdata.c (_GD_DoRawOut): Call _GD_WriteSeek and
+	_GD_WriteOut
+
+	* src/putdata.c (_GD_DoRawOut): Correctly handle write errors.
+
+	* configure.ac: Fix x86_64 host check.
+
+2011-11-10   D. V. Wiebe <getdata at ketiltrout.net> svn:622
+	* configure.ac: Figure out whether unaligned memory access will work.
+	* src/internal.h: Deal with UNALIGNED_ACCESS_OK
+	* src/sie.c (_GD_SampIndWrite): Handle unaligned memory access.
+
+2011-11-08   D. V. Wiebe <getdata at ketiltrout.net> svn:615
+	* test/add_scalar_carray.c: Added.
+
+	* src/add.c (_GD_Add): Copy scalar_ind when copying scalars.  Patch from
+	S. J. Benton.
+
+2011-11-08   D. V. Wiebe <getdata at ketiltrout.net> svn:614
+	* test/gzip_put_get.c test/gzip_move_to.c test/gzip_add.c
+	test/gzip_get_put.c test/gzip_put.c: Handle TEST_GZIP && !USE_GZIP.
+
+	* src/encoding.c (_GD_FiniRawIO): Don't change error code if already set.
+
+	* src/sie.c (_GD_SampIndSize): Fix descriptor leak.
+
+2011-11-05   D. V. Wiebe <getdata at ketiltrout.net> svn:610
+	* test/gzip_put_get.c test/ascii_add.c test/get_rofs.c test/gzip_move_to.c
+	test/gzip_add.c test/endian_alter_sie.c test/gzip_get_put.c: Added.
+	* test/gzip_put.c: Update.
+
+	* m4/encoding.m4: Add a AC_CHECK_FUNCS call.
+
+	* src/slim.c (_GD_SlimOpen): Update for the (non-existant) slimdopen().
+
+	* src/getdata.h.in: Renamed GD_SEEK_PAD to GD_SEEK_WRITE to better reflect
+	its purpose.
+	* bindings/idl/getdata.c (gdidl_seek): Update keywords for same.
+
+	* src/flush.c (_GD_Flush): Add a third parameter, clo, to distinguish
+	sync from sync-and-close.
+	* src/flush.c (_GD_SyncOrClose): Renamed from gd_flush.
+	* src/flush.c (gd_sync gd_flush): Added.
+
+	* src/internal.h: Added _gd_raw_file.mode.  Replaced encoding_t.ecor with
+	encoding_t.flags;
+	* src/encoding.c: Deleted touch, topen, tmove, tunlink from the encoding
+	framework.  Changed signature of open and seek.
+	* src/encoding.c (_GD_MoveOver): Renamed from _GD_GenericTMove.
+	* src/encoding.c (_GD_FiniRawIO) src/fpos.c (_GD_WriteSeek): Added.
+	* src/gzip.c (_GD_GzipOpen _GD_GzipSeek _GD_GzipClose) src/encoding.c
+	(_GD_InitRawIO): Update for out-of-place writes.
+	* src/endian.c (_GD_ByteSwapFragment) src/name.c (gd_rename) src/flush.c
+	(_GD_Flush) src/encoding.c (_GD_RecodeFragment) src/del.c (gd_delete)
+	src/flimits.c (_GD_ShiftFragment): Use _GD_FiniRawIO to clean up.
+	* src/encoding.c (_GD_GenericTouch) src/ascii.c (_GD_AsciiTOpen
+	_GD_AsciiTUnlink) src/sie.c (_GD_SampIndTOpen _GD_SampIndTUnlink) src/raw.c
+	(_GD_RawTOpen _GD_RawTUnlink): Deleted.
+	* src/move.c (_GD_MogrifyFile) src/mod.c (_GD_Change): Use _GD_FiniRawIO and
+	_GD_InitRawIO.
+	* src/parse.c (_GD_ParseFieldSpec) add.c (_GD_Add): Use _GD_InitRawIO for
+	touch.
+	* src/gzip.c (_GD_GzipOpen) src/ascii.c (_GD_AsciiOpen) src/sie.c
+	(_GD_SampIndDoOpen _GD_SampIndOpen) src/raw.c (_GD_RawOpen): Handle temp file
+	opens.
+	* src/putdata.c (_GD_DoRawOut) src/fpos.c (_GD_Seek): Use _GD_WriteSeek.
+
+	* src/fpos.c (_GD_GetFilePos): Only try to open the file if necessary.
+
+	* src/gzip.c (_GD_GzipWrite _GD_GzipSync): Added.
+
+2011-10-20   D. V. Wiebe <getdata at ketiltrout.net> svn:609
+	* test/get_here_foffs.c test/seek_foffs.c: Added.
+
+	* src/getdata.c (_GD_DoRaw): Update file->pos after calling FillZero.
+	* src/fpos.c (_GD_GetFilePos): Adjust for SPF.
+	* src/fpos.c (_GD_Seek): If seeking before FRAMEOFFSET, set file->pos < 0.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_seek): Fix type of frame_num,
+	sample_num.
+
+	* bindings/perl/typemap: off64_t is signed.
+
+	* bindings/f77/fgetdata.c (GDCONS GDMCOS GDSTRS GDMSTS GDSTRX GDMSTX):
+	Added.
+	* bindings/f77/getdata.f90.in (fgd_constants_i1 fgd_constants_i2
+	fgd_constants_i4 fgd_constants_i8 fgd_constants_r4 fgd_constants_r8
+	fgd_constants_c8 fgd_constants_c16 fgd_mconstants_i1 fgd_mconstants_i2
+	fgd_mconstants_i4 fgd_mconstants_i8 fgd_mconstants_r4 fgd_mconstants_r8
+	fgd_mconstants_c8 fgd_mconstants_c16 fgd_string_value_max fgd_strings
+	fgd_mstring_value_max fgd_mstrings): Added.
+
+	* bindings/idl/getdata.c (gdidl_getdata gdidl_putdata): Add /HERE.
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/perl/t/big_test.t bindings/f77/test/big_test.f
+	bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Added tests
+	183-204.
+
+2011-10-18   D. V. Wiebe <getdata at ketiltrout.net> svn:607
+	* man/gd_seek.3 man/gd_tell.3: Added.
+
+	* src/spf.c (gd_spf): Throw GD_E_DIMENSION on scalar field specified per
+	documentation.
+	* src/fpos.c (gd_tell64 gd_seek64): Ditto.
+
+	* src/putdata.c (_GD_DoFieldOut): Don't return on error from _GD_GetFilePos;
+	a better error will be generated later.
+
+	* bindings/make_parameters.c: Add GD_E_ARGUMENT, GD_SEEK_*, GD_HERE.
+	* bindings/python/pydirfile.c (gdpy_dirfile_seek gdpy_dirfile_tell)
+	bindings/cxx/dirfile.cpp (Dirfile::Seek Dirfile::Tell)
+	bindings/perl/simple_funcs.xsin (seek tell) bindings/f77/fgetdata.c (GDSEEK
+	GDTELL) bindings/f77/getdata.f90.in (fgd_seek fgd_tell)
+	bindings/idl/getdata.c (gdidl_seek gdidl_tell): Added.
+
+2011-10-13   D. V. Wiebe <getdata at ketiltrout.net> svn:606
+	* test/entry_divide.c test/entry_recip.c test/get_here.c test/get_heres.c
+	test/put_here.c test/put_heres.c test/seek64.c test/seek_cur.c test/seek_end.c
+	test/seek_set.c test/tell.c test/tell64.c: Added.
+
+	* test/legacy_put.c test/put_complex128.c test/put_complex64.c
+	test/put_float32.c test/put_float64.c test/put_ff.c test/put_foffs.c
+	test/put_fs.c test/put_int16.c test/put_int32.c test/put_int64.c
+	test/put_int8.c test/put_lincom1.c test/put_linterp.c
+	test/put_linterp_reverse.c test/put_off64.c test/put_phase.c
+	test/put_polynom1.c test/put_recip.c test/put_sf.c test/put_ss.c
+	test/put_uint16.c test/put_uint32.c test/put_uint64.c: Don't perform
+	unnecessary tests in the event the data file wasn't created.
+
+	* src/getdata.h.in: Combine GD_E_BAD_ENDIANNESS and GD_E_BAD_PROTECTION into
+	GD_ARGUMENT.  The former are kept as aliases of the new symbol.
+	* src/endian.c (gd_alter_endianness) src/errors.c src/protect.c
+	(gd_alter_protection): Update for GD_E_ARGUMENT.
+
+	* src/internal.h: Add .pos to _gd_raw_file.  Add .u.index_pos to
+	_gd_private_entry.
+	* src/ascii.c (_GD_AsciiOpen _GD_AsciiSeek _GD_AsciiRead _GD_AsciiTOpen
+	_GD_AsciiTUnlink) src/gzip.c (_GD_GzipOpen _GD_GzipSeek _GD_GzipRead)
+	src/lzma.c (_GD_LzmaOpen _GD_LzmaSeek _GD_LzmaRead) src/sie.c
+	(_GD_SampIndOpen _GD_SampIndSeek _GD_SampIndRead _GD_SampIndWrite
+	_GD_SampIndTOpen) src/raw.c (_GD_RawOpen _GD_RawSeek _GD_RawRead
+	_GD_RawWrite _GD_RawTOpen): Track file position.
+
+	* src/encoding.c (_GD_InitRawIO): Added.
+	* src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Call _GD_InitRawIO.
+
+	* src/fpos.c: Added.
+	* src/flimits.c (_GD_GetEOF): Publicise.
+	* src/getdata.c (gd_getdata64) src/putdata.c (gd_putdata64): Regularise use of
+	GD_HERE.  Also, only call _GD_GetSPF when necessary.
+	* src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut): Resolve
+	instances of GD_HERE.
+
+	* bindings/python/Makefile.am bindings/cxx/Makefile.am
+	bindings/f77/Makefile.am: Remove some unnecessary linking.
+
+	* bindings/idl/package/Makefile.am: Add $(DEFS) to the make_parameters rule
+	to ensure it builds properly.
+
+2011-08-23   D. V. Wiebe <getdata at ketiltrout.net> svn:600
+	* test/error_error.c: Simplify test.
+	* test/test.h (CHECKSp): Added.
+
+	* src/errors.c src/internal.h: Added GD_E_CREAT_OPEN.
+	* src/open.c (_GD_CreateDirfile): Distinguish GD_E_CREAT_DIR from
+	GD_E_CREAT_OPEN.
+
+	* src/internal.h: When linking to the MSVCRT, define GD_NO_DIR_OPEN to
+	indicate that the MSVCRT's open() prohibits openind directories.  (This is
+	referred to as "the non-POSIX case".
+	* src/open.c (_GD_CreateDirfile): Take dirfile, a malloc'd copy instead of
+	filedir itself.  In the non-POSIX case, this has the full pathname.  Also,
+	handle non-POSIX computation of dirfd.
+	* src/open.c (gd_cbopen): In the non-POSIX case, prepend the CWD to filedir
+	if it's not absolute, and pass that string to _GD_CreateDirfile.  Also need
+	to stat the directory in this case, in lieu of trying to open it.
+	* src/close.c (_GD_ShutdownDirfile): Don't try to close the dirfds in the
+	non-POSIX case.
+	* src/common.c (_GD_DirName): In the non-POSIX case, the dirfd parameter
+	simply contains the index into the dir array, so no need to search.
+	* src/common.c (_GD_GrabDir _GD_ReleaseDir): In the non-POSIX case, don't
+	try to open or close the directory: it just contains the index into dir, so
+	no need to search for it either.
+
+	* src/compat.c (gd_OpenAt): Or flags with O_BINARY for operation on Win32.
+
+	* src/open.c (gd_cbopen): Close dirfd on error.
+
+	* src/bzip.c (_GD_Bzip2Seek): Return -1 on error.
+
+	* src/internal.h (_GD_AbsPath): Added.
+
+	* src/internal.h (gd_swap64): Fix doubled backslashes.
+
+	* configure.ac: Fix perl check to properly exclude the bindings when
+	necessary.
+
+2011-08-20   D. V. Wiebe <getdata at ketiltrout.net> svn:599
+	* src/open.c (gd_cbopen): Properly initialise bname; also check for malloc
+	errors.
+	* sie/sie.c (_GD_SampIndWrite): Update the current record to reflect the
+	updated position of the file pointer.
+
+2011-08-20   D. V. Wiebe <getdata at ketiltrout.net> svn:597
+	* src/internal.h: Added bname to fragment struct holding the basename of the
+	file.
+	* src/open.c (gd_cbopen) src/include.c (_GD_Include): Initialise
+	fragment->bname.
+	* src/close.c (_GD_FreeD) src/include.c (gd_uninclude): Deallocate
+	fragment->bname.
+
+2011-08-19   D. V. Wiebe <getdata at ketiltrout.net> svn:596
+	* src/open.c (gd_invalid_dirfile gd_cbopen): If allocating the DIRFILE
+	itself fails, return NULL instead of segfaulting.
+
+	* src/nmeta.c (gd_nmfields_by_type): Throw GD_E_BAD_ENTRY on encountering
+	GD_NO_ENTRY.
+
+	* src/index.c (gd_framenum_subset64): Throw GD_E_DIMENSION if the caller
+	supplies the field code for a scalar.
+
+	* src/errors.c: Added GD_E_BOUNDS and GD_E_LINE_TOO_LONG.
+
+	* src/encoding.c (_GD_ResolveEncoding): Don't segfault on malloc error.
+
+	* src/flimits.c (_GD_GetBOF): Throw GD_INTERNAL_ERROR instead of
+	GD_E_BAD_FIELD_TYPE when encountering GD_NO_ENTRY.
+
+	* src/parse.c (_GD_UTF8Encode): Renamed from utf8encode for consistency.
+
+	* src/sie.c (_GD_SampIndTUnlink) src/include.c (gd_uninclude): Use
+	gd_UnlinkAt instead of bare unlink().
+
+	* man/make_html.pl: Handle multiparagraph .TPs.
+
+2011-08-11   D. V. Wiebe <getdata at ketiltrout.net> svn:595
+	* src/internal.h: In cases where no explicitly 64-bit stat struct can be
+	found, don't bother trying to use explicitly 64-bit stat functions.
+
+2011-08-11   D. V. Wiebe <getdata at ketiltrout.net> svn:594
+	* test/sie_nframes_big.c test/sie_get_big.c test/sie_get_little.c
+	test/sie_nframes_little.c test/sie_move_to.c test/sie_put_little.c
+	test/sie_move_from.c test/sie_put_big.c: Added.
+
+	* configure.ac src/internal.h: Handle missing fstat64, ftruncate64, and byte
+	swapping routines.
+
+	* src/internal.h src/errors.c: Differentiate GD_E_UNKNOWN_ENCODING errors
+	arising from existing, unknown encodings on disk from errors arising from
+	attempts to convert to an unknown encoding.
+
+	* src/endian.c (_GD_FixEndianness): Use standard system byte-swapping
+	routines, where possible, with the assumption that they're not slower than
+	our old implementation.
+
+	* src/encoding.c: Redo the way _gd_ef is initialised to try and make it
+	a little easier to maintain.
+
+	* src/internal.h: In struct _gd_raw_file, rename .fp to .idata and .encoding
+	to .subenc to reduce code obfuscation.
+
+	* src/encoding.c: Added SIE encoding hooks.
+	* src/sie.c: Added.
+
+	* src/internal.h (_GD_FileSwapBytes): Added.
+	* src/internal.h: _gd_ef->open(), ->size(), ->touch(), and ->topen() now take
+	a "swap" parameter, indicating whether bytes are opposite-endian.
+
+	* src/internal.h: Split _gd_ef->temp() into ->topen, ->tmove, and ->tunlink.
+	Also typedef all the framework method prototypes.
+	* src/ascii.c (_GD_AsciiTOpen _GD_AsciiTUnlink) src/raw.c (_GD_RawTOpen
+	_GD_RawTUnlink): Added.
+	* src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Deleted.
+	* src/encoding.c (_GD_GenericTMove): Added.
+	* src/endian.c (_GD_ByteSwapFragment) src/encoding.c (_GD_MissingFramework
+	_GD_RecodeFragment) src/move.c (_GD_MogrifyFile) src/flimits.c
+	(_GD_ShiftFragment) src/mod.c (_GD_Change): Replace _gd_ef->temp() calls with
+	t{open|move|unlink} calls.
+
+	* src/move.c (_GD_MogrifyFile) src/mod.c (_GD_Change): Call _GD_MakeTempFile
+	before calling _gd_ef->topen.
+
+2011-08-10   D. V. Wiebe <getdata at ketiltrout.net> svn:593
+	* bindings/perl/t/big_test.t: Convert to TAP.
+
+2011-06-13   D. V. Wiebe <getdata at ketiltrout.net> svn:588
+	* src/errors.c: Don't append strerror to the GD_E_CREAT_EXCL message.
+
+	* m4/perl.m4: Fix perl CFLAGS.
+
+2011-05-05   D. V. Wiebe <getdata at ketiltrout.net> svn:587
+	* src/open.c (_GD_CreateDirfile): Handle missing fdopendir.
+
+2011-05-05   D. V. Wiebe <getdata at ketiltrout.net> svn:586
+	* src/internal.h: The encoding framework has changed: open, touch, size,
+	move, unlink, and temp now all take the dirfd.  Furthermore, to allow
+	operation on non-POSIX.1-2008 systems, we hide the DIRFILE pointer in
+	_gd_raw_file, so callback can be made to the compatibility layer.  All
+	framework callers have been updated to pass dirfds.  fragment->sname is no
+	longer malloc'd and is now marked const; also, fragments now carry their
+	dirfd.  D->dir and D->ndir added.
+	* src/encoding.c (gd_MakeTempFile) src/compat.c (gd_OpenAt gd_RenameAt
+	gd_StatAt gd_StatAt64 gd_UnlinkAt) src/common.c (_GD_DirName
+	_GD_MakeFullPath _GD_GrabDir _GD_ReleaseDir): Added.
+	* src/open.c (gd_cbopen): Open the dirfile directory as soon as possible,
+	then work as much as possible with the descriptor instead of the path
+	itself.
+	* src/open.c (_GD_CreateDirfile): Use the dirfd produced by cb_open()
+	instead of relying on the pathname except with GD_CREAT.  As a side effect,
+	no longer need to compute fullname when truncating.
+	* src/entry.c (_GD_FreeE): Release LUT directory.  This requires passing the
+	DIRFILE to this function.
+	* src/close.c (_GD_FreeD): Don't free fragment->sname (it's no longer
+	malloc'd).  Free D->dir.
+	* src/close.c (_GD_ShutdownDirfile): Close all open directories.
+	* src/flush.c (_GD_FlushFragment): Call gd_MakeTempFile instead of mkstemp.
+	* src/encoding.c (_GD_SetEncodedName): set file->D to the DIRFILE pointer,
+	so the encoding framework has access to it.
+	* src/encoding.c (_GD_ResolveEncoding): Take dirfd for I/O purposes.
+	* src/move.c (_GD_MogrifyFile): Consider changes in dirfd.
+	* src/parse.c (_GD_ParseRaw): E->e->u.raw.filebase is a copy of E->field
+	now, (and could be removed, except we'll need it shortly).  The fragment
+	index (me) is no longer needed in this function.
+	* src/mod.c (_GD_Change): Release the LUT directory if it changes.
+	* src/include.c (_GD_Include): Open the grab the included fragment's
+	directory and store it in fragment->dirfd.  fragment->sname is now just the
+	value returned by _GD_DirName, and not malloc'd.
+	* src/include.c (gd_uninclude): Release the directory.
+	* src/compat.c (mkstemp _GD_Rename): Removed.
+	* src/common.c (_GD_SetTablePath): Open the directory.  table_path is
+	replaced with table_file.
+
+	* src/encoding.c (_GD_GenericTouch _GD_GenericUnlink _GD_GenericMove)
+	src/slim.c (_GD_SlimOpen _GD_SlimSize) src/gzip.c (_GD_GzipOpen _GD_GzipSize)
+	src/ascii.c (_GD_AsciiOpen _GD_AsciiSize _GD_AsciiTemp) src/lzma.c
+	(_GD_LzmaOpen _GD_LzmaSize) src/bzip.c (_GD_Bzip2Open _GD_Bzip2Size): Update
+	for changes in the encoding framework.
+
+	* src/slim.c (_GD_SlimOpen _GD_SlimSize): Slimlib doesn't accept file
+	descriptors, so compute the full path before calling it.  This has the
+	potential for breakage.
+	* src/gzip.c (_GD_GzipOpen _GD_GzipSize): Use gzdopen instead of gzopen.
+	* src/lzma.c (_GD_LzmaDoOpen) src/bzip.c (_GD_Bzip2DoOpen): Use dirfd to
+	create stream.
+
+	* src/legacy.c (_GD_GetDirfile) src/name.c (gd_rename) src/encoding.c
+	(_GD_MissingFramework _GD_ResolveEncoding) src/move.c (gd_move)
+	src/include.c (_GD_Include) src/add.c (_GD_Add): Remove the FILENAME_MAX
+	crutch.
+
+	* src/add.c (_GD_Add): Fix memory leak of new_ref.
+
+	* src/entry.c (gd_raw_filename): Return a malloc'd string.
+
+	* configure.ac: Fix am__fastdepCXX_* for --disable-cplusplus.  This is
+	presumably a autotools bug.  Look for ...at() functions.
+
+2011-04-21   D. V. Wiebe <getdata at ketiltrout.net> svn:581
+	* bindings/python/pydirfile.c (gdpy_dirfile_geterrorcount): Added.
+	* bindings/cxx/dirfile.cpp (Dirfile::ErrorCount): Added.
+	* bindings/f77/fgetdata.c (GDECNT): Added.
+	* bindings/f77/fgetdata.f90.in (fgd_error_count): Added.
+	* bindings/idl/getdata.c (gdidl_error_count): Added.
+
+	* bindings/perl/GetData.xs (gdp_to_entry): Fix initialisation of n for
+	LINCOM and POLYNOM.
+
+	* bindings/perl/GetData.pm.in: add constants and functions export tags.
+
+	* bindings/make_parameters.c (Perl): Don't insert unnecessary newlines.
+	* bindings/perl/Makefile.am: Use perl to generate funclist.sed.
+
+2011-04-20   D. V. Wiebe <getdata at ketiltrout.net> svn:580
+	* test/error_num.c: Added.
+	* src/errors.c (gd_error_count): Added.
+	* man/gd_error_count.3: Added.
+
+2011-04-06   D. V. Wiebe <getdata at ketiltrout.net> svn:574
+	* test/: Remove the unnecessarily baroque (rococo?) __TEST__ macro.
+	Add rmdirfile() to the top of each test before creating the test
+	dirfile.  Shift definitions to the top of the files for C89 compliance.
+	A few other minor fixes.
+	* cmake/test/CMakeLists.txt: Remove __TEST__ (and __TEST_SLASH__?);
+	no longer needed.
+
+	* src/mod.c (gd_alter_crecip89): Accept cdividend=NULL for cdividend=(0,0)
+
+2011-04-05   D. V. Wiebe <getdata at ketiltrout.net> svn:573
+	Merge in updates from 0.7 branch, r512 and subsequent:
+
+	* test/alter_crecip_zero.c test/alter_recip_zero.c: Added.
+	* src/mod.c (_GD_Change): If [c]dividend is zero, don't change it, per
+	documentation.
+
+	* src/encoding.c (_GD_MissingFramework): Properly compute the module path.
+
+	* src/flush.c (_GD_FieldSpec): For Standards Version >= 8, use new-style
+	metafield syntax.
+
+	* src/entry.c (gd_raw_filename): Clear dirfile error on entry.
+
+	* test/move_data_enc_ar.c test/entry_phase.c test/get_ss.c
+	test/alter_raw_type.c: Actually fail on error.
+
+	* m4/version.m4 configure.ac: Fix library soversion defines.
+
+	* m4/python.m4: Use the BSD `jot' if the Linux/Plan 9 `seq' is not found.
+		Also, look for python2.7.  Added --with-python-module-dir.
+
+	* src/add.c (_GD_Add): strdup ref_name when propagating upwards to prevent
+	double-free when _GD_FreeD() is called.
+	* test/add_raw_include.c: Added.
+
+	* src/include.c (gd_include): If GD_CREAT is specified, but no encoding,
+	inherit encoding from parent.
+
+	* test/test.h: Explicitly use long long format types in the checks.  Write
+	paths properly under WIN32/WIN64.
+
+	* src/legacy.c (GetFormat): Fix memset call.
+
+	* src/common.c (_GD_GetLine): Remove unused first_char.
+
+	* src/raw.c (_GD_RawSeek): nread is a ssize_t.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_putcarray): Remove unused ns.
+
+	* bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+	bindings/f77/test/gdcopn.f bindings/f77/getdata.f90.in: Explicity specify
+	constant kinds to stop the ridiculous complaints from Fedora's gfortran.
+
+	* bindings/idl/Makefile.am: Don't needlessly rebuild sublist.c.
+
+	* src/getdata.h.in: Replace #undefs with @DEFINE_...@ tokens.   Define
+	gd_off64_t instead of polluting the namespace.  Remove MSCRT specal casing
+	for the gd_*int*_t types.
+	* configure.ac: Update for changes to getdata.h.in.  Run getdata.h.in
+	through config.status twice, first as an AC_CONFIG_FILE to replace all the
+	@DEFINE... at s, second as an AC_CONFIG_HEADER as a NOP, just to get the change
+	check.
+	* cmake/CMakeLists.txt: Add DEFINE_... variables.
+
+	* configure.ac: Check for _strtoi64() and _strtoui64()
+	* src/internal.h: Use MSCRT's _strto[u]i64 for strto[u]ll when found.
+	* cmake/CMakeLists.txt: Add -DHAVE__STRTOI64 -DHAVE__STRTOUI64
+
+	* test/parse_include_absrel.c test/parse_include_relabs.c
+	test/parse_include_absolute.c: Free cwd.
+
+	* configure.ac: check for "slimdata" in addition to "slim", which is what
+	the binary is called under Fedora.
+	* m4/encoding.m4 (GD_CHECK_ENCODING): Handle multiple binary names in $5 and
+	$6.
+
+	* src/parse.c (_GD_ParseFieldSpec): Fix GD_E_FORMAT_DUPLICATE error data.
+
+	* src/internal.h: Define S_ISREG and S_ISDIR if missing.
+
+	* test/parse_include_absolute.c test/parse_include_absrel.c
+	test/parse_include_relabs.c test/parse_include_relrel.c: Added.
+
+	* src/include.c (_GD_Include): Handle absolute paths in /INCLUDE directives.
+		The sname now contains D->name when appropriate.
+	* src/add.c (_GD_Add) src/parse.c (_GD_ParseRaw) src/move.c (gd_move): Fix
+		computation of filebase for new sname.
+
+2011-03-25   D. V. Wiebe <getdata at ketiltrout.net> svn:566
+	* src/perl.m4: Added.
+	* configure.ac: Perl tests.
+	* bindings/make_parameters.c (Perl): Added.
+	* Bindings/perl: Added.
+
+2011-03-25   D. V. Wiebe <getdata at ketiltrout.net> svn:561
+	* util/checkdirfile.c: Zero-terminate option list.  Patch from Matthew
+	Truch.
+
+2011-03-22   Peter Kümmel <syntheticpp at gmx.net> svn:538
+	* merge from 0.7 branch strtoll/strtoull replacement with gd_* functions 
+
+2011-03-17   Peter Kümmel <syntheticpp at gmx.net>
+	* use _stat64 and struct _stat64 with msvc
+	* fix tests by removing the content of dirfile
+	* guard definitions of macros in C++ binding
+	* build tests with C89 API
+
+2011-03-03   D. V. Wiebe <getdata at ketiltrout.net>   svn:510
+	* m4/idl.m4: Munge IDL_LIBS to convert "-m <arg>" into "-m<arg>" since
+		libtool seems to delete <arg> if that's not the case.
+	* m4/version.m4: Added.
+	* bindings/idl/package: Added.
+	* bindings/idl/Makefile.am bindings/idl/getdata.c: Update for external build.
+	* configure.ac: Shipped version stuff off into m4/version.m4
+	* Makefile.am: Add rules for making idl_getdata package.
+
+	* bindings/idl/makedlm.sh.in: Handle missing keyword "KEYWORD" better.
+
+2011-02-26   D. V. Wiebe <getdata at ketiltrout.net>   svn:507
+	* m4/python.m4 m4/encoding.m4 m4/idl.m4 configure.ac: Fix double quoting
+	of brackets.
+	* m4/win32.m4 m4/idl.m4: Fix some non-critical errors for OS X 10.5.
+
+	* src/configure.ac: Added --with-module-dir.
+	* src/Makefile.am: Install modules in $moduledir.  -DGETDATA_MODULEDIR.
+	* src/encoding.c (_GD_MissingFramework): Look for modules in
+	GETDATA_MODULEDIR, but fall back to the default searchpath if that fails.
+	Also removed support for unversioned modules.
+
+	* bindings/python/test/big_test.py: Instead of whining, just delete the
+	dirfile at the end.
+
+	* src/encoding.c (_GD_MissingFramework): Release the mutex and zero
+	_gd_ef[].provides on failure to find a module.
+
+2010-12-13   Peter Kümmel <syntheticpp at gmx.net> svn 499 - 504
+	* cmake folder: CMake build system for Windows using MinGW or MS Visual Studio
+	* src/msvc: files not available in MSVC, patched MinGW files
+	* src/getdata.h.in: patches for MinGW and MSVC
+	
+2010-12-08   D. V. Wiebe <getdata at ketiltrout.net>   svn:498
+	* src/getdata.h.in: Add meaningless stuff after #undef's to appease msys's
+	config.status.
+
+2010-12-08   D. V. Wiebe <getdata at ketiltrout.net>   svn:497
+	* m4/encoding.m4: Replace TEST_<foo> AM_CONDITIONALs with a preprocessor
+	symbols.
+	* test/Makefile.am: Remove TEST_<foo> conditionals.
+	* test/gzip_move_from.c test/bzip_get_get.c test/gzip_get_get.c
+	test/gzip_get.c test/xz_nframes.c test/slim_nframes.c test/lzma_nframes.c
+	test/slim_get.c test/lzma_get.c test/bzip_move_from.c test/xz_get.c: If
+	helper binaries are unavailable, just skip these tests.
+
+	* test/test.h: MSVC mkdir() patch from Peter Kümmel.
+
+2010-12-07   D. V. Wiebe <getdata at ketiltrout.net>   svn:494
+	MSVC fixes from Peter:
+
+	* test/*.c: Remove unistd.h include.  (It will be included in internal.h
+	when needed.)
+
+	* src/flush.c: No need to make the GD_VERS_* macros long longs.
+
+	* src/putdata.c (_GD_DoConstOut): Cast to char* before performing pointer
+	arithmetic.
+
+	* src/mod.c (_gd_max): Renamed from max for better encapsulation.
+
+	* src/internal.h: Conditionalise inclusion of non-ANSI unistd.h and stdint.h.
+	Various _MSC_VER specific code.  Also, define gd_stat64 and gd_stat64_t to
+	plausibly useful things by default.
+	
+	* src/getdata.h.in: Remove unistd.h. Add math.h and some _MSC_VER specific
+	code.  (There are still unresolved MSVC issues with this file.)
+
+	* bindings/cxx/*.cpp: Fix constructor inhertiance.
+
+	* configure.ac: Check for unistd.h and stdint.h.
+
+2010-12-06   D. V. Wiebe <getdata at ketiltrout.net>   svn:493
+	GetData-0.7.1 released.
+
+2010-11-30   D. V. Wiebe <getdata at ketiltrout.net>   svn:488
+	GetData-0.7.1rc1:
+
+	* src/del.c (gd_delete): Fix order of tests to avoid accessing out-of-bounds
+	memory.
+	* src/parse.c (_GD_ParseDirective): Don't update the version list if
+	_GD_Include failed.
+	* src/common.c (_GD_GetRepr): Don't attempt to find a representation suffix
+	on field codes which are too short to contain them.
+	* src/add.c (_GD_Add): Zero memory allocated for a CARRAY or CONST so
+	behaviour is deterministic when creating these fields via gd_[m]add().
+
+2010-11-28   D. V. Wiebe <getdata at ketiltrout.net>   svn:487
+	* src/ test/ bindings/: Separate declarations from statements;
+
+	* src/common.c (_GD_SetTablePath): Don't use fixed length buffers.
+
+2010-11-27   D. V. Wiebe <getdata at ketiltrout.net>   svn:486
+	* bindings/cxx/test/big_test.cpp: Delete stuff.
+
+2010-11-27   D. V. Wiebe <getdata at ketiltrout.net>   svn:485
+	* test/alter_polynom_coeff.c test/include_ignore.c test/alter_entry.c
+	test/entry_linterp.c test/entry_multiply.c test/move_data_enc_ar.c
+	test/gzip_move_from.c test/include_ref.c test/global_name.c
+	test/entry_phase.c test/move_data_foffs.c test/entry_raw_scalar.c
+	test/alter_entry_scalar3.c test/move_data_endian.c test/move.c
+	test/entry_raw.c test/move_data_nop.c test/alter_entry_scalar4.c
+	test/entry_polynom_scalar.c test/move_index.c test/header_complex.c
+	test/alter_entry_recode.c test/entry_bit_scalar.c test/entry_scalar_repr.c
+	test/entry_polynom.c test/file.c test/entry_lincom.c test/name_move.c
+	test/fragment_name.c test/move_data_enc_ra.c test/move_protect.c
+	test/alter_entry_scalar2n.c test/move_subdir.c test/entry_lincom_scalar.c
+	test/entry_phase_scalar.c test/alter_crecip89.c test/bzip_move_from.c
+	test/move_meta.c test/name.c test/entry_bit.c test/alter_entry_scalar2a.c
+	test/alter_linterp.c test/global_ref_set.c test/global_ref.c
+	test/include_auto.c: Free strings.
+
+	* test/trunc_rofs.c test/open_notdirfile.c test/open_nonexistent.c: Close
+	dirfiles.
+
+	* src/entry.c (_GD_FreeE): Free LUT.
+	* src/open.c (_GD_CreateDirfile): Close DIR after truncation.
+	* src/close.c (_GD_FreeD): Free dot list.
+	* src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Free databuffer on
+	error.
+	* src/lzma.c (_GD_LzmaSize) src/bzip.c (_GD_Bzip2Size): Close file.
+	* src/move.c (_GD_MogrifyFile): Free new_filebase if necessary.
+	* src/parse.c (_GD_ParseFieldSpec): Free entry on duplicate field name.
+	* src/mod.c (_GD_Change): Transfer the old file structure to the new entry
+	in the case of RAW fields.  Don't forget to free the old CONST storage, if
+	necessary.
+	* src/include.c (gd_include): Always free ref_name.
+
+	* src/raw.c (_GD_RawTemp): Call the right close function on error.
+
+	* src/mod.c (gd_alter_crecip89): For some reason, intialise scalar_ind[0].
+
+	* src/parse.c (_GD_ParseFragment _GD_ParseFieldSpec): Handle GD_IGNORE_DUPS
+	inside _GD_ParseFieldSpec, which eliminates the spurious error message if
+	GD_VERBOSE is given.
+
+2010-11-26   D. V. Wiebe <getdata at ketiltrout.net>   svn:484
+	* test/ascii_get_get.c: Added.
+
+	* src/ascii.c (_GD_AsciiRead): Update fp as necessary so we don't get lost.
+
+	* bindings/python/pygetdata.c (gdpy_convert_from_pylist): Don't type-pun
+	the return array into a gdpy_quadruple_value.
+
+	* src/open.c (gd_cbopen): Don't allocate error string buffers.
+	* src/errors.c (_GD_SetError): Use strdup to copy error strings.
+
+	* bindings/f77/fgetdata.c (GDASCA): Clean-up.
+	* src/del.c (gd_delete): Alloc the correct del_list for metafields.
+	* src/common.c (_GD_GetLine): Deallocate the line before returning NULL.
+	* src/entry.c (_GD_FreeE): Free p.meta_entry when appropriate.
+
+	* src/nan.h: Added.
+	* src/internal.h: Removed NAN code.
+	* util/dirfile2ascii.c: Add missing -u option.  Allow cart-before-horse
+	arguments (ie. "dirfile2ascii -e field dirfile").  Handle running past the
+	end-of-field nicelier (added -z option).  Complain on no dirfile.
+
+2010-11-22   D. V. Wiebe <getdata at ketiltrout.net>   svn:480
+	GetData 0.7.0 released.
+
+2010-11-20   D. V. Wiebe <getdata at ketiltrout.net>   svn:478
+	* bindings/idl/getdata.c: Properly terminate IDL keyword lists.
+
+2010-11-17   D. V. Wiebe <getdata at ketiltrout.net>   svn:476
+	* bindings/python/pydirfile.c (gdpy_dirfile_init)
+	bindings/cxx/getdata/dirfile.h: Open dirfiles read-only by default (for
+	compatibility with the C API.
+
+2010-11-16   D. V. Wiebe <getdata at ketiltrout.net>   svn:475
+	* bindings/python/pydirfile.c (gdpy_dirfile_getdata): If neither num_samples
+	or num_frames are specified, raise ValueError.
+
+2010-11-06   D. V. Wiebe <getdata at ketiltrout.net>   svn:473
+	GetData-0.7.0rc4:
+
+	* src/errors.c (_GD_SetError): Rename variable.o
+	
+	* bindings/python/pygetdata.c (gdpy_type_from_npytype): Explicitly cast the
+	computed types.
+
+2010-11-06   D. V. Wiebe <getdata at ketiltrout.net>   svn:472
+	* src/ascii.c (_GD_AsciiOpen _GD_AsciiSize _GD_AsciiTemp) src/common.c
+	(_GD_ReadLinterpFile): Open text files in binary mode.
+
+	* src/internal.h: Define EOVERFLOW if necessary.  Also handle missing
+	fseeko64 and ftello64.
+
+	* src/compat.c (getdelim): Work around the bizarre behaviour of MSVCRT's
+	standard I/O.
+
+2010-11-06   D. V. Wiebe <getdata at ketiltrout.net>   svn:470
+	* src/getdata.h.in: Rename 'cons' to 'scalar' in the unified entry struct.
+
+	* src/internal.h: Remove GD_ANON from the private entry struct.
+
+2010-11-06   D. V. Wiebe <getdata at ketiltrout.net>   svn:469
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+	bindings/idl/test/big_test.pro: Added tests 158 through 181.
+	
+	* test/put_carray_slice.c test/cvlist_array_meta.c test/del_carray.c
+	test/get_carray_slice.c test/cvlist_array.c test/del_carray_deref.c
+	test/nmeta_vectors_del.c test/get_carray.c test/parse_carray.c
+	test/madd_carray.c test/add_carray.c test/put_carray.c test/get_carray_len.c
+	test/parse_carray_long.c test/alter_carray_len.c test/alter_carray_type.c:
+	Added.
+
+	* test/madd.c: Remove gd_get_constant call.
+
+	* test/parse_const.c: Actually test what is advertised.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getcarray gdpy_dirfile_carraylen
+	gdpy_dirfile_carrays gdpy_dirfile_mcarrays gdpy_dirfile_putcarray)
+	bindings/python/pyentry.c (gdpy_entry_getarraylen gdpy_entry_setarraylen):
+	Added.
+	* bindings/python/pyentry.c (gdpy_set_entry_from_tuple
+	gdpy_set_entry_from_dict gdpy_entry_getinfields gdpy_entry_getdatatypename
+	gdpy_entry_getdatatype): Update for CARRAY.
+
+	* bindings/cxx/bitentry.cpp (BitEntry::ScalarIndex) bindings/cxx/entry.cpp
+	(scalar_ok Entry::ScalarIndex Entry::SetScalar) bindings/cxx/lincomentry.cpp
+	(LincomEntry::ScalarIndex) bindings/cxx/dirfile.cpp (Dirfile::Carrays
+	Dirfile::CarrayLen Dirfile::MCarrays Dirfile::GetCarray Dirfile::PutCarray)
+	bindings/cxx/polynomentry.cpp (PolynomEntry::ScalarIndex)
+	bindings/cxx/sbitentry.cpp (SBitEntry::ScalarIndex)
+	bindings/cxx/getdata/rawentry.h (ScalarIndex)
+	bindings/cxx/getdata/recipentry.h (ScalarIndex): Added.
+	* bindings/cxx/bitentry.cpp (BitEntry::SetFirstBit BitEntry::SetNumBits)
+	bindings/cxx/lincomentry.cpp (LincomEntry::SetScale LincomEntry::SetOffset)
+	bindings/cxx/polynomentry.cpp (PolynomEntry::SetCoefficient)
+	bindings/cxx/phaseentry.cpp (PhaseEntry::SetShift)
+	bindings/cxx/sbitentry.cpp (SBitEntry::SetFirstBit SBitEntry::SetNumBits)
+	bindings/cxx/recipentry.cpp (RecipEntry::SetDividend):
+	Call Entry::SetScalar.
+	* bindings/cxx/entry.cpp (Entry::Scalar): Call scalar_ok.
+	* bindings/cxx/carrayentry.cpp bindings/cxx/getdata/carrayentry.h: Added.
+	* bindings/cxx/dirfile.cpp (Dirfile::ErrorString): Let the C library malloc
+	the string.  Also added a prototype with no parameters.
+
+	* bindings/f77/fgetdata.c (GDGECA GDADCA GDGTCA GDGCAS GDCALN GDPTCA GDPCAS
+	GDALCA):
+	* bindings/f77/fgetdata.c (GDGTCO GDPTCO): Removed the returned integer.
+	* bindings/f77/fgetdata.c (GDGSCA GDASCA): Deal with scalar index.
+	* bindings/f77/getdata.f90.in (fgd_get_constant_n fgd_get_constant_i1
+	fgd_get_constant_i2 fgd_get_constant_i4 fgd_get_constant_i8
+	fgd_get_constant_r4 fgd_get_constant_r8 fgd_get_constant_c8
+	fgd_get_constant_c16 fgd_put_constant_i1 fgd_put_constant_i2
+	fgd_put_constant_i4 fgd_put_constant_i8 fgd_put_constant_r4
+	fgd_put_constant_r8 fgd_put_constant_c8 fgd_put_constant_c16): Convert to
+	subroutines.
+	* bindings/f77/getdata.f90.in (fgd_entry fgd_add fgd_madd fgd_alter_entry):
+	Update for CARRAY.
+	* bindings/f77/getdata.f90.in (fgd_get_carray_n fgd_get_carray_i1
+	fgd_get_carray_i2 fgd_get_carray_i4 fgd_get_carray_i8 fgd_get_carray_c16
+	fgd_put_carray_i1 fgd_put_carray_i2 fgd_put_carray_i4 fgd_put_carray_i8
+	fgd_put_carray_r4 fgd_put_carray_r8 fgd_put_carray_c8 fgd_put_carray_c16
+	fgd_carray_len fgd_add_carray fgd_madd_carray fgd_alter_carray): Added.
+
+	* bindings/idl/getdata.c (gdidl_make_idl_entry): Update for CARRAY.
+	* bindings/idl/getdata.c (gdidl_add_const): fix handling of data values
+	* bindings/idl/getdata.c (gdidl_add_carray gdidl_alter_carray
+	gdidl_get_carray gdidl_carray_len gdidl_put_carray): Added.
+	* bindings/idl/getdata.c (gdidl_getdata): Free data on error.
+	* bindings/idl/getdata.c (gdidl_get_constant): Free data on return.
+
+	* src/interna.h: Replace the const data union with a void pointer.
+	* src/getdata.h.in: Define GD_MAX_CARRAY_LENGTH.
+
+	* src/common.c (_GD_GetLine): Call getdelim.  Return string length not
+	string itself.
+	* src/parse.c (_GD_ParseFragment): Handle n_cols < 2.  Raise
+	GD_E_LINE_TOO_LONG on overflow.
+	* src/parse.c (_GD_ParseFragment) mod.c (gd_alter_spec gd_malter_spec)
+	src/add.c (gd_add_spec gd_madd_spec): Don't provide buffers for instring and
+	outstring: they will be malloc'd by others.
+	* src/parse.c (_GD_Tokenise): Dynamically allocate outstring.  Also,
+	remember position, so tokenising can resume.
+	* src/parse.c (_GD_ParseFieldSpec _GD_ParseDirective): Pass through tok_pos
+	and outstring.
+	* src/compat.c (getdelim): Added.
+
+	* src/parse.c (_GD_ParseFragment): Permit the parser callback to re-malloc
+	pdata.line.  Also pass it the current length of pdata.line.
+
+	* src/entry.c (_GD_FreeE) src/nmeta.c (gd_nmvectors gd_nmfields_by_type)
+	src/close.c (_GD_FreeD) src/flush.c (_GD_FieldSpec) src/nfields.c
+	(gd_nvectors gd_nfields_by_type) src/native.c (_GD_NativeType) src/del.c
+	(gd_delete) src/parse.c (_GD_ParseFieldSpec) src/mod.c (_GD_Change)
+	src/add.c (_GD_Add): Update for CARRAY.
+	* src/getdata.c (_GD_DoConst) src/putdata.c (_GD_DoConstOut) src/flush.c
+	(_GD_WriteConst): Handle both CONST and CARRAY.
+	* src/constant.c (gd_get_carray_slice gd_get_carray gd_carray_len
+	gd_put_carray_slice gd_put_carray) src/parse.c (_GD_ConstType
+	_GD_ParseCarray) gd_field_lists (gd_carrays) src/mod.c (gd_alter_carray)
+	src/meta_list.c (gd_mcarrays) src/add.c (gd_add_carray gd_madd_carray): Added.
+	* src/parse.c (_GD_ParseConst): Storage for constant value is now dynamic.
+
+	* src/del.c (gd_delete): Update parent when deleting a metafield.
+
+	* src/ascii.c (_GD_AsciiSize) src/common.c (_GD_ReadLinterpFile): Call
+	getdelim.
+
+	* src/flush.c (_GD_FlushFragment): Skip writing and /ENCODING directive if
+	not known.
+
+	* src/errors.c (gd_error_string): malloc a suitably sized buffer for the
+	string if passed buffer=NULL.
+
+	* src/name.c (gd_rename) src/del.c (gd_delete) src/include.c (gd_uninclude):
+	Invalidate the field lists.
+
+	* src/flush.c (_GD_StringEscapeise _GD_PadField) _GD_FieldSpec: Write directly
+	to the stream, rathen than an intermediate buffer.
+
+	* src/entry.c (_GD_GetScalar) parse.c (_GD_SetScalar) src/mod.c
+	(_GD_AlterScalar): Handle the scalar index.
+
+	* src/legacy.c (_GD_CopyGlobalError): Dynamically handle error strings, rather
+	than using _GD_GlobalErrorString and _GD_GlobalErrorFile.
+
+2010-10-28   D. V. Wiebe <getdata at ketiltrout.net>   svn:468
+	* src/legacy.c (GetFormat): Fix counting of POLYNOM fields.
+
+2010-10-22   D. V. Wiebe <getdata at ketiltrout.net>   svn:463
+	GetData-0.7.0rc3:
+
+	* src/parse.c (_GD_ParseDirective): Update passed flags, not D->flags after
+	/INCLUDE.
+	
+	* src/common.c (lutcmp): Don't rely on typecasting to retain the -0+
+	distiction.
+
+2010-10-22   D. V. Wiebe <getdata at ketiltrout.net>   svn:462
+	* configure.ac m4/encoding.m4: Compute PRIVATE_LIBS
+	* src/getdata.pc: Correct private libs.
+
+2010-10-22   D. V. Wiebe <getdata at ketiltrout.net>   svn:461
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+	bindings/idl/test/big_test.pro: Added tests 156 and 157.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_init): Allow name=None to create
+	an invalid dirfile.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_close gdpy_dirfile_discard):
+	Don't check dirfile error on success.
+	* bindings/python/pygetdata.c: Add missing exceptions.
+
+	* bindings/python/pydirfile.c bindings/python/pyfragment.c: Update docs.
+
+	* bindings/make_parameters.c: GD_ARM_ENDIAN and GD_NOT_ARM_ENDIAN are type 2
+	constants.  Exclude unnecessary constants in Python and IDL.  GD_VERSION_*
+	added.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::Dirfile): Create the invalid dirfile
+	using gd_invalid_dirfile().
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getstandards
+	gdpy_dirfile_setstandards) bindings/f77/fgetdata.c (GDINVD GDSTDV)
+	bindings/f77/getdata.f90.in (fgd_invalid_dirfile fgd_dirfile_standards)
+	bindings/idl/getdata.c (gdidl_invalid_dirfile gdidl_dirfile_standards)
+	bindings/cxx/dirfile.cpp (Dirfile::Standards): Added.
+
+	* bindings/idl/getdata.c: Fix for GD_NOT_ARM_ENDIAN.
+
+2010-10-21   D. V. Wiebe <getdata at ketiltrout.net>   svn:460
+	* test/endian_get.c: Test ARM endianness.
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+	bindings/idl/test/big_test.pro: Fix test 79 on middle-ended platforms.
+
+	* src/getdata.h.in: Added GD_NOT_ARM_ENDIAN and conditionally figure out
+	whether it or GD_ARM_ENDIAN should be zero.
+	* bindings/make_parameters.c: Added GD_NOT_ARM_ENDIAN.
+	* src/internal.h: compute GD_ARM_FLAG.
+	* src/endian.c (_GD_ByteSwapFragment) src/open.c (gd_cbopen) src/getdata.c
+	(_GD_DoRaw) src/flush.c (_GD_FlushFragment) src/putdata.c (_GD_DoRawOut)
+	src/parse.c (_GD_ParseDirective): Fix handling of ARM flag.
+	* src/move.c (_GD_MogrifyFile): Only apply the ARM fix to double precision
+	data.  Also fixed the count in byte swapping calls.
+
+	* src/flush.c (_GD_FindVersion): Fix logic for ARM endianness.  Fix ordering
+	of fragment metadata tests.
+
+	* src/flush.c (_GD_FindVersion) src/errors.c: Better script for
+	GD_E_BAD_VERSION.  Differentiate between a non-conformant dirfile and an
+	invalid version number.
+
+2010-10-20   D. V. Wiebe <getdata at ketiltrout.net>   svn:459
+	* test/version_5.c: Fix for WORDS_BIGENDIAN.
+
+	* src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Fix
+	_GD_FixEndianness test.
+
+	* src/flush.c (_GD_FindVersion): Native byte sex is assumed in early versions.
+
+2010-10-19   D. V. Wiebe <getdata at ketiltrout.net>   svn:457
+	* legacy.c (_GD_GetDirfile): On error, set *error_code (now passed as a
+	parameter), copy the error, discard the bad dirfile, and return NULL.
+
+2010-10-18   D. V. Wiebe <getdata at ketiltrout.net>   svn:456
+	GetData-0.7.0rc2:
+
+	* encoding.c (_GD_ResolveSymbol _GD_MissingFramework): Fix types for
+	USE_MODULES.
+
+2010-10-17   D. V. Wiebe <getdata at ketiltrout.net>   svn:455
+	GetData-0.7.0rc1:
+
+	* configure.ac: update library interface numbers.  Removed
+	--disable-checkdirfile.
+
+	* MEWS: Update.
+
+2010-10-16   D. V. Wiebe <getdata at ketiltrout.net>   svn:453
+	* configure.ac: Generate Makefiles even for bindings we're not using (so we
+	can still run maintainer tasks on them.)
+
+2010-10-16   D. V. Wiebe <getdata at ketiltrout.net>   svn:452
+	* src/getdata.h.in: Keep anonymous structs and unions in C99-mode.
+	* src/internal.h: Helper macros for C99/C89 differences.
+	* test/ src/ bindings/: Update for changes.
+
+2010-09-18   D. V. Wiebe <getdata at ketiltrout.net>   svn:448
+	* bindings/python/pydirfile.c (gdpy_dirfile_close gdpy_dirfile_discard)
+	bindings/cxx/dirfile.cpp (Dirfile::Discard Dirfile::Close)
+	bindings/f77/fgetdata.c (_GDF_InitDirfiles) bindings/idl/getdata.c
+	(gdidl_init_dirfile): Call gd_invalid_dirfile() instead of using
+	GetData C internals.
+	* src/open.c (gd_invalid_dirfile): Added.
+
+	* bindings/cxx/: Declare const member functions.
+
+	* configure.ac: Fix mkdir check for C++ compilers masquerading as C
+	compilers.
+
+	* src/legacy.c: Humanely initialise _GD_GlobalErrors when possible.
+
+2010-09-17   D. V. Wiebe <getdata at ketiltrout.net>   svn:447
+	* test/Makefile.am src/Makefile.am bindings/python/Makefile.am
+	bindings/cxx/Makefile.am bindings/f77/test/Makefile.am
+	bindings/f77/Makefile.am bindings/idl/Makefile.am util/Makefile.am: Remove
+	hardcoded -Wall.
+	* m4/compiler.m4 (GD_PROG_CC_WALL GD_PROG_CXX_WALL GD_PROG_FC_WALL
+	GD_PROG_F77_WALL): Added.
+	* configure.ac: Check whether the compilers accept -Wall
+
+	* bindings/cxx/big_test.cpp: Fix for renamed functions.
+
+2010-09-15   D. V. Wiebe <getdata at ketiltrout.net>   svn:446
+	* bindings/cxx/dirfile.cpp (Dirfile::EoF Dirfile::BoF): Renamed.
+
+2010-09-11   D. V. Wiebe <getdata at ketiltrout.net>   svn:445
+	* bindings/f77/fgetdata.c (GDFNSS): Don't call the explicitly 64-bit
+	version of gd_framenum_subset.
+
+	* util/dirfile2ascii.c: Unroll type_data initialisation some more.
+
+2010-09-11   D. V. Wiebe <getdata at ketiltrout.net>   svn:444
+	* test/ src/ bindings/ util/: ANSI-C-ify.
+	* src/getdata.h.in: Define GD_NO_C99_API when the C99-compliant API has been
+	disabled at build time.
+	* src/getdata.h.in src/internal.h: ANSI C does not permit anonymous union
+	and structures, so name all the sub-bits of gd_entry_t and gd_private_entry.
+
+	* src/getdata.h.in: Encompass everything in an extern "C" block
+	for C++ compilers.
+
+	* src/: include gd_throw in definition of functions.
+
+	* src/debug.c src/common.c src/Makefile.am: Move gd_col_count and
+	gd_debug_col to common.c to remove the need for GDLIB.
+
+	* test/legacy_get_rofs.c test/legacy_get.c test/legacy_nonexistent.c
+	test/legacy_put.c: Fix skip test.
+
+	* test/flush_spec.c: Skip the blank line.
+
+	* test/slim_nframes.c: Add missing r.
+
+	* bindings/idl/test/Makefile.am: Use DL_LIBRARY_PATH in TESTS_ENVIRONMENT.
+
+	* configure.ac: Add --enable-ansi-c, which will disable Python and IDL.
+	A fail of AC_PROG_CC_C99 will also cause this to be asserted.
+
+	* configure.ac: Fix lfs_transitional_api check.
+
+2010-08-10   D. V. Wiebe <getdata at ketiltrout.net>   svn:443
+	* src/common.c (_GD_BadInput): Check the propper entry for scalarness.
+
+2010-08-10   D. V. Wiebe <getdata at ketiltrout.net>   svn:442
+	* bindings/cxx/getdata/linterpentry.h bindings/cxx/getdata/bitentry.h
+	bindings/cxx/getdata/entry.h bindings/cxx/getdata/sbitentry.h: Remove
+	__gd_unused.
+
+	* src/endian.c (_GD_ByteSwapFragment) src/encoding.c (_GD_RecodeFragment)
+	src/move.c (gd_move) src/flimits.c (_GD_ShiftFragment) src/mod.c
+	(_GD_Change) src/globals.c (gd_reference) src/add.c (_GD_Add gd_madd_spec
+	gd_add_spec): Clear GD_HAVE_VERSION.
+
+	* src/mod.c (gd_alter_spec gd_malter_spec): Use the standards version of the
+	open dirfile rather than GD_DIRFILE_STANDARDS_VERSION.
+	* src/include.c (gd_include): Calculate the opend dirfile's version if
+	necessary, and use this instead of GD_DIRFILE_STANDARDS_VERSION.  Clear
+	GD_HAVE_VERSION at the end.
+
+	* src/getdata.c (gd_getdata64) src/putdata.c (gd_putdata64) src/flimits.c
+	(_GD_GetEOF _GD_GetBOF): Return GD_E_DIMENSION instead of GD_E_BAD_FIELD_TYPE
+	on scalar field.
+	* src/errors.c: Add GD_E_DIMENSION errors.
+	* src/internal.h: Add GD_E_DIMENSION suberrors.
+
+	* src/getdata.h.in src/errors.c: Rename GD_E_OPEN_INCLUDE to
+	GD_E_OPEN_FRAGMENT.
+	* bindings/make_parameters.c: Add GD_E_OPEN_FRAGMENT (in addition to the
+	legacy GD_E_OPEN_INCLUDE, which remains).
+
+	* src/getdata.h.in configure.ac: Rename GETDATA_LEGACY_API,
+	NO_GETDATA_LEGACY_API, GETDATA_C89_API, GETDATA_FUNCTION_ALIASES,
+	DIRFILE_STANDARDS_VERSION to GD_LEGACY_API, GD_NO_LEGACY_API, GD_C89_API,
+	GD_FUNCTION_ALIASES, GD_DIRFILE_STANDARDS_VERSION.
+
+	* util/checkdirfile.c: Fix pluralisations.
+
+2010-07-20   D. V. Wiebe <getdata at ketiltrout.net>   svn:441
+	* src/flush.c (_GD_FlushMeta gd_metaflush gd_rewrite_fragment): Return error
+	on read-only dirfile.
+
+2010-07-20   D. V. Wiebe <getdata at ketiltrout.net>   svn:440
+	* util/checkdirfile.c: Fix reporting of conformant Standards Versions.
+
+2010-07-20   D. V. Wiebe <getdata at ketiltrout.net>   svn:439
+	* test/version_0_write.c test/version_1_write.c test/version_2_write.c
+	test/version_3_write.c test/version_4_write.c test/version_5_write.c
+	test/version_6_write.c test/version_7_write.c test/version_8_write.c: Added.
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/f77/test/big_test95.f90 bindings/f77/test/big_test.f
+	bindings/idl/test/big_test.pro: Add test 155.
+	* bindings/python/pyfragment.c (gdpy_fragment_rewrite): Added.
+	* bindings/cxx/fragment.cpp (Fragment::ReWrite): Added.
+	* bindings/f77/fgetdata.c (GDRFRG): Added.
+	* bindings/f77/getdata.f90.in (fgd_rewrite_fragment): Added.
+	* bindings/idl/getdata.c (gdidl_gd_rewrite_fragment): Added.
+
+	* src/flush.c (_GD_OldTypeName): Added
+	* src/flush.c (_GD_StringEscapeise _GD_PadField): Avoid escaping on early
+	versions.
+	* src/flush.c (_GD_FieldSpec _GD_FlushFragment): Write the specified version
+	metadata.
+
+	* src/flush.c (_GD_FlushMeta): Add force parameter.
+	* src/flush.c (gd_rewrite_fragment): Added.
+
+	* src/flush.c (_GD_FindVersion): Remove the REFERENCE check: it can be
+	wrong.
+
+2010-07-17   D. V. Wiebe <getdata at ketiltrout.net>   svn:438
+	* test/version_0.c test/version_1.c test/version_2.c
+	test/version_3.ctest/version_4.c: Weed out version 8.
+
+	* test/add_spec_directive.c: The test works again in version 8, so try it in
+	version 7.
+
+	* test/version_8_strict.c: Test syntax removed in version 8.
+
+	* bindings/idl/getdata.c (gdidl_gd_alter_endianness gdidl_gd_include
+	gdidl_gd_open): Handle ARM_ENDIAN and PERMISSIVE.
+
+	* bindings/make_parameters.c: Add GD_ARM_ENDIAN and GD_PERMISSIVE.
+
+	* src/add.c (gd_madd_spec gd_add_spec): Use the current version rather than
+	DIRFILE_STANDARDS_VERSION when calling the parser.
+
+	* src/name.c (_GD_ValidateField): Allow directives as field names in version 8
+	* src/endian.c (_GD_ByteSwapFragment) src/move.c (_GD_MogrifyFile): Handle ARM
+	ended floats.
+	* src/flush.c (_GD_FindVersion): Directives are permitted as field names in
+	version 8.
+	* src/parse.c (_GD_RawType): Single character types aren't permitted in
+	version 8.
+	* src/parse.c (_GD_ParseDirective): Slash is mandatory in version 8.
+
+	* src/open.c (gd_cbopen) getdata.c (_GD_DoRaw) putdata.c (_GD_DoRawOut: Merge
+	byte_sex and float_sex.
+	* src/flush.c (_GD_FlushFragment) src/parse.c (_GD_ParseDirective): Allow only
+	"arm" as float sex in format.
+
+2010-07-15   D. V. Wiebe <getdata at ketiltrout.net>   svn:436
+	* bindings/f77/test/big_test.f: Added tests 143-154
+	* bindings/f77/test/big_test95.f90: Added tests 143, 145-154
+	* bindings/cxx/test/big_test.cpp: Added tests 143, 145-148, 152, 153
+	* bindings/idl/test/big_test.pro: Added tests 143, 145, 146, 148, 152, 153
+	* bindings/python/test/big_test.py: Added tests 143, 145, 146, 149, 151
+
+	* bindings/f77/fgetdata.c (GDGEDV GDGERC GDGECR GDADDV GDADRC GDADCR GDMDDV
+	GDMDRC GDMDCR GDALDV GDALRC GDALCR): Added.
+	* bindings/f77/fgetdata.c (GDGSCA GDASCA): Update for DIVIDE and RECIP.
+
+	* bindings/f77/getdata.f90.in (fgd_entry fgd_add fgd_madd fgd_alter_entry):
+	Update for DIVIDE and RECIP.
+	* bindings/f77/getdata.f90.in (fgd_add_divide fgd_add_recip fgd_add_crecip
+	fgd_madd_divide fgd_madd_recip fgd_madd_crecip):
+	Added.
+
+	* bindings/cxx/entry.cpp (Entry::CheckIndex Entry::Scalar)
+	bindings/cxx/dirfile.cpp (Dirfile::Entry) bindings/cxx/getdata/entry.h:
+	Update for DIVIDE and RECIP.
+	* bindings/cxx/entry.cpp (Entry::Scalar): Don't reject valid indicies.
+	* bindings/cxx/recipentry.cpp bindings/cxx/divideentry.cpp
+	bindings/cxx/getdata/recipentry.h bindings/cxx/getdata/divideentry.h: Added.
+	
+	* bindings/python/pyentry.c (gdpy_entry_getdividend gdpy_entry_setdividend):
+	Added.
+	* bindings/python/pyentry.c (gdpy_set_entry_from_tuple
+	gdpy_set_entry_from_dict gdpy_entry_getinfields gdpy_entry_setinfields
+	gdpy_entry_getparms): Update for DIVIDE and RECIP.
+
+	* bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_read_idl_entry): Update
+	for DIVIDE and RECIP.
+	* bindings/idl/getdata.c (gdidl_gd_add_divide gdidl_gd_add_recip
+	gdidl_gd_alter_divide gdidl_gd_alter_recip): Added.
+
+	* bindings/python/pydirfile.c: Doc updates.
+
+	* bindings/python/pyentry.c (gdpy_entry_getshift): Properly handle
+	non-literal scalar fields.
+
+	* bindings/make_parameters.c: Update.
+
+	* test/dfes_recip.c test/get_recip.c test/parse_recip.c test/alter_recip.c
+	test/put_recip.c test/spf_recip.c test/version_8.c test/get_recip_const.c
+	test/alter_crecip89.c test/alter_crecip.c: Update for swapped parameters.
+	* src/parse.c (_GD_ParseRecip): Swap order of parameters in spec line to
+	agree with other derived fields.  Initalise comp_scal.
+
+	* src/debug.c: Export the shift buffer.
+
+2010-07-11   D. V. Wiebe <getdata at ketiltrout.net>   svn:435
+	The Great Renaming, part 2: removed get_ from many public function names.
+
+2010-07-10   D. V. Wiebe <getdata at ketiltrout.net>   svn:434
+	* test/madd_crecip.c test/add_recip.c test/add_crecip.c test/dfes_recip.c
+	test/get_recip.c test/spf_divide.c test/parse_recip.c test/alter_recip.c
+	test/put_recip.c test/spf_recip.c test/version_8.c test/madd_recip.c
+	test/madd_crecip89.c test/dfes_divide.c test/get_recip_const.c
+	test/alter_crecip89.c test/get_divide.c test/parse_divide.c
+	test/version_8_strict.c test/add_divide_invalid.c test/madd_divide.c
+	test/add_divide.c test/put_divide.c test/add_crecip89.c test/alter_crecip.c:
+	Added.
+
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry gd_get_entry gd_validate)
+	src/getdata.c (_GD_DoField) src/native.c (_GD_NativeType) src/spf.c
+	(_GD_GetSPF) src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_DeReference
+	_GD_ClearDerived) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/mod.c (_GD_Change)
+	src/add.c (_GD_Add): Split RECIP from DIVIDE.
+	* src/legacy.c (CopyMultDivEntry CopyMultiplyEntry): Renamed
+	CopyMultiplyEntry to CopyMultDivEntry.
+	* src/getdata.c (_GD_DoRecip) src/parse.c (_GD_ParseRecip _GD_ParseDivide)
+	src/mod.c (gd_alter_recip gd_alter_crecip gd_alter_crecip89 gd_alter_divide)
+	src/add.c (gd_add_divide gd_add_recip gd_add_crecip gd_add_crecip89
+	gd_madd_divide gd_madd_recip gd_madd_crecip gd_madd_crecip89): Added.
+	* src/getdata.h.in: Bump standards version to Version 8.  Add
+	GD_RECIP_ENTRY.  Fix unified entry struct for RECIP.
+	* src/parse.c (_GD_ParseFieldSpec): Recognise DIVIDE and RECIP.
+	* src/flush.c (_GD_FindVersion): Add Version 8.
+	* src/putdata.c (_GD_DoDivideOut _GD_DoRecipOut): Renamed _GD_DoDivideOut to
+	_GD_DoRecipOut.
+
+	* src/getdata.c (DIVIDE): Swap divisor and dividend in entry struct.
+
+	* test/version_6.c test/version_7.c: Update for Standards Version 8.
+
+	* test/convert_float64_int8.c test/eof_lincom.c: Delete the test dirfile.
+
+	* configure.ac m4/encoding.m4: Add --without-external-libraries switch.
+
+2010-07-08   D. V. Wiebe <getdata at ketiltrout.net>   svn:433
+	* test/alter_lincom_32.c: Added.
+
+	* src/native.c (_GD_NativeType): Fix computation of MULTIPLY.
+
+	* src/mod.c (_GD_Change): Fix memory leaks in LINCOM.
+
+	* src/putdata.c (_GD_DoLincomOut): Remove unnecessary error check.
+
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry gd_get_entry gd_validate)
+	src/getdata.c (_GD_DoField) src/native.c (_GD_NativeType) src/spf.c
+	(_GD_GetSPF) src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_DeReference
+	_GD_ClearDerived) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/mod.c (_GD_Change)
+	src/add.c (_GD_Add): Handle DIVIDE.
+	* src/getdata.c (_GD_DivideData _GD_CDivideData _GD_DoDivide) src/putdata.c
+	(_GD_DoDivideOut) src/common.c (_GD_InvertData _GD_CInvertData): Added.
+	* src/nfields.c (gd_get_nfields_by_type): Use a default case.
+	* src/getdata.h.in: Add GD_DIVIDE_ENTRY and DIVIDE entries to the entry
+	struct.
+
+	* src/legacy.c (CopyReciprocalEntry): Added.
+	* src/legacy.c (GetFormat): Store DIVIDEs as LINCOMs or MULTIPLYs.
+
+	* src/getdata.c: Combine MULTIPLY() and CMULTIPLY() macros.
+
+2010-07-07   D. V. Wiebe <getdata at ketiltrout.net>   svn:432
+	* src/common.c (_GD_ReadLinterpFile): Only sort if necessary.
+
+2010-07-07   D. V. Wiebe <getdata at ketiltrout.net>   svn:431
+	* test/get_linterp_notab.c: Test for dummy linterp creation.
+
+	* src/common.c (_GD_MakeDummyLinterp): Deleted.
+	* src/common.c (_GD_ReadLinterpFile): Don't make a dummy LUT on error.
+
+2010-07-07   D. V. Wiebe <getdata at ketiltrout.net>   svn:430
+	* test/bof_lincom.c: Fix.
+
+	* test/get_linterp_sort.c test/put_linterp_reverse.c
+	test/put_linterp_nomono.c: Added.
+
+	* src/getdata.c (_GD_DoLinterp): Update call to _GD_LinterpData.
+	* src/putdata.c (_GD_DoLinterpOut): Reject non-monotonic LUTs.  Update for
+	new LUT struct.
+	* src/common.c (_GD_LinterpData): Handle both complex and real tables.
+	* src/common.c (_GD_CLinterpData): Deleted.
+	* src/common.c (_GD_ReadLinterpFile): Sort the LUT.
+	* src/internal.h: GD_E_DOMAIN_ANTITONIC added.  Define new LUT struct.
+
+	* src/common.c (_GD_ReadLinterpFile): Don't read the file twice, instead
+	dynamically resize the LUT buffer.
+	* src/common.c (_GD_GetLine): Abort early on EOF.
+
+	* src/flimits.c (_GD_GetEOF): Fix INDEX check in PHASE.
+
+2010-07-07   D. V. Wiebe <getdata at ketiltrout.net>   svn:428
+	* bindings/cxx/test/addentry.cpp bindings/cxx/test/getdata.cpp
+	bindings/cxx/test/nframes.cpp bindings/cxx/test/spf.cpp
+	bindings/cxx/test/putdata.cpp: Deleted; coverage duplicated by big_test.
+
+2010-07-06   D. V. Wiebe <getdata at ketiltrout.net>   svn:427
+	* test/eof_phase.c test/eof.c test/eof_lincom.c test/eof_index.c: Renamed
+	from nsamples*.c
+	* test/bof.c test/bof_lincom.c test/bof_phase.c: Added.
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+	bindings/idl/test/big_test.pro: Add a new test 86 and also add test 142.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::EOF Dirfile::BOF): Added.
+	* bindings/python/pydirfile.c (gdpy_dirfile_getbof gdpy_dirfile_geteof):
+	Added.
+	* bindings/f77/fgetdata.c (GDGBOF GDGEOF): Added.
+	* bindings/f77/getdata.f90.in (fgd_get_bof fgd_get_eof): Added.
+	* bindings/idl/getdata.c (gdidl_get_bof gdidl_get_eof): Added.
+
+	* bindings/idl/makedlm.sh.in: Sort the subroutine list.
+
+	* src/flimits.c (gd_get_bof gd_get_bof64 _GD_GetBOF): Added.
+	* src/flimits.c (gd_get_eof gd_get_eof64 _GD_GetEOF): Renamed.  Proper INDEX
+	handling added.
+
+	* src/foffs.c src/flimits.c src/nsamples.c: foffs.c and nsamples.c merged
+	and renamed flimits.c.
+
+2010-06-30   D. V. Wiebe <getdata at ketiltrout.net>   svn:425 svn:426
+	* test/nsamples.c test/nsamples_index.c test/nsamples_lincom.c
+	test/nsamples_phase.c: Added.
+
+	* src/nsamples.c: Added.
+
+2010-06-30   D. V. Wiebe <getdata at ketiltrout.net>   svn:420
+	* src/errors.c: Update for GD_E_BAD_VERSION and GD_E_FLUSH.
+	* src/flush.c (_GD_FlushFragment): Replace GD_E_OPEN_INCLUDE errors with
+	GD_E_FLUSH for more sensical error reporting.
+	* src/getdata.h.in: Added GD_E_FLUSH.
+	* src/internal.h: Added GD_E_FLUSH suberrors.
+
+2010-06-30   D. V. Wiebe <getdata at ketiltrout.net>   svn:419
+	* src/mod.c (_GD_SPFConvert): _GD_AddData is only used by _GD_Change to
+	convert SPFs, so pare it down and rename.
+	* src/common.c (_GD_AddData): Moved to src/mod.c and renamed _GD_SPFConvert.
+
+2010-06-29   D. V. Wiebe <getdata at ketiltrout.net>   svn:418
+	* m4/compiler.m4 (GD_CHECK_LFS_TYPE): Added.
+	* configure.ac: Better tests for LFS Transitional API types.  Don't rely on
+	the `complex' macro when checking types.  Move the MSCVRT test back to the
+	proper place.
+
+2010-06-28   D. V. Wiebe <getdata at ketiltrout.net>   svn:414
+	Merged in changes from the ARM branch, revision 385:
+
+	* bindings/make_parameters.c: Don't include the legacy API.
+
+	* test/put_endian_float32_big.c test/put_endian_float64_big.c
+	test/put_endian_complex64_little.c test/put_endian_float32_arm.c
+	test/put_endian_float64_arm.c test/get_endian_complex64_big.c
+	test/put_endian_float32_little.c test/put_endian_complex64_big.c
+	test/endian_get.c test/get_endian_complex64_arm.c
+	test/put_endian_complex64_arm.c test/put_endian_complex128_big.c
+	test/get_endian_float32_little.c test/put_endian_complex128_arm.c
+	test/get_endian_complex128_big.c test/get_endian_float32_big.c
+	test/get_endian_float64_big.c test/get_endian_complex128_little.c
+	test/get_endian_complex128_arm.c test/get_endian_float32_arm.c
+	test/get_endian_float64_arm.c test/get_endian_complex64_little.c
+	test/put_endian_float64_little.c test/put_endian_complex128_little.c
+	test/get_endian_float64_little.c: Added.
+
+	* test/put_endian_float32.c test/get_endian_float64.c
+	test/put_endian_complex128.c test/put_endian_complex64.c
+	test/put_endian_float64.c test/get_endian_complex64.c
+	test/get_endian_complex128.c test/get_endian_float32.c: Removed.
+
+	* src/parse.c (_GD_ParseDirective): Handle missing second parameter to
+	/ENDIAN.
+
+	* m4/python.m4: Don't specify -L unless needed.
+	
+	* bindings/idl/getdata.c (gdidl_read_idl_entry): Fix compiler warning.
+
+	* configure.ac: Calculate BUILDCC
+	* bindings/Makefile.am: use BUILDCC
+
+	* bindings/make_parameters.c (main): Return zero.
+
+	* src/open.c (dirfile_cbopen): Fix default float_sex.
+
+	* test/endian_get.c: Test both sexes.
+
+	* configure.ac: Calculate BUILDCC
+	* bindings/Makefile.am: use BUILDCC
+
+	* configure.ac: Call GD_C_FLOATORDERING.
+	* m4/compiler.m4 (GD_C_FLOATORDERING): Added.
+
+	* configure.ac bindings/f77/Makefile.am: Handle missing diff gracefully.
+
+	* src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Call
+	_GD_ArmEndianise when appropriate.  Check float_sex when appropriate.
+	* src/endian.c (_GD_ArmEndianise): Added.
+
+	* bindings/cxx/Makefile.am bindings/cxx/test/Makefile.am
+	bindings/f77/Makefile.am bindings/f77/test/Makefile.am src/Makefile.am
+	test/Makefile.am util/Makefile.am: use *_WEXTRA conditionals.
+	* configure.ac: Call GD_PROG_CC_WEXTRA, GD_PROG_CXX_WEXTRA,
+	GD_PROG_F77_WEXTRA, GD_PROG_FC_WEXTRA; don't bother checking compilers we
+	aren't going to use.
+	* compiler.m4: Renamed from intel.m4.
+	* compiler.m4 (GD_PROG_CC_WEXTRA GD_PROG_CXX_WEXTRA GD_PROG_F77_WEXTRA
+	GD_PROG_FC_WEXTRA): Added.
+
+2010-06-27   D. V. Wiebe <getdata at ketiltrout.net>   svn:410
+	* src/internal.h: Only use the MSVCRT aliases when appropriate.  Handle no
+	complex.h, but with complex support in GCC (for Cygwin).  Deal with Cygwin
+	64-bit stat.
+
+	* src/getdata.h.in: Define LFS transitional functions under Cygwin.
+
+	* configure.ac: Disable Python and IDL tests for both Cygwin and MinGW.
+	Only conditionally define _LARGEFILE64_SOURCE.
+
+2010-06-26   D. V. Wiebe <getdata at ketiltrout.net>   svn:409
+	* configure.ac: Fix test for struct stat64.  Restore accidentally deleted
+	AC_SUBST.
+
+2010-06-25   D. V. Wiebe <getdata at ketiltrout.net>   svn:408
+	* test/: Include O_BINARY in open() calls.  Write "#\n" instead of "\n" in
+	empty fragments.
+	* test/test.h (gd_system): Added.  Use PRIxxx codes for format specifiers.
+	* test/trunc_rofs.c test/open_eaccess.c: Skip the test if the FS doesn't
+	honour access permissions.
+	* test/ascii_put.c: Read data as ints.
+	* test/legacy_put.c: Skip the stat() check.
+
+	* src/open.c (_GD_CreateDirfile): Use mode "rb" in fopen() call. 
+	* src/gzip.c (_GD_GzipSize) src/encoding.c (_GD_GenericTouch) src/include.c
+	(_GD_Include) src/raw.c (_GD_RawOpen): Include O_BINARY in open() calls.
+
+	* src/errors.c (gd_error_string): Handle STRERROR_R_CHAR_P.
+
+	* src/flush.c (_GD_FlushFragment): Skip fchmod() call unless HAVE_FCHMOD
+	defined.
+
+	* src/flush.c (_GD_FlushFragment) src/mod.c (_GD_Change) src/encoding.c
+	(_GD_GenericMove) src/raw.c (_GD_RawTemp): Replaced rename() with
+	_GD_Rename().
+
+	* src/encoding.c (_GD_ResolveEncoding) src/raw.c (_GD_RawSize): Use
+	gd_stat64_t and gd_stat64().
+
+	* src/ascii.c (_GD_AsciiOpen _GD_AsciiSize _GD_AsciiTemp): Use O_TEXT in open
+	call.
+	* src/ascii.c (_GD_ScanFormat _GD_AsciiRead): Handle NO_8BIT_INT_PREFIX.
+
+	* src/internal.h: Include <io.h> for Win32.  Define O_BINARY, O_TEXT if
+	necessary.  Define NO_8BIT_INT_PREFIX when appropriate.  Handle Win32
+	function aliases.
+
+	* src/compat.c: Added.
+
+	* src/common.c (GD_ReadLinterpFile): Call fopen() with FOPEN_TEXT.
+
+	* bindings/cxx/test/big_test.cpp bindings/cxx/test/putdata.cpp
+	bindings/cxx/test/spf.cpp bindings/cxx/test/getdata.cpp
+	bindings/cxx/test/nframes.cpp: Handle Win32 stuff.
+
+	* configure.ac: Call GD_MSYS_SHELL.  Add various Win32 checks.
+	* m4/win32.m4: Added.
+
+2010-05-22   D. V. Wiebe <getdata at ketiltrout.net>   svn:401 svn:402 svn:403
+	The Great Renaming:
+
+	* test/: Update for new function names.  Modernise error reporting.
+	* test/test.h: Added.
+	* test/add_many.h test/global_ref_get.c: Deleted.
+
+	* util/dirfile2ascii.c util/checkdirfile.c: Update for new function names.
+
+	* util/checkdirifle.c: Report standards version compliance.
+
+	* bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+	bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+	bindings/idl/test/big_test.pro: Remove test 86.
+
+	* bindings/python/*.c: Update for new function names.
+	* bindings/cxx/*.cxx: Ditto.
+	* bindigns/f77/fgetdata.c: Ditto.
+	* bindings/f77/getdata.f90.in: Ditto.
+	* bindings/idl/getdata.c: Ditto.
+
+	* src/: Use the gd_ namespace for all public functions.
+	* src/getdata.h.in: Add function aliases.
+
+	* src/legacy.c: Fix lengths of global error buffers.
+
+	* src/getdata_legacy.h src/getdata.h.in: Fix function attributes to work
+	with gcc but a non-gnu libc.
+
+	* bindings/cxx/fragment.cpp: Remove dependence on the LFS transitional API.
+
+	* src/configure.ac: Remove obsolete Darwin check.
+
+	* src/globals.c (get_reference): Deleted.
+
+2010-05-17   D. V. Wiebe <getdata at ketiltrout.net>   svn:400
+	* src/flush.c (_GD_FlushFragment): malloc temp_file.
+
+	* src/internal.h: Fix handling of !defined(HAVE_OFF64_T).
+	* src/getdata.h.in: __APPLE__ specifics.
+
+	* configure.ac: Set DL_LIBRARY_PATH based on $host.
+	* bindings/python/test/Makefile.am: Use DL_LIBRARY_PATH
+
+	* bindings/python/pydirfile.c bindings/python/pyfragment.c: De-LFSise.
+	* bindings/python/pydirfile.h: Define _FILE_OFFSET_BITS.
+
+	* bindings/cxx/fragment.cpp: De-LFSise.
+	* bindings/cxx/getdata/indexentry.h bindings/cxx/getdata/rawentry.h
+	bindings/cxx/getdata/dirfile.h bindings/cxx/getdata/linterpentry.h
+	bindings/cxx/getdata/polynomentry.h bindings/cxx/getdata/bitentry.h
+	bindings/cxx/getdata/entry.h bindings/cxx/getdata/multiplyentry.h
+	bindings/cxx/getdata/phaseentry.h bindings/cxx/getdata/fragment.h
+	bindings/cxx/getdata/lincomentry.h bindings/cxx/getdata/sbitentry.h
+	bindings/cxx/getdata/constentry.h bindings/cxx/getdata/stringentry.h: Define
+	_FILE_OFFSET_BITS.
+
+	* util/dirfile2ascii.c: Define off64_t if not present.
+
+2010-04-24   D. V. Wiebe <getdata at ketiltrout.net>   svn:390
+	* bindings/python/pydirfile.c (gdpy_dirfile_getdata): Use numpy to allocate
+	the data buffer, instead of doing it ourselves, to avoid memory hassles.
+	Also, only retrieve spf when needed.
+
+	* bindings/python/pygetdata.c (gdpy_type_from_npytype): Fix debug message.
+
+	* bindings/python/pygetdata.h: Undef Python's SIZEOF_OFF_T.
+
+	* bindings/make_parameters.c (main): Don't fall off the end.
+
+2010-03-17   D. V. Wiebe <getdata at ketiltrout.net>   svn:387
+	* configure.ac src/getdata.h.in: Disable LFS transitional API on Darwin.
+
+	* bindings/f77/Makefile.am: Change order of sed arguments to work with Darwin
+	sed.
+
+2010-03-05   D. V. Wiebe <getdata at ketiltrout.net>   svn:386
+	* test/version_0.c test/version_1.c test/version_2.c test/version_3.c
+	test/version_4.c test/version_5.c test/version_6.c test/version_7.c: Call
+	dirfile_standards().
+
+	* test/parse_version_include.c: Use GD_PERMISSIVE.
+
+	* src/internal.h: Add GD_HAVE_VERSION.
+	* src/getdata.h.in: Add GD_E_BAD_VERSION, GD_VERSION_*
+	* src/flush.c (_GD_FindVersion dirfile_standards): Added.
+	* src/open.c (dirfile_cbopen): Clear GD_PERMISSIVE if GD_PEDANTIC is set.
+	Clear GD_IGNORE_REFS if set.  If necessary, determine the standards
+	conformance of the dirfile.
+	* src/parse.c (_GD_ParseDirective): Set proper flags when calling
+	_GD_Include.  Propagate pedantry back up.  Enumerate fragment versions.
+	* src/include.c (_GD_Include): Take a pointer to the flags, to permit
+	propagation of pedantry.  Enumerate fragment versions.
+
+	* src/parse.c (_GD_ParseFragment): Take a pointer to the flags, to permit
+	propagation of pedantry.
+
+	* src/name.c (_GD_ValidateField): Prohibit characters < 0x20 in field names.
+
+	* src/parse.c (_GD_ParseDirective): Remove unnecessary first_fragment
+	parameter.
+
+2010-03-02   D. V. Wiebe <getdata at ketiltrout.net>   svn:380
+	* test/version_0.c test/version_1.c test/version_2.c test/version_6_strict.c
+	test/version_3.c test/version_4.c test/version_5.c test/version_6.c
+	test/parse_version_permissive.c test/version_7_strict.c test/version_7.c
+	test/version_5_strict.c: Added.
+
+	* test/parse_version_pedantic.c: Removed.
+
+	* test/parse_name.c: Update.
+
+	* test/put_foffs.c test/parse_version.c test/parse_version_slash.c
+	test/get_bad_code.c test/parse_name_ext.c: Better error reporting.
+
+	* src/getdata.h.in: Add GD_PERMISSIVE.
+
+	* src/name.c src/internal.h: move entry_cmp() to header as a static inline.
+
+	* src/internal.h: Add n_dot, dot_list, standards to _GD_DIRFILE.
+
+	* src/common.c (_GD_FindField): Pass the list and count as parameters.  If
+	looking for FILEFRAM in early versions, look for INDEX instead.
+	* src/common.c (_GD_FindFieldAndRepr): Added.
+
+	* src/entry.c (_GD_GetScalar get_entry get_entry_type get_fragment_index
+	dirfile_validate): Call _GD_FindFieldAndRepr instead of _GD_GetRepr and
+	_GD_FindField.
+	* src/index.c (get_framenum_subset64): Ditto.
+	* src/getdata.c (getdata64): Ditto.
+	* src/flush.c (dirfile_flush): Ditto.
+	* src/native.c (get_native_type): Ditto.
+	* src/spf.c (get_spf): Ditto.
+	* src/constant.c (get_constant put_constant): Ditto.
+	* src/putdata.c (putdata64): Ditto.
+	* src/del.c (dirfile_delete): Ditto.
+
+	* src/entry.c (get_raw_filename): Remove the representation from the input by
+	calling _GD_FindFieldAndRepr.
+
+	* src/name.c (_GD_ValidateField): Behave differently with different
+	versions.  Also set *is_dot on permitted '.' in field name.
+	* src/parse.c (_GD_RawType _GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp
+	_GD_ParseMultiply _GD_ParseBit _GD_ParsePhase _GD_ParsePolynom
+	_GD_ParseConst _GD_ParseString _GD_ParseFragment): Behave differently with
+	different versions.
+	* src/parse.c (_GD_ParseFieldSpec): Behave differently with different
+	versions.  Make FILEFRAM a reserved field name in early versions.
+	* src/parse.c (_GD_ParseDirective): Behave differently with different
+	versions.  Try to allow fields with directive names when it wouldn't confuse
+	us, and not in pedantic mode.  Set GD_PEDANTIC on encountering a VERSION
+	directive unless GD_PERMISSIVE was specified.
+
+	* src/name.c (dirfile_rename): Update the dot list when necessary.
+	* src/add.c (_GD_Add): Ditto.
+
+	* src/open.c (dirfile_cbopen): Initialise D->standards.
+
+2010-03-02   D. V. Wiebe <getdata at ketiltrout.net>   svn:379
+	* util/dirfile2ascii.c: Fix missing break statement per Matthew Truch.
+
+2010-02-19   D. V. Wiebe <getdata at ketiltrout.net>   svn:377
+	* util/dirfile2ascii.c: Add -a, -A, -F, -u.  Read UINT64 when appropriate.
+	Add --version and other long options.  Increase BUF_LEN to
+	GD_MAX_LINE_LENGTH.  Turn off default verbose.  Make ff an off64_t.
+
+	* m4/python.m4 m4/idl.m4: Fix typos in help strings.
+
+2010-02-17   D. V. Wiebe <getdata at ketiltrout.net>   svn:375
+	Merged in changes from the 0.6 branch, revision 373:
+
+	* src/ascii.c (_GD_AsciiSize): Don't trample on the file name.
+	* test/ascii_nframes.c: Update to test for same.
+
+2010-02-15   D. V. Wiebe <getdata at ketiltrout.net>   svn:362
+	* util/dirfile2ascii.c: Added Matthew Truch's ASCII conversion utility.
+
+2010-02-12   D. V. Wiebe <getdata at ketiltrout.net>   svn:361
+	GetData 0.6.1 released.
+
+2010-02-09   D. V. Wiebe <getdata at ketiltrout.net>   svn:358
+	GetData-0.6.1rc2:
+
+	* src/legacy.c: Fix length of global error string buffers.
+
+	* configure.ac: Bump GETDATA_IMPL_REVISION.
+	* configure.ac: Fix diff check.
+
+	* man/get_native_type.3 man/put_string.3: Typos.
+
+2010-02-04   D. V. Wiebe <getdata at ketiltrout.net>   svn:349
+	* bindings/cxx/test/getdata.cpp: Also fix the mkdir() bug here.
+
+2010-02-03   D. V. Wiebe <getdata at ketiltrout.net>   svn:346
+	GetData-0.6.1rc1:
+
+	* test/convert_complex128_float64.c test/add_cpolynom.c
+	test/convert_float32_complex128.c test/get_const_complex.c
+	test/get_complex128.c test/convert_float64_complex128.c test/repr_uint64.c
+	test/repr_real_m.c test/convert_complex64_uint64.c test/add_clincom.c
+	test/repr_float32.c test/convert_int16_complex64.c test/repr_i.c
+	test/get_complex64.c test/repr_int32.c test/put_complex128.c
+	test/convert_uint8_complex64.c test/get_cpolynom.c test/repr_int16.c
+	test/convert_float64_complex64.c test/convert_complex64_complex128.c
+	test/convert_float32_complex64.c test/repr_real_a.c test/repr_int64.c
+	test/convert_complex128_int64.c test/convert_complex64_int64.c
+	test/put_endian_complex128.c test/put_endian_complex64.c test/repr_a.c
+	test/convert_uint16_complex128.c test/repr_m.c test/put_complex64.c
+	test/convert_uint16_complex64.c test/repr_real_r.c test/repr_int8.c
+	test/convert_int64_complex64.c test/get_endian_complex64.c test/repr_uint8.c
+	test/convert_int32_complex64.c test/convert_int8_complex128.c
+	test/convert_int16_complex128.c test/madd_clincom.c test/repr_float64.c
+	test/convert_complex128_complex64.c test/convert_int8_complex64.c
+	test/convert_complex128_uint64.c test/convert_uint32_complex128.c
+	test/repr_uint32.c test/get_endian_complex128.c test/madd_cpolynom.c
+	test/convert_uint64_complex64.c test/repr_uint16.c
+	test/convert_int32_complex128.c test/get_clincom.c
+	test/convert_uint32_complex64.c test/convert_uint8_complex128.c
+	test/repr_r.c test/alter_cpolynom.c test/convert_uint64_complex128.c
+	test/get_const_repr.c test/convert_complex64_float64.c test/repr_real_i.c
+	test/convert_int64_complex128.c: Include complex.h.
+
+	* m4/encoding.m4 (GD_HIDE_LTDL_SYM): Removed.
+	* m4/ltdl.m4: Removed.
+	* src/gd_ltdl.c src/gd_ltdl.h: Removed.
+	* configure.ac: Update for libtool 2.x.  Remove support for the internal
+	ltdl.
+	* bindings/f77/test/Makefile.am bindings/f77/Makefile.am: Removed the
+	libtool 1.5.x hack.
+
+	* bindings/idl/getdata.c (gdidl_dirfile_alter_entry gdidl_dirfile_move
+	gdidl_dirfile_rename gdidl_dirfile_uninclude): Initialise kw.error and
+	kw.estr.
+
+	* bindings/cxx/test/big_test.cpp: Include headers to declare mkdir().  Bug
+	report from Matthew Truch.
+
+2009-11-13   D. V. Wiebe <getdata at ketiltrout.net>   svn:345
+	* src/getdata.h.in: Don't include <complex.h>; use _Complex directly.
+
+2009-11-03   D. V. Wiebe <getdata at ketiltrout.net>   svn:340
+	GetData 0.6.0 released.
+
+2009-11-01   D. V. Wiebe <getdata at ketiltrout.net>   svn:334
+	GetData-0.6.0rc4:
+
+	* test/header_complex.c: Added.
+
+	* test/repr_real_m.c test/repr_i.c test/repr_real_a.c test/repr_m.c
+	test/repr_real_r.c test/repr_a.c test/repr_real_i.c: Replaced M_PI with a
+	literal.
+
+	* configure.ac: Determine types for gd_bit_t, gd_spf_t, and gd_shift_t.  Fix
+	NumPy test.
+	* m4/intel.m4: Better tests for Fortran compilers.
+
+	* src/getdata.h.in: Export a C-89 compliant API if GETDATA_C89_API is set.
+	Include <complex.h> only if needed.  typedef gd_bit_t, gd_spf_t, gd_shift_t,
+	and use them in the public API.
+
+	* src/entry.c (_GD_GetScalar): Use correct types in call to _GD_DoField.
+	* src/entry.c (_GD_CalculateEntry): Use correct types in call to
+	_GD_GetScalar.
+	* src/flush.c (_GD_WriteConst _GD_FieldSpec): Use correct types and C-99
+	printf codes.
+	* src/del.c (_GD_DeReference): Use correct types in call to
+	_GD_DeReferenceOne.
+	* src/parse.c (_GD_ParseRaw _GD_ParseBit _GD_ParsePhase): Remove unnecessary
+	periphrasis in calls to _GD_SetScalar.
+	* bindings/python/pyentry.c (gdpy_set_scalar_from_pyobj): Use proper types.
+	* bindings/cxx/bitentry.cpp (BitEntry::SetFirstBit BitEntry::SetNumBits):
+	Remove periphrasis in calls to get_constant.
+	* bindings/cxx/rawentry.cpp (RawEntry::SetSamplesPerFrame): Remove periphrasis
+	in call to get_constant.
+	* bindings/cxx/phaseentry.cpp (PhaseEntry::SetShift): Remove periphrasis in
+	call to get_constant.
+	* bindings/cxx/sbitentry.cpp (SBitEntry::SetFirstBit SBitEntry::SetNumBits):
+	Remove periphrasis in calls to get_constant.
+
+	* src/index.c (_GD_GetIndex): Explicit typecast.
+	* src/getdata.c (EXTRACT_REPR MULTIPLY): Explicit typecasts.
+	* src/getdata.c (CMULTIPLY): Added.
+
+	* src/native.c (_GD_NativeType): Return GD_UNKNOWN on recursion error.
+
+	* src/add.c (_GD_Add): Properly set comp_scal for POLYNOM.
+
+	* src/getdata.c (_GD_DoBit): Remove unnecessary call to _GD_GetSPF.
+
+	* bindings/python/pydirfile.c: Allow compilation without NumPy.
+
+	* bindings/cxx/lincomentry.cpp bindings/cxx/polynomentry.cpp: Use C++ complex
+	class.
+	* bindings/cxx/tests/big_test.cpp: Use C++ complex class.
+	* bindings/cxx/getdata/indexentry.h bindings/cxx/getdata/rawentry.h
+	bindings/cxx/getdata/dirfile.hbindings/cxx/getdata/linterpentry.h
+	bindings/cxx/getdata/polynomentry.h bindings/cxx/getdata/bitentry.h
+	bindings/cxx/getdata/entry.h bindings/cxx/getdata/multiplyentry.h
+	bindings/cxx/getdata/phaseentry.h bindings/cxx/getdata/fragment.h
+	bindings/cxx/getdata/lincomentry.h bindings/cxx/getdata/sbitentry.h
+	bindings/cxx/getdata/constentry.h bindings/cxx/getdata/stringentry.h: Use the
+	C-89 GetData API.
+
+	* bindings/f77/test/Makefile.am: If using ifort, pass -assume byterecl
+
+	* bindings/f77/test/big_test95.f90: replace realpart() and imagpart() with
+	real(real()) and real(aimag())
+
+2009-10-29   D. V. Wiebe <getdata at ketiltrout.net>   svn:332
+
+	* bindings/cxx/test/addentry.cpp bindings/cxx/test/big_test.cpp
+	bindings/cxx/test/getdata.cpp bindings/cxx/test/nframes.cpp
+	bindings/cxx/test/putdata.cpp bindings/cxx/test/spf.cpp: Fix dirfile
+	initialisation.
+
+2009-10-29   D. V. Wiebe <getdata at keiltrout.net>   svn:331
+	* src/entry.c (_GD_FreeE): Free E->e->filebase.  Reported by CBN.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::~Dirfile):  Fix call to
+	dirfile_close().  Previously it only called dirfile_close() on NULL
+	pointers.  Reported by CBN.
+
+2009-10-29   D. V. Wiebe <getdata at keiltrout.net>   svn:329
+	* bindings/python/test/big_test.py: NumPy tests.
+
+	* configure.ac: Detect NumPy.
+
+	* bindings/python/pygetdata.h: #include <numpy/arrayobject.h>
+	* bindings/python/pygetdata.c (gdpy_type_from_npytype
+	gdpy_npytype_from_type): Added.
+	* bindings/python/pygetdata.c (initpygetdata): Call import_array().  Add
+	"__numpy_supported__" to Python module.
+	* bindings/python/pydirfile.c (gdpy_dirfile_getdata): Add "as_list"
+	parameter.  Return NumPy array.
+	* bindings/python/pydirfile.c (gdpy_dirfile_putdata): Handle NumPy arrays.
+
+2009-10-23   D. V. Wiebe <getdata at keiltrout.net>   svn:327
+	* test/entry_scalar_repr.c: Added.
+
+	* test/put_endian_complex128.c test/put_endian_complex64.c
+	test/get_endian_complex64.c test/get_endian_complex128.c: Fix checks.o
+
+	* src/entry.c (_GD_GetScalar): Handle representations: call _GD_DoField
+	instead of _GD_DoConst
+	* src/del.c (_GD_DeReferenceOne): Added.
+	* src/del.c (_GD_DeReference): Handle representations: call _GD_DoField.
+	* src/getdata.c (_GD_DoConst): Make static.  Callers should use _GD_DoField
+	so that the representation is properly handled.
+
+	* src/flush.c (_GD_StringEscapeise): Preprocessor check for unsigned char.
+
+	* src/flush.c (_GD_WriteConst): Handle long int for PHASE shift.
+
+	* src/parse.c (_GD_SetScalar): Don't convert everything willy-nilly to
+	double first.  Properly handle types.
+	* src/parse.c (_GD_ParseRaw _GD_ParseBit _GD_ParsePhase): Call _GD_SetScalar
+	with an intermediary.
+	* src/parse.c (_GD_ParseConst): Call _GD_SetScalar with the right type code.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getdata): Use correct integer
+	types and codes in PyArg_ParseTupleAndKeywords call.
+	* bindings/python/pyentry.c (gdpy_set_scalar_from_pyobj): Fix type for PHASE
+	shift.
+
+	* bindings/f77/fgetdata.c (GDASCA): Fix scalar_l type.  Reject index = 0.
+
+	* bindings/f77/test/Makefile.am bindings/python/Makefile.am
+	bindings/Makefile.am man/Makefile.am: noinst_ flag built files.
+
+2009-10-19   D. V. Wiebe <getdata at ketiltrout.net>  svn:325
+	GetData-0.6.0rc3:
+
+	* test/repr_real_m.c test/repr_i.c test/repr_real_a.c test/repr_m.c
+	test/repr_real_r.c test/repr_a.c test/repr_r.c test/repr_real_i.c: Made more
+	rigorous.
+
+	* src/getdata.c (_GD_ExtractRepr): Work with any input data type.
+	* src/getdata.c (_GD_DoField): Properly handle representations of real data.
+
+	* src/flush.c (_GD_Flush): Remove third argument by moving the E == NULL
+	test to dirfile_flush().
+
+	* src/flush.c (dirfile_flush): Discard representation.
+
+	* src/encoding.c: Add missing punctuation.
+
+	* bindings/python/pygetdata.c bindings/python/pydirfile.c
+	bindings/python/pyentry.c: Add module documentation.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_alter): Require field_code, like
+	the C API.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_delentry): Make flags optional.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getfieldlist
+	gdpy_dirfile_getfieldlistbytype): Combine.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getmfieldlist
+	gdpy_dirfile_getmfieldlistbytype): Combine.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getnfields
+	gdpy_dirfile_getnfieldsbytype): Combine.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_getnmfields
+	gdpy_dirfile_getnmfieldsbytype): Combine.
+
+	* bindings/python/pyentry.c (gdpy_entry_getscalars): Deleted.
+
+	* bindings/make_parameters.c: Add E_FORMAT_LITERAL (=GDF_LT).
+
+	* bindings/idl/getdata.c: Make SHIFT long.
+
+	* bindings/idl/getdata.c (gdidl_dirfile_alter_encoding
+	gdidl_dirfile_alter_endianness gdidl_dirfile_alter_frameoffset
+	gdidl_dirfile_protect): fragment_index is GD_ALL_FRAGMENTS by default.
+
+	* doc/README.f77 doc/README.f95 doc/README.cxx doc/README.python: Update.
+	* doc/README.idl: Added.
+
+	* man/get_native_type.3 man/dirfile_alter_entry.3 man/get_framenum_subset.3
+	man/put_string.3 man/get_string.3 man/getdata.3 man/put_constant.3
+	man/get_fragment_index.3 man/get_entry_type.3 man/putdata.3
+	man/dirfile_alter_bit.3 man/dirfile_move.3 man/dirfile_rename.3
+	man/get_spf.3 man/get_raw_filename.3 man/dirfile_reference.3
+	man/dirfile_delete.3 man/dirfile-format.5 man/dirfile_flush.3
+	man/dirfile_validate.3 NEWS: Update.
+	* man/get_framenum_subset64.3: Added.
+
+2009-10-17   D. V. Wiebe <getdata at ketiltrout.net>  svn:324
+	* src/entry.c (_GD_Calculate): Memory leak.
+
+	* src/entry.c (get_entry get_entry_type get_fragment_index
+	dirfile_validate): Throw GD_E_BAD_REPR when necessary.
+
+	* src/native.c (_GD_NativeType): Only calculate the entry if needed.
+	Properly calculate LINTERP and MULTIPLY native types.
+
+	* man/get_native_type.3 man/get_framenum_subset.3 man/dirfile_validate.3:
+	Added.
+
+2009-10-16   D. V. Wiebe <getdata at ketiltrout.net>  svn:323
+	* src/internal.h: Fix spelling of GD_E_FORMAT_LITERAL.
+	* src/errors.c src/parse.c: Ditto.
+
+	* src/putdata.c: Don't assume size_t is signed.
+
+2009-10-16   D. V. Wiebe <getdata at ketiltrout.net>  svn:322
+	* test/madd.c: Properly initialise E.
+
+	* src/getdata.c (_GD_DoRaw): Don't assume size_t is signed.
+
+	* src/flush.c (_GD_FlushFragment): Don't justify field names if they're very
+	long.
+
+	* bindings/f77/test/big_test95.f90: Use fixed width strings in array
+	initialisations.
+
+	* man/dirfile_alter_entry.3 man/dirfile_add_bit.3
+	man/get_mfield_list_by_type.3 man/get_entry_type.3 man/get_nvectors.3
+	man/dirfile_alter_bit.3 man/dirfile_cbopen.3 man/dirfile_rename.3
+	man/dirfile_include.3 man/dirfile_add.3 man/dirfile-format.5
+	man/get_field_list_by_type.3 man/get_mvector_list.3 man/dirfile_flush.3
+	man/get_vector_list.3 man/get_entry.3 man/dirfile_madd_bit.3
+	man/dirfile-encoding.5: Update.
+
+2009-10-14   D. V. Wiebe <getdata at ketiltrout.net>  svn:321
+	* internal.h: Add .ffname member to encoding_t.
+	* parse.c (_GD_ParseDirective): Run through _gd_ef instead of hard-coding
+	encoding names.
+
+2009-10-14   D. V. Wiebe <getdata at ketiltrout.net>  svn:319
+	GetData-0.6.0rc2:
+
+	* bindings/f77/test/big_test.f: Fix typos.
+
+	* bindings/idl/test/big_test.pro: Add scalar members to structure
+	initialisations in tests 125 and 126.
+
+	* bindings/idl/Makefile.am: Make sure .libs exists.
+
+2009-10-13   D. V. Wiebe <getdata at ketiltrout.net>  svn:318
+	* test/alter_polynom_coeff.c test/entry_raw_scalar.c
+	test/entry_polynom_scalar.c test/entry_bit_scalar.c test/add.c
+	test/entry_lincom_scalar.c test/entry_phase_scalar.c test/entry_bit.c:
+	Update for scalar[] in gd_entry_t.
+
+	* test/add_phase.c test/madd_phase.c test/get_phase.c: Update for long
+	shift.
+
+	* test/add_scalar.c alter_entry_scalar3.c alter_entry_scalar4.c
+	alter_entry_scalar2n.c alter_entry_scalar2a.c: Added.
+
+	* src/getdata.h.in: Use long int for phase shift in gd_entry_t.
+	* src/parse.c (_GD_SetScalar): Use INT64 for shift internally.
+
+	* src/internal.h src/getdata.h.in: Make scalar[] array public: moved from
+	_gd_private_entry to gd_entry_t.
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry): Update for above.
+	* src/del.c (_GD_DeReference): Ditto.
+	* src/parse.c (_GD_SetScalar _GD_ParseLincom _GD_ParseBit _GD_ParsePhase
+	_GD_ParsePolynom _GD_ParseRaw): Ditto.
+	* src/mod.c (dirfile_alter_raw dirfile_alter_lincom dirfile_alter_clincom
+	dirfile_alter_linterp dirfile_alter_bit dirfile_alter_sbit
+	dirfile_alter_phase dirfile_alter_polynom dirfile_alter_cpolynom):
+	Initialise E.scalar[].
+	* src/add.c (_GD_Add): Allow adding of non-literal scalars via dirfile_add.
+
+	* src/mod.c (_GD_AlterScalar): Added.
+	* src/mod.c (_GD_Change): Call _GD_AlterScalar to allow scalar
+	modifications.
+
+	* src/entry.c (_GD_GetScalar): Assume 16 bit integers for int types.
+
+	* src/internal.h: Encodings and byte_sex are unsigned longs.
+	* src/getdata.h.in: Renumber some open flags.
+	* src/encoding.c (_GD_ResolveEncoding): Return unsigned long.
+	* src/move.c (_GD_MogrifyFile): Parameters encoding and bye_sex are unsigned
+	longs.
+	* src/parse.c (_GD_ParseDirective _GD_ParseFragment): Parameter flags is
+	unsigned long.
+
+	* src/internal.h: typedef unsigned int as _gd_spf_t for use as internal
+	representation for SPFs.  In the external API, unsigned int is still
+	explicitly used.
+	* src/index.c (get_framenum_subset64): Use _gd_spf_t.
+	* src/getdata.c (_GD_MultiplyData _GD_CMultiplyData _GD_DoLincom
+	_GD_DoMultiply getdata64): Use _gd_spf_t internally.
+	* src/spf.c (_GD_GetSPF get_spf): Use _gd_spf_t internally.
+	* src/putdata.c (putdata64): Use _gd_spf_t internally.
+	* src/common.c (_GD_AddData _GD_LincomData _GD_CLincomData): Use _gd_spf_t.
+
+	* src/getdata.h.in: Added GD_PRETTY_PRINT.
+	* src/flush.c (_GD_PadField): Added.
+	* src/flush.c (_GD_FieldSpec): Pad field specs if requested.
+	* src/flush.c (_GD_FlushFragment): Compute max and mean field lengths if
+	pretty printing.
+	* bindings/make_parameters.c: Add GD_PRETTY_PRINT.
+
+	* src/getdata.h.in: Bump standards version.
+
+	* src/globals.c (dirfilename dirfile_reference): Clear error on success.
+
+	* bindings/python/test/big_test.py: Test adding/modifying scalars.
+	* bindings/python/pyentry.c (gdpy_set_scalar_from_pyobj
+	gdpy_entry_getscalars): Added.
+	* bindings/python/pyentry.c (gdpy_set_entry_from_tuple): Update for
+	scalar[].
+	* bindings/python/pyentry.c (gdpy_entry_setspf gdpy_entry_setm
+	gdpy_entry_setb gdpy_entry_setbitnum gdpy_entry_setnumbits
+	gdpy_entry_setshift gdpy_entry_seta): Allow non-literal CONST names.
+	* bindings/python/pyentry.c (gdpy_entry_getspf gdpy_entry_getm
+	gdpy_entry_getb gdpy_entry_getbitnum gdpy_entry_getnumbits
+	gdpy_entry_getshift gdpy_entry_geta): Return non-literal CONST names.
+
+	* bindings/cxx/bitentry.cpp (BitEntry::Scalar): Added.
+	* bindings/cxx/bitentry.cpp (BitEntry::SetFirstBit BitEntry::SetNumBits):
+	Add CONST name versions.
+	* bindings/cxx/sbitentry.cpp (SBitEntry::Scalar): Added.
+	* bindings/cxx/sbitentry.cpp (SBitEntry::SetFirstBit BitEntry::SetNumBits):
+	Add CONST name versions.
+	* bindings/cxx/entry.cpp (Entry::Scalar): Added.
+	* bindings/cxx/lincomentry.cpp (LincomEntry::SetScale
+	LincomEntry::SetOffset): Add CONST name versions.
+	* bindings/cxx/lincomentry.cpp (LincomEntry::Scalar): Added.
+	* bindings/cxx/rawentry.cpp (RawEntry::SetSamplesPerFrame): Add CONST name
+	version.
+	* bindings/cxx/polynomentry.cpp (PolynomEntry::SetCoefficient): Add CONST
+	name version.
+	* bindings/cxx/phaseentry.cpp (PhaseEntry::SetShift): Add CONST name version.
+	* bindings/cxx/getdata/rawentry.h (Scalar): Added.
+	* bindings/cxx/getdata/phaseentry.h (Scalar): Added.
+
+	* bindings/cxx/phaseentry.cpp (PhaseEntry::SetShift): shift is long int.
+	* bindings/cxx/getdata/entry.h (PhaseEntry::Shift): shift is long int.
+	* bindings/cxx/getdata/phaseentry.h (PhaseEntry::Shift): shift is long int.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::Dirfile Dirfile::Include): Flags is
+	unsigned long.
+
+	* bindings/f77/fgetdata.c (GDCLOS GDDSCD): Don't close dirfile unit #0.
+	* bindings/f77/fgetdata.c (GDGSCA GDASCA): Added.
+	* bindings/f77/test/big_test.f: Test GDGSCA and GDASCA.
+
+	* bindings/f77/getdata.f90.in: Add scalar member. to gd_entry.
+	* bindings/f77/getdata.f90.in (fget_entry): Call GDGSCA to fill scalar
+	members.
+
+	* bindings/idl/getdata.c: Add SCALAR to GD_ENTRY structure.
+	* bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_read_idl_entry): Copy
+	SCALAR members.
+	* bindings/idl/getdata.c (gdidl_dirfile_close): Don't close dirfile unit #0.
+
+2009-10-07   D. V. Wiebe <getdata at ketiltrout.net>  svn:316
+	* configure.ac: Update interface version info.
+
+	* m4/python.m4: Fix no Python assignment.
+	* configure.ac: Don't compute BUILD_DATE if it's not needed.
+
+	* bindings/f77/test/big_test.f: Use constant length strings in array
+	constructors.
+
+2009-10-06   D. V. Wiebe <getdata at ketiltrout.net>  svn:315
+	GetData-0.6.0rc1:
+
+	* test/move_meta.c: Added.
+
+	* m4/idl.m4: Add --with-idl-dlm-dir argument; needed by distcheck.
+
+	* src/ascii.c: Explicitly cast edata to (FILE*) to fix compiler warnings.
+	Reported by Josh Netterfield.
+
+	* src/move.c (dirfile_move): Update metafield entries on parent move.
+
+	* src/mod.c (dirfile_malter_spec): Fix "filename" in _GD_Tokenise call.
+
+	* bindings/python/pygetdata.c: Add GETDATA_VERSION_SUFFIX to version tuple.
+
+	* bindings/f77/fgetdata.c (_GDF_Callback): Fix debug message.
+
+	* bindings/make_parameters.c: Moved from f77 subdir, and updated to handle
+	both IDL and Python bindings as well.
+	* bindings/python/pyconstants.c: Removed; now automatically generated by
+	make_parameters.
+
+	* bindings/python/test/callback.py: Clean-up after test.o
+
+	* bindings/python/test/Makefile.am: Fix for rpath builds.
+
+	* bindings/idl/test: Added.
+
+	* bindings/idl/getdata.c (gdidl_clear_dirfile gdidl_cmp_to_c99
+	gdidl_get_frameoffset gdidl_get_string): Added.
+
+	* bindings/idl/getdata.c (gdidl_make_idl_entry): Initialise N_FIELDS and
+	POLY_ORD.  Fix initialisation of CM, CB, CA.
+
+	* bindings/idl/getdata.c (gdidl_read_idl_entry): Allow proper use for
+	dirfile_alter, by conditionally handling missing structure elements.
+
+	* bindings/idl/getdata.c (gdidl_convert_encoding): If the encoding is
+	numeric, assume it's a proper GD_<foo>_ENCODED value.
+
+	* bindings/idl/getdata.c (gdidl_dirfile_add_bit gdidl_dirfile_add_const
+	gdidl_dirfile_add_lincom gdidl_dirfile_add_linterp gdidl_dirfile_add_multiply
+	gdidl_dirfile_add_phase gdidl_dirfile_add_polynom gdidl_dirfile_add_sbit
+	gdidl_dirfile_add_string): Fix dirfile_madd_<foo>() calls.
+
+	* bindings/idl/getdata.c: IDL 6 appears to be adding INT type keyword
+	paramters to the existing value, instead of replacing them.  Fix the
+	bindings to allow for this.
+
+	* bindings/idl/getdata.c (gdidl_dirfile_alter_lincom
+	gdidl_dirfile_alter_polynom): Initialise n_fields/poly_ord if necessary.
+	Fix complex data conversion.
+
+	* bindings/idl/getdata.c (gdidl_dirfile_close): Add the "/DISCARD" keyword
+	to call dirfile_discard().  Remove the dirfile from the internal list on
+	success.
+	* bindings/idl/getdata.c (gdidl_dirfile_discard): Removed.
+
+	* bindings/idl/getdata.c (gdidl_get_entry): Handle look-up failure.
+
+	* bindings/idl/getdata.c (IDL_Load): Initialise the GD_CONSTANTS structure.
+
+	* configure.ac: Add getdata_extra macro.o
+
+	* man/dirfile_alter_encoding.3.in man/dirfile_alter_entry.3 man/getdata.3
+	man/dirfile_add_bit.3 man/dirfile_alter_bit.3 man/dirfile_cbopen.3
+	man/dirfile_add.3 man/dirfile-format.5 man/dirfile.5 man/get_constant.3
+	man/dirfile_add_spec.3 man/dirfile_madd_bit.3 man/dirfile-encoding.5: Update.
+
+	* man/dirfile-complex.5: Added.
+
+2009-09-30   D. V. Wiebe <getdata at ketiltrout.net>  svn:314
+	* test/convert_complex128_float64.c test/get_const_complex.c
+	test/madd_lincom.c test/madd_polynom.c test/repr_real_m.c test/repr_i.c
+	test/put_repr.c test/repr_real_a.c test/repr_m.c test/repr_real_r.c
+	test/get_const.c test/madd_string.c test/add_string.c test/repr_a.c
+	test/convert_complex128_complex64.c test/repr_r.c test/get_const_repr.c
+	test/convert_complex64_float64.c test/repr_real_i.c: Clean compiler
+	warnings.
+
+	* src/open.c (dirfile_parser_callback): Changed the parser callback protoype
+	again.  This is hopefully less likely to break things in the future.
+	* src/getdata.h.in: Define two new types: gd_parser_data_t, a structure
+	of getdata data passed to the callback function, and gd_parser_callback_t,
+	the callback function itself.
+	* src/parse.c (_GD_ParseFragment): Call the new parser callback.
+	* test/open_cb_invalid.c test/include_cb.c test/open_cb_rescan.c
+	test/open_cb_ignore.c test/include_pc.c test/open_cb_cont.c
+	test/open_cb_abort.c bindings/python/test/callback.py
+	bindings/python/pydirfile.c bindings/cxx/dirfile.cpp
+	bindings/cxx/getdata/dirfile.h bindings/f77/fgetdata.c: Update for new
+	callback prototype.
+
+	* configure.ac: Attempt to compile a minimal F90 program with a .f90
+	extension.  This should tip us off to any old G77s which are pretending to
+	be "Fortran" compilers.
+
+	* util/checkdirfile.c: A significant overhaul to add more functionality:
+	reports all the lines with syntax errors, calls dirfile_validate() on all
+	fields.
+
+2009-09-29   D. V. Wiebe <getdata at ketiltrout.net>  svn:313
+	* test/madd_spec.c test/madd_polynom.c test/get_polynom.c
+	test/entry_polynom.c test/entry_lincom.c test/add_string.c test/madd_phase.c
+	test/madd_sbit.c test/madd_linterp.c test/alter_linterp.c
+	test/madd_multiply.c: Make tests more rigorous.
+
+	* test/convert_complex128_float64.c test/parse_meta_implicit.c
+	test/convert_float32_complex128.c test/parse_meta_implicit2.c
+	test/get_const_complex.c test/get_complex128.c test/alter_spec_meta.c
+	test/convert_float64_complex128.c test/repr_uint64.c test/repr_real_m.c
+	test/convert_complex64_uint64.c test/repr_float32.c
+	test/convert_int16_complex64.c test/repr_i.c test/get_complex64.c
+	test/repr_int32.c test/put_complex128.c test/convert_uint8_complex64.c
+	test/alter_lincom_23.c test/get_cpolynom.c test/repr_int16.c
+	test/convert_float64_complex64.c test/put_repr.c
+	test/convert_complex64_complex128.c test/convert_float32_complex64.c
+	test/repr_real_a.c test/convert_complex128_int64.c
+	test/convert_complex64_int64.c test/put_endian_complex128.c
+	test/put_endian_complex64.c test/convert_uint16_complex128.c test/repr_m.c
+	test/convert_uint16_complex64.c test/repr_real_r.c
+	test/convert_int64_complex64.c test/get_const.c test/parse_meta_index2.c
+	test/get_endian_complex64.c test/repr_uint8.c test/convert_int32_complex64.c
+	test/convert_int8_complex128.c test/convert_int16_complex128.c
+	test/madd_string.c test/repr_float64.c test/convert_complex128_complex64.c
+	test/convert_int8_complex64.c test/repr_int64.c
+	test/convert_complex128_uint64.c test/convert_uint32_complex128.c
+	test/repr_a.c test/put_complex64.c test/repr_int8.c test/repr_uint32.c
+	test/get_endian_complex128.c test/madd_cpolynom.c
+	test/convert_uint64_complex64.c test/add_spec_meta.c test/repr_uint16.c
+	test/convert_int32_complex128.c test/get_clincom.c
+	test/convert_uint32_complex64.c test/convert_uint8_complex128.c test/repr_r.c
+	test/alter_cpolynom.c test/convert_uint64_complex128.c test/get_const_repr.c
+	test/convert_complex64_float64.c test/repr_real_i.c
+	test/convert_int64_complex128.c: Added.
+
+	* bindings/python/test/big_test.py: Added.
+	* bindings/python/test/tst_getdata.py: Deleted.
+
+	* bindings/cxx/test/big_test.cpp: Added.
+	* bindings/cxx/test/entry.cpp: Deleted.
+
+	* bindings/f77/test/big_test95.f90: Added.
+	* bindings/f77/test/big_test.f: Completed.
+	* bindings/f77/test/fget_field_list.f90 bindings/f77/test/fget_entry.f90
+	bindings/f77/test/gdfget.f bindings/f77/test/fgetdata.f90: Deleted.
+
+	* index.c (get_framenum_subset64): Multiply user-supplied frame limits by
+	spf.
+
+	* getdata.c (_GD_DoField): Don't pass the user-supplie represenation when
+	calculating the native type.
+
+	* errors.c: Fix error strings for GD_E_DELETE.
+
+	* encoding.c (_GD_EncodingUnderstood): Add GD_LZMA_ENCODED.
+
+	* constant.c (get_constant): specify num_samp=1 in _GD_DoField call to
+	ensure correct repr handling.
+
+	* putdata.c (_GD_DoRawOut): Properly handle byte swapping for complex data.
+
+	* putdata.c (putdata64): Remove spurious free().
+
+	* parse.c: Remove bogus const specifier from in_cols.
+
+	* internal.h: Add table_len to private entry struct.
+	* parse.c (_GD_ParseLinterp): Don't store the computed path in E->table.
+	* mod.c (_GD_Change): ditto.  Reset Qe.table_path instead.  Furthermore, if
+	moving the table, recompute table_path, first.
+	* common.c (_GD_SetTablePath): Added.
+	* common.c (_GD_ReadLinterpFile): Update for table_path.
+
+	* common.c (_GD_ReadLinterpFile): Close the file after reading it.
+
+	* mod.c (_GD_Change): Fix the limits on the scalar free.
+
+	* mod.c (dirfile_alter_cpolynom): Move invariant code out of the loop.
+
+	* parse.c (_GD_ParseFieldSpec): Parse a "Barth"-style meta field
+	specification.
+
+	* parse.c (_GD_ParseFieldSpec): Allow "INDEX" as a metafield name.
+
+	* mod.c (_GD_Change): Recompute comp_scal, instead of just using the input.
+	* add.c (_GD_Add): ditto.
+
+	* add.c (dirfile_madd_string): Search for the correct field code.
+
+	* common.c (_GD_Alloc): Return early on n=0.
+
+	* bindings/python: Renamed module to pygetdata.
+
+	* bindings/python/pydirfile.c (gdpy_dirfile_alter
+	gdpy_dirfile_getfragmentindex gdpy_dirfile_getrawfilename gdpy_dirfile_move
+	gdpy_dirfile_rename): Added.
+
+	* bindings/python/pyentry.c (gdpy_set_entry_from_tuple): Fix initialisation
+	of PHASE->shift.
+
+	* bindings/python/pyentry.c (gdpy_set_entry_from_dict): Fix RAW keys.
+
+	* bindings/python/pyentry.c (gdpy_entry_init): Make the parameter list
+	optional for STRING entries.
+
+	* bindings/python/pyentry.c (gdpy_entry_getbitnum gdpy_entry_setbitnum
+	gdpy_entry_getshift gdpy_entry_setshift): Fix field_type check.
+
+	* bindings/cxx/entry.cpp (Entry::Rename): Properly handle renaming
+	metafields.
+
+	* bindings/cxx/entry.cpp (Entry::SetName Entry::SetFragmentIndex): Added.
+	* bindings/cxx/getdata/entry.h (Entry::Associated Entry::Dissociate
+	Entry::Name Entry::ComplexScalars Entry::ConstType): Added.
+
+	* bindings/cxx/fragment.cpp (Fragment::SetEncoding): Fix
+	dirfile_alter_encoding call.
+
+	* bindings/cxx/lincomentry.cpp (LincomEntry::SetScale
+	LincomEntry::SetOffset): Add complex versions.
+	* bindings/cxx/polynomentry.cpp (PolynomEntry::SetCoefficient): ditto.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::Dirfile): Add empty constructor.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::FragmentIndex Dirfile::Name): Added.
+
+	* bindings/cxx/getdata/rawentry.h bindings/cxx/getdata/linterpentry.h
+	bindings/cxx/getdata/polynomentry.h bindings/cxx/getdata/bitentry.h
+	bindings/cxx/getdata/multiplyentry.h bindings/cxx/getdata/phaseentry.h
+	bindings/cxx/getdata/lincomentry.h bindings/cxx/getdata/sbitentry.h
+	bindings/cxx/getdata/constentry.h bindings/cxx/getdata/stringentry.h: Added
+	empty constructors.
+
+	* bindings/cxx/getdata/dirfile.h: Include all the other headers.
+
+	* bindings/cxx/getdata.entry.h (Entry::Coefficient Entry::CCoefficient
+	Entry::Input): Fix calls for POLYNOM entries.
+
+	* bindigns/f77/fgetdata.c (_GDF_CString): Return a empty string instead of
+	NULL on l=0.
+
+	* bindings/f77/fgetdata.c (_GDF_GetDirfile): Don't crash on index out of
+	range.
+
+	* bindings/f77/fgetdata.c (gdgtst gdptst): Report a length one less than the
+	C API.
+
+	* bindings/f77/getdata.f90.in: Don't overload gd_entry%n_fields: use
+	gd_entry%poly_ord when necessary.
+
+	* bindings/f77/getdata.f90.in (fget_nmfields): Call the right F77 function.
+
+	* bindings/f77/getdata.f90.in (fget_mvector_list): Fix gdmven call.
+
+	* bindings/f77/getdata.f90.in (fget_entry): Call the right F77 function for
+	PHASE entries.
+
+	* bindings/f77/getdata.f90.in (fdirfile_add_multiply fdirfile_add_phase
+	fdirfile_madd_multiply fdirfile_madd_phase fdirfile_alter_multiply
+	fdirfile_alter_phase): Fix name.
+
+	* bindings/f77/getdata.f90.in (fdirfile_madd_sbit fdirfilename): Added.
+
+2009-09-26   D. V. Wiebe <getdata at ketiltrout.net>  svn:312
+	* bindings/idl/getdata.c: Fixed typo in DLM magic for
+	gdidl_get_raw_filename.
+
+	* configure.ac: Remove spurious AC_SUBST.
+
+2009-09-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:311
+	* src/getdata.h.in: complex_scalars member shortened to comp_scal.
+
+	* test/add_cpolynom.c test/add_clincom.c test/index.c test/index_range.c
+	test/madd_clincom.c test/index_domain.c test/madd_const.c: Added.
+
+	* test/madd_bit.c test/madd_lincom.c test/add_lincom.c test/add_phase.c
+	test/add_multiply.c test/add_bit.c test/add_const.c test/add_linterp.c
+	test/add.c test/add_sbit.c test/madd.c test/add_raw.c test/add_polynom.c
+	test/add_spec.c: Make more rigourous tests for success.
+
+	* src/entry.c (dirfile_validate): Added.
+
+	* src/getdata.c (_GD_DoField): removed the largely unnecessary field_code
+	argument.  All callers changed.
+	* src/putdata.c (_GD_DoFieldOut): ditto.
+
+	* src/legacy.c (CopyPolynomEntry GetFormat): Report POLYNOMs and LINCOMs.
+	Similarly, report SBITs as BITs.
+
+	* src/index.c: Added.
+
+	* src/getdata.c (_GD_DoLincom _GD_DoPolynom): Select complex versions of the
+	calculation functions based on E->comp_scal, not the native type.
+
+	* src/errors.c (get_error_string): Properly report success.
+
+	* src/getdata.c src/internal.h: Moved the NAN() function to the header.
+
+	* src/getdata.h.in: Removed a number of GNUisms.
+
+	* src/add.c (_GD_Add): Set E->comp_scal for LINCOMs and POLYNOMs.  Fix
+	copying of POLYNOM parameters.
+	* src/add.c (dirfile_madd_clincom): Set comp_scal correctly.
+
+	* src/add.c (dirfile_madd_const): Search for the correct field code.
+
+	* bindings/python/test/callback.py bindings/python/test/tst_getdata.py:
+	Added.
+
+	* bindings/python/pygetdata.c bindings/python/pyconstants.c
+	bindings/python/pydirfile.c bindings/python/pygetdata.h
+	bindings/python/pyentry.c: Update for get_framenum() and complex values.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::NativeType Dirfile::Validate
+	Dirfile::FrameNum): Added.
+	* bindings/cxx/lincomentry.cpp bindings/cxx/polynomentry.cpp
+	bindings/cxx/getdata/polynomentry.h: Update for complex values.
+
+	* bindings/f77/test/big_test.f: Added.
+
+	* bindings/f77/fgetdata.c (_GDF_FString): Don't unnecessarily cut of the
+	last character of the string.  Also, don't corrupt memory.
+	* bindings/f77/fgetdata.c (GDFLDN GDMFDN): Check for field_num < 0.
+	* bindings/f77/fgetdata.c (GDESTR): Properly space-pad the string.
+	* bindings/f77/fgetdata.c (GDGERW GDGELC GDGEPN GDGECP GDGEBT GDGESB GDGEMT
+	GDGEPH GDGECO): Fix crash-on-error due to indiscriminate use of
+	dirfile_free_entry_strings().
+
+	* bindings/f77/fgetdata.c (GDGEPN): Fix multiple bugs resulting from
+	improper translationg from GDGELC.
+
+	* bindings/f77/fgetdata.c (GDGECL GDGECP GDADCL GDADCP GDMDCL GDMDCP GDALCL
+	GDALCP GDNTYP GDCSCL GDVLDT GDFNUM GDFNSS): Added.
+
+	* bindings/f77/getdata.f90.in (fgetdata_c8 fgetdata_c16 fget_constant_c8
+	fget_constant_c16 fputdata_c8 fputdata_c16 fput_constant_c8
+	fput_constant_c16 fdirfile_add_clincom fdirfile_add_cpolynom
+	fdirfile_madd_clincom fdirfile_madd_cpolynom fdirfile_alter_clincom
+	fdirfile_alter_cpolynom fget_native_type fdirfile_validate fget_framenum
+	fget_framenum_subset): Added.
+
+	* bindings/idl/getdata.c: Update.
+
+2009-09-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:309
+	* src/meta_list.c (get_mstrings): Properly terminate the list.  Bug
+	report from Matthew Truch.
+
+	* test/svlist_meta.c: Be more verbose.
+
+2009-09-03   D. V. Wiebe <getdata at ketiltrout.net>  svn:308
+	* test/put_sbit.c: Ensure data is signed.
+
+	* src/internal.h: Add repr, complex_table, cy, cconst to _gd_private_entry;
+	added representation stuff.
+	* src/getdata.h.in: Add GD_E_BAD_REPR, GD_E_FORMAT_LITTERAL, GD_COMPLEX64,
+	GD_COMPLEX128.  Add complex_scalars, cm, cb, ca to _gd_unified_entry.
+
+	* src/entry.c (_GD_GetScalar): Set complex_scalars.
+	* src/entry.c (_GD_CalculateEntry): Retrieve all scalars as GD_COMPLEX, and
+	then realify back down.
+	* src/types.c (_GD_ConvertType): Handle complex types.
+	* src/getdata.c (_GD_FillFileFrame _GD_PolynomData _GD_MultiplyData): Handle
+	complex types.
+	* src/getdata.c (_GD_DoRaw): Handle complex data endianness correction
+	properly.
+	* src/getdata.c (_GD_CPolynomData _GD_CMultiplyData): Added.
+	* src/getdata.c (_GD_DoMultiply _GD_DoPolynom): Handle complex input fields.
+	* src/getdata.c (_GD_DoLinterp): Permit complex y-valued LUTs.
+	* src/getdata.c (_GD_DoConst): Handle complex valued scalars.
+	* src/flush.c (_GD_TypeName): Add GD_COMPLEX64 and GD_COMPLEX128.
+	* src/flush.c (_GD_WriteConst): Write a complex literal.
+	* src/flush.c (_GD_FieldSpec): Handle complex valued literals.
+	* src/ascii.c (_GD_ScanFormat _GD_AsciiRead _GD_AsciiWrite): Handle complex
+	data.
+	* src/putdata.c (_GD_DoLinterpOut _GD_DoLincomOut _GD_DoPolynomOut
+	_GD_DoConstOut): Handle complex writes.
+	* src/del.c (_GD_DeReference): Handle complex scalars.
+	* src/parse.c (_GD_RawType): Add GD_COMPLEX64 and GD_COMPLEX128.
+	* src/parse.c (_GD_SetScalar): Handle complex literals.  This may now
+	through the FORMAT suberror GD_E_FORMAT_LITTERAL.  Callers updated.
+	* src/parse.c (_GD_ParseLincom _GD_ParsePolynom _GD_ParseConst): Handle
+	complex literals.
+	* src/mod.c (_GD_Change): Handle complex scalars.
+	* src/mod.c (dirfile_alter_clincom dirfile_alter_cpolynom): Added.
+	* src/add.c (_GD_Add): Handle complex scalars.
+	* src/add.c (dirfile_add_clincom dirfile_add_cpolynom dirfile_madd_clincom
+	dirfile_madd_cpolynom): Added.
+	* src/common.c (_GD_ReadLinterpFile): Allow complex y-values.
+	* src/common.c (_GD_LinterpData): Handle complex return types.
+	* src/common.c (_GD_CLinterpData): Added.
+
+	* src/native.c: Added.
+
+	* src/entry.c (get_entry get_entry_type get_fragment_index): Discard any
+	represenation in the input field code.
+	* src/getdata.c (_GD_ExtractRepr): Added.
+	* src/getdata.c (_GD_DoField): Handle represenations for both complex and
+	real types.
+	* src/getdata.c (getdata64): Decode the input representation.
+	* src/name.c (_GD_ValidateField): Don't allow representation suffixes in
+	field names.
+	* src/spf.c (get_spf): Discard any represenation in the input field code.
+	* src/constant.c (get_constant put_constant): Handle representations.
+	* src/putdata.c (_GD_DoFieldOut): Complain on getting a representation.
+	* src/putdata.c (putdata64): Decode the input representation.
+	* src/common.c (_GD_GetRepr): Added.
+
+	* src/errors.c: Add errors for GD_E_FORMAT_LITTERAL and GD_E_BAD_REPRs.
+
+	* src/legacy.c: Add GD_E_BAD_REPR to GD_ERROR_CODES.
+
+	* src/getdata.c (_GD_FillZero): Let the caller deal with s0.
+
+	* src/getdata.c (_GD_DoLincom _GD_DoMultiply _GD_DoBit _GD_DoPhase
+	_GD_DoLinterp _GD_DoPolynom): Use _GD_BadInput.
+	* src/spf.c (_GD_GetSPF): Use _GD_BadInput.
+	* src/common.c (_GD_BadInput): Added.
+
+	* src/constant.c (put_constant): Return -1 on error.
+
+	* src/getdata.c (_GD_DoLincom): Rewrote for better optimisation.  Includes
+	Matthew Truch's m=1 b=0 short circuit.
+	* src/common.c (_GD_ScaleData): Deleted.
+	* src/commonc. (_GD_LincomData _GD_CLincomData): Added.
+
+	* src/common.c (_GD_Alloc): Throw GD_E_ALLOC on malloc error.
+
+	* src/flush.c (_GD_FlushFragment): Add the missing encoding types, and write
+	something to the file on an unhandled type.
+
+	* src/putdata.c (_GD_DoRawOut): Check malloc return.
+
+	* src/getdata.c (_GD_DoRaw _GD_DoLincom _GD_DoMultiply _GD_DoBit _GD_DoPhase
+	_GD_DoLinterp _GD_DoPolynom _GD_DoField getdata64): Only the user cares about
+	first_frame, and num_frames.  Convert to pure samples early in getdata64().
+	* src/putdata.c (_GD_DoRawOut _GD_DoLincomOut _GD_DoBitOut _GD_DoPhaseOut
+	_GD_DoLinterpOut _GD_DoPolynomOut _GD_DoFieldOut putdata64): Ditto in
+	putdata64().
+
+
+2009-08-17   D. V. Wiebe <getdata at ketiltrout.net>  svn:306
+	* src/getdata.c (_GD_DoMultiply): Load the second field as GD_DOUBLE.
+	* src/getdata.c (_GD_MultiplyData): Compute MULTIPLYs in double precision,
+	rather than the return_type.
+
+2009-08-13   D. V. Wiebe <getdata at ketiltrout.net>  svn:305
+	GetData license changed to GNU LGPLv2.1+.  All documentation updated.
+
+2009-08-04   D. V. Wiebe <getdata at ketiltrout.net>  svn:304
+	* m4/ax_compare_version.m4 m4/idl.m4: Added.
+	* m4/idl.m4: Added.
+	* bindings/idl: Added.
+
+	* src/getdata.h.in: Renamed GD_MAX_POLYNOM to GD_MAX_POLYORD to remove
+	confusion as to what this actually is.
+
+	* bindings/f77/fgetdata.c: Ensure the f77dirfiles array is initialised
+	before we try to read from it, even if the caller hasn't opened a dirfile
+	yet.
+
+2009-07-20   D. V. Wiebe <getdata at ketiltrout.net>  svn:302
+	* test/open_cb_invalid.c test/include_cb.c test/open_cb_rescan.c
+	test/open_cb_ignore.c test/include_pc.c test/open_cb_cont.c
+	test/open_cb_abort.c: Update for new sehandler.
+
+	* test/flush_spec.c: Fix compiler warinings.
+
+2009-07-20   D. V. Wiebe <getdata at ketiltrout.net>  svn:301
+	* util/: moved from bin/
+
+	* test/flush_spec.c: Added.
+	* src/flush.c (_GD_StringEscapeise): Properly handle bytex 0x80-0xFF.
+	* src/flush.c (_GD_WriteConst): Added.
+	* src/flush.c (_GD_FieldSpec): Write CONST field parameters, where
+	appropriate.
+
+	* src/parse.c (_GD_ParseBit): Fix check for CONST field in error checks for
+	numbits and bitnum.
+
+	* m4/python.m4: Added.
+	* bindings/python/: Added.
+	* configure.ac: Python tests.
+
+	* src/open.c (dirfile_parser_callback dirfile_cbopen): Pass an opaque
+	pointer as a fourth argument to the parser callback handler.
+	* src/parse.c (_GD_ParseFragment): Pass the fourth, opaque pointer to the
+	callback.
+	* bindings/cxx/dirfile.cpp: Update for fourth argument to callback.
+	* bindings/f77/fgetdata.c: Use fourth argument to callback to support
+	per-dirfile callback functions.  Removed _gdf_f77_callback global.
+
+	* src/mod.c (_GD_Change): Fix _GD_SetError calls for GD_E_BAD_TYPE errors.
+	* src/add.c (_GD_Add): Ditto.
+
+	* src/add.c (dirfile_add_spec dirfile_madd_spec): Flag fragment as modified
+	on parser success.
+
+	* src/foffs.c: Remove spurious newlines from debugging trace messages.
+
+	* src/types.c (_GD_ConvertType): return propper error on bad out_type
+
+	* src/getdata.h.in: Changed the value of GD_SCALAR_ENTRY
+
+	* bindings/cxx/entry.cpp bindings/cxx/dirfile.cpp
+	bindings/cxx/getdata/dirfile.h bindings/cxx/getdata/entry.h: Update for SBIT
+	and POLYNOM.
+	* bindings/cxx/polynomentry.cpp bindings/cxx/sbitentry.cpp
+	bindings/cxx/getdata/polynomentry.h bindings/cxx/getdata/sbitentry.h: Added.
+	* bindings/f77/fgetdata.c (GDGEPN GDGESB GDADPN GDADSB GDMDPN GDMDSB GDALSB
+	GDALPN): Added.
+	* bindings/f77/make_parameters.c: Added GD_LZMA_ENCODED GD_POLYNOM_ENTRY
+	GD_SBIT_ENTRY.
+	* bindings/f77/getdata.f90.in (fget_entry fdirfile_add fdirfile_madd
+	fdirfile_alter_entry): Update for SBIT and POLYNOM.
+	* bindings/f77/getdata.f90.in (fdirfile_add_sbit fdirfile_add_polynom
+	fdirfile_madd_polynom fdirfile_alter_sbit fdirfile_alter_polynom): Added.
+
+	* bindings/cxx/test/fragment.h: Add the Index() method.
+
+	* bindings/cxx/lincomentry.cpp (LincomEntry::SetNFields): Fix initialisation
+	of new terms.
+
+	* man/dirfile_uninclude.3 man/dirfile_include.3 man/get_entry.3: Typoes.
+
+2009-06-23   D. V. Wiebe <getdata at ketiltrout.net>  svn:298
+	* test/get_sbit.c test/parse_sbit.c test/add_sbit.c test/put_sbit.c
+	test/madd_sbit.c: Added.
+
+	* src/getdata.h.in: define GD_SBIT_ENTRY.
+
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry get_entry): Update for SBIT.
+	* src/getdata.c (_GD_DoBit): Add is_signed parameter and calculates signed
+	bitfields when needed.
+	* src/getdata.c (_GD_DoField): Update for SBIT.
+	* src/flush.c (_GD_FieldSpec _GD_Flush): Update for SBIT.
+	* src/nfields.c (get_nfields_by_type): Update for SBIT.
+	* src/putdata.c (_GD_DoFieldOut): Update for SBIT.
+	* src/del.c (_GD_ClearDerived _GD_DeReference): Update for SBIT.
+	* src/parse.c (_GD_ParseBit): Add is_signed parameter and parse SBIT.
+	* src/parse.c (_GD_ParseFieldSpec): Update for SBIT.
+	* src/field_list.c: Add GD_SBIT_ENTRY to _gd_entype_index.
+	* src/mod.c (dirfile_alter_sbit): Added.
+	* src/mod.c (_GD_Change): Update for SBIT.
+	* src/add.c (_GD_Add): Update for SBIT.
+	* src/add.c (dirfile_add_sbit dirfile_madd_sbit): Added.
+
+2009-06-18   D. V. Wiebe <getdata at ketiltrout.net>  svn:297
+	* configure.ac: Move AM_CONDITIONALS to a block near the end to avoid
+	testing them too soon.
+
+2009-06-16   D. V. Wiebe <getdata at ketiltrout.net>  svn:295
+	* test/xz_nframes.c test/lzma_nframes.c test/lzma_get.c test/xz_get.c:
+	Added.
+
+	* m4/encoding.m4 (GD_CHECK_ENCODING): Fix to allow an empty 6th parameter.
+	* configure.ac: Add LZMA/xz encoding framework check.
+
+	* src/lzma.c: Added.
+	* src/encoding.c: Add entries to _gd_ef for the LZMA schemes.
+	* src/internal.h: Add GD_ENC_LZMA_RAW and GD_ENC_XZ_RAW.
+	* src/getdata.h.in: Add GD_LZMA_ENCODED.
+
+	* src/bzip.c (_GD_Bzip2Read): Fix length count.
+
+2009-06-11   D. V. Wiebe <getdata at ketiltrout.net>  svn:292
+	* test/get_lincom_non.c test/parse_lincom_non_ncols.c
+	test/parse_lincom_non.c: Added.
+
+	* src/parse.c (_GD_ParseLincom): Make <n> optional.
+
+2009-06-11   D. V. Wiebe <getdata at ketiltrout.net>  svn:291
+	* test/alter_polynom_coeff.c test/get_polynom_noin.c
+	test/parse_polynom_scalar.c test/put_polynom1.c test/alter_polynom_input.c
+	test/put_polynom2.c test/madd_polynom.c test/entry_polynom_scalar.c
+	test/parse_polynom_ncols1.c test/parse_polynom.c test/add_polynom.c
+	test/spf_polynom.c test/parse_polynom_ncols2.c test/put_polynom_noin.c
+	test/alter_polynom_ord.c test/get_polynom.c test/entry_polynom.c: Added.
+
+	* src/getdata.c (_GD_DoField): Fix call to _GD_DoPolynom.
+
+	* src/parse.c (_GD_ParsePolynom): Fix off-by-one error.
+
+	* src/mod.c (_GD_Change): Handle poly_ord = 0 properly.
+	* src/mod.c (dirfile_alter_polynom): Fix off-by-one error.
+
+	* src/getdata.h.in: Declare polynom API.
+
+	* src/add.c (_GD_Add): Only copy the first polynom in_field.
+
+2009-06-09   D. V. Wiebe <getdata at ketiltrout.net>  svn:290
+	* src/internal.h: Add GD_E_BAD_ENTRY_POLYORD.
+	* src/getdata.h.in: Define GD_MAX_POLYNOM and GD_POLYNOM_ENTRY.  Increment
+	GD_N_ENTYPES.  Add POLYNOM struct to the entry struct.
+
+	* src/entry.c (_GD_FreeE _GD_CalculateEntry get_entry): Add case for
+	GD_POLYNOM_ENTRY.
+	* src/getdata.c (_GD_DoField): Add case for GD_POLYNOM_ENTRY.
+	* src/flush.c (_GD_Flush _GD_FieldSpec): Add case for GD_POLYNOM_ENTRY.
+	* src/nfields.c (get_nfields_by_type): Add case for GD_POLYNOM_ENTRY.
+	* src/spf.c (_GD_GetSPF): Add case for GD_POLYNOM_ENTRY.
+	* src/putdata.c (_GD_DoFieldOut): Add case for GD_POLYNOM_ENTRY.
+	* src/del.c (_GD_ClearDerived _GD_DeReference): Add case for GD_POLYNOM_ENTRY.
+	* src/mod.c (_GD_Change): Add case for GD_POLYNOM_ENTRY.
+	* src/add.c (_GD_Add): Add case for GD_POLYNOM_ENTRY.
+
+	* src/getdata.c (_GD_PolynomData _GD_DoPolynom): Added.
+	* src/putdata.c (_GD_DoPolynomOut): Added.
+	* src/parse.c (_GD_ParsePolynom): Added.
+	* src/mod.c (dirfile_alter_polynom): Added.
+	* src/add.c (dirfile_add_polynom dirfile_madd_polynom): Added.
+
+	* src/entry.c (_GD_FreeE): GD_MAX_LINCOM -> GD_MAX_POLYNOM in limits.
+	* src/mod.c (_GD_Change): GD_MAX_LINCOM -> GD_MAX_POLYNOM in limits.
+	* src/internal.h: GD_MAX_LINCOM -> GD_MAX_POLYNOM in limits.
+
+	* src/parse.c (_GD_ParseFieldSpec): Handle POLYNOM field type.
+	* src/errors.c: Add GD_E_BAD_ENTRY_POLYORD suberror under GD_E_BAD_ENTRY.
+	* src/field_list.c: Add GD_POLYNOM_ENTRY to _gd_entype_index.
+	* src/mod.c (dirfile_alter_entry): For POLYNOM, also set move.
+
+	* src/mod.c (_GD_Change): Fix scalar_free flags for LINCOM.
+	* src/mod.c (dirfile_alter_lincom): Rename "move" to "flags" to avoid
+	obfuscating the purpose of this variable.
+
+	* src/mod.c (dirfile_alter_lincom): Check validity of n_fields before use.
+	* src/add.c (_GD_Add dirfile_add_lincom dirfile_madd_lincom): Check validity
+	of n_fields before use.
+
+2009-01-16   D. V. Wiebe <getdata at ketiltrout.net>  svn:285
+	GetData 0.5.0 released.
+
+2009-01-13   D. V. Wiebe <getdata at ketiltrout.net>  svn:283
+	GetData-0.5.0rc4:
+
+	* test/endian_move.c test/encode_move.c test/endian_alter.c: Fix more
+	big-endian errors reported by Matthew Truch.
+
+	* bindings/f77/fgetdata.c (gdcopn gdclbk): Properly check the callback
+	parameter for NULL.  Reported by Matthew Truch.
+
+	* bindings/f77/fgetdata.c bindings/f77/Makefile.am: Add debugging tracing.
+
+2009-01-09   D. V. Wiebe <getdata at ketiltrout.net>  svn:281
+	GetData-0.5.0rc3:
+
+	* test/encode_move.c test/move_data_endian.c test/endian_get.c
+	test/endian_alter.c: Fix for correct operation on big endian architectures.
+
+	* src/gzip.c (_GD_GzipSize): Byte swap size on big endian machines.
+
+	* src/flush.c (_GD_FlushFragment): Static.
+
+	* bindings/cxx/dirfile.cpp (Dirfile::Add Dirfile::MAdd): Don't return before
+	setting the dirfile for the entry.
+
+	* bindings/f77/fgetdata.c (_GDF_Callback): Static.
+
+	* bindings/f77/fgetdata.h: Fix function names.
+
+2009-01-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:279
+	GetData-0.5.0rc2:
+
+	* src/encoding.c src/endian.c src/foffs.c src/getdata.c src/name.c
+	src/flush.c src/encoding.c src/putdata.c src/del.c src/move.c src/parse.c
+	src/mod.c src/internal.h src/nframes.c: Hide internal symbols.
+
+	* src/internal.h src/Makefile.am Makefile.am configure.ac: Use an embeded ltdl
+	if no system ltdl is found.
+	* m4/encdoing.m4: Hide ltdl symbols.
+	* m4/ltdl.m4 src/gd_ltdl.c src/gd_ltdl.h: Added.  These are taken unmodified
+	from the libtool distribution.
+
+
+2008-12-23   D. V. Wiebe <getdata at ketiltrout.net>  svn:277
+	GetData-0.5.0rc1:
+
+	* NEWS README: Updated.
+
+	* src/slim.c (_GD_SlimOpen _GD_SlimSize): Remove filebase stuff.
+
+2008-12-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:276
+	* bindings/cxx/linterpentry.cpp bindings/cxx/bitentry.cpp
+	bindings/cxx/multiplyentry.cpp bindings/cxx/lincomentry.cpp
+	bindings/cxx/fragment.cpp bindings/cxx/constentry.cpp
+	bindings/cxx/rawentry.cpp bindings/cxx/phaseentry.cpp
+	bindings/cxx/getdata/indexentry.h bindings/cxx/getdata/getdata/rawentry.h
+	bindigns/cxx/getdata/linterpentry.h bindings/cxx/getdata/bitentry.h
+	bindings/cxx/getdata/multiplyentry.h bindings/cxx/getdata/phaseentry.h
+	bindings/cxx/getdata/lincomentry.h bindings/cxx/getdata/fragment.h
+	bindings/cxx/getdata/constentry.h bindings/cxx/getdata/stringentry.h
+	bindings/cxx/stringentry.cpp bindings/cxx/indexentry.cpp: Added.
+
+	* bindings/cxx/dirfile.cpp bindings/cxx/getdata/dirfile.h
+	bindings/cxx/entry.cpp bindings/cxx/getdata/entry.h: Updated C++ bindings
+	for the new functions.
+
+	* bindings/f77/fgetdata.c bindings/f77/getdata.f.in
+	bindings/f77/getdata.f90.in: Update for get_entry_type and get_fragment_index.
+
+	* test/fragment_index.c test/entry_type.c: Added.
+	* src/entry.c (get_entry_type get_fragment_index): Added.
+
+	* src/name.c (dirfile_rename): Prohibit renaming INDEX.
+	* src/move.c (dirfile_move): Prohibit moving INDEX.
+
+2008-12-19   D. V. Wiebe <getdata at ketiltrout.net>  svn:274
+	* bindings/f77/getdata.f90.in doc/README.F95: Add Fortran 95 bindings for new
+	functions, and for the dirfile_[m]add_<field_type> functions.
+
+	* bindings/f77/getdata.f90.in: Fix call to gdadsp and gdmdsp
+
+2008-12-19   D. V. Wiebe <getdata at ketiltrout.net>  svn:273
+	* src/protect.c (dirfile_protect): Swap order of arguments for consistency
+	with the dirfile_alter_<metadata> functions.
+
+	* bindings/f77/fgetdata.c (_GDF_CString _GDF_FString): Use Fortran string
+	length = 0 as a proxy for a C NULL pointer. 
+
+	* bindings/f77/fgetdata.c bindings/f77/fgetdata.h bindings/f77/getdata.f.in
+	doc/README.f77: Add Fortran 77 bindings for new functions.
+
+2008-12-18   D. V. Wiebe <getdata at ketiltrout.net>  svn:272
+	* test/include_pc.c test/include_cb.c test/include_syntax.c: Added.
+
+	* src/open.c (dirfile_parser_callback): Added.
+
+2008-12-18   D. V. Wiebe <getdata at ketiltrout.net>  svn:270
+	* test/global_ref_get.c: Added.
+	* src/globals.c (get_reference): Added.
+
+	* bindings/f77/test/gdcopn.f: Added.
+
+	* bindings/f77/fgetdata.c (_GDF_ClearDirfile): Let caller close dirfile.
+
+	* bindings/f77/fgetdata.c (_GDF_FString): Fix off-by-one error.
+
+	* bindings/f77/fgetdata.c (_GDF_Callback): Added.
+	* bindings/f77/fgetdata.c: Add bindings for dirfile_cbopen and
+	dirfile_discard.
+
+	* bindings/f77/make_parameters.c: Add delete flags, protect levels,
+	callback actions, syntax suberrors, GD_MAX_LINE_LENGTH, GD_ALL_FRAGMENTS,
+	DIRFILE_STANDARDS_VERSION.
+
+2008-12-18   D. V. Wiebe <getdata at ketiltrout.net>  svn:269
+	* bindings/f77/make_parameters.c: Update for GD_E_BAD_PROTECTION and
+	GD_E_UNCLEAN_DB.
+
+	* bindings/f77/fgetdata.c bindings/f77/getdata.f.in bindings/f77/fgetdata.h
+	bindings/f77/getdata.f90.in README.f77 bindings/f77/test/gdfget.f: Convert
+	all Fortran-77 function names from GDFxxx to GDxxxx.
+
+	* test/alter_mspec.c test/alter_spec.c: Added.
+
+	* src/mod.c (dirfile_alter_spec dirfile_malter_spec): Call
+	_GD_ParseFieldSpec with creat = 0.
+
+2008-12-17   D. V. Wiebe <getdata at ketiltrout.net>  svn:267
+	* test/name_move.c test/protect_alter.c test/move_subdir.c test/file_code.c
+	test/protect_get.c test/name.c test/unclude_del.c test/unclude.c
+	test/file_type.c test/parent.c test/file.c test/unclude_move.c: Added.
+
+	* doc/unclean_database_recovery.txt: Added.
+	* COPYING.DOC: Added.
+	* man/dirfile_alter_encoding.3.in man/dirfile_alter_endianness.3.in
+	man/dirfile_alter_frameoffset.3in configure.ac: Build mans with paths.
+
+	* src/getdata.h.in src/error.c: Added GD_E_UNCLEAN_DB.
+	* src/endian.c (_GD_ByteSwapFragment) src/foffs.c (_GD_ShiftFragment)
+	src/encoding.c (_GD_RecodeFragment): Return the dreaded GD_E_UNCLEAN_DB if
+	finalisation fails.
+
+	* src/entry.c (get_raw_filename): Call _GD_SetEncodedName.
+
+	* src/flush.c (_GD_FlushFragment): Added.
+	* src/flush.c (_GD_FlushMeta): Call _GD_FlushFragment.
+
+	* src/internal.h: Add parent field to private entry.
+	* src/parse.c (_GD_ParseFieldSpec): Record parent.
+
+	* src/parse.c (_GD_Tokenise): Gracefully handle lines without terminating
+	newlines.
+
+	* src/include.c (dirfile_uninclude _GD_CollectFragments
+	_GD_ContainsFragment): Added.
+
+	* src/parse.c src/open.c: Split open.c
+
+	* src/move.c (_GD_MogrifyFile dirfile_move): Perform mogrification if filebase
+	has changed.
+	* src/move.c (strcmpnull): Added.
+
+	* src/fragment.c (get_parent_fragment): Added.
+	* src/fragment.c: Prperly clear error in public functions.
+
+	* src/fragment.c: Renamed from format_list.c
+
+	* src/name.c (_GD_ValidateField): Moved from encoding.c.
+
+	* src/name.c src/protect.c: Added.
+	* src/getdata.h.in src/error.c: Added GD_E_BAD_PROTECTION.
+	* src/getdata.h.in src/internal.h: Move GD_PROTECT macros to public header.
+
+	* src/encoding.c src/internal.h: Add move method to encoding framework.
+	* src/encoding.c (_GD_GenericMove): Added.
+
+2008-12-10   D. V. Wiebe <getdata at ketiltrout.net>  svn:266
+	* bindings/cxx/dirfile.cpp (Dirfile::ReferenceFilename): Added.
+
+2008-12-10   D. V. Wiebe <getdata at ketiltrout.net>  svn:265
+	* src/encoding.c (_GD_EncodingUnderstood): Understand GD_TEXT_ENCODED.
+
+	* src/encoding.c (_GD_RecodeFragment): Properly handle moving the temporary
+	file and deleting the old file.
+
+	* src/encoding.c (get_encoding): Determine encoding if needed.  Report
+	GD_ENC_UNSUPPORTED if encoding is not understood.
+
+2008-12-09   D. V. Wiebe <getdata at ketiltrout.net>  svn:264
+	* test/endian_move.c test/endian_get.c test/endian_alter.c: Added.
+
+	* src/endian.c: Use unsigned long for byte_sex parameters.
+
+	* src/endian.c (_GD_ByteSwapFragment) src/open.c (dirfile_cbopen)
+	src/include.c (_GD_Include): Canonicalise byte sex as soon as possible.
+
+	* src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Check for valid
+	field name before trying move.
+
+	* src/endian.c (_GD_ByteSwapFragment): Don't bother checking encoding ecor
+	before calling _GD_Mogrify.
+
+	* src/endian.c (get_endianness): Return unsigned long and 0 on error.
+
+2008-12-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:263
+	* test/foffs_move.c test/foffs_get.c test/foffs_alter.c: Added.
+
+2008-12-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:261
+	* test/alter_multiply.c test/alter_entry.c test/alter_phase.c
+	test/alter_linterp_move.c test/alter_lincom_input.c
+	test/alter_lincom_slope.c test/alter_linterp.c test/alter_const.c
+	test/alter_raw_type.c test/alter_entry_recode.c test/alter_bit_bitnum.c
+	test/alter_raw_spf.c test/alter_bit_numbits.c test/alter_lincom_offset.c:
+	Added.
+
+	* src/flush.c (_GD_FlushMeta): Preserve access mode for fragments.
+	* src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Preserve access mode.
+
+	* src/mod.c (_GD_Change): Don't initialise enc until subencoding is
+	determined.  Fully determine LUT table paths.  Type convert CONST data as
+	needed.  Fix lincom argument handling.
+
+	* src/mod.c (dirfile_alter_raw): Swap order of spf and data type arguments
+	to correspond to dirfile_add_raw().
+
+	* src/mod.c (dirfile_alter_lincom): Set n_fields properly, potentially by
+	finding the field to be changed first.  Fix checks for NULL arguments.
+
+	* src/mod.c (dirfile_alter_multiply): Set correct field type.
+
+	* src/mod.c (dirfile_malter_spec): Swap order of line and parent arguments
+	to correspond to dirfile_madd_spec().
+
+2008-12-06   D. V. Wiebe <getdata at ketiltrout.net>  svn:260
+	* src/endian.c (dirfile_alter_endianness): Renamed from put_endianness.
+	* src/foffs.c (dirfile_alter_frameoffset64 dirfile_alter_frameoffset):
+	Renamed from put_frameoffset64 and put_frameoffset.
+	* src/encoding.c (dirfile_alter_encoding): Renamed from put_encoding.
+	* src/mod.c (dirfile_alter_raw dirfile_alter_lincom dirfile_alter_linterp
+	dirfile_alter_bit dirfile_alter_multiply dirfile_alter_phase
+	dirfile_alter_const dirfile_alter_spec dirfile_malter_spec): Renamed from
+	dirfile_change_*.
+	* src/mod.c (dirfile_alter_entry): Renamed from dirfile_change.
+
+2008-12-03   D. V. Wiebe <getdata at ketiltrout.net>  svn:258
+	* src/open.c (_GD_ParseDirective): Handle bzip and gzip ENCODING directives.
+
+	* src/encoding.c: Fix bzip2 non-module framework.
+
+	* src/ascii.c (_GD_AsciiRead): Don't throw an error on EOF.
+
+	* src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Don't overwrite the
+	main file.
+
+	* src/bzip.c (_GD_Bzip2Seek _GD_Bzip2Read): Intelligently handle EOF.
+
+	* src/move.c (_GD_MogrifyData): Handle new_filebase internally.  Don't check
+	the input encoding before determining it.  Always use temp files, even when
+	changing encodings.  Error handling fixes.
+
+	* test/move_data_enc_ar.c test/gzip_move_from.c test/move_data_enc_ra.c
+	test/move_data_foffs.c test/move_data_endian.c test/bzip_move_from.c
+	test/move_data_nop.c: Added.
+
+2008-12-03   D. V. Wiebe <getdata at ketiltrout.net>  svn:254
+	* src/move.c (dirfile_move): Don't bother checking whether the encoding is
+	understood if we're not moving the data.  Also, update the fragment index
+	for the field and mark both the old and new fragments as dirty.
+
+	* test/move.c test/move_protect.c test/move_index.c: Added.
+
+2008-12-01   D. V. Wiebe <getdata at ketiltrout.net>  svn:253
+	* src/ascii.c src/bzip.c src/encoding.c src/gzip.c src/raw.c: Initialise
+	filename in the library directly instead of passing that off on the encoding
+	framework.
+
+	* man/dirfile_move.3: Added.
+
+	* src/getdata.h.in: Add GD_IGNORE_REFS.
+	* src/include.c (dirfile_include): Handle both explicit and implicit
+	reference field declarations, along with GD_IGNORE_REFS.
+	* test/include_ignore.c test/include_ref.c test/include_auto.c: Added.
+	* man/dirfile_include.3: Update.
+
+	* test/global_ref_empty.c test/global_ref_set.c test/global_ref.c: Added.
+	* man/dirfile_reference.3: Added.
+
+	* add.c (_GD_Add): Don't modify the dirfile until we're sure to succeed.
+
+	* src/add.c (_GD_Add) src/entry.c (_GD_GetScalar) src/legacy.c
+	(_GD_GetDirfile GetFormat) src/open.c (_GD_ParseFieldSpec) src/globals.c
+	(dirfile_reference): Properly check realloc for error before use.
+
+	* src/slim.c src/encoding.c: Fix symbols for slim module.
+
+	* src/del.c (dirfile_delete): If the reference field is deleted, do
+	something sensible.
+
+	* src/open.c (dirfile_cbopen dirfile_open) src/include.c (dirfile_include):
+	Flags are long.
+
+	* m4/encoding.m4: Fix library check for extra prefix.
+
+	* src/common.c (_GD_FindField): index should be unsigned.
+
+	* bindings/f77/make_parameters.c README.f77: Update for new symbols.
+
+2008-11-28   D. V. Wiebe <getdata at ketiltrout.net>  svn:252
+	* man/dirfile_include.3: Updated for calback.
+	* man/dirfile_close.3: Updated for dirfile_discard.
+
+	* src/getdata.h.in: Sorted.
+
+	* src/Makefile.am: Correct flags for bzip2 module.
+
+	* src/globals.c (dirfile_reference): Renamed from put_reference and merged
+	with get_reference.
+
+	* test/close_discard.c: Added.
+
+	* src/encoding.c src/internal.h: Removed the per-dirfile encoding
+	frameworks.  Renamed encoding_framework ef and made non static and non
+	const.
+	* src/encoding.c (_GD_InitialiseFramework): Reimplemented to initialise
+	global framework.
+	* src/open.c (dirfile_cbopen): Call _GD_InitialiseFramework to initialise
+	global framework.
+	* src/close.c (_GD_ShutdownDirfile): Don't call lt_dlexit();
+
+	* src/close.c (_GD_ShutdownDirfile): Renamed from dirfile_close and
+	added the flush_meta parameter.
+	* src/close.c (dirfile_close dirfile_discard): Added.
+
+2008-11-28   D. V. Wiebe <getdata at ketiltrout.net>  svn:251
+	* test/del.c test/del_meta.c test/del_meta_force.c test/del_const.c
+	test/del_const_deref.c test/del_const_force.c test/del_data.c
+	test/del_derived.c test/del_derived_force.c test/open_cb_invalid.c: Added.
+	* man/dirfile_delete.3: Added.
+
+	* src/spf.c (_GD_GetSPF): Calculate RAW fields, if requried.
+
+	* src/del.c (dirfile_delete): Multiple bug fixes.
+
+	* src/getdata.h.in: Remove GD_DEL_NONE
+
+2008-11-27   D. V. Wiebe <getdata at ketiltrout.net>  svn:250
+	* test/open_cb_ignore.c test/open_cb_cont.c test/open_cb_abort.c
+	test/open_cb_rescan.c: Added.
+
+	* src/open.c (_GD_ParseFragment): Properly ABORT or RESCAN.
+
+	* src/internal.h src/getdata.h.in: GD_SYNTAX_* macros should be public.
+
+	* src/getdata.h.in: dirfile_cbopen() forward declaration.
+
+2008-11-27   D. V. Wiebe <getdata at ketiltrout.net>  svn:248 svn:249
+	* test/global_name.c: Added.
+
+	* src/open.c (_GD_ParseFragment): Fail with GD_E_CALLBACK on invalid
+	callback response.
+
+	* src/open.c (dirfile_cbopen): Check malloc.
+
+	* man/dirfilename.3: Added.
+
+2008-11-27   D. V. Wiebe <getdata at ketiltrout.net>  svn:247
+	* test/bzip_put.c test/bzip_get_get.c test/bzip_nframes.c test/bzip_get.c:
+	Added.
+
+	* m4/encodings.m4: Always AC_SUBST the Makefile variables.  Differentiate
+	between internal and external encodings.
+
+	* src/bzip.c: Added.
+	* src/encoding.c: Add bzip2 framework.
+
+	* src/gzip.c (_GD_GzipSeek): Return samples not bytes.
+
+	* src/configure.ac: Add --enable-modules with checks.
+	* src/Makefile.am: Add rules for USE_MODULES
+	* src/encoding.c: Initialise encoding framework for USE_MODULES
+	* src/open.c (dirfile_cbopen) src/close.c (dirfile_close) src/slim.c
+	src/gzip.c src/encoding.c: Wrap ltdl stuff in USE_MODULES
+
+2008-11-25   D. V. Wiebe <getdata at ketiltrout.net>  svn:246
+	* m4/encoding.m4: Check for executables needed for tests even if the
+	library isn't found.
+	* test/slim_nframes.c test/slim_get.c test/gzip_get_get.c test/gzip_get.c
+	test/gzip_nframes.c: Allow proper execution in the absence of the
+	corresponding encoding support.
+
+2008-11-25   D. V. Wiebe <getdata at ketiltrout.net>  svn:244
+	* configure.ac: Reduce code duplication with the introduction of the
+	GD_CHECK_ENCODING macro.
+	* m4/encoding.m4: Added.
+
+	* src/common.c: Replaced the only assert() in the library with an internal
+	library error.
+	* configure.ac src/internal.h: Removed assert-related checks.
+
+2008-11-24   D. V. Wiebe <getdata at ketiltrout.net>  svn:243
+	* configure.ac: Fix pthread check.
+
+2008-11-24   D. V. Wiebe <getdata at ketiltrout.net>  svn:242
+	* src/encoding.c (_GD_ValidateField): Moved from open.c because it needs the
+	global encoding framework array.
+	* src/internal.h: Add local encoding framework array to DIRFILE struct.
+	Most functions now use this. (GD_SetEncodedName is a notable exception.)
+	* src/encoding.c (_GD_InitialiseFramework): Added.
+	* test/gzip_get_get: Added.
+
+	* src/encoding.c (_GD_ResolveSymbol _GD_MissingFramework): Use ltdl to
+	dynamically load libraries instead of calling dlopen directly.
+	* src/gzip.c src/slim.c: Export ltdl symbols.
+	* src/open.c (dirfile_cbopen): Call lt_dlinit().
+	* src/close.c (dirfile_close): Call lt_dlexit().
+	* configure.ac: ltdl checks.
+	* Makefile.am: conditionally descend into libltdl.
+	* src/Makefile.am: Pass -export-dynamic -module and -dlopen to libtool as
+	appropriate.
+
+	* configure.ac: remove --disable-pkg-config.
+	* src/Makefile.am: always install getdata.pc.
+
+	* man/Makefile.am: Properly link to dirfile_madd_bit.3
+
+2008-11-23   D. V. Wiebe <getdata at ketiltrout.net>  svn:241
+	* src/add.c (_GD_Add) src/include.c (_GD_Include) open.c (_GD_ParseRaw):
+	Don't unnecessarily add "/./" to paths.
+
+	* src/gzip.c: Added.
+	* src/encoding.c src/getdata.h.in: Add GD_GZIP_ENCODING.
+	* test/gzip_get.c test/gzip_nframes.c test/gzip_put.c: Added.
+	* conigure.ac Makefile.am src/Makefile.am: Add gzip support.
+
+	* src/entry.c (_GD_FreeE): fix de-allocation of gd_raw_file objects.
+
+	* configure.ac: Check for -ldl.
+	* src/encoding.c (_GD_ResolveSymbol): Added.
+	* src/encoding.c (_GD_MissingFramework): dlopen an encoding sublibrary if
+	required.  Made non-static.
+	* src/encoding.c (GD_SetEncodedName): Remove initial underscore to enable
+	exporting because sublibraries may need it.
+
+	* src/Makefile.am: Compile slim.c into a stand-alone "sublibrary"
+	libgetdataslim.la.
+
+	* src/raw.c (_GD_RawWrite): Return samples, not bytes.
+
+	* src/move.c (_GD_MogrifyFile): Add encoding recoding.  Fix endianness
+	conversion calculation.
+	* src/encoding.c (_GD_RecodeFragment): Replaced the heavy lifting with a
+	call to _GD_MogrifyFile.
+
+2008-11-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:240
+	* src/move.c: Added.
+	* src/foffs.c (_GD_ShiftFragment) src/endian.c (_GD_ByteSwapFragment): Call
+	_GD_MogrifyFile (in move.c) instead of handling the file translation
+	directly.
+
+	* src/encoding.c (_GD_RecodeFragment): Reset subencodings when not moving
+	files.
+
+2008-11-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:239
+	* src/mod.c (dirfile_change_spec dirfile_mchange_spec): Added.
+
+	* src/open.c (_GD_ParseFieldSpec): Add insert parameter to indicate whether
+	the parsed entry should be inserted into the dirfile.
+
+	* sr/mod.c (_GD_Change): Remove unnecessary intermediate variables.
+	Properly handle scalars.
+
+2008-11-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:238
+	* src/common.c (_GD_AddData): Moved from getdata.c and made non-static.
+
+	* src/mod.c: Added.
+
+2008-11-20   D. V. Wiebe <getdata at ketiltrout.net>  svn:237
+	* configure.ac: Use AC_PROG_CC_C99 again, bump AC_PREREQ to 2.63.
+	* m4/c99.m4: Removed.
+
+2008-11-20   D. V. Wiebe <getdata at ketiltrout.net>  svn:236
+	* src/endian.c (_GD_FixEndianness): Moved from types.c.
+
+	* src/endian.c: Added.
+
+	* src/encoding.c (_GD_RecodeFragment put_encoding get_encoding): Added.
+
+	* src/foffs.c (_GD_ShiftFragment): Check for GD_EF_SEEK.  Only open the
+	input file if not already open.  Check seek success.  Seek on both files.
+
+	* src/getdata.h.in legacy.c: Add GD_E_BAD_ENDIANNESS.
+
+	* src/putdata.c (_GD_DoRawOut): Don't divide n_wrote by size.
+
+	* src/slim.c (_GD_SlimSeek) src/raw.c (_GD_RawSeek): Return samples, not
+	bytes.
+
+	* src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Check seek
+	success.
+
+	* src/internal.h: Split the unnecessarily difficult fragment->flags into
+	fragment->encoding and fragment->byte_sex.
+
+2008-11-18   D. V. Wiebe <getdata at ketiltrout.net>  svn:232
+	* src/open.c (_GD_ParseFragment): Added GD_IGNORE_DUPS flags.
+	* test/parse_duplicate_ignore.c: Added.
+
+	* src/internal.h src/getdata.h.in: Moved gd_entry_t->size to
+	_gd_private_entry.
+
+	* src/foffs.c (_GD_ShiftFragment): Do the move and cleanup.
+	* src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Added.
+
+	* src/foffs.c (put_frameoffset64): Check offset parameter for range.
+
+	* src/encoding.c (_GD_SetEncodedName): Added.
+
+	* src/slim.c (_GD_SlimUnlink) src/ascii.c (_GD_AsciiUnlink) src/raw.c
+	(_GD_RawUnlink): Removed and replaced by _GD_GenericUnlink.
+	* src/ascii.c (_GD_AsciiTouch) src/raw.c (_GD_RawTouch): Removed and replaced
+	by _GD_GenericTouch.
+
+	* src/internal.h: Created the _gd_raw_file object. Renamed
+	_gd_private_entry->file to _gd_private_entry->filebase.
+	* src/encoding.c: Encoding framework updated to work on _gd_raw_file
+	objects.
+
+	* src/entry.c (get_raw_filename): Use cached filename.
+
+2008-11-18   D. V. Wiebe <getdata at ketiltrout.net>  svn:228
+	 Merged in changes from the 0.4.x branch, revision 223:
+
+	* src/flush.c (_GD_Flush): Fix SEGV.
+
+	* src/getdata.c (_GD_DoRaw): don't divide samples_read by data size.
+	* src/raw.c (_GD_RawRead): divide nread by data size.
+	* test/slim_get.c test/slim_nframes.c: Test with uint16_t to check for
+		above bug.  Invoke slim binary with -k (force).
+
+	* src/legacy.c (GetFormat): Remove const from return
+	* src/getdata_legacy.h: wrap all function declarations in extern "C"
+
+	* src/legacy.c: Trace function calls.
+
+	* src/Makefile.am: add symbolic link getdata_struct.h -> getdata.h for
+	better legacy API support.
+
+	* src/include.c (_GD_Include) src/open.c (dirfile_open): Initialise
+	protection level for fragments.
+
+2008-11-17   D. V. Wiebe <getdata at ketiltrout.net>  svn:224
+	* src/getdata.h.in src/internal.h: Rename MAX_LINE_LENGTH to
+	GD_MAX_LINE_LENGTH and move to public header.
+
+	* src/getdata.h.in src/internal.h: Clean up GD_E_FORMAT_* suberrors and move
+	to public header.  GD_E_FORMAT_N_COLS renamed to GD_E_FORMAT_N_TOK.
+	GD_E_FORMAT_MAX_I, GD_E_FORMAT_N_RAW, removed.  All codes renumbered.
+
+	* src/internal.h: _gd_private_entry->stream renamed to edata.
+
+	* src/entry.c (_GD_GetScalar): Call _GD_DoConst() directly instead of
+	_GD_DoField().
+	* src/getdata.c (_GD_DoConst): No longer static.
+
+	* src/errors.c: Correct typo in GD_E_FORMAT:GD_E_FORMAT_CHARACTER string.
+
+	* src/entry.c (get_raw_filename): Added.
+
+	* src/encoding.c (_GD_Supports): Added.
+	* src/encoding.c (_GD_ResolveEncoding): Make static.
+	* src/open.c (_GD_ParseFieldSpec) src/putdata.c (_GD_DoRawOut) src/getdata.c
+	(_GD_DoRaw) src/add.c (_GD_Add) src/nframes.c (get_nframes64): Replace
+	encoding checks with _GD_Supports call.
+
+	* src/common.c (_GD_FindField): Rename argument next to index.
+
+	* src/encoding.c (_GD_GenericUnlink _GD_GenericTouch): Added.
+	* src/slim.c (_GD_SlimUnlink) src/ascii.c (_GD_AsciiUnlink) src/raw.c
+	(_GD_RawUnlink): Added.
+	* src/ascii.c (_GD_AsciiTouch) src/raw.c (_GD_RawTouch): Call
+	_GD_GenericTouch().
+
+	* src/open.c (dirfile_cbopen): Renamed from dirfile_open
+	* src/open.c (dirfile_open): Added.
+	* src/open.c (_GD_ParseFragment): Call sehandler.
+
+	* src/slim.c: Trace.
+
+	* src/foffs.c: Added.
+	* src/del.c: Added.
+	* src/globals.c: Added.
+
+	* src/encoding.c: Split from getdata.c.
+
+2008-11-14   D. V. Wiebe <getdata at ketiltrout.net>  svn:216
+	Fork GetData-0.4.
+
+2008-11-07   D. V. Wiebe <getdata at ketiltrout.net>  svn:211
+	* src/open.c (_GD_ValidateField _GD_Tokeniser): Replace slow strchr calls
+	with explicit tests.
+
+	* src/open.c (_GD_ValidateField): Conditionally allow "." in field names,
+	but prohibit encoding extensions in this case.
+	* test/parse_name_dot.c test/parse_name_ext.c test/parse_name_pedantic.c:
+	Added.
+
+	* src/open.c (_GD_ParseRaw): Don't set fragment->ref_name: it will be done
+	later.
+
+	* src/entry.c (_GD_FreeE): Free the file string for RAW fields.
+	* src/close.c (_GD_FreeD): Call _GD_FreeE instead of de-allocating entries
+	explicitly.  A few other missing free calls added.
+
+	* src/getdata.c src/internal.h src/ascii.c: Add _GD_AsciiTouch.
+
+2008-10-31   D. V. Wiebe <getdata at ketiltrout.net>  svn:206
+	GetData-0.4.0 released.
+
+2008-10-28   D. V. Wiebe <getdata at ketiltrout.net>  svn:204
+	GetData-0.4.0rc4:
+
+	* src/nframes.c (get_nframes): Don't divide by the datatype size twice.
+
+	* bindings/cxx/test/entry.cpp bindings/cxx/test/putdata.cpp
+	bindings/cxx/test/spf.cpp bindings/cxx/test/getdata.cpp
+	bindings/cxx/test/addentry.cp bindings/cxx/test/nframes.cpp: Update for new
+	header locations.
+
+2008-10-28   D. V. Wiebe <getdata at ketiltrout.net>  svn:200
+	GetData-0.4.0rc3:
+
+	* src/field_list.c (get_field_list get_vector_list get_field_list_by_type
+	get_strings) src/meta_list.c (get_mfield_list get_mvector_list
+	get_mfield_list_by_type get_mstrings): Return a valid list even if there
+	are zero elements.
+
+	* src/field_list.c (get_mfield_list_by_type): Return the correct list in all
+	cases.
+
+2008-10-22   D. V. Wiebe <getdata at ketiltrout.net>  svn:197
+	GetData-0.4.0rc2:
+
+	* src/putdata.c (_GD_DoRawOut): Figure out the encoding scheme before
+	attempting to check whether idem needs byte-swapping.  Bug report from
+	Matthew Truch.
+
+2008-10-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:185
+	GetData-0.4.0rc1:
+
+	* src/include.c: Remove duplicate accessmode check.
+
+2008-10-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:184
+	* src/open.c: Fix PROTECT parsing.
+
+	* src/putdata.c: Check protection for STRING, not PHASE.
+
+	* src/putdata.c (_GD_DoStringOut): Don't de-allocate old string until
+	new string is successful.
+
+	* src/internal.h: Don't mix CONST data and client list.
+
+	* src/flush.c (_GD_FlushMeta): Don't write INDEX.
+
+	* src/add.c (_GD_Add): Split format and data protection checks.
+
+2008-10-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:180
+	* src/internal.h: Add protection, ref_name, and frame_offset to
+	gd_fragment_t.  Remove first_field, first_fragment from same.  Remove
+	frame_offset from DIRFILE.
+	* src/open.c (_GD_DoRaw): Set the first field stuff after attempting to
+	create the new file.
+	* src/open.c (_GD_ParseDirective): FRAMEOFFSET is fragment local.  Parse
+	PROTECT.
+	* src/open.c (_GD_ParseFragment): Set reference name.
+	* src/flush.c (_GD_FlushMeta): Write PROTECT, REFERENCE, FRAMEOFFSET.  Don't
+	worry about first fields any more.
+
+	* src/add.c (_GD_Add dirfile_add_spec dirfile_madd_spec) src/putdata.c
+	(_GD_DoRawOut _GD_DoConstOut _GD_DoStringOut): Check protection.
+	* src/getdata.c (_GD_DoRaw _GD_DoRawOut): frame_offset is fragment local.
+	* src/include.c (dirfile_include): check access mode and protection.
+
+2008-10-21   D. V. Wiebe <getdata at ketiltrout.net>  svn:179
+	* src/internal.h: Renamed D->include_list, D->n_include, and D->first_field to
+	D->fragment, D->n_fragment, and D->reference_field.  Also removed
+	E->e->first and D->fragment[].first and added D->fragment[].first_field and
+	D->fragment[].first_fragment.
+	* src/getdata.h.in bindings/f77/make_parameters.c: Added GD_E_BAD_REFERENCE.
+
+	* src/open.c (_GD_ParseFieldSpec): Return a pointer to the gd_entry_t just
+	created if it's a RAW field (or else NULL).  Also, it no longer gets
+	passed &have_first.
+	* src/open.c (_GD_ParseDirective): Update ref_name instead of have_first.
+	Parse REFERENCE directive.
+	* src/open.c (_GD_ParseFragment): Renamed from _GD_ParseFormatFile.  Returns
+	the ref_name.  Sets fragment->first_fragment and fragment->first_raw.
+	* src/flush.c (_GD_FlushMeta): Updated for new first field stuff.
+	* src/include.c (_GD_Include): Accept and return ref_name to caller.
+	* src/include.c (dirfile_include) open.c (dirfile_open): Resolve REFERENCE
+	after parsing completes.
+
+	* man/dirfile_include.3 man/dirfile_open.3 dirfile-format.5: Update for
+	REFERENCE.
+
+	* src/flush.c (_GD_FlushMeta): Write global metadata at the end so it will
+	take precedence.
+
+	* src/flush.c (_GD_FieldSpec): String escapeise the field name.
+
+2008-10-19   D. V. Wiebe <getdata at ketiltrout.net>  svn:173
+	* src/errors.c (_GD_SetError) src/getdata.h.in: Added GD_VERBOSE flag.
+
+	* src/flush.c (_GD_Flush): Use encoding framework to flush and close raw
+	files.
+
+	* src/open.c (_GD_Tokenise): Properly handle trailing backslash.
+
+	* test/parse_eol.c test/parse_quote_mismatch.c: Added.
+
+2008-10-17   D. V. Wiebe <getdata at ketiltrout.net>  svn:169
+	* src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Some encodings
+	need no endianness correction.
+
+2008-10-17   D. V. Wiebe <getdata at ketiltrout.net>  svn:165
+	* src/nmeta.c: Renamed get_nmetafields, get_nmetavectors, and
+	get_nmetafields_by_type to get_nmfields, get_nmvectors, and
+	get_nmfields_by_type.
+	* src/field_list.c: Renamed get_constant_values and get_string_values to
+	get_constants and get_strings.
+	* src/flush.c: Renamed dirfile_flush_metadata to dirfile_metaflush
+	* src/meta_list.c: Renamed get_metaconstant_values, get_metastring_values,
+	get_metafield_list_by_type, get_metavector_list, and get_metafield_list to
+	get_mconstants, get_mstrings, get_mfield_list_by_type, get_mvector_list, and
+	get_mfield_list.
+	* src/add.c: Renamed dirfile_add_metaspec, dirfile_add_meta,
+	dirfile_add_metalincom, dirfile_add_metalinterp, dirfile_add_metabit,
+	dirfile_add_metamultiply, dirfile_add_metaphase, dirfile_add_metastring, and
+	dirfile_add_metaconst to dirfile_madd_spec, dirfile_madd,
+	dirfile_madd_lincom, dirfile_madd_linterp, dirfile_madd_bit,
+	dirfile_madd_multiply, dirfile_madd_phase, dirfile_madd_string, and
+	dirfile_madd_const.
+	* bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h: Updated C++ bindings
+	accordingly.
+	* bindings/f77/fgetdata.c bindings/f77/getdata.f.in bindings/f77/fgetdata.h
+	bindings/f77/getdata.f90.in: Updated Fortran 77 and 95 bindings accordingly.
+	* test/add_meta_linterp_invalid.c test/add_meta_lincom_invalid.c
+	test/add_meta_phase_invalid.c test/add_meta_phase.c test/add_meta_multiply.c
+	test/add_meta_spec_invalid.c test/add_meta_spec.c test/add_meta_linterp.c
+	test/add_meta_lincom.c test/add_meta_spec_directive.c
+	test/add_meta_bit_invalid.c test/add_meta_bit.c test/add_meta.c
+	test/add_meta_multiply_invalid.c: Removed.
+	* test/madd_bit.c test/madd_lincom_invalid.c test/madd_lincom.c
+	test/madd_spec.c test/madd_phase.c test/madd.c test/madd_linterp_invalid.c
+	test/madd_bit_invalid.c test/madd_linterp.c test/madd_spec_invalid.c
+	test/madd_spec_directive.c test/madd_multiply_invalid.c test/madd_multiply.c
+	test/madd_phase_invalid.c: Added.
+	* test/nmeta_type.c test/vlist_meta.c test/cvlist_invalid.c
+	test/nmeta_vectors_parent.c test/svlist_invalid.c test/cvlist.c
+	test/svlist.c test/nmeta_parent.c test/nmeta_vectors.c
+	test/cvlist_meta_invalid.c test/flist_meta_invalid.c
+	test/svlist_meta_invalid.c test/cvlist_meta.c test/nmeta_type_invalid.c
+	test/vlist_meta_invalid.c test/flush_meta.c test/svlist_meta.c
+	test/nmeta_invalid.c test/nmeta.c test/flist_type_meta_invalid.c
+	test/flist_type_meta.c test/nmeta_vectors_invalid.c test/nmeta_type_parent.c
+	test/flist_meta.c: Updated.
+
+2008-10-17   D. V. Wiebe <getdata at ketiltrout.net>  svn:164
+	* src/open.c src/putdata.c src/getdata.c src/flush.c src/getdata.h.in
+	src/add.c src/nframes.c: Rename format_file in gd_entry_t to fragment_index,
+	also similar function parameters.
+	* bindings/cxx/entry.cpp bindings/cxx/entry.h bindings/f77/fgetdata.c
+	bindings/f77/getdata.f.in bindings/f77/fgetdata.h
+	bindings/f77/getdata.f90.in: Update bindings to match.
+	* test/add_rdonly.c test/add_invalid.ca test/add.c test/add_code.c
+	test/add_duplicate.c test/add_type.c test/add_meta.c test/add_format.c:
+	Updated.
+
+	* src/open.c (_GD_ParseRaw): Use me instead of E->fragment_index, since the
+	latter hasn't been initialised yet.
+
+	* test/format_filename.c test/nformats.c test/format_filename_oor.c:
+	Removed.
+	* test/fragmentname.c test/nfragments.c test/fragmentname_oor.c: Added.
+
+2008-10-17   D. V. Wiebe <getdata at ketiltrout.net>  svn:163
+	* src/getdata.c (_GD_DoString) src/string.c (get_string): Add one to string
+	length to account for terminating NUL.
+	* src/putdata.c (_GD_DoStringOut) src/string.c (put_string): Return string
+	length.
+
+	* src/format_list.c: Renamed get_format_filename to get_fragmentname and
+	get_nformats to get_nfragments.  Bindings changed.
+
+	* src/constant.c (get_constant put_constant): Reutrn -1 on error.
+
+2008-10-16   D. V. Wiebe <getdata at ketiltrout.net>  svn:161
+	* src/meta_list.c src/nmeta.c: Fail if the specified parent is itself a
+	metafield.
+
+2008-10-16   D. V. Wiebe <getdata at ketiltrout.net>  svn:155
+	* src/open.c: Moved meta field enumeration to _GD_ParseFieldSpec from
+	_GD_ParseDirective to allow dirfile_add_metaspec to benefit seamlessly.
+
+	* src/add.c (dirfile_add_metaspec dirfile_add_spec): Reversed parameters.
+	It's better to keep the order consistent with the other dirfile_add
+	functions rather than having it consistent with the format file.
+	* bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h bindings/f77/fgetdata.c
+	bindings/f77/fgetdata.h bindings/f77/getdata.f90.in README.cxx README.f95
+	README.f77: Ditto for bindings.
+
+	* src/add.c (dirfile_add_metaspec dirfile_add_spec): Fail on a read-only
+	dirfile or format_file out of range.
+
+	* src/add.c (dirfile_add_metaspec): Pass parent to _GD_ParseFieldSpec.
+
+	* test/add_meta_spec_invalid.c test/add_meta_spec.c
+	test/add_meta_spec_directive.c: Added.
+
+2008-10-15   D. V. Wiebe <getdata at ketiltrout.net>  svn:151
+	* src/add.c src/flush.c src/getdata.c src/include.c src/internal.h
+	src/nframes.c src/open.c src/putdata.c man/dirfile-format.5: Made endianness
+	fragment-local.
+
+	* man/dirfile_include.3: Added.
+
+2008-10-15   D. V. Wiebe <getdata at ketiltrout.net>  svn:148
+	* src/include.c (dirfile_include): Throw GD_E_ACCMODE if GD_CREAT or
+	GD_TRUNC are passed to a read-only dirfile.
+
+	* test/include.c test/include_invalid.c test/include_accmode.c
+	test/include_creat.c test/include_nonexistent.c: Added.
+
+2008-10-15   D. V. Wiebe <getdata at ketiltrout.net>  svn:147
+	* README.f77 bindings/f77/fgetdata.c bindings/f77/fgetdata.h
+	bindings/f77/getdata.f.in: Add more Fortran 77 bindings.
+
+	* README.f95 bindings/f77/fgetdata.f90.in: Added Fortran 95 bindings for the
+	new public functions.
+
+2008-10-14   D. V. Wiebe <getdata at ketiltrout.net>  svn:146
+	* bindings/f77/fgetdata.c bindings/f77/fgetdata.h
+	bindings/f77/getdata.f90.in: Renamed GDFNFT to GDFNFO.
+
+	* README.f77 bindings/f77/fgetdata.c bindings/f77/fgetdata.h
+	bindings/f77/getdata.f.in bindings/f77/make_parameters.c: Added Fortran 77
+	bindings for the new public functions.
+
+2008-10-14   D. V. Wiebe <getdata at ketiltrout.net>  svn:143
+	* test/nframes_empty.c: Correct for removal of GD_E_EMPTY.
+
+	* README.cxx bindings/cxx/dirfile.h bindings/cxx/dirfile.cpp
+	bindings/cxx/entry.h: Added C++ bindings for new public functions.
+
+	* src/constant.c: get_constant returns size_t, not ssize_t, like the other
+	get_<foo>() functions.
+
+	* src/getdata.h.in: Add some missing public prototypes.
+
+	* src/nfields.c src/nmeta.c: Removed the _ after nmeta in public function
+	names.
+	* test/nmeta_type.c test/nmeta_vectors_parent.c test/nmeta_parent.c
+	test/add_meta_phase.c test/add_meta_multiply.c test/nmeta_type_invalid.c
+	test/add_meta_linterp.c test/add_meta_lincom.c test/nmeta_invalid.c
+	test/nmeta.c test/nmeta_vectors_invalid.c test/add_meta_bit.c
+	test/add_meta.c test/nmeta_type_parent.c: Updated.
+
+	* src/close.c (_GD_FreeD) src/entry.c (_GD_FreeE) src/field_list.c
+	src/internal.h src/meta_list.c: Replaced get_constant_list() and
+	get_string_list() with get_field_list_by_type(), which reduces the amount of
+	duplicated code and provides a more flexible interface.  Similarly with the
+	META versions.
+	* test/clist.c test/clist_invalid.c test/clist_meta.c
+	test/clist_meta_invalid.c test/slist.c test/slist_invalid.c test/slist_meta.c
+	test/slist_meta_invalid.c: Removed.
+	* test/flist_type.c test/flist_type_invalid.c test/flist_type_meta.c
+	test/flist_type_meta_invalid.c: Added.
+
+	* src/open.c: Reduce paranoia by not re-zeroing memory already memset to
+	zero.
+
+2008-10-14   D. V. Wiebe <getdata at ketiltrout.net>  svn:140
+	* src/legacy.c src/errors.c src/nframes.c (get_nframes64): GD_E_EMPTY is
+	no-longer an error. (Per discussion with Barth.)
+
+	* bindings/f77/make_parameters.c: Updated.
+
+2008-10-14   D. V. Wiebe <getdata at ketiltrout.net>  svn:139
+	* bindings/f77/test/fget_field_list.f90: Fix for new list and count function
+	behaviour.
+	* bindings/cxx/test/addentry.cpp: Fix for new get_nfields behaviour and
+	properly clean-up dirfile.
+
+	* src/entry.c (_GD_FreeE) src/internal.h: Add calculated and scalar[] array.
+	* src/open.c (_GD_SetScalar): Added.
+	* src/open.c (_GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp
+	_GD_ParseMultiply _GD_ParseBit _GD_ParsePhase _GD_ParseConst
+	_GD_ParsePhase): Record non-numeric scalar tokens for deferred calculation.
+	Numeric tokens are detected using strtod().
+	* src/entry.c (_GD_GetScalar _GD_CalculateEntry): Added.
+	* src/entry.c (get_entry) src/getdata.c (_GD_DoField) src/putdata.c
+	(_GD_DoFieldOut): Call _GD_CalculateEntry when necessary.
+	* src/constant.c (put_constant): Reset clients after changing the constant.
+	* src/add.c (_GD_Add) src/open.c (_GD_ParseConst): Initialise client list.
+
+	* test/entry_bit_scalar.c test/entry_lincom_scalar.c
+	test/entry_phase_scalar.c test/entry_raw_scalar.c test/parse_bit_scalar.c
+	test/parse_lincom_scalar.c test/parse_phase_scalar.c
+	test/parse_raw_scalar.c test/entry_raw_scalar_code
+	test/entry_raw_scalar_type: Added.
+
+2008-10-14   D. V. Wiebe <getdata at ketiltrout.net>  svn:138
+	* src/field_list.c (get_string_values): Fix array out of bounds crash.
+
+	* src/internal.h: Remove errant ; on _GD_InternalError macro.
+
+	* src/open.c (dirfile_open): Gave INDEX it's own explicit entry.  This
+	automatically allows defining /META fields for INDEX, per Barth's request.
+	This entry has the special type GD_INDEX_ENTRY.  Some other
+	simplifications/complications result.  First among these is that the list
+	functions and the counting functions now may include INDEX, as appropriate.
+	* test/add_lincom.c test/add_sort.c test/add_spec_directive.c
+	test/add_phase.c test/add_string.c test/add_multiply.c
+	test/add_bit_numbits.c test/add_bit_bitsize.c test/flist.c test/vlist.c
+	test/add_raw.c test/add_bit.c test/add_code.c test/add_duplicate.c
+	test/add_const.c test/nvectors.c test/add_type.c test/add_meta.c
+	test/parse_sort.c test/add_linterp.c test/add_format.c test/add_spec.c:
+	Update for new list and counting function behaviour.
+	* test/parse_meta_index.c: Added.
+	* src/common.c (_GD_GetEntry): Removed (no longer needed).  Callers call
+	_GD_FindField directly now, and must throw their own errors.
+	* src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut) src/spf.c
+	(_Get_SPF): Replaced INDEX special-casing with GD_INDEX_ENTRY handling.
+
+2008-10-13   D. V. Wiebe <getdata at ketiltrout.net>  svn:137
+	* src/add.c (_GD_Add): Properly initialise the private entry after creating
+	it.  Crash report from Matthew Truch.
+
+	* test/add_meta_linterp_invalid.c test/add_meta_lincom_invalid.c
+	test/add_raw_invalid.c test/nmeta_vectors_parent.c test/nmeta_parent.c
+	test/add_meta_phase_invalid.c test/add_invalid.c test/add_phase_invalid.c
+	test/add_string.c test/add_linterp_invalid.c test/add_bit_invalid.c
+	test/add_lincom_invalid.c test/add_meta_bit_invalid.c
+	test/add_multiply_invalid.c test/add_meta_multiply_invalid.c
+	test/add_spec_invalid.c test/nmeta_type_parent.c: Fix compiler warning.
+
+	* getdata.h.in: Add declarations for dirfile_add_string() and
+	dirfile_add_const().
+
+2008-10-12   D. V. Wiebe <getdata at ketiltrout.net>  svn:136
+	* src/add.c (_GD_Add): Prohibit declaring METAs in a fragment not containing
+	its parent.
+	* src/open.c (_GD_ParseDirective): Ditto.
+	* src/getdata.h.in: GD_FORMAT_AUTO is no longer needed.
+
+	* src/internal.h src/open.c: MAX_IN_COLS moved to header.
+	* src/add.c (dirfile_add_metaspec dirfile_add_spec): Added.
+
+	* src/internal.h: Store subdir (sname) in include list.
+	* src/close.c (_GD_FreeD): free sname.
+	* src/open.c (_GD_ParseRaw _GD_ParseFieldSpec _GD_ParseDirective): Derive
+	subdir and other relevant information from the include_list, where possible.
+
+	* src/open.c (_GD_Tokenise): Allow specification of the empty string as "".
+	* src/open.c (_GD_ValidateField): Prohibit reserved words and the empty
+	string.
+
+	* src/add.c (_GD_Add): Provide defaults for CONST and STRING; properly
+	enumerate types.
+
+	* src/add.c: Add GD_INVALID checks to all public functions.
+
+	* src/add.c (dirfile_add_metalincom dirfile_add_metalinterp
+	dirfile_add_metabit dirfile_add_metamultiply dirfile_add_metaphase): Put
+	parent parameter before field_code to mimic the field spec order.
+
+	* src/flush.c (_GD_FieldSpec _GD_FlushMeta): Properly handle META fields.
+
+	* src/getdata.h.in: dirfile_add_raw dirfile_add dirfile_add_spec
+	dirfile_add_metaspec may all potentially call I/O functions; ergo, don't
+	mark them with THROW.o
+
+	* test/Makefile.am: Re-organise tests.
+	* test/add_meta_linterp_invalid.c test/add_meta_lincom_invalid.c
+	test/vlist_invalid.c test/add_raw_invalid.c test/vlist_meta.c
+	test/cvlist_invalid.c test/svlist_invalid.c test/cvlist.c test/svlist.c
+	test/add_meta_phase_invalid.c test/add_invalid.c test/add_meta_phase.c
+	test/add_phase_invalid.c test/add_spec_directive.c test/add_string.c
+	test/clist_invalid.c test/add_linterp_invalid.c test/add_meta_multiply.c
+	test/slist_invalid.c test/clist.c test/cvlist_meta_invalid.c
+	test/flist_meta_invalid.c test/slist.c test/svlist_meta_invalid.c
+	test/cvlist_meta.c test/vlist_meta_invalid.c test/svlist_meta.c
+	test/parse_string_null.c test/add_meta_linterp.c test/add_meta_lincom.c
+	test/vlist.c test/add_bit_invalid.c test/add_lincom_invalid.c
+	test/add_meta_bit_invalid.c test/add_meta_bit.c test/add_multiply_invalid.c
+	test/add_const.c test/add_meta_multiply_invalid.c test/clist_meta_invalid.c
+	test/add_meta.c test/add_spec_invalid.c test/slist_meta_invalid.c
+	test/clist_meta.c test/add_spec.c test/slist_meta.c test/flist_meta.c: Added
+	tests for the list functions, add_spec, and add_meta.
+
+	* src/include.c (_GD_Include): Extracted include file handler from
+	_GD_ParseDirective in src/open.c.
+	* src/include.c (dirfile_include): Added.
+
+	* src/add.c (_GD_Add) src/getdata.c (_GD_DoRaw) src/include.c (_GD_Include)
+	src/nframes.c (get_nframes64) src/putdata.c (_GD_DoRawOut): Make encodings
+	fragment specific.
+	* src/flush.c (_GD_FlushMeta): Write /ENCODING.
+
+
+2008-10-11   D. V. Wiebe <getdata at ketiltrout.net>  svn:135
+	* src/open.c (_GD_Tokenise _GD_ParseDirective _GD_ParseFieldSpec
+	_GD_ParseFormatFile): Okay, the parser is now in three pieces: tokeniser,
+	directive parser (formerly _GD_ParseFormatLine), and field spec parser, all
+	called from _GD_ParseFormatFile, which handles looping through a format file. 
+	This should be sufficiently functional for the upcoming features.
+
+2008-10-11   D. V. Wiebe <getdata at ketiltrout.net>  svn:133
+	* src/open.c (_GD_Tokenise _GD_ParseFormatLine): Split tokeniser from line
+	parser.
+
+2008-10-10   D. V. Wiebe <getdata at ketiltrout.net>  svn:132
+	* src/open.c (_GD_ParseFormatFile _GD_ParseFormatLine dirfile_open):
+	Properly propagate standards.
+
+2008-10-10   D. V. Wiebe <getdata at ketiltrout.net>  svn:131
+	* src/open.c (_GD_ParseFieldSpec): Properly propagate have_first to caller.
+
+	* src/open.c (_GD_ParseFormatFile _GD_ParseFormatLine): Split line
+	parsing (now in _GD_ParseFormatLine) from the format file loop (the little
+	bit remaining in _GD_ParseFormatFile).
+
+	* bindings/cxx/test/Makefile.am: Properly clean up after tests.
+
+2008-10-10   D. V. Wiebe <getdata at ketiltrout.net>  svn:130
+	* src/getdata.h.in: Incorporate a GD_SCALAR_ENTRY flag in gd_entype_t.
+	* src/field_list.c (get_nvectors) src/meta_list.c (get_nmeta_vectors):
+	Use GD_SCALAR_ENTRY.
+
+	* src/add.c (_GD_Add): Properly initialise the meta field lists in the private
+	entry to prevent crash on error.  (Reported by Matthew Truch)
+
+	* src/raw.c (_GD_RawTouch): Add mode to open call (patch from Matthew
+	Truch).
+
+	* src/getdata.h.in: Add GD_E_DIMENSION
+	* src/getdata.c src/putdata.c src/spf.c: Detect and fail if a vector type
+	contains an input field that's a scalar.
+
+	* src/spf.c (_GD_GetSPF): Removed redundant field_code parameter.
+
+	* src/common.c (_GD_GetEntry): Removed FILEFRAM as an alias for INDEX per
+	discussion with Barth.
+
+2008-10-10   D. V. Wiebe <getdata at ketiltrout.net>  svn:128 svn:129
+	* src/entry.c (_GD_FreeE): Renamed from dirfile_free_entry_strings (for
+	which a new boilerplate function has been created).  Separated cleaning up
+	internal and externally created entries.  Internally, the library now
+	uses this function in all places where it used to call
+	dirfile_free_entry_strings.
+
+	* src/open.c (_GD_ParseRaw): n_meta should be zero.
+
+	* src/open.c (_GD_ParseFormatFile): fix duplicates check
+
+	* test/add_sort.c test/nfields_type.c test/nfields_type_invalid.c
+	test/nmeta.c test/nmeta_invalid.c test/nmeta_parent.c test/nmeta_type.c
+	test/nmeta_type_invalid.c test/nmeta_type_parent.c test/nmeta_vectors.c
+	test/nmeta_vectors_invalid.c test/nmeta_vectors_parent.c test/nvectors.c
+	test/nvectors_invalid.c test/parse_const.c test/parse_const_ncols.c
+	test/parse_duplicate.c test/parse_meta.c test/parse_meta_parent.c
+	test/parse_meta_raw.c test/parse_quote.c test/parse_sort.c
+	test/parse_string.c test/parse_string_ncols.c test/parse_whitespace.c:
+	Added.
+
+	* src/add.c (_GD_Add): Encapsulate the file creation with a call to an
+	encoding specific *touch() function.
+	* src/raw.c (_GD_RawTouch): Added.  (Also used for the ASCII encoding).
+
+	* src/meta_list.c: Added (META version of field_list.c)
+	* src/field_list.c: Call _GD_ClearError in all public functions.
+	* src/nmeta.c: Added (META version of nfields.c)
+
+	* src/open.c (_GD_ParseFieldSpec): Moved some repeated code out of the
+	ParseFoo functions and into this one.  Also, don't count META fields in
+	n_string or n_cost.
+
+2008-10-09   D. V. Wiebe <getdata at ketiltrout.net>  svn:127
+	* src/open.c (_GD_ValidateField): Now takes a pointer to the parent, rather
+	than the parent's name, and generates the "/" demarcation itself.
+
+	* src/open.c (_GD_ParseFormatFile): Determine META field's parent entry.
+	* src/open.c (_GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp _GD_ParseBit
+	_GD_ParsePhase _GD_ParseConst _GD_ParseString _GD_ParseFieldSpec): Pass
+	around the parent's pointer, rather than its name.
+
+	* src/add.c (_GD_Add) src/open.c (_GD_ParseRaw): Remember the full path name.
+	* src/getdata.c (_GD_DoRaw) src/nframes.c (_GD_NFrames) src/putdata.c
+	(_GD_DoRawOut): No need to compose file name.
+
+	* src/open.c (_GD_ParseFieldSpec): Simplify the switch() code.  Also, check
+	for duplicates.
+	* src/common.c (_GD_InsertSort): Added.
+
+	* src/open.c (_GD_ParseFormatFile): Automatically handle /u and /ooo out of
+	range.
+
+	* src/close.c (_GD_FreeD): Clean up include_list[0], too.
+
+	* src/close.c (dirfile_close): Call _GD_FlushMeta().
+
+2008-10-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:125
+	* src/open.c (_GD_ParseRaw): Prohibit META RAW fields.
+	* src/add.c (_GD_Add): Ditto.
+	* src/add.c (dirfile_add_metaraw): Deleted.
+
+2008-10-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:124
+	* src/open.c (_GD_ValidateField): Malloc one more byte for the terminating
+	NULL.  Crash report from Matthew Truch.
+	* test/add_many.c: Add test-case for same (from Matthew Truch).
+
+	* src/internal.h: Removed all instances of ierror and user_error in the
+	DIRFILE struct.
+
+	* src/add.c (_GD_Add): Properly compose metafield codes.  Always create
+	the empty binary file.
+
+2008-10-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:123
+	* src/add.c: Fix debugging messages
+
+2008-10-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:122
+	* man/Makefile.am: Fix install target (patch from Matthew Truch)
+
+2008-10-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:121
+	* src/getdata.h.in: Add forward declarations for public functions.
+
+2008-10-08   D. V. Wiebe <getdata at ketiltrout.net>  svn:120
+	* src/putdata.c (putdata64): Fail if passed a CONST or STRING field code.
+	* src/string.c (put_string): Added.
+	* src/constant.c (put_constant): Added.
+
+	* src/add.c (_GD_Add): Renamed from dirfile_add, which is now a boilerplate
+	stub for this internal function.  Added meta field support.
+	* src/add.c (dirfile_add_meta dirfile_add_metaraw dirfile_add_metalincom
+	dirfile_add_metalinterp dirfile_add_metabit dirfile_add_metamultiply
+	dirfile_add_metaphase dirfile_add_metastring dirfile_add_metaconst): Added.
+
+	* src/add.c (_GD_Add): create an empty raw file, when necessary.
+
+2008-10-07   D. V. Wiebe <getdata at ketiltrout.net>  svn:119
+	* src/add.c (dirfile_add_string dirfile_add_const): Added.
+	* man/dirfile_add_raw: Updated for dirfile_add_string and dirfile_add_const.
+
+2008-10-07   D. V. Wiebe <getdata at ketiltrout.net>  svn:118
+	* src/flush.c: Add hostname to comments at the top of the format file.
+
+	* src/nfields (get_nvectors get_nfields_by_type): Added.
+	* man/get_nvectors.3 man/get_nfields_by_type.3: Added.
+
+2008-10-07   D. V. Wiebe <getdata at ketiltrout.net>  svn:115
+	* src/open.c: Record whether a field is meta.
+
+	* src/open.c: Count strings, constants and meta fields.
+
+	* src/open.c (_GD_CreateDirfile): If creating (or truncating) a dirfile,
+	assume GD_UNENCODED if GD_AUTO_ENCODED was specified.
+
+	* src/putdata.c (_GD_DoRawOut): Set GD_E_UNKNOWN_ENCODING instead of
+	GD_UNSUPPORTED if the encoding can't be figured out.
+
+	* src/field_list.c (get_constant_values get_constant_list get_string_values
+	get_string_list get_vector_list): Added.
+	* src/field_list.c (get_field_list): Don't return meta fields in the list.
+	* src/nfields.c: Return the number of non-meta fields.
+
+	* src/constant.c: Renamed from src/get_constant.c
+	* src/string.c: Renamed from src/get_string.c
+
+	* src/getdata.c (_GD_DoString): If num_samp == 0 or data_out is NULL, don't
+	copy the string.
+
+	* src/errors.c (dirfile_user_error): Removed per discussion with Barth.
+
+	* man/get_constant.3 man/get_error.3 man/get_string.3: Added.
+
+2008-10-06   D. V. Wiebe <getdata at ketiltrout.net>  svn:114
+	* test/error_error.c: Added.
+
+	* test/flush_recurse.c: Removed. _GD_Flush no longer resolves input fields.
+
+	* src/common.c (_GD_GetEntry): Added a _GD_FindField wrapper that
+	properly handles INDEX/FILEFRAM.
+
+	* src/open.c (_GD_ValidateField): Add field prefix needed for META fields.
+	* src/open.c (_GD_ParseFieldSpec): Split from _GD_ParseFormatFile to handle
+	both META and regular field specs.
+	* src/open.c (_GD_ParseFormatFile): Add /META support.
+
+	* src/open.c (_GD_ParseFormatFile): Fix the parser bug introduced in svn:113.
+
+	* src/open.c (_GD_CreateDirfile): Report the dirfile path not the format
+	file path in error strings.
+
+	* src/flush.c src/getdata.c src/putdata.c src/spf.c: Use pre-cached entry
+	pointers.
+
+	* src/get_constant.c src/get_string.c: Added.
+	* src/getdata.c (getdata64): Prevent calling getdata() with CONST or STRING
+	fields.
+
+	* src/errors.c: Got rid of the positional parameter C99 desecration which
+	GCC 4.3 complains about.  get_error_string() now builds the string itself.
+
+	* src/format_list.c (get_format_filename): make the index parameter unsigned.
+
+2008-10-05   D. V. Wiebe <getdata at ketiltrout.net>  svn:113
+	* src/add.c src/close.c src/entry.c src/flush.c src/getdata.c src/getdata.h.in
+	src/open.c src/putdata.: Add support for CONST, STRING, and ENCODING.
+
+	* src/common.c src/open.c: Added escape sequence and quoted token support.
+
+	* src/flush.c src/getdata.c src/putdata.c src/spf.c: Functions that check
+	recurse_level now also take care of incrementing and decrementing it.
+
+	* man/dirfile-format.5: Update for standards version six.
+
+2008-10-02   D. V. Wiebe <getdata at ketiltrout.net>  svn:112
+	* configure.ac: Locate `slim' and `unslim' binaries needed for slimlib
+	tests.
+
+	* test/Makefile.am test/ascii_get.c test/ascii_nframes.c test/ascii_put.c
+	test/slim_get.c test/slim_nframes.c test/slim_put.c: Add tests for ASCII
+	and slimlib encodings. (slim_put is currently always skipped.)
+
+	* src/ascii.c: Bug fixes.
+
+2008-10-01   D. V. Wiebe <getdata at ketiltrout.net>  svn:111
+	* src/entry.c: Properly initialise the private data in the gd_entry_t
+	object returned.
+
+	* bindings/cxx/test/putdata.cpp: Fix constructor call.
+
+	* bindings/f77/make_parameters.c: Add encoding framework parameters.
+
+2008-10-01   D. V. Wiebe <getdata at ketiltrout.net>  svn:110
+	* src/internal.h: Moved config.h inclusion to internal.h
+
+	* src/open.c: Added "." to the list of prohibited field code characters.
+
+	* src/getdata.h.in, src/internal.h: Hide dirfile implementation from the
+	public.
+	* src/errors.c: Added get_error() and dirfile_user_error()
+
+	* src/getdata.c src/internal.h src/nframes.c src/open.c src/putdata.c
+	src/raw.c: Added encoding framework.
+
+	* src/getdata.c src/slim.c: Add slimlib encoding.
+
+	* src/ascii.c src/getdata.c: Add ASCII encoding.
+
+2008-09-28   D. V. Wiebe <getdata at ketiltrout.net>  svn:109
+	* bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h bindings/cxx/entry.cpp
+	bindings/cxx/entry.h test/Makefile.am test/addentry.cpp: Add C++ support
+	for dirfile_add(), dirfile_flush_metadata(), get_format_filename(), and
+	get_nformats().
+
+	* bindings/f77/fgetdata.c bindings/f77/fgetdata.h bindings/f77/getdata.f.in
+	bindings/f77/getdata.f90.in bindings/f77/make_parameters.c: Add F77 and F95
+	bindings for dirfile_add(), dirfile_flush_metadata(), get_format_filename(),
+	and get_nformats().
+
+	* src/add.c (dirfile_add_raw): swap spf and data_type to correspond to the
+	ordering in the format file.
+
+2008-09-28   D. V. Wiebe <getdata at ketiltrout.net>  svn:108
+	* man/dirfile_add.3 man/dirfile_add_raw.3: Added.
+	* man/Makefile.am: Install all the mans previously forgotten about.  Also,
+	link to aliases.
+
+	* src/add.c (dirfile_add_lincom): Don't use a variadic function, since in
+	obfuscates data typing.
+
+	* src/add.c (dirfile_add): Add suberror codes for GD_E_BAD_ENTRY.
+	Initialise internal data.  Initialise the first RAW field, if necessary.
+
+	* src/close.c src/flush.c src/open.c: Distinguish between "canonical"
+	format file names (i.e.  the full path used to open the file) and
+	"external" names (i.e. the relative path written to the parent format file).
+
+	* src/errors.c: Add strings for dirfile_add().
+
+	* src/getdata.h.in: Move FILENAME_MAX stuff into internal.h since it doesn't
+	need to be public anymore.
+	* src/internal.h: Always define MAX_LINE_LENGTH to 4096.
+
+	* test/Makefile.am test/add.c test/add_bit.c test/add_bit.c
+	test/add_bit_bitnum.c test/add_bit_bitsize.c test/add_bit_numbits.c
+	test/add_code.c test/add_duplicate.c test/add_format.c test/add_lincom.c
+	test/add_lincom_nfields.c test/add_linterp.c test/add_multiply.c
+	test/add_phase.c test/add_raw.c test/add_raw_spf.c test/add_raw_type.c
+	test/add_rdonly.c test/add_type.c test/error.c test/error_short.c
+	test/flush_meta.c test/format_filename.c test/format_filename_oor.c
+	test/nformats.c: Added tests for dirfile_add() and alternates,
+	get_error_string(), dirfile_flush_metadata(), get_format_filename(), and
+	get_nformats().
+
+	* test/Makefile.am: test put_linterp_noin, which has been around for a
+	while, but missing from the Makefile.
+	* test/trunc_readonly.c: Deleted.  (An old copy of trunc_rdonly.c)
+
+2008-09-27   D. V. Wiebe <getdata at ketiltrout.net>  svn:106
+	* src/flush.c (_GD_Flush): Don't call fsync on read-only dirfiles.
+
+	* src/open.c (_GD_ParseFormatFile dirfile_open): Don't find the first raw
+	field at the end, but rather do it as we're scanning raw fields.  Also,
+	record some format file metadata: whether it contains the first raw field,
+	and whether it is modified.
+
+	* src/close.c (_GD_FreeD): free the include_list.
+
+	* src/internal.h: Minimum format file line length is 4096 characters.
+
+	* src/flish.c (_GD_FlushMeta dirfile_flush_metadata): flush metadata changes
+	to disk (i.e. write format files).  Includes public function.
+
+	* src/add.c (dirfile_add): prevent adding to read-only dirfiles
+
+2008-09-26   D. V. Wiebe <getdata at ketiltrout.net>  svn:105
+	* man/get_entry.3 src/add.c src/getdata.h.in src/open.c: Expose include_list
+	to the public.  Add include index to each entry.
+
+	* man/get_format_filename.3 man/get_nformats.3 src/format_list.c
+	src/getdata.h.in: Add public functions get_nformats() and
+	get_format_filename().
+
+2008-09-25   D. V. Wiebe <getdata at ketiltrout.net>  svn:103
+	* src/open.c (_GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp
+	_GD_ParseMultiply _GD_ParseBit _GD_ParsePhase): Fixed memory leaks
+
+	* src/errors.c (_GD_ClearError): Replaced with a macro of the same name
+	defined in internal.h.
+
+	* src/add.c src/getdata.h.in: First part of dirfile_add(): input validation
+	and add to DIRFILE list.
+
+2008-09-22   D. V. Wiebe <getdata at ketiltrout.net>  svn:99
+	GetData-0.3.1 released.
+
+2008-09-22   D. V. Wiebe <getdata at ketiltrout.net>  svn:97
+	* configure.ac bindings/cxx/Makefile.am bindings/cxx/test/Makefile.am: Call
+	the C++ bindings libgetdata++ instead of libdirfile to be a little more
+	explicit about what it is.  This also allows installation alongside TK's
+	libdirfile.
+
+2008-09-22   D. V. Wiebe <getdata at ketiltrout.net>  svn:94
+	* bindings/cxx/entry.cpp: Use <cstring> instead of <string>.  Patch from
+	Matthew Truch.
+
+2008-09-18   D. V. Wiebe <getdata at ketiltrout.net>  svn:90
+	* src/legacy.c (_GD_GetDirfile) test/legacy_get_rofs.c test/legacy_get_put.c:
+	Open dirfiles read-only unless called via PutData().  Re-open read-only
+	dirfile read-write when necessary.  Added two test-cases for same.
+
+	* test/Makefile.am: Conditionally compile legacy tests.
+
+2008-09-15   D. V. Wiebe <getdata at ketiltrout.net>  svn:86
+	* src/errors.c: Fix GD_E_RAW_IO error string.
+
+2008-09-15   D. V. Wiebe <getdata at ketiltrout.net>  svn:84
+	GetData-0.3.0 released.
+
+2008-09-05   D. V. Wiebe <getdata at ketiltrout.net>  svn:77
+	* m4/c99.m4 configure.ac Makefile.am: Re-implement AC_PROG_CC_C99 as
+	GD_PROG_CC_C99 to fix `deprecated -c99' warning with icc.
+
+	* bindings/cxx/dirfile.h bindings/cxx/entry.h bindings/cxx/test/getdata.cpp
+	bindings/cxx/test/putdata.cpp bindings/f77/fgetdata.h
+	test/convert_float32_float64.c test/convert_float32_int16.c
+	test/convert_float32_int32.c test/convert_float32_int64.c
+	test/convert_float32_int8.c test/convert_float32_uint16.c
+	test/convert_float32_uint32.c test/convert_float32_uint64.c
+	test/convert_float32_uint8.c test/convert_float64_float32.c
+	test/convert_int16_float32.c test/convert_int16_float64.c
+	test/convert_int16_int32.c test/convert_int16_int64.c
+	test/convert_int16_int8.c test/convert_int16_uint16.c
+	test/convert_int16_uint32.c test/convert_int16_uint64.c
+	test/convert_int16_uint8.c test/convert_int32_float32.c
+	test/convert_int32_float64.c test/convert_int64_float32.c
+	test/convert_int64_float64.c test/convert_int8_float32.c
+	test/convert_int8_float64.c test/convert_int8_int16.c
+	test/convert_int8_int32.c test/convert_int8_int64.c
+	test/convert_int8_uint16.c test/convert_int8_uint32.c
+	test/convert_int8_uint64.c test/convert_int8_uint8.c
+	test/convert_uint16_float32.c test/convert_uint16_float64.c
+	test/convert_uint16_int16.c test/convert_uint16_int32.c
+	test/convert_uint16_int64.c test/convert_uint16_int8.c
+	test/convert_uint16_uint32.c test/convert_uint16_uint64.c
+	test/convert_uint16_uint8.c test/convert_uint32_float32.c
+	test/convert_uint32_float64.c test/convert_uint64_float32.c
+	test/convert_uint64_float64.c test/convert_uint8_float32.c
+	test/convert_uint8_float64.c test/convert_uint8_int16.c
+	test/convert_uint8_int32.c test/convert_uint8_int64.c
+	test/convert_uint8_int8.c test/convert_uint8_uint16.c
+	test/convert_uint8_uint32.c test/convert_uint8_uint64.c test/dfes_phase.c
+	test/dfes_raw.c test/flush.c test/flush_all.c test/get64.c test/get_bit.c
+	test/get_char.c test/get_endian16.c test/get_endian32.c test/get_endian64.c
+	test/get_endian8.c test/get_endian_float32.c test/get_endian_float64.c
+	test/get_ff.c test/get_float32.c test/get_float64.c test/get_foffs.c
+	test/get_fs.c test/get_int16.c test/get_int8.c test/get_lincom1.c
+	test/get_lincom2.c test/get_lincom3.c test/get_linterp.c
+	test/get_linterp_noin.c test/get_linterp_notab.c test/get_multiply.c
+	test/get_multiply_noin.c test/get_nonexistent.c test/get_null.c
+	test/get_off64.c test/get_phase.c test/get_sf.c test/get_ss.c
+	test/get_type.c test/get_uint16.c test/legacy_get.c test/legacy_put.c
+	test/nframes_spf.c test/put64.c test/put_bit.c test/put_char.c
+	test/put_endian16.c test/put_endian32.c test/put_endian64.c
+	test/put_endian8.c test/put_endian_float32.c test/put_endian_float64.c
+	test/put_ff.c test/put_float32.c test/put_float64.c test/put_foffs.c
+	test/put_fs.c test/put_int16.c test/put_int8.c test/put_lincom1.c
+	test/put_lincom2.c test/put_lincom_noin.c test/put_linterp.c
+	test/put_linterp_noin.c test/put_linterp_notab.c test/put_multiply.c
+	test/put_off64.c test/put_phase.c test/put_phase_noin.c test/put_sf.c
+	test/put_ss.c test/put_uint16.c: Fix compiler warnings
+
+2008-09-05   D. V. Wiebe <getdata at ketiltrout.net>  svn:75
+	* man/get_field_list.3 src/field_list.c: NULL terminate the list.
+
+	* src/field_list.c (get_field_list): Return GD_E_ALLOC on malloc error.
+
+2008-09-04   D. V. Wiebe <getdata at ketiltrout.net>  svn:73
+	* bindings/cxx/entry.h (Entry::Scale Entry::Offset): fix return.
+
+	* src/flush.c (_GD_Flush): Handle GD_NO_ENTRY in switch
+
+	* test/dfes_bit.c test/dfes_linterp test/dfes_lincom test/dfes_multiply
+	test/dfes_phase test/dfes_raw test/flist test/flush_invalid
+	test/flush_bad_code test/flush_recurse: Remove unused variables
+	* test/entry_lincom: Include math.h
+
+2008-09-04   D. V. Wiebe <getdata at ketiltrout.net>  svn:68
+	* src/getdata_legacy.h src/legacy.c: Go through all the bother to
+	reconstruct the former FormatType for callers who use GetFormat()
+
+	* src/close.c (_GD_FreeD): Handle GD_NO_ENTRY in switch
+
+	* configure.ac: Use modern AM_INIT_AUTOMAKE invocation so as not to have
+	to repeat package name and package version.
+	* Makefile.am: Require automake 1.6
+
+	* NEWS: added
+
+2008-09-04   D. V. Wiebe <getdata at ketiltrout.net>  svn:67
+	* bindings/cxx/Makefile.am: Fix include dir
+
+	* bindings/f77/fgetdata.c (GDFELC): Return nfield = 0 on error
+
+	* bindings/f77/getdata.f90.in: Make field an array
+
+	* Makefile.am: Add ChangeLog to dist.
+
+	* README.cxx README.f77 README.f95: Update for get_entry() bindings
+
+2008-09-04   D. V. Wiebe <getdata at ketiltrout.net>  svn:66
+	* test/Makefile.am test/dfes_bit.c test/dfes_lincom.c test/dfes_linterp.c
+	test/dfes_multiply.c test/dfes_null.c test/dfes_phase.c test/dfes_raw.c
+	test/dfes_zero.c test/entry_bad_code.c test/entry_bit.c test/entry_invalid.c
+	test/entry_lincom.c test/entry_linterp.c test/entry_multiply.c
+	test/entry_phase.c test/entry_raw.c: Add test suite for
+	dirfile_free_entry_strings() and get_entry()
+
+	* bindings/cxx/entry.h bindings/cxx/test/entry.cpp bindings/f77/fgetdata.c
+	bindings/f77/getdata.f90.in bindings/f77/test/fget_entry.f90 man/get_entry.3
+	src/entry.c src/getdata.h.in: RAW filename should be internal
+
+	* bindings/f77/make_parameters.c: Fix parentheses around F77 parameters
+
+	* man/Makefile.am: install get_entry.3
+
+2008-09-03   D. V. Wiebe <getdata at ketiltrout.net>  svn:64 svn:65
+	* src/entry.c (dirfile_free_entry_strings): Fix double free
+
+	* bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h: Use the GetData namespace
+
+	* bindings/cxx/Makefile.am bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h
+	bindings/cxx/entry.cpp bindings/cxx/entry.h bindings/cxx/test/Makefile.am
+	bindings/cxx/test/entry.cpp: Add GetData::Entry class to abstractise
+	gd_entry_t as well as C++ bindings for get_entry().
+
+	* bindings/f77/fgetdata.c bindings/f77/getdata.f.in
+	bindings/f77/getdata.f90.in bindings/f77/make_parameters.c
+	bindings/f77/test/fget_entry.f90: Add Fortran bindings for get_entry()
+
+2008-09-03   D. V. Wiebe <getdata at ketiltrout.net>  svn:63
+	* src/getdata.h.in: add a GD_NO_ENTRY entry type
+
+	* man/dirfile_free_entry_strings man/get_entry.3 src/entry.c src/getdata.h.in:
+	add dirfile_free_entry_strings()
+
+2008-09-02   D. V. Wiebe <getdata at ketiltrout.net>  svn:62
+	*	bindings/f77/test/Makefile.am: fix include directory
+
+	* src/getdata.h.in src/close.c src/common.c src/getdata.c src/nframes.c
+	src/open.c src/putdata.c src/spf.c: re-organised gd_entry_t again
+
+	* src/getdata.c (_GD_DoLincom): ensure we return 0 on error
+
+	* src/close.c (dirfile_close): return -1 instead of 1 on error
+
+	* src/entry.c (get_entry): instead of returning the library's internal
+	gd_entry_t, copy the relevant bits to a caller supplied object.  This should
+	be significantly more bullet proof against unintentional metadata corruption
+	* man/get_entry.3: update
+
+	* test/Makefile.am: clean up after tests
+
+2009-09-02  D. V. Wiebe <getdata at ketiltrout.net>  svn:61
+	* man/get_entry.3 src/Makefile.am src/entry.c src/getdata.h.in: added
+	get_entry()
+
+	* src/close.c src/flush.c: Split flush.c from close.c
+
+	* src/field_list.c src/nfields.c: Split nfields.c from field_list.c
+
+	* src/common.c src/open.c: Moved _GD_GetLine to common.c
+
+	* src/Makefile.am: Don't export internal symbols
+
+2009-09-02  D. V. Wiebe <getdata at ketiltrout.net>  svn:60
+	* README src/getdata.h.in: Add NO_GETDATA_LEGACY_API to getdata.h to permit
+	callers to not include the legacy API.
+
+2009-09-02  D. V. Wiebe <getdata at ketiltrout.net>  svn:59
+	* configure.ac: disable all Fortran bindings with one option.  Rename
+	the bindings options.
+
+2008-09-01  D. V. Wiebe <getdata at ketiltrout.net>  svn:58
+	* src/getdata_legacy.c src/legacy.c: Re-implement GetFormat();
+
+	* src/getdata.h.in: store frame offset as off64_t
+
+	* man/dirfile_flush.3: added
+
+	* man/dirfile_close.3: corrected for changes made in revision 57
+
+2008-09-01  D. V. Wiebe <getdata at ketiltrout.net>  svn:57
+	* man/get_error_string.3 src/errors.c: Renamed getdata_error_string to
+	get_error_string so people don't think its relevance is exclusive to getdata()
+
+	* src/internal.h: Suberror codes may not = 0.
+
+	* README.cxx README.f77 README.f95 bindings/cxx/dirfile.cpp
+	bindings/cxx/dirfile.h bindings/f77/fgetdata.c bindings/f77/getdata.f.in
+	bindings/f77/getdata.f90.in man/Makefile.am man/dirfile_close.3 src/close.c
+	src/getdata.h.in test/Makefile.am test/close.c test/close_bad.c
+	test/close_null.c test/flush.c test/flush_all.c test/flush_bad_code.c
+	test/flush_invalid.c test/flush_recurse.c: Added public function
+	dirfile_flush() along with corresponding C++, F77 and F95 bindings.
+	dirfile_close calls dirfile_flush and might now fail (if fsync(2) or
+	close(2) returns with an error); ergo, it now returns an integer success
+	value, since D->error can't be checked if the call was successful.
+
+	* src/close.c (dirfile_close): per the man page, now always succeeds when
+	passed NULL.
+
+	* man/dirfile-format.5 src/open.c test/Makefile.am test/parse_endian_slash.c
+	test/parse_foffs_slash.c test/parse_include_slash.c
+	test/parse_version_slash.c: reserved words in the format file may now have
+	an initial '/' to ensure they're treated as such.
+
+	* man/dirfile-format.5 src/errors.c src/open.c test/Makefile.am
+	test/parse_name.c: prohibit / \ < > # & | ; in field names. Of these, /
+	would confuse the filesystem (and is now used to optionally demarcate reserved
+	words), # is already cast out by GetLine().  We reserve the others for future
+	use.  Most of these are bash(1) metacharacters; ( and ) are the other
+	non-whitespace metacharacters in bash, but GetData allows them in field names.
+
+2008-09-01  D. V. Wiebe <getdata at ketiltrout.net>  svn:56
+	* src/open.c src/close.c: split up dirfile_open.c
+	* src/getdata.c src/types.c src/common.c: split up getdata.c
+
+2008-08-30  D. V. Wiebe <getdata at ketiltrout.net>  svn:54
+	* field_list.c: renamed get_n_fields() to get_nfields()
+	* nframes.c: renamed get_n_frames() to get_nframes()
+	* spf.c: renamed get_samples_per_frame() to get_spf()
+
+2008-08-30  D. V. Wiebe <getdata at ketiltrout.net>  svn:52 svn:53
+	* bindings/f77/Makefile.am bindings/f77/getdata.f90.in
+	bindings/f77/test/Makefile.am bindings/f77/test/fget_field_list.f90
+	bindings/f77/test/fgetdata.f90: Use .f90 instead of .f95 for free-form
+	Fortran source code
+
+2008-08-29  D. V. Wiebe <getdata at ketiltrout.net>  svn:51
+	* man/README.cxx man/README.f77 bindings/cxx/dirfile.cpp
+	bindings/cxx/dirfile.h bindings/f77/fgetdata.c bindings/f77/getdata.f: added
+	get_n_fields and get_field_list to C++ and F77 bindings.
+
+	* bindings/f77/Makefile.am bindings/f77/getdata.f.in
+	bindings/f77/make_parameters.c : automatically generate parameters
+
+	* README.f95 bindings/f77/Makefile.am bindings/f77/getdata.f95.in
+	bindings/f77/test/Makefile.am bindings/f77/test/fget_field_list.f95
+	bindings/f77/test/fgetdata.f95 configure.ac: Added Fortran 95 bindings
+
+2008-08-29  D. V. Wiebe <getdata at ketiltrout.net>  svn:50
+	* man/dirfile-format.5: Fix a rather egregious omission
+
+2008-08-29  D. V. Wiebe <getdata at ketiltrout.net>  svn:49
+	* src/getdata.h.in: Change GD_UNKNOWN
+
+2008-08-26  D. V. Wiebe <getdata at ketiltrout.net>  svn:47 svn:48
+	* man/Makefile.am man/get_field_list.3 man/get_n_fields.3 src/Makefile.am
+	src/dirfile_open.c src/field_list.c src/getdata.h.in test/Makefile.am
+	test/flist.c test/flist_invalid.c test/nfields.c test/nfields_invalid.c: Add
+	get_n_fields and get_field_list functions
+
+	* man/dirfile_open.3: Add BUGS section
+
+2008-08-25  D. V. Wiebe <getdata at ketiltrout.net>  svn:45
+	* configure.ac src/Makefile.am src/debug.c src/dirfile_open.c src/errors.c
+	src/getdata.c src/internal.h src/nframes.c src/putdata.c src/spf.c: tracing
+	in debug mode
+
+2008-08-25  D. V. Wiebe <getdata at ketiltrout.net>  svn:41 svn:42 svn:43 svn:44
+	* src/getdata_internal.h: renamed to internal.h
+
+	* README.cxx README.f77: add
+
+2008-08-25  D. V. Wiebe <getdata at ketiltrout.net>  svn:40
+	* src/errors.c (getdata_error_string): Rewrote to get rid of the nested
+	switches and to collect the strings.
+
+	* src/errors.c src/getdata.h.in src/getdata_legacy.h src/legacy.c: Move
+	GD_ERROR_CODES to legacy.c and deprecate.
+
+	* src/dirfile_open.c src/getdata.c src/nframes.c src/putdata.c: Cleaned up
+	error reporting code
+
+2008-08-25  D. V. Wiebe <getdata at ketiltrout.net>  svn:38
+	* src/dirfile_open.c src/getdata.c src/getdata.h.in src/getdata_internal.h
+	nframes.c putdata.c spf.c: Replace the various different EntryType structs
+	with a single, unified one.  This also gets rid of the ENTRY() craziness.
+
+2008-08-25  D. V. Wiebe <getdata at ketiltrout.net>  svn:36 svn:37
+	* src/getdata.c src/getdata_internal.h src/putdata.c src/spf.c: Add
+	_GD_InternalError()
+
+	* src/errors.c: Rename _GD_SetGetDataError and _GD_ClearGetDataError to
+	_GD_SetError and _GD_ClearError
+
+2008-08-25  D. V. Wiebe <getdata at ketiltrout.net>  svn:35
+	* bindings/f77/fgetdata.c (_GDF_ClearDirfile): Don't accidentally close
+	dirfile unit zero
+
+2008-08-21  D. V. Wiebe <getdata at ketiltrout.net>  svn:34
+	* bindings/f77/fgetdata.c configure.ac src/dirfile_open.c src/getdata.c
+	src/getdata.h.in src/getdata_internal.h src/getdata_legacy.h src/putdata.c:
+	Fixes for compilation with icc, mostly concerning type casting.
+
+	* configure.ac:  AC_PREREQ([2.60])
+
+	* Makefile.am: don't include getdata.h in the tarball
+
+2008-08-21  D. V. Wiebe <getdata at ketiltrout.net>  svn:33
+	* src/getdata.h.in: Be less clever defining stuff.
+
+2008-08-20  D. V. Wiebe <getdata at ketiltrout.net>  svn:32
+	* bindings/f77/getdata.f: Add EXTERNAL function declarations
+
+2008-08-19  D. V. Wiebe <getdata at ketiltrout.net>  svn:30
+	* bindings/f77/test/gdfget.f: Remove references to TRIM
+
+2008-08-19  D. V. Wiebe <getdata at ketiltrout.net>  svn:26 svn:27
+	* README: add
+
+	* Makefile.am: Remove explicit -lm
+
+2008-08-19  D. V. Wiebe <getdata at ketiltrout.net>  svn:25
+	* test/: Fix test suite for VPATH builds
+
+2008-08-18  D. V. Wiebe <getdata at ketiltrout.net>  svn:24
+	* Makefile.am configure.ac bindings/: Add C++ and Fortran 77 bindings.
+
+2008-08-17  D. V. Wiebe <getdata at ketiltrout.net>  svn:20 svn:21
+	* configure.ac getdata.h.in: Use AC_CONFIG_HEADERS with getdata.h
+
+	* INSTALL: This is the generic autoconf/libtool INSTALL document.
+
+2008-08-17  D. V. Wiebe <getdata at ketiltrout.net>  svn:19
+	* Makefile.am configure.ac bin/Makefile.am bin/checkdirfile.c: add
+	checkdirfile util
+
+2008-08-17  D. V. Wiebe <getdata at ketiltrout.net>  svn:18
+	* getdata_internal.h: If FILENAME_MAX is unreasonably small, still permit
+	roomy format file lines.
+
+2008-08-17  D. V. Wiebe <getdata at ketiltrout.net>  svn:16
+	* Makefile.am test/: added test suite
+
+	* man/get_n_frames64.3 man/getdata64.3 man/putdata.3 man/putdata64.3: added
+
+	* man/getdata.3: Added .SH LIMITATIONS
+
+	* src/dirfile_open.c src/errors.c src/getdata.c src/nframes.c src/spf.c:
+	split getdata.c into smaller pieces
+
+	* src/putdata.c (putdata): add support for access mode and frame offset
+
+2008-08-12  D. V. Wiebe <getdata at ketiltrout.net>  svn:13
+	* src/getdata.c src/getdata.h.in: rm unused error codes
+
+2008-08-12  D. V. Wiebe <getdata at ketiltrout.net>  svn:10 svn:11 svn:12
+	* configure.ac man/getdata.3 man/get_n_frames.3 src/getdata.c
+	src/getdata.h.in src/getdata_internal.h src/legacy.c src/putdata.c: LFS
+	support
+
+2008-08-12  D. V. Wiebe <getdata at ketiltrout.net>  svn:8
+	* src/getdata.c src/getdata.h.in: remove GD_E_ENDIAN_ERROR
+
+	* src/putdata.c (_GD_DoBitOut): Multibit putdata
+
+2008-08-12  D. V. Wiebe <getdata at ketiltrout.net>  svn:7
+	* man/dirfile_open.3: modern symbol
+
+2008-08-12  D. V. Wiebe <getdata at ketiltrout.net>  svn:6
+	* src/getdata.c (_GD_SetGetDataError): don't crash on NULL
+
+	* src/putdata.c (_GD_DoPhaseOut): add
+
+2008-08-12  D. V. Wiebe <getdata at ketiltrout.net>  svn:5
+	* src/legacy.c: Don't SEGV on bad dirfiles
+	* src/getdata.c src/getdata_internal.h src/putdata.c: Check for invalid
+	DIRFILEs
+
+2008-08-12  D. V. Wiebe <getdata at ketiltrout.net>  svn:4
+	* configure.ac: --enable-debug
+	* src/getdata.c src/legacy.c src/putdata.c: rename DIRFILE_DEBUG to
+	GETDATA_DEBUG
+
+2008-08-12  D. V. Wiebe <getdata at ketiltrout.net>  svn:2
+	* AUTHORS COPYING Makefile.am configure.ac man/Makefile.am
+	man/dirfile-format.5 man/dirfile.5 man/dirfile_close.3 man/dirfile_open.3
+	get_n_frames.3 man/get_samples_per_frame.3 man/getdata.3
+	man/getdata_error_string.3 src/Makefile.am src/getdata.c src/getdata.h.in
+	src/getdata_internal.h src/getdata_legacy.h src/legacy.c src/putdata.c:
+	Initial import of getdata for sourceforge.net.  Previous history for getdata
+	can be found in the KDE subversion repository, for the kst project.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..b2899ce
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,238 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'. 
+
+To create the configure script, and the rest of the build environment 
+which are not part of a plain checkout from sourceforge, execute:
+  autoreconf -vifs 
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..02365e7
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,176 @@
+# Copyright (C) 2008, 2011, 2014 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign dist-bzip2 check-news 1.13
+
+EXTRA_DIST = ChangeLog
+
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = src . test bindings util man doc
+
+dist_doc_DATA = COPYING.DOC
+
+clean-local:
+	if [ -e $(distdir) ]; then chmod -R u+w $(distdir); fi
+	if [ -e idl_$(distdir) ]; then chmod -R u+w idl_$(distdir); fi
+	if [ -e matlab_$(distdir) ]; then chmod -R u+w matlab_$(distdir); fi
+	rm -rf *~  m4/*~ README.txt $(distdir) idl_$(distdir) matlab_$(distdir)
+
+%.sig: %
+	gpg --use-agent -abo $@ $<
+
+DISTCHECK_CONFIGURE_FLAGS = --with-idl-dlm-dir="$$dc_install_base/idl" \
+														--with-perl-dir="$$dc_install_base/perl" \
+														--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:
+	tar -zxvf $(distdir).tar.gz
+	cd $(distdir) && \
+		mkdir _inst && \
+		./configure --disable-bindings --prefix=`pwd`/_inst && \
+		${MAKE} && \
+		${MAKE} install
+
+# matlab-only package
+matlabdist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig
+	rm -rf svn_export
+	svn export $(top_srcdir) svn_export
+	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
+	( cd svn_export && \
+		mkdir matlab_getdata && \
+		mkdir matlab_getdata/m4 && \
+		mkdir matlab_getdata/src && \
+		cp bindings/matlab/package/* matlab_getdata && \
+		cp -r bindings/matlab/Makefile.am bindings/matlab/gd_*.[cm] \
+		bindings/matlab/matlab.c bindings/matlab/gd_matlab.h bindings/matlab/test \
+		bindings/matlab/doc.tail bindings/matlab/Contents.m.head \
+		bindings/matlab/make_contents.sh.in \
+		matlab_getdata/src && \
+		cp -r bindings/make_parameters.c matlab_getdata && \
+		cp -r m4/matlab.m4 m4/compiler.m4 m4/version.m4 matlab_getdata/m4 && \
+		cp -r doc/README.matlab COPYING AUTHORS ChangeLog INSTALL NEWS \
+		matlab_getdata && \
+		( cd matlab_getdata && \
+		aclocal -I m4 && \
+		libtoolize && \
+		autoconf && \
+		autoheader && \
+		automake --add-missing --force-missing && \
+		./configure && \
+		${MAKE} dist && \
+		cp matlab_${distdir}* ../.. \
+		) )
+	rm -rf svn_export
+
+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
+	tar -zxvf $<
+	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
+	${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \
+	cd matlab_$(distdir) && ./configure && make dist && make distcheck
+	rm -rf matlab_$(distdir)
+	rm -rf $(distdir)
+
+# idl-only package
+idldist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig
+	rm -rf svn_export
+	svn export $(top_srcdir) svn_export
+	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
+	( cd svn_export && \
+		mkdir idl_getdata && \
+		mkdir idl_getdata/m4 && \
+		mkdir idl_getdata/src && \
+		cp bindings/idl/package/* idl_getdata && \
+		cp -r bindings/idl/Makefile.am bindings/idl/makedlm.sh.in \
+		bindings/idl/getdata.c bindings/idl/test idl_getdata/src && \
+		cp -r bindings/make_parameters.c idl_getdata && \
+		cp -r m4/idl.m4 m4/compiler.m4 m4/ax_compare_version.m4 m4/version.m4 \
+		idl_getdata/m4 && \
+		cp -r doc/README.idl COPYING AUTHORS ChangeLog INSTALL NEWS idl_getdata && \
+		( cd idl_getdata && \
+		aclocal -I m4 && \
+		libtoolize && \
+		autoconf && \
+		autoheader && \
+		automake --add-missing --force-missing && \
+		./configure && \
+		make dist && \
+		cp idl_${distdir}* ../.. \
+		) )
+	rm -rf svn_export
+
+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
+	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
+	${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \
+	cd idl_$(distdir) && ./configure && make dist && make distcheck
+	rm -rf idl_$(distdir)
+	rm -rf $(distdir)
+
+# windows source package
+windist: $(DISTFILES)
+	rm -rf crlf_export
+	cd man && $(MAKE) htmlman
+	svn --native-eol CRLF export $(top_srcdir) crlf_export
+	( cd crlf_export && \
+		mkdir $(distdir) && \
+		mkdir $(distdir)/bindings && \
+		mkdir $(distdir)/doc && \
+		mkdir $(distdir)/man && \
+		cp ../man/*[35].html $(distdir)/man && \
+		cp -r bindings/cxx $(distdir)/bindings && \
+		cp -r cmake util src test $(distdir) && \
+		$(SED) cmake/CMakeLists.txt \
+		-e 's/-DPACKAGE_VERSION=\\".*\\"/-DPACKAGE_VERSION=\\"$(PACKAGE_VERSION)\\"/' \
+		> $(distdir)/cmake/CMakeLists.txt && \
+		cp -r doc/README.cxx doc/unclean_database_recovery.txt $(distdir)/doc && \
+		cp AUTHORS COPYING COPYING.DOC ChangeLog NEWS TODO $(distdir) && \
+		cp README.win $(distdir)/README && \
+		rm -f $(distdir)/*/Makefile.am $(distdir)/*/*/Makefile.am && \
+		zip -rq getdata_win-$(PACKAGE_VERSION).zip $(distdir) && \
+		cp getdata_win*.zip .. \
+	)
+	rm -rf crlf_export
+
+# 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
+SIGS=$(addsuffix .sig,$(PACKAGES))
+
+# release stuff
+README.txt: NEWS RELEASE_NOTES.in
+	cp -f RELEASE_NOTES.in $@ 
+	head -n `grep -nm 1 '^|' NEWS | awk 'BEGIN {FS=":"} {print $$1-1}'` NEWS >> $@
+
+dist-post: $(SIGS)
+
+dist-push: $(PACKAGES) $(SIGS) README.txt
+	@if [ -z "${SFUSER}" ]; then echo "ERROR: SFUSER unset"; false; fi
+	rsync -avP -e ssh $^ $(SFUSER)@frs.sourceforge.net:/home/frs/project/g/ge/getdata/getdata/$(PACKAGE_VERSION)/
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..24d821a
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,1111 @@
+# 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 = .
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) $(dist_doc_DATA) \
+	AUTHORS COPYING COPYING.DOC ChangeLog INSTALL NEWS README TODO \
+	compile config.guess config.sub depcomp install-sh missing \
+	ltmain.sh
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ 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 =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(docdir)"
+DATA = $(dist_doc_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+GZIP_ENV = --best
+DIST_TARGETS = dist-bzip2 dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008, 2011, 2014 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign dist-bzip2 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" \
+														--with-perl-dir="$$dc_install_base/perl" \
+														--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
+
+SIGS = $(addsuffix .sig,$(PACKAGES))
+all: all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool config.lt
+install-dist_docDATA: $(dist_doc_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
+	done
+
+uninstall-dist_docDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+	-rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(DISTFILES)
+	@case `sed 15q $(srcdir)/NEWS` in \
+	*"$(VERSION)"*) : ;; \
+	*) \
+	  echo "NEWS not updated; not releasing" 1>&2; \
+	  exit 1;; \
+	esac
+	$(am__remove_distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__post_remove_distdir)
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__post_remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__post_remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__post_remove_distdir)
+
+dist-tarZ: distdir
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__post_remove_distdir)
+
+dist-shar: distdir
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__post_remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__post_remove_distdir)
+
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir)
+	chmod u+w $(distdir)
+	mkdir $(distdir)/_build $(distdir)/_inst
+	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
+	  && ../configure \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	    --srcdir=.. --prefix="$$dc_install_base" \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__post_remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(docdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-dist_docDATA
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-dist_docDATA
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+	am--refresh check check-am clean clean-cscope clean-generic \
+	clean-libtool clean-local cscope cscopelist-am ctags ctags-am \
+	dist dist-all dist-bzip2 dist-gzip dist-lzip dist-shar \
+	dist-tarZ dist-xz dist-zip distcheck distclean \
+	distclean-generic distclean-libtool distclean-tags \
+	distcleancheck distdir distuninstallcheck dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dist_docDATA install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-dist_docDATA
+
+
+clean-local:
+	if [ -e $(distdir) ]; then chmod -R u+w $(distdir); fi
+	if [ -e idl_$(distdir) ]; then chmod -R u+w idl_$(distdir); fi
+	if [ -e matlab_$(distdir) ]; then chmod -R u+w matlab_$(distdir); fi
+	rm -rf *~  m4/*~ README.txt $(distdir) idl_$(distdir) matlab_$(distdir)
+
+%.sig: %
+	gpg --use-agent -abo $@ $<
+
+# a locally-installed library for building and testing the IDL and matlab packages
+$(distdir)/_inst/lib/pkgconfig:
+	tar -zxvf $(distdir).tar.gz
+	cd $(distdir) && \
+		mkdir _inst && \
+		./configure --disable-bindings --prefix=`pwd`/_inst && \
+		${MAKE} && \
+		${MAKE} install
+
+# matlab-only package
+matlabdist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig
+	rm -rf svn_export
+	svn export $(top_srcdir) svn_export
+	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
+	( cd svn_export && \
+		mkdir matlab_getdata && \
+		mkdir matlab_getdata/m4 && \
+		mkdir matlab_getdata/src && \
+		cp bindings/matlab/package/* matlab_getdata && \
+		cp -r bindings/matlab/Makefile.am bindings/matlab/gd_*.[cm] \
+		bindings/matlab/matlab.c bindings/matlab/gd_matlab.h bindings/matlab/test \
+		bindings/matlab/doc.tail bindings/matlab/Contents.m.head \
+		bindings/matlab/make_contents.sh.in \
+		matlab_getdata/src && \
+		cp -r bindings/make_parameters.c matlab_getdata && \
+		cp -r m4/matlab.m4 m4/compiler.m4 m4/version.m4 matlab_getdata/m4 && \
+		cp -r doc/README.matlab COPYING AUTHORS ChangeLog INSTALL NEWS \
+		matlab_getdata && \
+		( cd matlab_getdata && \
+		aclocal -I m4 && \
+		libtoolize && \
+		autoconf && \
+		autoheader && \
+		automake --add-missing --force-missing && \
+		./configure && \
+		${MAKE} dist && \
+		cp matlab_${distdir}* ../.. \
+		) )
+	rm -rf svn_export
+
+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
+	tar -zxvf $<
+	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
+	${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \
+	cd matlab_$(distdir) && ./configure && make dist && make distcheck
+	rm -rf matlab_$(distdir)
+	rm -rf $(distdir)
+
+# idl-only package
+idldist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig
+	rm -rf svn_export
+	svn export $(top_srcdir) svn_export
+	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
+	( cd svn_export && \
+		mkdir idl_getdata && \
+		mkdir idl_getdata/m4 && \
+		mkdir idl_getdata/src && \
+		cp bindings/idl/package/* idl_getdata && \
+		cp -r bindings/idl/Makefile.am bindings/idl/makedlm.sh.in \
+		bindings/idl/getdata.c bindings/idl/test idl_getdata/src && \
+		cp -r bindings/make_parameters.c idl_getdata && \
+		cp -r m4/idl.m4 m4/compiler.m4 m4/ax_compare_version.m4 m4/version.m4 \
+		idl_getdata/m4 && \
+		cp -r doc/README.idl COPYING AUTHORS ChangeLog INSTALL NEWS idl_getdata && \
+		( cd idl_getdata && \
+		aclocal -I m4 && \
+		libtoolize && \
+		autoconf && \
+		autoheader && \
+		automake --add-missing --force-missing && \
+		./configure && \
+		make dist && \
+		cp idl_${distdir}* ../.. \
+		) )
+	rm -rf svn_export
+
+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
+	PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \
+	${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \
+	cd idl_$(distdir) && ./configure && make dist && make distcheck
+	rm -rf idl_$(distdir)
+	rm -rf $(distdir)
+
+# windows source package
+windist: $(DISTFILES)
+	rm -rf crlf_export
+	cd man && $(MAKE) htmlman
+	svn --native-eol CRLF export $(top_srcdir) crlf_export
+	( cd crlf_export && \
+		mkdir $(distdir) && \
+		mkdir $(distdir)/bindings && \
+		mkdir $(distdir)/doc && \
+		mkdir $(distdir)/man && \
+		cp ../man/*[35].html $(distdir)/man && \
+		cp -r bindings/cxx $(distdir)/bindings && \
+		cp -r cmake util src test $(distdir) && \
+		$(SED) cmake/CMakeLists.txt \
+		-e 's/-DPACKAGE_VERSION=\\".*\\"/-DPACKAGE_VERSION=\\"$(PACKAGE_VERSION)\\"/' \
+		> $(distdir)/cmake/CMakeLists.txt && \
+		cp -r doc/README.cxx doc/unclean_database_recovery.txt $(distdir)/doc && \
+		cp AUTHORS COPYING COPYING.DOC ChangeLog NEWS TODO $(distdir) && \
+		cp README.win $(distdir)/README && \
+		rm -f $(distdir)/*/Makefile.am $(distdir)/*/*/Makefile.am && \
+		zip -rq getdata_win-$(PACKAGE_VERSION).zip $(distdir) && \
+		cp getdata_win*.zip .. \
+	)
+	rm -rf crlf_export
+
+# release stuff
+README.txt: NEWS RELEASE_NOTES.in
+	cp -f RELEASE_NOTES.in $@ 
+	head -n `grep -nm 1 '^|' NEWS | awk 'BEGIN {FS=":"} {print $$1-1}'` NEWS >> $@
+
+dist-post: $(SIGS)
+
+dist-push: $(PACKAGES) $(SIGS) README.txt
+	@if [ -z "${SFUSER}" ]; then echo "ERROR: SFUSER unset"; false; fi
+	rsync -avP -e ssh $^ $(SFUSER)@frs.sourceforge.net:/home/frs/project/g/ge/getdata/getdata/$(PACKAGE_VERSION)/
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..5c06739
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,1696 @@
+New in verison 0.8.9:
+
+  Library Changes:
+
+  * BUG FIX: The metadata writer now correctly stores bytes in the range
+    0x01 through 0x1F to the format files (encoded as hex escape sequences:
+    \x##).
+
+  * BUG FIX: A number of memory leaks associated with error returns from
+    libary functions have been fixed.
+
+  * BUG FIX: Attempting to create a new field or alias with the name of
+    an existing dangling alias now fails with error GD_E_DUPLICATE, as it
+    should.  Reported by Alexandra Rahlin.
+
+  * BUG FIX: Random-access reads on a RAW field with a frame offset no
+    longer result in mispositioning of the field's I/O pointer, which
+    previously would result in returning data from the wrong part of a
+    field.  Reported by S. J. Benton.
+
+  * BUG FIX: The return value of gd_nframes() is now correct when using a
+    sample-index encoded field as the reference field.
+
+  * BUG FIX: The sample-index encoding no longer creates sequential records
+    with the same value.
+
+  Bindings Changes:
+
+  * F77 and F95 BUG FIX: Passing zero as the field code length (F77) to
+    GDFLSH GDSYNC GDRCLO, or, equivalently, an empty string as the field
+    code to fgd_flush, fgd_sync, fgd_raw_close now causes operation on all
+    fields, as with passing NULL to the corresponding C API functions does.
+    This is what the documentation said these functions did all along.
+
+  * PYTHON BUG FIX: Accessing the prefix or suffix member of fragment
+    objects no longer leaks memory if the other affix is non-NULL.
+
+
+|=========================================================================|
+
+New in verison 0.8.8:
+
+  Library Changes:
+
+  * BUG FIX: The incorrect handling of the explicit 64-bit API declarations
+    in getdata.h (those associated with the GD_64BIT_API symbol), which
+    prevented GetData-0.8.7 from compiling on 32-bit systems, has been fixed.
+
+  GetData-0.8.8 is ABI compatible with GetData-0.8.7.
+
+|==============================================================================|
+
+New in verison 0.8.7:
+
+  Library Changes:
+
+  * BUG FIX: Opening a Dirfile read-write (GD_RDWR) no longer fails if
+    /INCLUDEd fragments are read-only.  Reported by Alexandra Rahlin.
+
+  * BUG FIX: Several fixes have been made to the sample index encoding
+    (SIE) engine, which should now produce properly encoded data when
+    performing random writes.
+
+  Bindings Changes:
+
+  * F95 BUG FIX: Passing the empty string to fgd_reference() now returns
+    the current reference field without modifying it, instead of crashing.
+
+  * PYTHON BUG FIX: Querying dirfile.reference no longer causes a crash on
+    an empty dirfile.  Reported by Alexandra Rahlin.
+
+  * PYTHON BUG FIX: Memory leaks have been fixed in functions returning
+    lists of field names or other metadata lists.  Reported by Alexandra
+    Rahlin.
+
+  * PYTHON BUG FIX: On error, dirfile.get_string() no longer segfaults or
+    leaks memory.
+
+|==============================================================================|
+
+New in verison 0.8.6:
+
+  Library Changes:
+
+  * BUG FIX: Computation of LINCOMs with complex valued input fields now
+    correctly happens in the complex plane.  As a side effect, gd_native_type()
+    now also correctly reports such LINCOM fields to be complex valued.
+
+  * BUG FIX: The gd_[m]add() functions now ignore zero-length scalar strings.
+    Previously they would store these invalid field codes, causing problems
+    later.
+
+  * BUG FIX: Returning complex-valued CARRAYs as purely real now works.
+    Previously only the first element requested would be returned, the remaining
+    output buffer containing uninitialised data.
+
+  * BUG FIX: Entry members spf, bitnum, numbits, and period are now 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: The parsing of the \x and \u escape sequences is now correct.
+
+  * BUG FIX: A scalar field code specified for the last factor in a POLYNOM
+    entry is no longer ignored by gd_[m]add().
+
+  * BUG FIX: gd_[m]add() no longer rejects MPLEX fields with negative count_val.
+
+  * BUG FIX: DIVIDE fields with complex-valued divisors are now properly
+    computed.
+          
+  * BUG FIX: Complex-valued POLYNOM and RECIP fields are now computed properly
+    when the library is built in ANSI C mode.
+
+  * BUG FIX: gd_alter_entry() no longer corrupts the DIRFILE when modifying
+    named scalars of MPLEX fields.
+
+  * BUG FIX: Writing complex-valued MPLEX fields no longer corrupts the stored
+    data.
+
+  * BUG FIX: gd_bof() now returns the correct number (i.e.: zero) when reporting
+    the beginning of field of derived fields shifted to before the start of the
+    dirfile.  Previously, this function incorrectly returned values ranging from
+    zero to one less than the samples-per-frame of the requested field.
+
+  * BUG FIX: gd_flush(), gd_sync(), gd_raw_close() no longer segfault when
+    operating on a LINCOM with only one input field.
+
+  * BUG FIX: gd_seek() now works correctly on PHASE fields; previously, the
+    sign of the PHASE shift was flipped.
+
+  * BUG FIX: gd_seek() now correctly positions the virtual I/O pointer of the
+    INDEX field.
+
+  * BUG FIX: gd_framenum_subset() now returns the correct value when passed a
+    field_end which is beyond the end of field, and then is required to
+    extrapolate outside of the specified frame range.
+
+  * BUG FIX: gd_error_string() now produces the correct string when reporting
+    an out-of-range poly_ord encountered by gd_add_polynom() and similar.
+
+  * BUG FIX: gd_[m]alter_spec() no longer ignore co-efficients specified for
+    POLYNOM entries.
+
+  * BUG FIX: gd_alter_encoding() now deletes the internal cache of RAW filenames
+    of the affected fragment; previously, these old, cached filenames could lead
+    to I/O errors when reading and writing the re-encoded RAW data files.
+
+  * BUG FIX: Calling the Legacy API function GetFormat() on a Dirfile with MPLEX
+    or WINDOW fields no longer results in a segmentation fault.
+
+  * BUG FIX: Attempts to read past the EOF of a gzipped field no longer results
+    in an I/O error, but successfully returns no data.
+
+  * BUG FIX: The internal recursion counter wasn't being properly reset on
+    certain error conditions, leading to spurious GD_E_RECURSE_LEVEL errors
+    being returned from valid calls.
+
+  Bindings Changes:
+
+  * F77 and F95 BUG FIX: Named scalar indices are now indexed from one instead
+    of zero, like all other array indices are in the Fortran GetData bindings.
+
+  * C++ BUG FIX: Fixed segfault in RawEntry destructor.  Reported by S. J.
+    Benton.
+
+  * C++ BUG FIX: Entry::ComplexScalars() now returns non-zero for RECIP
+    entries when appropriate, instead of always returning zero.  (The
+    RecipEntry::ComplexScalars() method always returned the correct value.)
+
+  * IDL BUG FIX: The /UPDATEDB flag to gd_rename is no longer ignored; also, the
+    /MOVE_DATA flag no longer also acts as if /UPDATEDB had been specified.
+
+  * PYTHON BUG FIX: The keyword for the "dirfile" parameter in the
+    getdata.fragment constructor is now properly spelled.
+
+|==============================================================================|
+
+New in verison 0.8.5:
+
+  Library Changes:
+
+  * The zzslim encoding framework, which was inadvertantly rendered
+    non-compilable in 0.8.4, should once again work.  Reported by Matthew
+    Hasselfield.
+
+  Bindings Changes:
+
+  * PYTHON BUG FIX: A spurious debugging message accidentally left in the
+    0.8.4 release has been expunged.
+
+|==============================================================================|
+
+New in version 0.8.4:
+
+  Dirfile Changes:
+
+  * CLARIFICATION: Inconsistant behaviour in the library, coupled with
+    contradictory statements in the Dirfile Standards, has resulted in confusion
+    over the meaning of the final, optional, parameter in a MPLEX definition.
+    To be clear: this parameter is simply the expected period between successive
+    occurances of the "count" value in the index vector.  (It is used by GetData
+    only to figure out a resonable length for the MPLEX lookback.)  The 
+    following clarifications and corrections have been made to the definition
+    of the MPLEX field type in dirfile-format(5):
+
+    - The final, optional parameter has been renamed from "max" to "period".
+
+    - This parameter indicates not the maximal range of the index vector, as 
+      previously stated, but the expected number of samples between successive
+      occurances of the specified "count" value in the index vector; as before,
+      it should be regarded as a hint, and does not place any actual restriction
+      on the contents of the index vector.
+
+    - The incorrect requirement that the "count" parameter be non-negative has
+      been deleted.
+
+    - The incorrect requirement that "count" be less than or equal to "max", if
+      "max" is present and non-zero, has been deleted.
+
+    - The meaning of an omitted or zero "period", indicating that the spacing of
+      "count" in the index vector is unknown or non-uniform, is now explicitly
+      stated.
+
+    - Different MPLEX fields using the same index vector may specify different
+      periods.
+    
+    See also the related library bug fixes below.
+
+  Library Changes:
+
+  * 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 MPLEX fields where
+    count_val is greater than the period (formerly called count_max).
+
+  * BUG FIX: The default MPLEX period, if none is specified, is 2*count_val + 1,
+    not simply 2 * count_val, when count_val is greater than 5.
+
+  * BUG FIX: Trying to position an I/O pointer to before sample zero with
+    gd_seek() now properly fails.  Previously it would allow it, causing bizarre
+    things to happen later.
+
+  * BUG FIX: Using gd_tell to get the I/O pointer position of a derived field
+    with exactly two input fields (MULTIPLY, DIVIDE, MPLEX, WINDOW) now properly
+    reports an error in the "multiposition" case (ie. when the two inputs are
+    ultimately reading from different locations in the same RAW field).
+
+  * BUG FIX: Trying to read sample zero of a gzipped RAW field the second time
+    now works as expected.  Previously, the request to reposition the I/O
+    pointer back to zero would be ignored by the gzip framework.  Reported by
+    Alexandra Rahlin.
+
+  * BUG FIX: The field code of a reference field declared in a subfragment
+    included with affixes is no longer corrupted by spurious application of the
+    affixes when the subfragment's metadata are (re-)written.  Reported by Seth.
+
+  Bindings Changes:
+
+  * C++: The Entry and MplexEntry member functions CountMax and SetCountMax have
+    been renamed to Period and SetPeriod for consistency with the changes listed
+    above.  CountMax and SetCountMax are still avaialbe as aliases, but are
+    marked deprecated.
+
+  * IDL BUG FIX: GD_ENTRY structures representing MPLEX fields are now properly
+    interpreted.  Previously, the underlying gd_entry_t object was being
+    incorrectly initialised.
+
+  * PYTHON BUG FIX: Numpy arrays returned by dirfile.getdata() are now the
+    correct length.  Previously they would always be the length requested (or
+    the length of the dirfile, if no length was explicitly given) even if fewer
+    samples were returned.  Extra elements would contain uninitialised memory.
+
+|==============================================================================|
+
+New in version 0.8.3:
+
+  Library Changes:
+  
+  * BUG FIX: Several bugs on big-ended systems have been fixed.  Reported by
+    Dinar Valeev.
+
+  * BUG FIX: Adding an entry via gd_[m]add() with a negative CARRAY scalar index
+    no longer results in an internal error or worse when the added field is
+    later read.
+
+  * BUG FIX: Changing a CONST field to a real floating point type using
+    gd_alter_const() (or similar) no longer results in the value of the field
+    being corrupted.
+
+  * BUG FIX: A bug in the parser's tokeniser has been fixed to prevent spurious
+    "unterminated token" syntax errors.  Typically this would only be seen when
+    using gd_strtok() to tokenise an (apparently innocuous) user-supplied
+    string, but a carefully crafted format file could also be made to get
+    gd_open() to produce it.
+
+  Bindings Changes:
+
+  * Bindings for MATLAB have been added.
+
+  * The IDL, Perl, and Python bindings no longer require a C99 compiler to be
+    built.
+
+|==============================================================================|
+
+New in version 0.8.2:
+
+  Library Changes:
+  
+  * BUG FIX: A trailing symlink (i.e. situations where a symlink is the last
+    element of a path) no longer confuses GetData when the target of the
+    symlink: (1) is absolute, or (2) starts with "../".  Reported by S. J.
+    Benton.
+
+  * BUG FIX: Trying to read data from the first sample of an MPLEX no longer
+    results in an internal error if the first sample of the index doesn't match
+    the target value.
+
+|==============================================================================|
+
+New in version 0.8.1:
+
+  Library Changes:
+
+  * BUG FIX: A segfault when negotiating symbolic links in file paths, typically
+    manifesting in gd_open calls, has been fixed.
+
+  * BUG FIX: gd_strtok now saves a copy of the string passed to it, as the
+    documentation suggests it should.  Previously it cached the pointer itself.
+
+  * BUG FIX: A number of minor memory leaks, mostly occurring when the library
+    encounters an error, have been fixed.
+
+  * BUG FIX: /HIDDEN directives weren't being written for aliases.
+
+  * BUG FIX: The parser now fails properly on /INCLUDEs which specify paths
+    which don't point to regular files.
+
+  * BUG FIX: Fixed a bug which would result in the parser getting confused over
+    the current Standards Version, potentially leading to rejected valid
+    dirfiles.  Reported by Daniel Flanigan.
+
+  * WIN32 BUG FIX: On Windows, the parser can now properly handle hexadecimal
+    floating point.
+
+  API Changes:
+
+  * How the API deals with field code affixes has changed.  Input vector and
+    scalar fields are reported by gd_entry(), &c. now include their prefix and
+    suffix, if any, which should remove the need to do manual affix bookkeeping
+    when reading metadata.  The other side to this change is that when modifying
+    metdata (gd_add(), gd_alter_entry(), &c.), supplied field codes must also
+    contain the appropriate suffixes.
+
+  * gd_dirfilename() now returns a fully canonicalised version of the dirfile
+    path.
+
+  * A new function, gd_linterp_tablename() has been added which returns a fully
+    canonicalised version of the look-up table pathname for a LINTERP.
+
+  * BUG FIX: gd_alter_entry() and gd_madd_alias() weren't clearing the Dirfile
+    error before operation, resulting in them failing erroneously in certain
+    situations.
+
+  * BUG FIX: When including an existing fragment which itself has subfragments,
+    gd_include() no longer returns the wrong fragment index.
+
+  Bindings Changes:
+
+  * F77 BUG FIX: A memory leak has been fixed in GDALLC.
+
+|==============================================================================|
+
+New in version 0.8.0:
+
+  Dirfile Changes:
+
+  * Dirfile Standards Version 9 has been released.  It adds two new field
+    types: MPLEX, which allows multiplexing multiple low-rate channels in
+    one high-rate one, and WINDOW, which extracts a portion of a field
+    based on the value of a second field.  More changes are listed below.
+
+  * Alternate field names may be defined using the /ALIAS directive.
+    Aliases can't be used as a parent when defining metafields, but are
+    otherwise indistinguishable from a field's original ("canonical") name.
+
+  * The /VERSION directive now has fragment scope, which should alleviate
+    some of the problems associated with "version leakage" found in
+    previous versions.  Previous versions are unchanged, but a "/VERSION 9"
+    directive will not propagate back up into a parent fragment, nor will
+    any /VERSION directive be propagated back up into a Version 9 fragment.
+
+  * Fields may be "hidden" using the /HIDDEN directive.  The Standards
+    don't say what a "hidden" field does, but GetData will, by default,
+    exclude them from the count and list functions.
+
+  * Literal integers in the format may now be specified in octal (using
+    0####) or hexidecimal (using 0x##### or 0X#####) in addition to
+    decimal.  C99-standard hexidecimal floating point literals (0x##.##p##,
+    &c.) are also accepted.
+
+  * The /INCLUDE directive can take two additional, optional parameters
+    which specify a prefix and/or suffix used to modify the entry names of
+    the fields defined in the included fragment.  (The intent of this is to
+    permit the inclusion of multiple subdirfiles which define the same set
+    of fields, by modifying their field names.)
+
+  * Three new encoding schemes are available.  The first is the Sample-
+    Index Encoding (SIE), similar to run-length encoding, useful for
+    compressing data which changes very rarely 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.
+
+  * The /ENCODING directive takes an optional second token.  The zzip and
+    zzslim encoding schemes optionally use this token to specify the name
+    of the combined ZIP archive.
+
+  * The data type names FLOAT (an alias for FLOAT32) and DOUBLE (an alias
+    for FLOAT64) have been deprecated.
+
+  Library Changes:
+
+  * On POSIX systems, GetData now caches the dirfile directory (and any
+    other necessary subdirectories).  This guards against third-parties
+    renaming the directory while GetData is interested in it.
+
+  * GetData is, in general, more careful about pathname management.  At
+    least on POSIX systems, it will now try to canonicalise all paths it
+    comes across, including resolving symlinks.  As a result, GetData no
+    longer becomes befuddled by a caller who opens a Dirfile with a
+    relative pathname and then calls chdir(2).  Functions like
+    gd_fragmentname() and gd_raw_filename() now return canonicalised paths.
+
+  * The library no longer forces a sync of all raw data on close.  The sync
+    causes a flush of filesystem buffers, which is usually unnecessary
+    overhead, and degredatious to efficient disk I/O.  Use an explicit
+    gd_sync() or gd_flush() before closing to recover the old behaviour, if
+    desired.
+
+  * The error messages output by GetData with GD_VERBOSE turned on now has
+    "libgetdata: " prefixed to it.  A further prefix may be specified by
+    the caller.
+
+  * When truncating a dirfile, the primary format file is no longer deleted
+    and then recreated.  Instead, it is simply truncated in-place.  This
+    change means that a Dirfile which is undergoing truncation always
+    appears (to GetData, at least) to be a valid Dirfile, which can be
+    useful if it is being concurrently read.
+
+  * Write support for gzip-encoded data has been added.  Writes occur out
+    of place, which means sufficient space on the filesystem is needed for
+    a second copy of every field being written.  Writing to a gzip
+    compressed field requires uncompressing the portion of the field before
+    the write of the existing file, recompressing it to the temporary file,
+    then writing the new data to the temporary file.  A subsequent write at
+    a later position, will continue to write to the compressed file, but a
+    subsequent write to an earlier position requires coping all remaining
+    data from the old file to the temporary file, finalising it, moving it
+    over top of the old file, and then starting afresh with a new temporary
+    file.  As a result, it's not very fast, and likely should be avoided
+    for non-sequential writes.
+
+  * Raw data files are now only opened for writing if writing is going to
+    occur.  In particular, this means that opening a dirfile with GD_RDWR
+    will still work even if you don't have write access to it, so long as
+    you don't try writing to it.
+
+  * GetData now tracks a "current location" for all RAW files, and allows
+    reads and writes to occur at the "current location" (via the special
+    symbol GD_HERE).  For some derived fields the idea of a "current
+    location" doesn't make sense, and this won't work.
+
+  * BUG FIX: In previous versions, renaming a field with gd_rename()
+    wouldn't update or invalidate the cache of fields which depended on the
+    old name, leading to surprising results.  It will now either invalidate
+    these fields' metadata caches or else change the name in those
+    definitions as well.
+
+  * BUG FIX: The invalid syntax "/META parent/child granchild ..." is now
+    properly rejected by the parser.  Previously it half-worked, resulting
+    in a segfault in gd_close().
+
+  * BUG FIX: Several syntax errors encountered in PHASE and RECIP field
+    specifications weren't being reported by the parser, leading to
+    corrupted metadata on open.
+
+  * BUG FIX: GetData no longer omits the input field to a RECIP when
+    writing metadata to disk.  Nor does it forget to put newlines after
+    RECIP or DIVIDE field specifications.
+
+  * BUG FIX: GetData no longer assumes all LINCOM input fields have the
+    same number of samples per frame.
+
+  * BUG FIX: Writing an empty fragment with GD_PRETTY_PRINT turned on no
+    longer results in a floating-point exception.
+
+  * BUG FIX: Renaming a field now properly flags the fragment which
+    contains it as dirty, which will ensure the rename is writen to disk
+    when the metadata are next flushed.
+
+  * BUG FIX: Whitespace within tokens is now properly escaped when metadata
+    is flushed to disk.
+
+  * BUG FIX: The parser no longer gets tripped up by two character escape
+    sequences in a row, nor by an escape sequence at the start of a token.
+
+  * BUG FIX: "/PROTECT data" directives are now being written when they
+    should be.  Previously, they were dropped completely.  Reported by
+    Alexandra Rahlin.
+
+  * BUG FIX: CARRAY indices provided to gd_add() in the entry.scalar_ind
+    member are no longer ignored.  Reported by S. J. Benton.
+
+  * BUG FIX: When adding a metafield with gd_(m)add(), GetData no longer
+    checks the protection of the fragment indexed by entry->fragment_index.
+    Instead it ignores entry->fragment_index completely (as the
+    documentation indicates it should) and checks the protection of the
+    fragment containing the parent field.
+
+  API Changes:
+
+  * Functions which add fields (gd_add(), gd_add_<type>(), &c.) can now be
+    used to add metafields by using their full "parent/name" field code.
+    The old, explicit metafield adding routines (gd_madd(), &c.) are still
+    available.
+
+  * As with their corresponding names in the Standards, the gd_type_t
+    symbols GD_FLOAT and GD_DOUBLE are now deprecated.  Use GD_FLOAT32 and
+    GD_FLOAT64 as appropriate.
+
+  * A new open flag, GD_TRUNCSUB, will cause GD_TRUNC to descend into
+    subdirectories of a directory it is truncating.  If not specified along
+    with GD_TRUNC, it does nothing.
+
+  * New public functions gd_nentries() and gd_entry_list() provide a
+    generic interface to the field counting and list functionality.  The
+    other functions (gd_nfields(), gd_nfields_by_type(), &c. and
+    gd_field_list(), gd_field_list_by_type(), &c.) are now simply special
+    cases of these two functions.
+
+  * The "hiddenness" of a field name may be queried with gd_hidden(), set
+    with gd_hide() and cleared with gd_unhide().
+
+  * /INCLUDE affixes may be queried with gd_fragment_affixes() and added,
+    modified or deleted with gd_alter_affixes().  A new fragment can be
+    added to the dirfile with affixes using gd_include_affix().
+
+  * New aliases may be added with gd_add_alias() or gd_madd_alais.  The
+    target of an alias is retrned by gd_alias_target(); a list of aliases
+    of a field, or their number, is returned by gd_aliases() and
+    gd_naliases().
+
+  * Because GetData considers aliases and canonical names to be
+    indistinguishable, passing an alias name to most functions will result
+    in the function operating on target field.  To manipulate aliases
+    themselves, the API has the new interfaces gd_move_alias() and
+    gd_delete_alias().
+
+  * In addition to the special symbol GD_HERE which may be passed to
+    gd_getdata() and gd_putdata(), the "current location" of fields may be
+    queried with gd_tell() and moved with gd_seek().
+
+  * The typedefs gd_bit_t and gd_spf_t have been deprecated.  They are
+    replaced with 'int' and 'unsigned int' respectively.  For backwards
+    compatibility, the typedefs (with their new types) are still declared
+    in getdata.h, but the API no longer makes use of them.
+
+  * GetData's tokeniser has been exposed to the public API via the
+    gd_strtok() function, which works similar to strtok(3), and returns
+    successive tokens of a string given it.
+
+  * A new function gd_error_count() returns the number of GetData errors
+    encountered on a Dirfile since it was last called (or since the Dirfile
+    was opened).  This is useful for programs that care whether *something*
+    failed, but don't really care what it was.
+
+  * Reading MPLEX fields can result in inefficiencies due to GetData having
+    to look backwards for the first value of the part of the derived field
+    requested.  A new function, gd_mplex_lookback(), can be used to alter
+    how much lookback is done, if any.
+
+  * The "move_data" flag in gd_rename() has been replaced with a generic
+    "flags" parameter.  Two rename flags are defined: GD_REN_DATA, which
+    recovers the old behaviour of move_data, and GD_REN_UBDB which will
+    cause references to the renamed field to be renamed also in derived
+    fields which refer to it.  Without GD_REN_UBDB, these definitions are
+    left unchagned.
+
+  * Flags which affect the long-term operation of GetData may be modified
+    after open using gd_flags().  Currently these flags are just GD_VERBOSE
+    and GD_PRETTY_PRTNT.
+
+  * The gd_flush() function, which both syncs and closes RAW files, has
+    been broken up into its two parts with two new functions: gd_sync(),
+    which just syncs and gd_raw_close(), which just closes.  gd_flush()
+    still does both.
+
+  * Using the new gd_desync() function will cause GetData to determine
+    whether the Dirfile metadata on disk has changed since the Dirfile was
+    opened.
+
+  * A prefix to the automatic error messages printed by GetData when using
+    the GD_VERBOSE flag may be specified with gd_verbose_prefix().
+
+  * When requesting the exclusive creation of a new dirfile with (GD_CREAT
+    | GD_EXCL) GetData will now return the new error GD_E_EXISTS if the
+    dirfile already exists.  Previously it would return GD_E_CREAT in this
+    situation.
+
+  * The error codes GD_E_BAD_ENDIANNESS, GD_E_BAD_PROTECTION, and
+    GD_E_BAD_VERSION have been combined into a more generic error code:
+    GD_E_ARGUMENT.  The old symbols are retained for backwards
+    compatibility but have been marked deprecated.
+
+  * CONST and CARRAY handling has been combined somewhat.  When passed to
+    {get,put}_carray[_slice]() or gd_carray_len(), CONSTs behave like
+    length-one CARRAYs.  Similarly, {get,put}_constant() will operate on
+    the first element of a CARRAY, as if it were a CONST field.
+
+  * C89 API: Passing NULL to gd_alter_crecip() for cdividend is now treated
+    as if it were passed zero (ie. it indicates no change for cdividend).
+
+  * BUG FIX: 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.
+
+  Legacy API Changes:
+
+  * The never-used n_mplex/mplexEntries part of the FormatType now has a
+    use: both MPLEX and WINDOW entries are reported there.
+
+  Bindings Changes:
+
+  * Bindings for Perl5 have been added.  Perl is not well suited to
+    numerical analysis, and the bindings may be inefficient.
+
+  * F77: Due to small namespace issues, the encoding parameters
+    (corresponding to the GD_...ENCODED symbols in the C API) have all been
+    renamed.  They are now of the form GDE_xx.
+
+  * C++: The bindings now make use of the explicitly-64-bit offset type
+    gd_off64_t defined in getdata.h.  Previously, the bindings tried to
+    force off_t to be 64-bit through preprocessor shenanigans, which led,
+    in certain cases, to linking problems down the road when used by third
+    parties.
+
+  * Python: The return_type, num_fields, and num_samples parameters to
+    dirfile.getdata() are now optional.  The return_type defautls to
+    pygetdata.FLOAT, and if neither num_fields nor num_samples are given,
+    all frames (ie. the value of dirfile.nframes) are returned.
+
+  * IDL: A number of undocumented, unnecessary function aliases have been
+    removed. They should be replaced with their canonical names, without
+    change in use:
+
+        Alias                   Replacement
+        ----------------------  ----------------
+        GD_ADD_CLINCOM          GD_ADD_LINCOM
+        GD_ADD_CPOLYNOM         GD_ADD_POLYNOM
+        GD_ADD_CRECIP           GD_ADD_RECIP
+        GD_ALTER_CLINCOM        GD_ALTER_LINCOM
+        GD_ALTER_CPOLYNOM       GD_ALTER_POLYNOM
+        GD_ALTER_CRECIP         GD_ALTER_RECIP
+        GD_FIELD_LIST_BY_TYPE   GD_ENTRY_LIST
+        GD_FRAMENUM_SUBSET      GD_FRAMENUM
+        GD_MADD                 GD_ADD
+        GD_MADD_BIT             GD_ADD_BIT
+        GD_MADD_CARRAY          GD_ADD_CARRAY
+        GD_MADD_CLINCOM         GD_ADD_LINCOM
+        GD_MADD_CPOLYNOM        GD_ADD_POLYNOM
+        GD_MADD_CRECIP          GD_ADD_RECIP
+        GD_MADD_DIVIDE          GD_ADD_DIVIDE
+        GD_MADD_LINCOM          GD_ADD_LINCOM
+        GD_MADD_LINTERP         GD_ADD_LINTERP
+        GD_MADD_MULTIPLY        GD_ADD_MULTIPLY
+        GD_MADD_PHASE           GD_ADD_PHASE
+        GD_MADD_POLYNOM         GD_ADD_POLYNOM
+        GD_MADD_RECIP           GD_ADD_RECIP
+        GD_MADD_SBIT            GD_ADD_SBIT
+        GD_MADD_STRING          GD_ADD_STRING
+        GD_MALTER_SPEC          GD_ALTER_SPEC
+        GD_MCONSTANTS           GD_CONSTANTS
+        GD_MFIELD_LIST          GD_ENTRY_LIST
+        GD_MFIELD_LIST_BY_TYPE  GD_ENTRY_LIST
+        GD_MSTRINGS             GD_STRINGS
+        GD_MVECTOR_LIST         GD_VECTOR_LIST
+        GD_NFIELDS_BY_TYPE      GD_NENTRIES
+        GD_NMFIELDS             GD_NENTRIES
+        GD_NMFIELDS_BY_TYPE     GD_NENTRIES
+        GD_NMVECTORS            GD_NVECTORS
+
+  * BUG FIX: All bindings now provide a named constant corresponding to the
+    C API error GD_E_UNKNOWN_ENCODING, which was overlooked in previous
+    releases.
+
+  * IDL BUG FIX: The missing /IGNORE_REFS and /PRETTY_PRINT are now
+    available in gd_open.
+
+|==============================================================================|
+
+New in version 0.7.3:
+
+  Library Changes
+
+  * BUG FIX: Passing a zero dividend to alter_crecip() and alter_recip() now
+    results in the dividend not changing, per documentation.
+
+  * BUG FIX: GetData wasn't properly computing the module directory, causing
+    encodings using external modules to fail with GD_E_UNSUPPORTED.
+
+  * BUG FIX: Metafield records are now properly stored in the format file for
+    Standards Version 8.
+
+  * BUG FIX: gd_raw_filename() wasn't clearing the Dirfile error before
+    operation, resulting in it failing erroneously in certain situations.
+
+  Utilities Changes:
+
+  * BUG FIX: A potential segmentation fault has been patched in dirfile2ascii.
+
+|==============================================================================|
+
+New in version 0.7.2:
+
+  Library Changes
+
+  * If built with modules, the plugin shared objects will now be installed in
+    a separate directory (by default "${libdir}/getdata", but see the
+    --with-module-dir option in ./configure).
+
+  * BUG FIX: When using modules, a missing plugin no longer results in a lock up
+    the second time an attempt is made to find it.
+
+  * BUG FIX: GetData now properly processes /INCLUDE directives with absolute
+    paths, as the documentation insists it should.
+
+  * BUG FIX: gd_add()ing the first raw field in a dirfile to a subfragment no
+    longer results in memory corruption when calling gd_close().
+
+  API Changes
+
+  * If called with GD_CREAT but no encoding specified, gd_include() now will
+    duplicate the encoding of the parent fragment (if any).
+
+  Miscellaneous
+
+  * The python module install dir can now be changed by passing
+    --with-python-module-dir to configure.
+
+|==============================================================================|
+
+New in version 0.7.1:
+
+  Library Changes
+
+  * BUG FIX: When the parser fails in a gd_include() call, the internal list of
+    conformant Standards Versions for the loaded dirfile is no longer corrupted.
+
+  * BUG FIX Performing two consecutive reads of the same field in an ASCII
+    encoded datasources no longer confuses GetData.
+
+  * BUG FIX: Numerous memory leaks have been patched (mostly pin-holes, although
+    there are a few, rare but egregious ones).
+
+  API Changes:
+
+  * The value(s) of a CONST or CARRAY field added with gd_[m]add() is now
+    guaranteed to be zero; previously, it was unspecified.
+
+  * BUG FIX: Specifying both GD_VERBOSE and GD_IGNORE_DUPS no longer results in
+    spurious "Field code already defined" messages when duplicate fields are
+    encountered.
+
+  * BUG FIX: Calling gd_delete on a metafield no longer results in a segfault.
+
+  Bindings Changes:
+
+  * F77 BUG FIX: A memory leak in GDASCA has been fixed.
+  * Python BUG FIX: The first element of a python list (instead of a NumPy
+    array) is no longer dropped when passed to pygetdata on 64-bit systems.
+
+  Utilities Changes:
+
+  * dirfile2ascii now pads reads past the end-of-field.  The value used to
+    pad may be specified with '-z', and defaults to 0/NaN.  Previously, the
+    value of uninitialized memory was output.
+
+  * BUG FIX: dirfile2ascii now does what the user intends when presented with
+    cart-before-horse arguments, ie. "dirfile2ascii -e field DIRFILE".
+    Previously this resulted in confusion.
+
+  * BUG FIX: dirfile2ascii now accepts field conversion '-u', which was
+    documented but overlooked in the argument parser.
+
+|==============================================================================|
+
+New in version 0.7.0:
+
+  Dirfile Changes
+
+  * Dirfile Standards Version 8 has been released.  It adds three new field
+    types: DIVIDE, which computes X/Y for vectors X and Y, RECIP, which computes
+    A/X for vector X and scalar A, and CARRAY, which is an array of CONST
+    scalars.  A few other changes are listed below.
+
+  * Like CONST fields, CARRAY elements can be used as parametersin the
+    definition of other fields.  Syntax is 'field<n>', where 'field' is the
+    field name and 'n' the element index in the CARRAY (and the angle brackets
+    are literal angle brackets).  If the '<n>' is omitted, the first element
+    (numbered 0) is assumed.
+
+  * Slashes on reserved words are now mandatory, allowing fields with reserved
+    words as names.
+
+  * The long-deprecated single character data type codes have been removed from
+    Standards Version 8.  (They are still accepted by GetData, which handles
+    all previous Standards Versions as well.)
+
+  * The /ENDIAN directive now takes an optional second parameter.  The only
+    allowed value for this second token is "arm", which indicates that double
+    precision floating point data (including double precision complex data) are
+    stored in the ARM middle-endian format.  Without this, floating point data
+    are assumed to have the same byte sex as integer data.
+
+  Library Changes
+
+  * GetData, including its bindings, is now supported under MacOS X, Cygwin, and
+    Win32 using MinGW.  In the case of MinGW, this includes linking against the
+    Microsoft C Runtime, which isn't POSIX compliant.  Users should excercise
+    caution when writing to dirfiles in this case.
+
+  * GetData can now be used on ARM processors.  As a side-effect, GetData can
+    now read and write the middle-ended floating point format used by older ARM
+    processors (on any processor, via endianness conversion).
+
+  * Some changes have been made to the parser.  It now operates in one of two
+    modes: pedantic mode, which adheres strictly to one particular Dirfile
+    Standards Version, and permissive mode (the default) which is more
+    lenient, as the old parser was.  Encountering a /VERSION directive will
+    switch the parser from permissive to pedantic mode unless told not to (see
+    GD_PERMISSIVE below), and will change the particular Standards Version to
+    which pedantic mode is adhering.
+
+  * As a result of the previous change, the Standards compliance of the parser
+    in strict mode has been greatly increased.  This affects allowed characters
+    in field names, and field name lengths.  The existance or lack thereof of
+    the implicit FILEFRAM field (an alias for INDEX) is also affected.
+
+  * Since Standards Versions 4 and earlier were never codified, we've made some
+    assumptions as to their behaviour in certain undocumented situtations.  Most
+    noticably, they still prohibit ASCII control codes (bytes < 0x20) and '/'
+    in field names.  We also assume these dirfiles have native byte sex, even
+    though some early GetData behaviour implied only little-ended data was
+    acceptable.
+
+  * Every Dirfile object now records its current Standards Version, which
+    affects functions such as gd_add_spec().  The Version will start out as the
+    value of the last /VERSION directive encountered by the parser, or else the
+    latest compliant Standards Version.  It can be changed (see below).
+
+  * When writing metadata to disk, fragments will be written according to the
+    current Standards Version of the dirfile object, rather than always using
+    the latest version, as before.
+
+  * The C library now sports an "ANSI C" mode, which allows compilation of
+    GetData without a C99-compliant compiler.  Some functionality may be lost,
+    most prominently, but unsurprisingly, the default (C99) API.
+
+  * The artificial maximum line length of 4096 bytes for format metadata has
+    been removed.  The maximum line length is now 2**31 bytes on 32-bit systems,
+    and more on 64-bit systems.  This also has the side-effect of removing the
+    same length limit which had been applied to field names.
+
+  * LINTERP tables are no longer required to be sorted.  The library will
+    sort them, if needed.  As a side-effect of this, tables are no longer read
+    twice when loading, leading to potential speed-up.
+
+
+  * BUG FIX: The library wasn't properly checking that the second and higher
+    input fields in LINCOM and MULTIPLY fields were, in fact, vectors, leading
+    to possible segfaults.
+
+  * BUG FIX: A memory leak associated with modifying LINCOM metadata has been
+    fixed.
+
+  * BUG FIX: Using a complex valued vector as the second input field in a
+    MULTIPLY wouldn't result in the field being internally flagged as complex,
+    leading to loss of the imaginary part in certain situtaitons.
+
+  * BUG FIX: Trying to write to a LINTERP via a table which isn't monotonic now
+    results in error.  Previously, this was allowed, with arbitrary data stored
+    to disk.
+
+  * BUG FIX: On encountering a line longer than it was prepared to deal with,
+    the parser used to get very confused, potentially resulting in bizarre
+    behaviour.  On the off chance such a line is encountered, GetData will now
+    raise GD_E_LINE_TOO_LONG in these cases. (And, since the maxmium line
+    length has been increased to at least 2**31 characters, this should only
+    occur in pathological situations.)
+
+  * BUG FIX: Deleting a metafield was not being communicated to its parent,
+    resulting in differing opinions within the library as to the deleted field's
+    exsitence.
+
+  API Changes
+
+  * Due to namespace conflicts with the MacOS X System Library (which contains
+    the C Standard Library), a wholesale renaming of public symbols has been
+    performed.  All public functions, and data types now begin with 'gd_'.  All
+    public preprocessor macros now begin with 'GD_'.  Symbol renaming has
+    occurred in the following manner:
+
+    - functions which started with 'put' simply prefix 'gd_' to their name.  So
+      put_constant() becomes gd_put_constant().
+    - functions which started with 'get' replace 'get' with 'gd', except those
+      functions with a corresponding 'put' function; these simply prefix 'gd_'.
+      So, get_constants() becomes gd_constants(), but get_constant() becomes
+      gd_get_constant().
+    - functions which started with 'dirfile' replace 'dirfile' with 'gd',
+      except for dirfilename(), which becomes gd_dirfilename().  So,
+      dirfile_alter_encoding() becomes gd_alter_encoding().
+    - macros which started with 'GETDATA_' now start with 'GD_'.  Those that
+      started with 'NO_GETDATA_' now start with 'GD_NO_'.  So GETDATA_LEGACY_API
+      becomes GD_LEGACY_API and NO_GETDATA_LEGACY_API becomes GD_NO_LEGACY_API.
+
+  * The above renaming rules result in one gd_ namespace clash.  As a result,
+    get_reference() has been removed completely.  Calls will have to be
+    changed to use gd_reference(), formerly dirfile_reference().
+
+  * Furthermore, the function dirfile_protect() is now gd_alter_protection() to
+    match the naming of other fragment metadata altering functions.
+
+  * To ease transition to the new namespace, defining GD_FUNCTION_ALIASES before
+    including getdata.h will create a bunch of preprocessor macros which map the
+    old names to the new.
+
+  * The meaning of the GD_PEDANTIC flag to gd_[cb]open() has changed.  It now
+    forces the parser to start off in pedantic mode (see above), following the
+    latest Standards Version, rather than the default permissive mode.  This is
+    a subtle change, and in most cases the effects of GD_PEDANTIC will be the
+    same as they were before.
+
+  * A new dirfile flag, GD_PERMISSIVE, has been added.  Passing this to
+    gd_[cb]open() will prohibit the parser from switching into pedantic mode
+    when it encounters a /VERSION directive.  This flag is needed to read
+    dirfiles which claim to adhere to the Standards via a /VERSION directive,
+    but contain invalid syntax nonetheless.
+
+  * The current Standards Version of an open dirfile can be set or queried by
+    calling the new function gd_dirfile_standards().  NB: this only affects the
+    open dirfile, not the metadata stored on disk.
+
+  * A new function, gd_rewrite_fragment() will force GetData to write the
+    specified fragment to disk, even if no metadata in the fragment has changed.
+
+  * Two new functions, gd_bof() and gd_eof() can be used to find the sample
+    number of the beginning- or end-of-field for a given field.  Notably, these
+    can be used to calculate the amount of raw data on disk for a given field.
+
+  * The new gd_invalid_dirfile() function will return a newly created, invalid
+    dirfile.  Primarily useful to callers as a "null dirfile" placeholder.
+
+  * GD_E_OPEN_INCLUDE has been renamed to GD_E_OPEN_FRAGMENT, but the former
+    symbol remains as an alias.
+
+  * Two new bitflags to gd_cbopen and gd_open: GD_ARM_ENDIAN and
+    GD_NOT_ARM_ENDIAN allow specifying the default ordering of double precision
+    data.  These flags may also be used with gd_alter_endianness() and will be
+    returned by gd_endianness().  On all platforms except for middle-endian
+    ARMs, GD_NOT_ARM_ENDIAN equals zero and may be omitted.
+
+  * Where gd_flush() and gd_metaflush() in the past raised GD_E_OPEN_INCLUDE
+    on I/O error, they now raise the new GD_FLUSH.
+
+  * All functions now raise GD_E_DIMENSION when encountering a scalar field
+    when expecting a vector.  In the past, the error value returned was
+    different for different functions.
+
+  * getdata.h now wraps itself in an extern "C" block if included by a C++
+    compiler.
+
+  * If passed a NULL pointer, gd_error_string() will return a newly malloc'd
+    buffer long enough to hold the entire string.  It should be free'd by the
+    caller.
+
+  * The parser data passed to the callback function now includes the length of
+    the buffer.  The parser also permits the callback to assign a new pointer to
+    the 'line' element of the parser data if the buffer passed in is too small.
+
+  * gd_metaflush() now fails and raises GD_E_ACCMODE if called on a read-only
+    dirfile.  (Previously it would successfully do nothing.)
+
+  Legacy API Changes
+
+  * In the legacy format struct, DIVIDE fields are listed as MULTIPLYs and RECIP
+    fields are listed as LINCOMs, with the dividend stored in m[0].
+
+  * BUG FIX: In previous versions, attempting to access an invalid dirfile
+    (anything that would cause gd_open to fail) resulted in leaked memory.  This
+    leak has been plugged.
+
+  * BUG FIX: A segfault involving the reporting of POLYNOM fields has been fixed
+    in GetFormat().
+
+  Bindings
+
+  * Bindings for the functionality introduced into 0.7.0 have been added.
+
+  * F77: GDPROT has been renamed GDAPRT to mirror the renaming of
+    gd_alter_protection().
+
+  * F77: GDGTCO and GDPTCO no longer return an indicator of success.
+
+  * F77: The signatues of GDGSCA and GDASCA have changed to return/take the
+    scalar index as well.
+
+  * F95: For consistency sake, the Fortran 95 bindings have undergone the same
+    renaming so they have the same name as their C counterparts.  All functions
+    are now preceded by 'fgd_'.
+
+  * F95: The fgd_get_constant_* and fgd_put_constant_* procedures are now
+    subroutines, not functions.
+
+  * C++: Const member functions are now flagged as such.
+
+  * C++: The len parameter to Dirfile::ErrorString is now ignored.
+
+  * C++: dirfiles are now opened read-only by default.
+
+  * IDL: The IDL bindings have also followed suit in the great renaming.  The
+    exception to this is GETDATA_CONSTANTS(), which is not renamed.
+
+  * IDL: Various constants defined in getdata.h but not used by the IDL bindings
+    have been removed from the structure returned by GETDATA_CONSTANTS().
+
+  * Python: dirfile.getdata() now raises ValueError if neither num_frames nor
+    num_samples are specified.  In the past, it would happily return nothing
+    in this case.
+
+  * Python: dirfiles are now opened read-only by default.
+
+
+  * C++ BUG FIX: Entry::Scalar() no longer rejects valid values of index.
+
+  * IDL BUG FIX: A memory impropriety involving keyword arguments.  This bug
+    manifested by rejecting valid keyword arguments on 64-bit systems, but may
+    have had other, subtle effects on 32-bit systems as well.
+
+  * Python BUG FIX: A non-literal phase shift is now properly reported.
+
+  * Python BUG FIX: Calling Dirfile.discard() or Dirfile.close() no longer
+    results in a segfault.
+
+  Miscellaneous
+
+  * The --disable-checkdirfile option has been removed from ./configure.  It
+    is now always installed.
+
+  * A utility, dirfile2ascii, is now installed alongside checkdirfile.  This
+    utility converts all or part of a dirfile into ASCII text.  dirfile2ascii
+    was written by Matthew Truch.
+
+  * The thoroughness of the checks done by checkdirfile have increased.  It now
+    reports format syntax errors, Dirfile Standards compliance, problems with
+    field definitions (such as missing input fields), and the size of the
+    dirfile.
+
+|==============================================================================|
+
+New in version 0.6.3:
+
+  Bindings
+
+  * A memory leak has been plugged in the Python bindings manifesting in calls
+    to dirfile.getdata() returning a NumPy array.  In previous versions, the
+    memory used by the returned array to hold the data was not reclaimed by GC.
+
+|==============================================================================|
+
+New in version 0.6.2:
+
+  Library Changes
+
+  * Attempting to get the number of frames from an ASCII file no longer fails
+    the second time.
+
+|==============================================================================|
+
+New in version 0.6.1:
+
+  API Changes
+
+  * The getdata.h header no longer includes complex.h explicitly.
+
+  Legacy API Changes
+
+  * A potential segfault relating to error reporting in the legacy API has
+    been fixed.
+
+  Bindings
+
+  * C++ BUG FIX: Several bugs preventing compilation of the C++ test-suite under
+    Fedora 13 have been fixed.
+
+  * IDL BUG FIX: Several segfaults in the IDL bindings have been eradicated.
+
+  Miscellaneous
+
+  * Libtool has been upgraded to 2.2.6b, which provides proper support for
+    Fortran-9x.  The outdated, internal libltdl has been removed.  Building
+    modules now requires an installed libltdl.
+
+|==============================================================================|
+
+New in version 0.6.0:
+
+  License
+
+  * The GetData library and its bindings are now distributed under the GNU
+    Lesser Public License, version 2.1 or later.
+
+  Dirfile Changes
+
+  * GetData now support Dirfile Standards Version 7.  Standards Version 7 adds
+    complex data types, a signed bitfield (SBIT), a polynomial derived field
+    (POLYNOM), and other features detailed below.
+
+  * Metafields can now be specified using a normal format specification line and
+    their full (slashed) field code.
+
+  * Field codes can now contain a "representation suffix", which allows
+    specifying a complex norm used to convert complex valued data into purely
+    real data.
+
+  * The n_fields parameter in a LINCOM specification is now optional.
+
+  * A new encoding scheme which supports LZMA compressed data using the .xz
+    container format has been added.
+
+  * Look-up tables may contain a complex y-value.  This prohibits writing to
+    the associated LINTERP field.
+
+  Library Changes
+
+  * The field parameters spf (RAW), bitnum and numbits (BIT and SBIT) are now
+    restricted to 16-bit numbers, which should be more than enough.  The public
+    API uses gd_spf_t and gd_bit_t for these quantities.
+
+  * The shift field parameter is now a 64-bit integer type, called gd_shift_t.
+
+  * The dirfile flags, including encoding and endianness symbols are now
+    explicitly long ints.  Previously these quantities mixed long int with int
+    arbitrarily.  This affects the public API.
+
+  * The parser callback has received a new, API breaking signature, which should
+    hopefully reduce the amount of API breakage in the future.  It is also now
+    possible for the caller to pass data through GetData to the callback, if
+    desired.
+
+  * Computation of derived fields can now handle complex valued inputs, and
+    computation will occur in the complex plane when required.
+
+  * The computation of LINCOM fields has been re-written and is now ~20% faster
+    for LINCOMs with 2 or 3 input fields.  (No change for LINCOMs of 1 field.)
+
+  * A new open flag, GD_PRETTY_PRINT, tells the library to attempt to write a
+    nicer looking format file.  What this specifically means, isn't part of the
+    public API and shouldn't be relied on in portable code.
+
+  * BUG FIX: dirfile_madd_spec() and dirfile_add_spec() didn't properly flag
+    the fragments they modified as dirty, leading to possible loss of metadata.
+
+  * BUG FIX: calling get_nframes on a bzip2 encoded dirfile would report the
+    wrong dirfile length.
+
+  * BUG FIX: LINTERP tables are now closed after loading, resolving a file
+    descriptor leak of great age (ie. pre-0.3.0).
+
+  * BUG FIX: When re-writing a format file fragment containing fields with
+    CONST scalar field parameters, GetData no longer replaces the CONST field
+    codes in the field specification lines with the value of the CONST field.
+
+  * BUG FIX: when moving a field with dirfile_move(), the fragment index in
+    the entry objects of metafields defined for the field were not updated.
+    (The metafields were placed in the correct fragment when the metadata was
+    flushed to disk, despite this.)
+
+  * BUG FIX: Calling getdata() or putdata() on 64-bit architectures in certain
+    situations involving a non-zero frameoffset no longer results in bizarrity.
+
+  * BUG FIX: A memory leak associated with RAW field metadata has been fixed.
+
+  * BUG FIX: 64-bit integer literals in the format file are no longer truncated
+    to double precision when read.
+
+  API Changes
+
+  * This release breaks ABI compatibility and, to a lesser extent, API
+    compatibility.  The SOVERSION of the library has been incremented
+    accordingly.
+
+  * A C-89 API will be declared by getdata.h if GETDATA_C89_API is defined
+    before inclusion.  If this symbol is not defined, the C API defined will
+    include C-99 conforming complex types, and getdata.h will include complex.h
+    if `complex' has not been defined before inclusion.
+
+  * Due to the new, simple way of specifying META fields in Standards Version 7,
+    dirfile_add_spec() and dirfile_alter_spec() can be used to modify
+    metafields. dirfile_madd_spec() and dirfile_malter_spec() remain as well.
+
+  * An array containing the CONST scalar field codes used when non-literal
+    parameters are used in the specification of various different fields has
+    been added to the gd_entry_t object.  As a side-effect of this,
+    dirfile_add(), dirfile_alter_entry(), and dirfile_madd() can be used to
+    manipulate non-literal field parameters.
+
+  * A function, get_native_type(), now exists which returns the underlying data
+    type of a specified field code.
+
+  * A function, get_framenum(), is now available to perform a "reverse look-up"
+    on a field: given a data value, it reports the frame number where the field
+    has that value.  The field must be monotonic.
+
+  * A function, dirfile_validate(), now exists which can be used to check the
+    validity of a field code before use.
+
+  * Two new error codes have been added: GD_E_DOMAIN, potentially returned by
+    get_framenum(), and GD_E_BAD_REPR, indicating an unrecognised representation
+    suffix, or an attempt to write to a representation.
+
+  * A new syntax error suberror code has been added: GD_E_FORMAT_LITERAL, which
+    indicates a syntax error in a complex literal number.
+
+  * BUG FIX: On success, dirfilename(), dirfile_reference(), and get_reference()
+    didn't change the error code to GD_E_OK, resulting in spurious error codes
+    from these functions.
+
+  * BUG FIX: dirfile_madd_string() and dirfile_madd_const() now don't fail
+    erroneously by reporting GD_E_BAD_CODE.
+
+  * BUG FIX: error strings relating to GD_E_DELETE error codes now report the
+    proper error information.
+
+  * BUG FIX: the list returned by get_mstrings() is now properly NULL
+    terminated.
+
+  * BUG FIX: the entry->table member now reports the proper path to the LUT.
+    (That is, the path stored in the format file.)  Previously it incorrectly
+    reported a path relative to the base dirfile directory.
+
+  Legacy API Changes
+
+  * Because they would otherwise be unreported, in the structure returned by
+    GetFormat(), POLYNOM entries are reported as LINCOM entries, by discarding
+    higher order terms.  Similarly, SBIT entries are reported as BIT entries.
+
+  Bindings
+
+  * Bindings for Python and the Interactive Data Language (IDL) have been
+    added.
+
+  * Bindings for the functionality introduced into 0.6.0 have been added.
+
+  * C++: The missing bindings for dirfilename(), get_nvectors(), and
+    get_fragment_index() have been added.
+
+  * C++: Empty entry class constructors have been added which allow delayed
+    specification of field metadata.
+
+  * C++: The dirfile.h header now includes all other C++ headers, and is now
+    the only header required to be included in applications.  (The other headers
+    can still be included, with no ill effects.)
+
+  * All bindings have a much expanded test suite, which has resulted in the
+    discovery of many bugs (subsequently fixed).
+
+  * F77: The callback function is now dirfile-specific, as it is in the C API.
+
+  * C++ BUG FIX: Entry class constructors now properly set the field name for
+    metafields.
+
+  * C++ BUG FIX: Fragment::SetEncoding() now actually does what it advertises,
+    instead of doing nothing.
+
+  * C++ BUG FIX: The recode argument to various functions is now optional and
+    defaults to zero, as the documentation already indicated.
+
+  * C++ BUG FIX: dirfile_close() was not being called by the Dirifle destructor.
+
+  * F77 BUG FIX: a NULL C string returned from the C API now returns an empty
+    string, rather than causing a segfault.
+
+  * F77 BUG FIX: attempting to call another F77 function before calling GDCOPN
+    or GDOPEN no longer results in a segfault.
+
+  * F77 BUG FIX: passing an out-of-range dirfile unit no longer results in
+    undefined behaviour.
+
+  * F77 BUG FIX: the last character of a string returned by the bindings is no
+    longer deleted.
+
+  * F77 BUG FIX: string lengths now report the correct length.
+
+  * F77 BUG FIX: passing dirfile unit 0 to GDCLOS or GDDSCD no longer corrupts
+    the bindings.
+
+  * F77 BUG FIX: GDFLDN no longer accepts indices less than one.
+
+  * F77 BUG FIX: GDESTR now space pads its output string, rather than filling
+    the remainder of the string with garbage.
+
+  * F77 BUG FIX: The get_entry() bindings, GDGExx no longer segfault on dirfile
+    error.
+
+  * F77 BUG FIX: GDGTST and GDPTST now report the FORTRAN string length, which
+    is one less than the C API would report, due to the lack of a terminating
+    null.
+
+  * F95 BUG FIX: Attempting to retrieve a PHASE entry with fget_entry() now
+    works.
+
+  * F95 BUG FIX: Several routines which were named fdrifile_<foo> are now
+    properly spelled.
+
+  Miscellaneous
+
+  * All bindings can now be disabled by passing --disable-bindings to
+    ./configure.
+
+|==============================================================================|
+
+New in version 0.5.0:
+
+  Dirfile Changes
+
+  * Support for two new encoding schemes has been added which handle bzip2 and
+    gzip compression.  Like the slim encoding, the bzip and gzip encoding
+    schemes currently do not support writing, but do allow reading dirfile data
+    compressed with the standard gzip and bzip2 utilities.  Reading compressed
+    data is unsurprisingly slow.
+
+  Library Changes
+
+  * Encoding schemes relying on external libraries (slim, gzip, bzip2) may now
+    be built into stand-alone library modules which will be loaded, as needed,
+    at runtime.  GetData will fail gracefully if modules are missing.  See the
+    README for full details.
+
+  * BUG FIX: Writing metadata to disc now preserves the permissions of the
+    format file fragments which are changed.
+
+  * BUG FIX: Format files without a line feed character at the end of the file
+    no longer cause the parser to segfault.
+
+  * BUG FIX: putdata() now reports the correct number of samples written for
+    ASCII encoded files.
+
+  * BUG FIX: GetData no longer inserts unnecessary "/./" elements into the paths
+    it reports.
+
+  API Changes
+
+  * The caller can now register a callback function with a DIRFILE by opening
+    the dirfile with dirfile_cbopen instead of dirfile_open.  This callback
+    function will be called by GetData whenever the format file parser
+    encounters a syntax error.  The callback function can be used by the caller
+    to either correct the syntax error, or else tell GetData whether to ignore
+    the line or not.  The callback function may be later modified by calling
+    dirfile_parser_callback.
+
+  * A fragment may be removed from a dirfile by calling dirfile_uninclude.
+
+  * The pathname of the dirfile may be retrieved by calling dirfilename.
+
+  * The reference field for the dirfile may be set or retrieved by calling
+    dirfile_reference.
+
+  * Fragment metadata may be queried or modified by calling:
+
+      - get_encoding, dirfile_alter_encoding
+      - get_endianness, dirfile_alter_endianness
+      - get_frameoffset, dirfile_alter_frameoffset
+      - get_protection, dirfile_protect
+      - get_parent_fragment
+
+  * Various functions now exist to modify field metadata:
+
+      - dirfile_alter_entry, dirfile_alter_<field-type>, dirfile_alter_spec,
+        dirfile_malter_spec
+
+  * A field may be moved to a different format file fragment using dirfile_move.
+
+  * A field may be renamed by using dirfile_rename.
+
+  * A field may be removed from the dirfile by calling dirfile_delete.
+
+  * The type or fragment index of a field may be retrieved by calling
+    get_entry_type or get_fragment_index, respectively.
+
+  * The pathname of a raw field may be obtained from a call to get_raw_filename.
+
+  * A DIRFILE may be deallocated without saving modified metadata by calling
+    dirfile_discard.
+
+  * A new flag, GD_IGNORE_DUPS, may be passed to dirfile_open to tell the
+    parser to ignore duplicate field specifications in the format files.  This
+    is really only useful identically duplicate specifications, since there is
+    no indication of which of the duplicates is honoured.  Explicit control can
+    be obtained by handling this inside a caller supplied callback function.
+
+  Bindings:
+
+  * All functions in the Fortran 77 bindings have been completely renamed from
+    GDFxxx to GDxxxx to provide a larger namespace for our use.
+
+  * Fortran 77, Fortran 95, and C++ bindings have been updated for the latest
+    API changes.
+
+  * BUG FIX: Fortran 77 functions which return character strings no longer
+    corrupt memory as a side-effect of operation.  This also affected the
+    Fortran 95 bindings.
+
+  Miscellaneous:
+
+  * BUG FIX: The dirifle_madd_bit(3) manual page has been corrected to show
+    the correct order or parameters for all the dirfile_madd_<field_type>
+    functions.
+
+|==============================================================================|
+
+New in version 0.4.2:
+
+  Library Changes
+
+  * BUG FIX: The default protection level of format file fragments is now
+    properly set to "none".  Reported by Brendan Crill.
+
+  * BUG FIX: getdata() now reports the correct number of samples read for slim
+    and ASCII encoded files.  Reported by Adam Hincks.
+
+  * BUG FIX: A segmentation fault only encountered when reading slim encoded
+    data has been fixed in dirfile_flush().
+
+  Legacy API Changes
+
+  * Several fixes have been made to better re-create the legacy API:
+
+      - the return value of GetFormat is no longer marked const (although
+        it should be considered so).
+      - a symbolic link getdata_struct.h -> getdata.h is created when the
+        headers are installed, but only if the legacy API is present in the
+        library.
+      - when included with a C++ compiler, the legacy function prototypes
+        are wrapped in an extern "C" block. (The new API functions are not.)
+
+|==============================================================================|
+
+New in version 0.4.1:
+
+  Library Changes
+
+  * BUG FIX: Adding an ASCII encoded RAW field no longer creates an empty,
+    unencoded binary file.
+
+  * BUG FIX: A few minor memory leaks have been patched.  Most of these
+    were the result of insufficient clean up in dirfile_close().
+
+  * As an exception to the Standards, the full stop character '.' is once
+    again permitted in field names.  This is required by BLAST.  Instead,
+    field names are prohibited from ending with the known encoding extensions.
+    The Standards still prohibit the full stop character in field names, and the
+    GD_PEDANTIC flag will disable this exception.  Furthermore, fields may not
+    be added via GetData which contain a full stop character.
+
+  * Some minor speed improvements have been made to the format file parser
+    resulting in a ~30% decrease in parsing time.
+
+|==============================================================================|
+
+New in version 0.4.0:
+
+  Dirfile Changes
+
+  * GetData now supports Dirfile Standards Version 6.  Standards Version 6 adds
+    numerical (CONST) and string (STRING) scalar fields to the dirfile, as well
+    as other features outlined below.
+
+  * CONST names can now appear as parameters in field specifications in certain
+    places in lieu of a literal number.
+
+  * The tokeniser has been re-written.  Any sequence of non-NUL bytes can now
+    form a valid token.  Field codes may not have ASCII control characters
+    or the "reserved characters" &, /, ;, <, >, |, . but may contain any other
+    characters (including whitespace).
+
+  * Subordinate fields may now be attached to fields.  These subfields are
+    defined with the META directive, and referenced in most cases as
+    "<parent-field>/<subfield>".
+
+  * Binary files in dirfiles may now be "encoded".  In addition to raw
+    (unencoded) files, two encodings are currently supported:
+
+      - ASCII encoding (a simple proof-of-functionality encoding), and
+      - Slimlib encoding (a compression library used by ACT).
+
+    Encoding schemes are fragment-local, although they are inherited from parent
+    fragments.
+
+  * Endianness is now also fragment-local, meaning different endiannesses can
+    co-exist in the same dirfile (so long as the fields are defined in different
+    format file fragments), and GetData will do the Right Thing.
+
+  * "FILEFRAM" is no-longer supported as an alias for "INDEX".  This affects
+    GetData's implementation of all Standards Versions.  Code that made use of
+    FILEFRAM will have to be updated to use INDEX instead.
+
+  * The reference field, previously the first RAW field in the format file,
+    may now be specified using the REFERENCE directive.  The reference field
+    is the field that is looked at when get_nframes() is called.  This is
+    important to programs like kst which support streaming dirfiles.
+
+  * Portions (or all) of a dirfile's data and metadata can be protected from
+    change by specifying the PROTECT directive.  This protection is "advisory",
+    ie. while GetData will respect it in all cases, don't count on the PROTECT
+    directive to ensure data integrity.
+
+  Library Changes
+
+  * INDEX is now a normal field.  It appears in the count/list functions.
+    Attempts to write to INDEX will fail.
+
+  * The GD_E_EMPTY error code has been removed: it is no longer an error to
+    query a dirfile containing no RAW fields.
+
+  * The presence of two fields in the dirfile with the same name is now
+    detected, and will cause a syntax error when parsing the format file.
+    Previously, such things were allowed, but only one of the synonym fields
+    could ever be queried. (Which field was returned was arbitrary.)
+
+  * Field code look-ups for input fields are now cached, which should result
+    in slightly better performance from the library.
+
+  API Changes
+
+  * Fields may now be added to dirfiles in a number of different ways:
+
+    - by passing an gd_entry_t to dirfile_add()
+    - by passing a field specification line to dirfile_add_spec()
+    - by passing field parameters to one of the dirfile_add_<foo>() functions.
+
+  * Whole other format file fragments may also be added to the dirfile by
+    calling dirfile_include().
+
+  * A function is now present (dirfile_metaflush()) to flush metadata changes to
+    disk (by re-writing format file fragments).  dirfile_flush() and
+    dirfile_close() will also flush metadata, if needed.
+
+  * STRING and CONST values can be retrieved/set by calling (get,put)_string()
+    and (get,put)_constant().  (get,put)data() are only for vector type fields.
+
+  * META fields can be queried/set like normal fields using the get/put
+    functions and their full (slashed) field code.
+
+  * In addition to get_nfields() and get_field_list(), there are now
+    corresponding functions that provide lists/counts of vectors
+    (get_vector_list()/get_nvectors()), particular field types
+    (get_field_list_by_type()/get_nfields_by_type()), as well as functions
+    that provide lists of string values (get_string_values()) and constant
+    values (get_const_values()).
+
+  * Analogous functions for the add, list, and counting functions exist for
+    META fields, as well.
+
+  * Extra flags have been added to dirfile_open() to permit indicating the
+    encoding type, if not specified in the dirfile itself.
+
+  * DIRFILE struct members and gd_entry_t private members are now completely
+    hidden from the public interface.  Where previously callers could query
+    dirfile->error to check for an error, they must now call get_error(dirfile).
+    This change was made to reduce unintentional ABI breakage when modifying
+    internal library properties.
+
+  * GD_VERBOSE has been added to the list of available dirfile_open() flags.
+    If this flag is specified, GetData will write errors to stderr as
+    encountered.
+
+  Legacy API Changes
+
+  * Error codes which cannot be returned by the legacy API might not have a
+    corresponding string in GD_ERROR_CODES[].  Instead, these entries will
+    simply be the NULL pointer.
+
+  * No facilities exist in the legacy API to set or query CONST or STRING
+    fields.  However, META fields of vector type can be queried/set using
+    GetData() and PutData(), as in the new API.
+
+|==============================================================================|
+
+New in version 0.3.1:
+
+  Legacy API Changes
+
+  * BUG FIX: Dirfiles are now opened in read-only mode, unless instantiated via
+    PutData(), allowing GetData() calls on read-only dirfiles.  If
+    PutData() is called on a dirfile previously opened read-only, it will be
+    re-opened in read-write mode.
+
+  Bindings
+
+  * The C++ bindings, formerly called libdirfile, are now called libgetdata++
+    to be more explicit about what this library is.
+
+  Miscellaneous
+
+  * The package now includes pkg-config support for libgetdata.
+
+|==============================================================================|
+
+New in version 0.3.0:
+
+  Dirfile Changes
+
+  * GetData now supports Dirfile Standards Version 5 which includes support
+    for signed 8-bit, and signed and unsigned 64-bit integer types.
+
+  * As part of Standards Version 5, the restriction on field name length has
+    been removed.  (The filesystem will impose an effective limit on RAW fields
+    of a few hundred characters, and format file lines are limited to several
+    thousand, limiting derived field names.)
+
+  * The library can now convert between big and little endiannesses.  An
+    optional directive, ENDIAN, added in Standards Version 5, is available to
+    specify the byte-sex of a dirfile.
+
+  API Changes
+
+  * There is a new interface which fixes issues with thread safety and largefile
+    support in the old interface.  The old interface (referred to as the "legacy
+    API") is still supported, but doesn't fully implement Dirfile Standards
+    Version 5.  See the README for full details.
+
+  * putdata now respects FRAMEOFFSET.
+
+  * putdata can now write to PHASE fields, and multi-bit BIT fields.
+
+  * Some error codes have been renamed, and others removed or added, in order to
+    regularise error codes between getdata and putdata in the sundry versions.
+    Furthermore, the underlying values of some of these codes have changed
+    (notably excluding GD_E_OK, which is guaranteed to be zero). Changes
+    include:
+
+      - GD_E_OPEN_FORMAT is now called GD_E_OPEN
+      - GD_E_BAD_RETURN_TYPE is now called GD_E_BAD_TYPE
+      - GD_E_NO_RAW_FIELDS is now called GD_E_EMPTY
+      - PD_E_MULT_LINCOM is now called GD_E_BAD_PUT_FIELD
+      - GD_E_OPEN_RAWFIELD and PD_E_OPEN RAWFIELD are now both represented by
+          GD_E_RAW_IO
+      - PD_E_BAD_CODE is now handled by GD_E_BAD_CODE
+      - GD_E_FIELD, GD_E_SIZE_MISMATCH, ENDIAN_ERROR, CLOSE_ERROR are no longer
+        applicable and have been removed
+      - PD_E_CLOSE_RDONLY, PD_E_WRITE_LOCK, PD_E_FLOCK_ALLOC, which were were
+        defined in the header but never used, have been removed
+      - GD_E_TRUNC, GD_E_CREAT, GD_E_BAD_DIRFILE, GD_E_RANGE and GD_E_ACCMODE
+        are new
+
+    This affects the legacy API.
+
+  Legacy API Changes
+
+  * The legacy API has been marked deprecated.
+
+  * Error codes have changed per the description above.
+
+  * Only the public members of FormatType are now initialised by GetFormat.
+
+  Bindings
+
+  * Added bindings for C++ (libdirfile), Fortran 77 (libfgetdata), and
+    Fortran 95 (libf95getdata)
+
+  Miscellaneous
+
+  * A rudimentary, but thorough, test-suite has been made.
diff --git a/README b/README
new file mode 100644
index 0000000..66b5c72
--- /dev/null
+++ b/README
@@ -0,0 +1,280 @@
+THE GETDATA PROJECT
+===================
+
+The GetData Project is the reference implementation of the Dirfile Standards.
+The Dirfile database format is designed to provide a fast, simple format for
+storing and reading binary time-ordered data.  The Dirfile Standards are
+described in detail in three Unix manual pages distributed with this package:
+dirfile(5), dirfile-format(5) and dirfile-encoding(5), which may be read before
+installation by running:
+
+  $ man man/dirfile.5
+  $ man man/dirfile-format.5
+  $ man man/dirfile-encoding.5
+
+from the top GetData Project directory (the directory containing this README
+file).  After installation, they can be read with the standard man command:
+
+  $ man dirfile
+  $ man dirfile-format
+  $ man dirfile-encoding
+
+More information on the GetData Project and the Dirfile database format may be
+found on the World Wide Web:
+
+  http://getdata.sourceforge.net/
+
+
+WARRANTY AND REDISTRIBUTION
+===========================
+
+GetData is free software; you can redistribute it and/or modify it under the
+terms of the GNU Lesser General Public License as published by the Free Software
+Foundation: either version 2.1 of the License, or (at your option) any later
+version.
+
+GetData is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with GetData in a file called `COPYING'; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+
+
+CONTENTS
+========
+
+This package provides:
+  * the Dirfile Standards documents (three Unix manual pages)
+  * the C GetData library (libgetdata) including Unix manual pages
+  * Several utitilities, which also serve as examples of use:
+    - checkdirfile, which checks the metadata of a dirfile for problems
+    - dirfile2ascii, which can convert all or part of a dirfile to ASCII text
+  * several bindings to the library from other languages:
+    - C++ (libgetdata++)
+    - Fortran 77 (libfgetdata)
+    - Fortran 95 (libf95getdata)
+    - the Interactive Data Language (IDL; idl_getdata)
+    - MATLAB (libgetdata-matlab and associated MEX files)
+    - Perl (GetData.pm)
+    - Python (pygetdata)
+
+Documentation for the various bindings, if present, can be found in files
+named `README.<language>' in the doc/ directory.  The C interface is described
+in this document and the associated man pages.
+
+A full list of features new to this release of GetData may be found in the
+file called `NEWS'.
+
+
+DIRFILE STANDARDS VERSION 9
+===========================
+
+The 0.8.0 release of the GetData Library (July 2012) is the first release to
+provide suuport the latest version of the Dirfile Standards, known as Standards
+Version 9.
+
+Standards Version 9 introduces the following:
+  * Two new field types: MPLEX and WINDOW, both meant to deal with extracting a
+    subset of their input.
+  * Field name munging via /INCLUDEs, aliases, and "hidden" names.
+  * Support for zzip-compressed dirfiles, as well as simple compression via an
+    in-built scheme called Sample Index Encoding.
+
+This is the first update to the Dirfile Standards since Standards Version 8
+(November 2010).  A full history of the Dirfile Standards can be found in the
+dirfile-format(5) man page.
+
+
+BUILDING THE LIBRARY
+====================
+
+This package may be configured and built using the GNU autotools.  Generic
+installation instructions are provided in the file called `INSTALL'.  A
+brief summary follows.  A C99-compliant compiler is required to build (but not
+to use) the package, although a compatible library with reduced functionality
+can be built with any ANSI C compiler.
+
+Most users should be able to build the package by simply executing:
+
+  $ ./configure
+  $ make
+
+from the top GetData Project directory (the directory containing this README
+file).  After the project has been built, you may (optionally) test the build by
+executing:
+
+  $ make check
+
+which will run a series of self-tests.  Finally,
+
+  $ make install
+
+will install the utilities, libraries, bindings, and documentation.
+
+The package configuration can be changed, if the default configuration is
+insufficient, before building it by passing options to ./configure.  Running
+
+  $ ./configure --help
+
+will display a brief help message summarising available options.
+
+
+PREREQUISITES
+=============
+
+The only library required to build GetData is the C Standard Library.  Several
+other external will be used if found by ./configure to provide support for
+various data encodings (typically compression schemes).  These are:
+
+- the slim compression library by Joseph Fowler;
+- the zlib library by Jean-loup Gailly and Mark Adler;
+- the bzip2 compression library by Julian Seward;
+- the lzma library, part of the XZ Utils suite by Lasse Collin, Ville Koskinen,
+  and Igor Pavlov; and,
+- the zzip library by Tomi Ollila and Guido Draheim.
+
+If these libraries are not found by configure, GetData will lack support for
+the associated encoding scheme and fail gracefully if encountering dirfiles so
+encoded.
+
+Building bindings requires appropriate compilers/interpreters and libraries for
+the various languages.  In particular:
+
+- the C++ bindings require a C++90 compliant compiler
+- the Fortran-77 bindings require a Fortran-77 compliant compiler
+- the Fortran-95 bindings require both a Fortran-95 compliant compiler and a
+  Fortran-77 compiler (because the Fortran-95 bindings are built on top of
+  the Fortran-77 bindings)
+- the IDL bindings require a licenced IDL interpreter, version 5.5 or later;
+  they will not work on an unlicenced interpreter in timed demo mode
+- the MATLAB bindings require both a MATLAB interpreter and a MEX compiler
+- the Perl bindings require a Perl5 interpreter version 5.6 or later, as well
+  as the Math::Complex and Module::Build modules.
+- the Python bindings require Python 2.3 or later.  NumPy is also highly
+  recommended for efficient use.
+
+USING THE LIBRARY
+=================
+
+To use the library in C programs, the header file getdata.h should be included.
+This file declares all the various APIs provided by th library.  Programs
+linking to static versions of the GetData library need to be linked against the
+C Standard Math Library, in addition to GetData itself, plus any other libraries
+required for encodings supported by the library, e.g. using `-lgetdata -lm
+<other-libraries>'.
+
+The various small programs in the `util' subdirectory of the package provide
+examples of use.
+
+The checkdirfile utility was designed to report syntax errors in the format
+file(s) of the large, complex dirfiles used in the analysis of the BLAST
+experiment data.  This utility will report all syntax errors it find in the
+supplied dirfile, plus any problems in the metadata itself.
+
+Bindings exist for using the GetData library in languages other than C.  If
+language bindings exist for your particular library, a README.<language> file
+explaining its use should be present in the `doc' subdirectory.
+
+If no bindings exist for your language of choice, you will have to write your
+own.  If you are willing to have these bindings redistributed under identical
+terms as the GetData Project, we encourage you to submit them for inclusion in
+the package.
+
+
+USING MODULES
+=============
+
+Starting with GetData 0.5.0, encoding schemes which rely on optional external
+libraries (slim, gzip, bzip2, &c.) may be built as stand-alone library modules
+which will be dynamically loaded, as needed, at runtime by the core GetData
+library.  This architecture is provided to permit packaging the core GetData
+library separately from the parts of the library requiring the optional external
+libraries without having to give up the functionality these extra libraries
+provide.  To enable this behaviour, pass `--enable-modules' to ./configure.
+
+The modules are dynamically loaded via GNU libtool's portable dlopen wrapper
+library, libltdl.  The libltdl library permits dynamic loading of modules on at
+least Solaris, Linux, BSD, HP-UX, Win16, Win32, BeOS, Darwin, MacOS X.  The
+libltdl library is no longer distributed with GetData.  It can usually be found
+as part of the GNU libtool package on any modern GNU system, or else obtained
+for free from the GNU Project.
+
+GetData will fail gracefully if a library module is not found or cannot be
+opened at runtime.  In this case, the call which triggered the attempt to load
+the module will fail with the GD_E_UNSUPPORTED error.
+
+The dlopen library (and, by extension, libltdl) is notoriously not thread safe.
+As a result, if a POSIX thread implementation can be found, calls to the dynamic
+loader will be wrapped in a mutex.
+
+
+THE GETDATA HEADER FILE
+=======================
+
+The GetData header file, `getdata.h', installed in ${prefix}/include, declares
+the new API.  It also includes `getdata_legacy.h' (also installed) which
+declares the legacy API.  The legacy header should never be included directly.
+Defining the preprocessor symbol `GD_NO_LEGACY_API' before including getdata.h
+will prevent the legacy API from being declared.  In cases when the legacy API
+is declared, getdata.h will define the symbol GD_LEGACY_API, which can be used
+by callers to determine whether the legacy API is present at compile time.
+
+If the legacy API is not built (as a result of passing `--disable-legacy-api'
+to ./configure), getdata_legacy.h will not be installed, and the legacy API will
+never be declared.
+
+The default GetData API makes use of C99 features.  An ANSI C API is also
+available and can be used by defining GD_C89_API before including getdata.h.  If
+GetData was built without a C99-compliant compiler, the C99 API will be missing.
+In this case, the ANSI C API will be enabled by default (as if GD_C89_API were
+always defined) and, furthermore, getdata.h will define the symbol GD_NO_C99_API
+to indicate this.
+
+
+LARGEFILE SUPPORT
+=================
+
+When built on a platform using the GNU C Library, or another compatible
+C Library, the new GetData API will respect the feature test macros
+_LARGEFILE64_SOURCE and _FILE_OFFSET_BITS affecting largefile (> 2 GB)
+support.  If one or the other of these are to be used, they must be defined
+before including getdata.h or any Standard C Library header file.
+
+The first of these, _LARGEFILE64_SOURCE, if defined before including getdata.h,
+will enable the obsolete, transitional largefile extensions defined by the LFS.
+This will enable explicit support for large files through the definition of the
+64-bit explicit type `off64_t', and result in GetData defining the explicitly
+64-bit interfaces `gd_getdata64', `gd_putdata64', `gd_get_nframes64', &c.  This
+macro is largely obsolete, and using _FILE_OFFSET_BITS is preferred, if
+supported.
+
+The second macro, _FILE_OFFSET_BITS, determines the size of `off_t'.  If not
+defined, or defined to `32', `off_t' will be the old 32-bit type.  If, instead,
+this macro is defined to `64', `off_t' will be the largefile supporting 64-bit
+type, and calls to gd_getdata, gd_putdata, &c. will intrinsically have largefile
+support.  On 64-bit systems this macro has no effect, since a 64-bit `off_t'
+is used all the time.
+
+If your system uses the GNU C Library, the feature_test_macros(7) man page
+will provide further explanation.  On systems where these macros are
+unsupported, the gd_getdata64, &c. interfaces will never be defined, and the
+size of `off_t' will be system dependent.  In this case, GetData will likely
+lack largefile support.
+
+If you build GetData against a C Library that lacks largefile support, the
+GetData library will not support large files either, no matter what you do with
+these macros.
+
+
+AUTHOR
+======
+
+The Dirfile Standards and the GetData library were conceived and written by
+C. B. Netterfield <netterfield at astro.utoronto.ca>.
+
+Since Standards Version 3 (January 2006), the Dirfile Standards and GetData
+have been maintained by D. V. Wiebe <dvw at ketiltrout.net>.
+
+A full list of contributors is given in the file called `AUTHORS'.
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..43c20fb
--- /dev/null
+++ b/TODO
@@ -0,0 +1,5 @@
+* Locking
+* Hashed compressed files
+* linterp table path munging [MH]
+* Make webpage suck less
+* Fused multiply-add [CBN]
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..c4f38ec
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1418 @@
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.14'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.14.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# Figure out how to run the assembler.                      -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AS
+# ----------
+AC_DEFUN([AM_PROG_AS],
+[# By default we simply use the C compiler to build assembly code.
+AC_REQUIRE([AC_PROG_CC])
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
+AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
+])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "$am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+             [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+		  [_AM_DEPENDENCIES([CC])],
+		  [m4_define([AC_PROG_CC],
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+		  [_AM_DEPENDENCIES([CXX])],
+		  [m4_define([AC_PROG_CXX],
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES([OBJC])],
+		  [m4_define([AC_PROG_OBJC],
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+		  [_AM_DEPENDENCIES([OBJCXX])],
+		  [m4_define([AC_PROG_OBJCXX],
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# ---------------------------------------------------------------------------
+# Adds support for distributing Python modules and packages.  To
+# install modules, copy them to $(pythondir), using the python_PYTHON
+# automake variable.  To install a package with the same name as the
+# automake package, install to $(pkgpythondir), or use the
+# pkgpython_PYTHON automake variable.
+#
+# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
+# locations to install python extension modules (shared libraries).
+# Another macro is required to find the appropriate flags to compile
+# extension modules.
+#
+# If your package is configured with a different prefix to python,
+# users will have to add the install directory to the PYTHONPATH
+# environment variable, or create a .pth file (see the python
+# documentation for details).
+#
+# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
+# cause an error if the version of python installed on the system
+# doesn't meet the requirement.  MINIMUM-VERSION should consist of
+# numbers and dots only.
+AC_DEFUN([AM_PATH_PYTHON],
+ [
+  dnl Find a Python interpreter.  Python versions prior to 2.0 are not
+  dnl supported. (2.0 was released on October 16, 2000).
+  m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
+[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
+ python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
+
+  AC_ARG_VAR([PYTHON], [the Python interpreter])
+
+  m4_if([$1],[],[
+    dnl No version check is needed.
+    # Find any Python interpreter.
+    if test -z "$PYTHON"; then
+      AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
+    fi
+    am_display_PYTHON=python
+  ], [
+    dnl A version check is needed.
+    if test -n "$PYTHON"; then
+      # If the user set $PYTHON, use it and don't search something else.
+      AC_MSG_CHECKING([whether $PYTHON version is >= $1])
+      AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
+			      [AC_MSG_RESULT([yes])],
+			      [AC_MSG_RESULT([no])
+			       AC_MSG_ERROR([Python interpreter is too old])])
+      am_display_PYTHON=$PYTHON
+    else
+      # Otherwise, try each interpreter until we find one that satisfies
+      # VERSION.
+      AC_CACHE_CHECK([for a Python interpreter with version >= $1],
+	[am_cv_pathless_PYTHON],[
+	for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
+	  test "$am_cv_pathless_PYTHON" = none && break
+	  AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
+	done])
+      # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
+      if test "$am_cv_pathless_PYTHON" = none; then
+	PYTHON=:
+      else
+        AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
+      fi
+      am_display_PYTHON=$am_cv_pathless_PYTHON
+    fi
+  ])
+
+  if test "$PYTHON" = :; then
+  dnl Run any user-specified action, or abort.
+    m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
+  else
+
+  dnl Query Python for its version number.  Getting [:3] seems to be
+  dnl the best way to do this; it's what "site.py" does in the standard
+  dnl library.
+
+  AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
+    [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
+  AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
+
+  dnl Use the values of $prefix and $exec_prefix for the corresponding
+  dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
+  dnl distinct variables so they can be overridden if need be.  However,
+  dnl general consensus is that you shouldn't need this ability.
+
+  AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
+  AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
+
+  dnl At times (like when building shared libraries) you may want
+  dnl to know which OS platform Python thinks this is.
+
+  AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
+    [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
+  AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
+
+  # Just factor out some code duplication.
+  am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x.  See automake bug#10227.
+try:
+    import sysconfig
+except ImportError:
+    can_use_sysconfig = 0
+else:
+    can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+    from platform import python_implementation
+    if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
+        can_use_sysconfig = 0
+except ImportError:
+    pass"
+
+  dnl Set up 4 directories:
+
+  dnl pythondir -- where to install python scripts.  This is the
+  dnl   site-packages directory, not the python standard library
+  dnl   directory like in previous automake betas.  This behavior
+  dnl   is more consistent with lispdir.m4 for example.
+  dnl Query distutils for this directory.
+  AC_CACHE_CHECK([for $am_display_PYTHON script directory],
+    [am_cv_python_pythondir],
+    [if test "x$prefix" = xNONE
+     then
+       am_py_prefix=$ac_default_prefix
+     else
+       am_py_prefix=$prefix
+     fi
+     am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+    sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+    from distutils import sysconfig
+    sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
+     case $am_cv_python_pythondir in
+     $am_py_prefix*)
+       am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
+       am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
+       ;;
+     *)
+       case $am_py_prefix in
+         /usr|/System*) ;;
+         *)
+	  am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
+	  ;;
+       esac
+       ;;
+     esac
+    ])
+  AC_SUBST([pythondir], [$am_cv_python_pythondir])
+
+  dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
+  dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
+  dnl   more consistent with the rest of automake.
+
+  AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
+
+  dnl pyexecdir -- directory for installing python extension modules
+  dnl   (shared libraries)
+  dnl Query distutils for this directory.
+  AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
+    [am_cv_python_pyexecdir],
+    [if test "x$exec_prefix" = xNONE
+     then
+       am_py_exec_prefix=$am_py_prefix
+     else
+       am_py_exec_prefix=$exec_prefix
+     fi
+     am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+    sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+    from distutils import sysconfig
+    sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
+     case $am_cv_python_pyexecdir in
+     $am_py_exec_prefix*)
+       am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
+       am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
+       ;;
+     *)
+       case $am_py_exec_prefix in
+         /usr|/System*) ;;
+         *)
+	   am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
+	   ;;
+       esac
+       ;;
+     esac
+    ])
+  AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
+
+  dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
+
+  AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
+
+  dnl Run any user-specified action.
+  $2
+  fi
+
+])
+
+
+# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# ---------------------------------------------------------------------------
+# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
+# Run ACTION-IF-FALSE otherwise.
+# This test uses sys.hexversion instead of the string equivalent (first
+# word of sys.version), in order to cope with versions such as 2.2c1.
+# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
+AC_DEFUN([AM_PYTHON_CHECK_VERSION],
+ [prog="import sys
+# split strings by '.' and convert to numeric.  Append some zeros
+# because we need at least 4 digits for the hex conversion.
+# map returns an iterator in Python 3.0 and a list in 2.x
+minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
+minverhex = 0
+# xrange is not present in Python 3.0 and range returns an iterator
+for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
+sys.exit(sys.hexversion < minverhex)"
+  AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
+
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
+  rm -rf conftest.dir
+
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/ax_compare_version.m4])
+m4_include([m4/compiler.m4])
+m4_include([m4/encoding.m4])
+m4_include([m4/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/python.m4])
+m4_include([m4/win32.m4])
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
new file mode 100644
index 0000000..df53b0f
--- /dev/null
+++ b/bindings/Makefile.am
@@ -0,0 +1,63 @@
+# Copyright (C) 2008-2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+
+BUILDCC=@BUILDCC@
+
+if MAKE_CXXBINDINGS
+CXX_SUBDIR=cxx
+endif
+
+if MAKE_F77BINDINGS
+F77_SUBDIR=f77
+endif
+
+if MAKE_IDLBINDINGS
+IDL_SUBDIR=idl
+endif
+
+if MAKE_MATLABBINDINGS
+MATLAB_SUBDIR=matlab
+endif
+
+if MAKE_PYBINDINGS
+PY_SUBDIR=python
+endif
+
+if MAKE_PERLBINDINGS
+PERL_SUBDIR=perl
+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}
+
+make_parameters$(EXEEXT): $(make_parameters_SOURCES) \
+				    $(nodist_make_parameters_SOURCES)
+	${BUILDCC} $(DEFS) -I../src -o make_parameters$(EXEEXT) \
+		$(srcdir)/$(make_parameters_SOURCES)
+
+clean-local:
+	rm -rf *~ 
diff --git a/bindings/Makefile.in b/bindings/Makefile.in
new file mode 100644
index 0000000..b1925a4
--- /dev/null
+++ b/bindings/Makefile.in
@@ -0,0 +1,821 @@
+# 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@
+noinst_PROGRAMS = make_parameters$(EXEEXT)
+subdir = bindings
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_make_parameters_OBJECTS = make_parameters.$(OBJEXT)
+nodist_make_parameters_OBJECTS =
+make_parameters_OBJECTS = $(am_make_parameters_OBJECTS) \
+	$(nodist_make_parameters_OBJECTS)
+make_parameters_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+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 = $(make_parameters_SOURCES) $(nodist_make_parameters_SOURCES)
+DIST_SOURCES = $(make_parameters_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = . f77 cxx idl matlab python perl
+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_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008-2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+ at MAKE_CXXBINDINGS_TRUE@CXX_SUBDIR = cxx
+ at MAKE_F77BINDINGS_TRUE@F77_SUBDIR = f77
+ at MAKE_IDLBINDINGS_TRUE@IDL_SUBDIR = idl
+ at MAKE_MATLABBINDINGS_TRUE@MATLAB_SUBDIR = matlab
+ at MAKE_PYBINDINGS_TRUE@PY_SUBDIR = python
+ at MAKE_PERLBINDINGS_TRUE@PERL_SUBDIR = perl
+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}
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/make_parameters.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(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: check-recursive
+all-am: Makefile $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libtool clean-local \
+	clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am
+
+
+make_parameters$(EXEEXT): $(make_parameters_SOURCES) \
+				    $(nodist_make_parameters_SOURCES)
+	${BUILDCC} $(DEFS) -I../src -o make_parameters$(EXEEXT) \
+		$(srcdir)/$(make_parameters_SOURCES)
+
+clean-local:
+	rm -rf *~ 
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/cxx/Makefile.am b/bindings/cxx/Makefile.am
new file mode 100644
index 0000000..b87c686
--- /dev/null
+++ b/bindings/cxx/Makefile.am
@@ -0,0 +1,59 @@
+# 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
+#
+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
+LIBS=
+
+SUBDIRS=test
+
+getdata_include_HEADERS = getdata/dirfile.h getdata/entry.h getdata/rawentry.h \
+													getdata/lincomentry.h getdata/linterpentry.h \
+													getdata/bitentry.h getdata/multiplyentry.h \
+													getdata/phaseentry.h getdata/constentry.h \
+													getdata/stringentry.h getdata/indexentry.h \
+													getdata/sbitentry.h getdata/polynomentry.h \
+													getdata/fragment.h getdata/divideentry.h \
+													getdata/recipentry.h getdata/carrayentry.h \
+													getdata/windowentry.h getdata/mplexentry.h
+
+lib_LTLIBRARIES=libgetdata++.la
+libgetdata___la_SOURCES = dirfile.cpp bitentry.cpp carrayentry.cpp \
+													constentry.cpp divideentry.cpp entry.cpp \
+													fragment.cpp indexentry.cpp lincomentry.cpp \
+													linterpentry.cpp mplexentry.cpp multiplyentry.cpp \
+													phaseentry.cpp polynomentry.cpp rawentry.cpp \
+													recipentry.cpp sbitentry.cpp stringentry.cpp \
+													windowentry.cpp ${getdata_include_HEADERS} internal.h
+libgetdata___la_LIBADD=../../src/libgetdata.la
+libgetdata___la_LDFLAGS = -version-info @GETDATAXX_VERSION@
+
+clean-local:
+	rm -rf *~ getdata/*~
diff --git a/bindings/cxx/Makefile.in b/bindings/cxx/Makefile.in
new file mode 100644
index 0000000..fb71891
--- /dev/null
+++ b/bindings/cxx/Makefile.in
@@ -0,0 +1,961 @@
+# 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/cxx
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/depcomp $(getdata_include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" \
+	"$(DESTDIR)$(getdata_includedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libgetdata___la_DEPENDENCIES = ../../src/libgetdata.la
+am__objects_1 =
+am_libgetdata___la_OBJECTS = dirfile.lo bitentry.lo carrayentry.lo \
+	constentry.lo divideentry.lo entry.lo fragment.lo \
+	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)
+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@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libgetdata___la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+	$(AM_CXXFLAGS) $(CXXFLAGS) $(libgetdata___la_LDFLAGS) \
+	$(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_ 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
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_ at AM_V@)
+am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ 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 = $(libgetdata___la_SOURCES)
+DIST_SOURCES = $(libgetdata___la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+HEADERS = $(getdata_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+GD_FDIRSEP = @GD_FDIRSEP@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_DEBUG = @GETDATA_DEBUG@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GETDATA_MAJOR = @GETDATA_MAJOR@
+GETDATA_MINOR = @GETDATA_MINOR@
+GETDATA_REVISION = @GETDATA_REVISION@
+GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+GZIP_LIBS = @GZIP_LIBS@
+IDL = @IDL@
+IDL_CFLAGS = @IDL_CFLAGS@
+IDL_LIBS = @IDL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JOT = @JOT@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBLTDL = @LIBLTDL@
+LIBOBJS = @LIBOBJS@
+LIBS = 
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTDLINCL = @LTDLINCL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+LZMA_LIBS = @LZMA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATLAB = @MATLAB@
+MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@
+MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@
+MEX = @MEX@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008-2012 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+getdata_includedir = ${includedir}/getdata
+ at CXX_WALL_TRUE@WALL = -Wall
+ at CXX_WEXTRA_TRUE@WEXTRA = -Wextra
+AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(top_srcdir)/src
+SUBDIRS = test
+getdata_include_HEADERS = getdata/dirfile.h getdata/entry.h getdata/rawentry.h \
+													getdata/lincomentry.h getdata/linterpentry.h \
+													getdata/bitentry.h getdata/multiplyentry.h \
+													getdata/phaseentry.h getdata/constentry.h \
+													getdata/stringentry.h getdata/indexentry.h \
+													getdata/sbitentry.h getdata/polynomentry.h \
+													getdata/fragment.h getdata/divideentry.h \
+													getdata/recipentry.h getdata/carrayentry.h \
+													getdata/windowentry.h getdata/mplexentry.h
+
+lib_LTLIBRARIES = libgetdata++.la
+libgetdata___la_SOURCES = dirfile.cpp bitentry.cpp carrayentry.cpp \
+													constentry.cpp divideentry.cpp entry.cpp \
+													fragment.cpp indexentry.cpp lincomentry.cpp \
+													linterpentry.cpp mplexentry.cpp multiplyentry.cpp \
+													phaseentry.cpp polynomentry.cpp rawentry.cpp \
+													recipentry.cpp sbitentry.cpp stringentry.cpp \
+													windowentry.cpp ${getdata_include_HEADERS} internal.h
+
+libgetdata___la_LIBADD = ../../src/libgetdata.la
+libgetdata___la_LDFLAGS = -version-info @GETDATAXX_VERSION@
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/cxx/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/cxx/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libgetdata++.la: $(libgetdata___la_OBJECTS) $(libgetdata___la_DEPENDENCIES) $(EXTRA_libgetdata___la_DEPENDENCIES) 
+	$(AM_V_CXXLD)$(libgetdata___la_LINK) -rpath $(libdir) $(libgetdata___la_OBJECTS) $(libgetdata___la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bitentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/carrayentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/constentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dirfile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/divideentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/indexentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lincomentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/linterpentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mplexentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/multiplyentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/phaseentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/polynomentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rawentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/recipentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sbitentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stringentry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/windowentry.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-getdata_includeHEADERS: $(getdata_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(getdata_include_HEADERS)'; test -n "$(getdata_includedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(getdata_includedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(getdata_includedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(getdata_includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(getdata_includedir)" || exit $$?; \
+	done
+
+uninstall-getdata_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(getdata_include_HEADERS)'; test -n "$(getdata_includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(getdata_includedir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(getdata_includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-getdata_includeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-getdata_includeHEADERS \
+	uninstall-libLTLIBRARIES
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libLTLIBRARIES \
+	clean-libtool clean-local cscopelist-am ctags ctags-am \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-getdata_includeHEADERS install-html \
+	install-html-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am \
+	uninstall-getdata_includeHEADERS uninstall-libLTLIBRARIES
+
+
+clean-local:
+	rm -rf *~ getdata/*~
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/cxx/bitentry.cpp b/bindings/cxx/bitentry.cpp
new file mode 100644
index 0000000..a3cdd05
--- /dev/null
+++ b/bindings/cxx/bitentry.cpp
@@ -0,0 +1,117 @@
+// Copyright (C) 2008-2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+BitEntry::BitEntry(const char* field_code, const char* in_field,
+    int bitnum, int numbits, int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_BIT_ENTRY;
+  E.in_fields[0] = strdup(in_field);
+  E.u.bit.bitnum = bitnum;
+  E.u.bit.numbits = numbits;
+  E.fragment_index = fragment_index;
+}
+
+int BitEntry::SetInput(const char* field)
+{
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return 0;
+
+  free(E.in_fields[0]);
+  E.in_fields[0] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int BitEntry::SetFirstBit(int first_bit)
+{
+  E.u.bit.bitnum = first_bit;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int BitEntry::SetNumBits(int num_bits)
+{
+  E.u.bit.numbits = num_bits;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+const char *BitEntry::Scalar(int index) const
+{
+  if (index != 0 && index != 1)
+    return NULL;
+
+  return E.scalar[index];
+}
+
+int BitEntry::ScalarIndex(int index) const
+{
+  if (index != 0 && index != 1)
+    return 0;
+
+  return E.scalar_ind[index];
+}
+
+int BitEntry::SetFirstBit(const char *first_bit)
+{
+  int r = 0;
+
+  SetScalar(0, first_bit);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r)
+      r = gd_get_constant(D->D, first_bit, GD_INT16, &E.u.bit.bitnum);
+  }
+  
+  return r;
+}
+
+int BitEntry::SetNumBits(const char *num_bits)
+{
+  int r = 0;
+
+  SetScalar(1, num_bits);
+    E.scalar[1] = strdup(num_bits);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r)
+      r = gd_get_constant(D->D, num_bits, GD_INT16, &E.u.bit.numbits);
+  }
+  
+  return r;
+}
diff --git a/bindings/cxx/carrayentry.cpp b/bindings/cxx/carrayentry.cpp
new file mode 100644
index 0000000..cef6675
--- /dev/null
+++ b/bindings/cxx/carrayentry.cpp
@@ -0,0 +1,51 @@
+// Copyright (C) 2010-2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+CarrayEntry::CarrayEntry(const char* field_code, DataType data_type,
+    size_t array_len, int fragment_index)
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_CARRAY_ENTRY;
+  E.u.scalar.const_type = (gd_type_t)data_type;
+  E.u.scalar.array_len = array_len;
+  E.fragment_index = fragment_index;
+}
+
+int CarrayEntry::SetType(DataType type)
+{
+  E.u.scalar.const_type = (gd_type_t)type;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int CarrayEntry::SetArrayLen(size_t array_len)
+{
+  E.u.scalar.array_len = array_len;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
diff --git a/bindings/cxx/constentry.cpp b/bindings/cxx/constentry.cpp
new file mode 100644
index 0000000..7d72667
--- /dev/null
+++ b/bindings/cxx/constentry.cpp
@@ -0,0 +1,42 @@
+// Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+ConstEntry::ConstEntry(const char* field_code, DataType data_type,
+    int fragment_index)
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_CONST_ENTRY;
+  E.u.scalar.const_type = (gd_type_t)data_type;
+  E.fragment_index = fragment_index;
+}
+
+int ConstEntry::SetType(DataType type)
+{
+  E.u.scalar.const_type = (gd_type_t)type;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
diff --git a/bindings/cxx/dirfile.cpp b/bindings/cxx/dirfile.cpp
new file mode 100644
index 0000000..b25c13b
--- /dev/null
+++ b/bindings/cxx/dirfile.cpp
@@ -0,0 +1,573 @@
+// Copyright (C) 2008-2012 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+Dirfile::Dirfile()
+{
+  D = gd_invalid_dirfile();
+  error_string = NULL;
+  reference_name = NULL;
+}
+
+Dirfile::Dirfile(const char* filedir, unsigned long flags,
+    gd_parser_callback_t sehandler, void* extra)
+{
+  D = gd_cbopen(filedir, flags, sehandler, extra);
+  error_string = NULL;
+  reference_name = NULL;
+}
+
+Dirfile::Dirfile(DIRFILE* dirfile)
+{
+  D = dirfile;
+  error_string = NULL;
+  reference_name = NULL;
+}
+
+Dirfile::~Dirfile()
+{
+  free(error_string);
+  free(reference_name);
+
+  gd_close(D);
+}
+
+int Dirfile::Add(GetData::Entry &entry) const
+{
+  int ret = gd_add(D, &entry.E);
+  entry.SetDirfile(this);
+  return ret;
+}
+
+int Dirfile::AddSpec(const char *spec, int format_file) const
+{
+  return gd_add_spec(D, spec, format_file);
+}
+
+int Dirfile::MAdd(GetData::Entry &entry, const char *parent) const
+{
+  int ret = gd_madd(D, &entry.E, parent);
+  entry.SetDirfile(this);
+  return ret;
+}
+
+int Dirfile::MAddSpec(const char *spec, const char *parent) const
+{
+  return gd_madd_spec(D, spec, parent);
+}
+
+Entry *Dirfile::Entry(const char* field_code) const
+{
+  GetData::EntryType type = (GetData::EntryType)gd_entry_type(D, field_code);
+
+  switch(type) {
+    case RawEntryType:
+      return new GetData::RawEntry(this, field_code);
+    case LincomEntryType:
+      return new GetData::LincomEntry(this, field_code);
+    case LinterpEntryType:
+      return new GetData::LinterpEntry(this, field_code);
+    case BitEntryType:
+      return new GetData::BitEntry(this, field_code);
+    case SBitEntryType:
+      return new GetData::SBitEntry(this, field_code);
+    case MultiplyEntryType:
+      return new GetData::MultiplyEntry(this, field_code);
+    case DivideEntryType:
+      return new GetData::DivideEntry(this, field_code);
+    case RecipEntryType:
+      return new GetData::RecipEntry(this, field_code);
+    case PhaseEntryType:
+      return new GetData::PhaseEntry(this, field_code);
+    case PolynomEntryType:
+      return new GetData::PolynomEntry(this, field_code);
+    case ConstEntryType:
+      return new GetData::ConstEntry(this, field_code);
+    case CarrayEntryType:
+      return new GetData::CarrayEntry(this, field_code);
+    case StringEntryType:
+      return new GetData::StringEntry(this, field_code);
+    case IndexEntryType:
+      return new GetData::IndexEntry(this, field_code);
+    case WindowEntryType:
+      return new GetData::WindowEntry(this, field_code);
+    case MplexEntryType:
+      return new GetData::MplexEntry(this, field_code);
+    case NoEntryType:
+      break;
+  }
+
+  return NULL;
+}
+
+int Dirfile::Flush(const char* field_code) const
+{
+  return gd_flush(D, field_code);
+}
+
+int Dirfile::MetaFlush() const
+{
+  return gd_metaflush(D);
+}
+
+int Dirfile::Error() const
+{
+  return gd_error(D);
+}
+
+int Dirfile::ErrorCount() const
+{
+  return gd_error_count(D);
+}
+
+const char *Dirfile::ErrorString(size_t __gd_unused n)
+{
+  return ErrorString();
+}
+
+const char *Dirfile::ErrorString()
+{
+  if (error_string)
+    free(error_string);
+  error_string = gd_error_string(D, NULL, 0);
+  
+  return error_string;
+}
+
+int Dirfile::Include(const char* file, int format_file, unsigned long flags)
+  const
+{
+  return gd_include(D, file, format_file, flags);
+}
+
+unsigned int Dirfile::SamplesPerFrame(const char* field_code) const
+{
+  return gd_spf(D, field_code);
+}
+
+unsigned int Dirfile::NFields() const
+{
+  return gd_nfields(D);
+}
+
+unsigned int Dirfile::NFieldsByType(EntryType type) const
+{
+  return gd_nfields_by_type(D, (gd_entype_t)type);
+}
+
+const char** Dirfile::FieldListByType(EntryType type) const
+{
+  return gd_field_list_by_type(D, (gd_entype_t)type);
+}
+
+unsigned int Dirfile::NMFields(const char *parent) const
+{
+  return gd_nmfields(D, parent);
+}
+
+unsigned int Dirfile::NMFieldsByType(const char *parent, EntryType type) const
+{
+  return gd_nmfields_by_type(D, parent, (gd_entype_t)type);
+}
+
+const char** Dirfile::MFieldListByType(const char *parent, EntryType type) const
+{
+  return gd_mfield_list_by_type(D, parent, (gd_entype_t)type);
+}
+
+const gd_carray_t *Dirfile::Carrays(DataType type) const
+{
+  return gd_carrays(D, (gd_type_t)type);
+}
+
+size_t Dirfile::CarrayLen(const char *field_code) const
+{
+  return gd_carray_len(D, field_code);
+}
+
+const void *Dirfile::Constants(DataType type) const
+{
+  return gd_constants(D, (gd_type_t)type);
+}
+
+const char **Dirfile::Strings() const
+{
+  return gd_strings(D);
+}
+
+const gd_carray_t *Dirfile::MCarrays(const char *parent, DataType type) const
+{
+  return gd_mcarrays(D, parent, (gd_type_t)type);
+}
+const void *Dirfile::MConstants(const char *parent, DataType type) const
+{
+  return gd_mconstants(D, parent, (gd_type_t)type);
+}
+
+const char **Dirfile::MStrings(const char *parent) const
+{
+  return gd_mstrings(D, parent);
+}
+
+const char** Dirfile::FieldList() const
+{
+  return gd_field_list(D);
+}
+
+const char** Dirfile::MFieldList(const char *parent) const
+{
+  return gd_mfield_list(D, parent);
+}
+
+unsigned int Dirfile::NVectors() const
+{
+  return gd_nvectors(D);
+}
+
+const char** Dirfile::VectorList() const
+{
+  return gd_vector_list(D);
+}
+
+unsigned int Dirfile::NMVectors(const char *parent) const
+{
+  return gd_nmvectors(D, parent);
+}
+
+const char** Dirfile::MVectorList(const char *parent) const
+{
+  return gd_mvector_list(D, parent);
+}
+
+gd_off64_t Dirfile::NFrames() const
+{
+  return gd_nframes64(D);
+}
+
+gd_off64_t Dirfile::EoF(const char *field_code) const
+{
+  return gd_eof64(D, field_code);
+}
+
+gd_off64_t Dirfile::BoF(const char *field_code) const
+{
+  return gd_bof64(D, field_code);
+}
+
+int Dirfile::GetCarray(const char *field_code, DataType type, void *data_out,
+    unsigned int start, size_t len) const
+{
+  if (len == 0)
+    return gd_get_carray(D, field_code, (gd_type_t)type, data_out);
+  else
+    return gd_get_carray_slice(D, field_code, start, len, (gd_type_t)type,
+        data_out);
+}
+
+int Dirfile::GetConstant(const char *field_code, DataType type, void *data_out)
+  const
+{
+  return gd_get_constant(D, field_code, (gd_type_t)type, data_out);
+}
+
+size_t Dirfile::GetData(const char* field_code, gd_off64_t first_frame,
+    gd_off64_t first_sample, size_t num_frames, size_t num_samples,
+    DataType type, void* data_out) const
+{
+  return gd_getdata64(D, field_code, first_frame, first_sample, num_frames,
+      num_samples, (gd_type_t)type, data_out);
+}
+
+size_t Dirfile::GetString(const char *field_code, size_t len, char* data_out)
+  const
+{
+  return gd_get_string(D, field_code, len, data_out);
+}
+
+int Dirfile::PutCarray(const char *field_code, DataType type,
+    const void *data_in, unsigned int start, size_t len) const
+{
+  if (len == 0)
+    return gd_put_carray(D, field_code, (gd_type_t)type, data_in);
+  else
+    return gd_put_carray_slice(D, field_code, start, len, (gd_type_t)type,
+        data_in);
+}
+
+int Dirfile::PutConstant(const char *field_code, DataType type,
+    const void *data_in) const
+{
+  return gd_put_constant(D, field_code, (gd_type_t)type, data_in);
+}
+
+size_t Dirfile::PutData(const char* field_code, gd_off64_t first_frame,
+    gd_off64_t first_sample, size_t num_frames, size_t num_samples,
+    DataType type, const void* data_in) const
+{
+  return gd_putdata64(D, field_code, first_frame, first_sample, num_frames,
+      num_samples, (gd_type_t)type, data_in);
+}
+
+size_t Dirfile::PutString(const char *field_code, const char* data_in) const
+{
+  return gd_put_string(D, field_code, data_in);
+}
+
+GetData::Fragment* Dirfile::Fragment(int index) const
+{
+  if (index < 0 || index >= gd_nfragments(D))
+    return NULL;
+
+  return new GetData::Fragment(this, index);
+}
+
+int Dirfile::NFragments() const
+{
+  return gd_nfragments(D);
+}
+
+const char* Dirfile::ReferenceFilename()
+{
+  const char* ref = gd_reference(D, NULL);
+
+  if (ref == NULL)
+    return NULL;
+
+  free(reference_name);
+  reference_name = gd_raw_filename(D, ref);
+  return reference_name;
+}
+
+int Dirfile::Discard()
+{
+  int ret = gd_discard(D);
+
+  if (!ret)
+    D = gd_invalid_dirfile();
+
+  return ret;
+}
+
+int Dirfile::Close()
+{
+  int ret = gd_close(D);
+
+  if (!ret)
+    D = gd_invalid_dirfile();
+
+  return ret;
+}
+
+void Dirfile::SetCallback(gd_parser_callback_t sehandler, void* extra) const
+{
+  gd_parser_callback(D, sehandler, extra);
+}
+
+RawEntry* Dirfile::Reference(const char* field_code) const
+{
+  const char* ref = gd_reference(D, field_code);
+
+  if (ref == NULL)
+    return NULL;
+
+  return new RawEntry(this, ref);
+}
+
+int Dirfile::AlterSpec(const char *line, int recode) const
+{
+  return gd_alter_spec(D, line, recode);
+}
+
+int Dirfile::MAlterSpec(const char* line, const char *parent, int recode) const
+{
+  return gd_malter_spec(D, line, parent, recode);
+}
+
+int Dirfile::Delete(const char* field_code, int flags) const
+{
+  return gd_delete(D, field_code, flags);
+}
+
+int Dirfile::UnInclude(int fragment_index, int del) const
+{
+  return gd_uninclude(D, fragment_index, del);
+}
+
+DataType Dirfile::NativeType(const char* field_code) const
+{
+  return (DataType)gd_native_type(D, field_code);
+}
+
+int Dirfile::Validate(const char* field_code) const
+{
+  return gd_validate(D, field_code);
+}
+
+double Dirfile::FrameNum(const char* field_code, double value,
+    gd_off64_t frame_start, gd_off64_t frame_end) const
+{
+  return gd_framenum_subset64(D, field_code, value, frame_start, frame_end);
+}
+
+int Dirfile::FragmentIndex(const char* field_code) const
+{
+  return gd_fragment_index(D, field_code);
+}
+
+const char* Dirfile::Name() const
+{
+  return gd_dirfilename(D);
+}
+
+int Dirfile::Standards(int version) const
+{
+  return gd_dirfile_standards(D, version);
+}
+
+gd_off64_t Dirfile::Seek(const char* field_code, gd_off64_t frame_num,
+    gd_off64_t sample_num, int flags) const
+{
+  return gd_seek64(D, field_code, frame_num, sample_num, flags);
+}
+
+gd_off64_t Dirfile::Tell(const char* field_code) const
+{
+  return gd_tell64(D, field_code);
+}
+
+int Dirfile::AddAlias(const char* field_code, const char* target,
+    int fragment_index) const
+{
+  return gd_add_alias(D, field_code, target, fragment_index);
+}
+
+const char** Dirfile::Aliases(const char* field_code) const
+{
+  return gd_aliases(D, field_code);
+}
+
+const char* Dirfile::AliasTarget(const char* field_code) const
+{
+  return gd_alias_target(D, field_code);
+}
+
+int Dirfile::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);
+}
+
+int Dirfile::Hidden(const char* field_code) const
+{
+  return gd_hidden(D, field_code);
+}
+
+int Dirfile::IncludeAffix(const char *file, int fragment_index,
+    const char* prefix, const char* suffix, unsigned long flags) const
+{
+  return gd_include_affix(D, file, fragment_index, prefix, suffix, flags);
+}
+
+int Dirfile::MAddAlias(const char* parent, const char* name, const char* target)
+  const
+{
+  return gd_madd_alias(D, parent, name, target);
+}
+
+int Dirfile::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);
+}
+
+int Dirfile::Sync(const char* field_code) const
+{
+  return gd_sync(D, field_code);
+}
+
+int Dirfile::RawClose(const char* field_code) const
+{
+  return gd_raw_close(D, field_code);
+}
+
+int Dirfile::UnHide(const char* field_code) const
+{
+  return gd_unhide(D, field_code);
+}
+
+char *Dirfile::StrTok(const char *string)
+{
+  return gd_strtok(D, string);
+}
+
+int Dirfile::DeSync(unsigned int flags)
+{
+  int desync = gd_desync(D, flags);
+  if (desync && flags & GD_DESYNC_REOPEN) {
+    free(error_string);
+    free(reference_name);
+
+    error_string = NULL;
+    reference_name = NULL;
+  }
+
+  return desync;
+}
+
+unsigned long Dirfile::Flags(unsigned long set, unsigned long reset)
+{
+  return gd_flags(D, set, reset);
+}
+
+int Dirfile::VerbosePrefix(const char *prefix) const
+{
+  return gd_verbose_prefix(D, prefix);
+}
+
+void Dirfile::MplexLookback(int lookback) const
+{
+  gd_mplex_lookback(D, lookback);
+}
+
+unsigned int Dirfile::NEntries(const char *parent, int type, unsigned int flags)
+  const
+{
+  return gd_nentries(D, parent, type, flags);
+}
+
+const char** Dirfile::EntryList(const char *parent, int type,
+    unsigned int flags) const
+{
+  return gd_entry_list(D, parent, type, flags);
+}
+
+char* Dirfile::LinterpTableName(const char *field_code)
+{
+  return gd_linterp_tablename(D, field_code);
+}
diff --git a/bindings/cxx/divideentry.cpp b/bindings/cxx/divideentry.cpp
new file mode 100644
index 0000000..d66f0c4
--- /dev/null
+++ b/bindings/cxx/divideentry.cpp
@@ -0,0 +1,52 @@
+// Copyright (C) 2010-2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+DivideEntry::DivideEntry(const char* field_code, const char* in_field1,
+    const char* in_field2, int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_DIVIDE_ENTRY;
+  E.in_fields[0] = strdup(in_field1);
+  E.in_fields[1] = strdup(in_field2);
+  E.fragment_index = fragment_index;
+}
+
+int DivideEntry::SetInput(const char* field, int index)
+{
+  if (index < 0 || index > 1)
+    return -1;
+
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return -1;
+
+  free(E.in_fields[index]);
+  E.in_fields[index] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
diff --git a/bindings/cxx/entry.cpp b/bindings/cxx/entry.cpp
new file mode 100644
index 0000000..5b7c8f6
--- /dev/null
+++ b/bindings/cxx/entry.cpp
@@ -0,0 +1,213 @@
+// Copyright (C) 2008-2012, 2014, 2015 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+Entry::Entry()
+{
+  memset(&E, 0, sizeof(E));
+  D = NULL;
+}
+
+Entry::Entry(const GetData::Dirfile *dirfile, const char* field_code)
+{
+  D = dirfile;
+  if (gd_entry(D->D, field_code, &E))
+    memset(&E, 9, sizeof(E));
+}
+
+Entry::~Entry()
+{
+  gd_free_entry_strings(&E);
+}
+
+int Entry::CheckIndex(gd_entype_t field_type, int n_fields, int index)
+{
+  if (index < 0)
+    return 0;
+
+  switch (field_type) {
+    case GD_RAW_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+      return 0;
+    case GD_LINCOM_ENTRY:
+      if (index > n_fields)
+        return 0;
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (index > 2)
+        return 0;
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_RECIP_ENTRY:
+      if (index > 1)
+        return 0;
+  }
+
+  return 1;
+}
+
+int Entry::Move(int new_fragment, int move_data)
+{
+  int ret = -1;
+
+  if (D != NULL)
+    ret = gd_move(D->D, E.field, new_fragment, move_data);
+
+  if (!ret)
+    E.fragment_index = new_fragment;
+
+  return ret;
+}
+
+int Entry::Rename(const char* new_name, int move_data)
+{
+  char* ptr;
+  int ret = -1;
+
+  if (D != NULL)
+    ret = gd_rename(D->D, E.field, new_name, move_data);
+
+  if (ret) {
+    if (E.field == NULL) {
+      E.field = strdup(new_name);
+    } else {
+      /* 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).
+       */
+      char* nn = (char*)malloc(strlen(E.field) + strlen(new_name));
+      strcpy(nn, E.field);
+      ptr = strchr(nn, '/');
+
+      if (ptr) { /* metafield */
+        strcpy(ptr + 1, new_name);
+      } else {
+        free(nn);
+        nn = strdup(new_name);
+      }
+
+      free(E.field);
+      E.field = nn;
+    }
+  }
+
+  return ret;
+}
+
+void Entry::SetDirfile(const GetData::Dirfile* dirfile)
+{
+  D = dirfile;
+}
+
+void Entry::SetName(const char* name)
+{
+  this->Rename(name);
+}
+
+void Entry::SetFragmentIndex(int fragment_index)
+{
+  this->Move(fragment_index);
+}
+
+static inline int scalar_ok(const gd_entry_t &E, int index)
+{
+  if (index < 0)
+    return 0;
+
+  switch (E.field_type) {
+    case GD_LINCOM_ENTRY:
+      if (index >= GD_MAX_LINCOM + E.u.lincom.n_fields ||
+          (index >= E.u.lincom.n_fields && index < GD_MAX_LINCOM))
+      {
+        return 0;
+      }
+      break;
+    case GD_POLYNOM_ENTRY:
+      if (index > E.u.polynom.poly_ord)
+        return 0;
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (index >= 2)
+        return 0;
+      break;
+    case GD_RAW_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_RECIP_ENTRY:
+    case GD_WINDOW_ENTRY:
+      if (index >= 1)
+        return 0;
+      break;
+    case GD_LINTERP_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+      return 0;
+  }
+
+  return 1;
+}
+
+const char *Entry::Scalar(int index) const
+{
+  return scalar_ok(E, index) ? E.scalar[index] : NULL;
+}
+
+int Entry::ScalarIndex(int index) const
+{
+  return scalar_ok(E, index) ? E.scalar_ind[index] : 0;
+}
+
+void Entry::SetScalar(int n, const char *code)
+{
+  free(E.scalar[n]);
+  if (code == NULL)
+    E.scalar[n] = NULL;
+  else {
+    E.scalar[n] = strdup(code);
+    char *ptr = strchr(E.scalar[n], '<');
+    if (ptr) {
+      *ptr = '\0';
+      E.scalar_ind[n] = atoi(ptr + 1);
+    } else
+      E.scalar_ind[n] = -1;
+  }
+}
diff --git a/bindings/cxx/fragment.cpp b/bindings/cxx/fragment.cpp
new file mode 100644
index 0000000..83d914b
--- /dev/null
+++ b/bindings/cxx/fragment.cpp
@@ -0,0 +1,116 @@
+// Copyright (C) 2008, 2010, 2011, 2014 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+Fragment::Fragment(const GetData::Dirfile *dirfile, int index)
+{
+  dtrace("%p, %i", dirfile, index);
+
+  D = dirfile;
+
+  ind = index;
+  enc = (GetData::EncodingScheme)gd_encoding(D->D, index);
+  end = gd_endianness(D->D, index);
+  off = gd_frameoffset64(D->D, index);
+  prot = gd_protection(D->D, index);
+  name = gd_fragmentname(D->D, index);
+  parent = (index == 0) ? -1 : gd_parent_fragment(D->D, index);
+
+  if (gd_fragment_affixes(D->D, index, &prefix, &suffix) == -1)
+    prefix = suffix = NULL;
+
+  dreturnvoid();
+}
+
+Fragment::~Fragment()
+{
+  free(prefix);
+  free(suffix);
+}
+
+int Fragment::ReWrite() const
+{
+  return gd_rewrite_fragment(D->D, ind);
+}
+
+int Fragment::SetEncoding(GetData::EncodingScheme encoding, int recode)
+{
+  int ret = gd_alter_encoding(D->D, (unsigned long)encoding, ind, recode);
+
+  if (!ret)
+    enc = encoding;
+
+  return ret;
+}
+
+int Fragment::SetEndianness(unsigned long byte_sex, int recode)
+{
+  int ret = gd_alter_endianness(D->D, byte_sex, ind, recode);
+
+  if (!ret)
+    end = byte_sex;
+
+  return ret;
+}
+
+int Fragment::SetFrameOffset(gd_off64_t offset, int recode)
+{
+  int ret = gd_alter_frameoffset64(D->D, offset, ind, recode);
+
+  if (!ret)
+    off = offset;
+
+  return ret;
+}
+
+int Fragment::SetProtection(int protection_level)
+{
+  int ret = gd_alter_protection(D->D, protection_level, ind);
+
+  if (!ret)
+    prot = protection_level;
+
+  return ret;
+}
+
+int Fragment::SetPrefix(const char* new_prefix)
+{
+  int ret = gd_alter_affixes(D->D, ind, new_prefix, suffix);
+
+  free(prefix);
+  free(suffix);
+  if (!ret)
+    ret = gd_fragment_affixes(D->D, ind, &prefix, &suffix);
+  return ret;
+}
+
+int Fragment::SetSuffix(const char* new_suffix)
+{
+  int ret = gd_alter_affixes(D->D, ind, prefix, new_suffix);
+
+  free(prefix);
+  free(suffix);
+  if (!ret)
+    ret = gd_fragment_affixes(D->D, ind, &prefix, &suffix);
+  return ret;
+}
diff --git a/bindings/cxx/getdata/bitentry.h b/bindings/cxx/getdata/bitentry.h
new file mode 100644
index 0000000..845633b
--- /dev/null
+++ b/bindings/cxx/getdata/bitentry.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2008-2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_BITENTRY_H
+#define GETDATA_BITENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class BitEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      BitEntry() : Entry() { E.field_type = GD_BIT_ENTRY; };
+
+      BitEntry(const char* field_code, const char* in_field, int bitnum,
+          int numbits = 1, int fragment_index = 0);
+
+      virtual const char *Input() const { return E.in_fields[0]; };
+
+      virtual int FirstBit() const { return E.u.bit.bitnum; };
+
+      virtual int NumBits() const { return E.u.bit.numbits; };
+
+      int SetInput(const char* field);
+      int SetFirstBit(int first_bit);
+      int SetFirstBit(const char* first_bit);
+      int SetNumBits(int num_bits);
+      int SetNumBits(const char* num_bits);
+
+      virtual const char *Scalar(int index = 0) const;
+
+      virtual int ScalarIndex(int index = 0) const;
+
+    private:
+      BitEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/carrayentry.h b/bindings/cxx/getdata/carrayentry.h
new file mode 100644
index 0000000..dc55ff5
--- /dev/null
+++ b/bindings/cxx/getdata/carrayentry.h
@@ -0,0 +1,57 @@
+// Copyright (C) 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_CARRAYENTRY_H
+#define GETDATA_CARRAYENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class CarrayEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      CarrayEntry() : Entry() { E.field_type = GD_CARRAY_ENTRY; };
+
+      CarrayEntry(const char* field_code, DataType type, size_t array_len,
+          int fragment_index = 0);
+
+      virtual DataType ConstType() const
+      {
+        return (DataType)E.u.scalar.const_type;
+      }
+
+      virtual size_t ArrayLen() const { return E.u.scalar.array_len; }
+
+      int SetArrayLen(size_t array_len);
+
+      int SetType(DataType type);
+
+    private:
+      CarrayEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/constentry.h b/bindings/cxx/getdata/constentry.h
new file mode 100644
index 0000000..1e4436d
--- /dev/null
+++ b/bindings/cxx/getdata/constentry.h
@@ -0,0 +1,52 @@
+// Copyright (C) 2008, 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_CONSTENTRY_H
+#define GETDATA_CONSTENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class ConstEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      ConstEntry() : Entry() { E.field_type = GD_CONST_ENTRY; };
+
+      ConstEntry(const char* field_code, DataType type, int fragment_index = 0);
+
+      virtual DataType ConstType() const
+      {
+        return (DataType)E.u.scalar.const_type;
+      }
+
+      int SetType(DataType type);
+
+    private:
+      ConstEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/dirfile.h b/bindings/cxx/getdata/dirfile.h
new file mode 100644
index 0000000..babe414
--- /dev/null
+++ b/bindings/cxx/getdata/dirfile.h
@@ -0,0 +1,291 @@
+// Copyright (C) 2008-2012 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_DIRFILE_H
+#define GETDATA_DIRFILE_H
+
+// Enable the explicit 64-bit API (gd_getdata64() &c.)
+#ifndef GD_64BIT_API
+# define GD_64BIT_API
+#endif
+
+// Disable the legacy API since its symbols clash with us.
+#ifndef GD_NO_LEGACY_API
+# define GD_NO_LEGACY_API
+#endif
+
+// Use the C89 API since C++ compilers aren't required to support the
+// C99 _Complex keyword
+#ifndef GD_C89_API
+# define GD_C89_API
+#endif
+
+#include <getdata.h>
+
+#include <getdata/fragment.h>
+#include <getdata/entry.h>
+#include <getdata/rawentry.h>
+#include <getdata/lincomentry.h>
+#include <getdata/linterpentry.h>
+#include <getdata/bitentry.h>
+#include <getdata/sbitentry.h>
+#include <getdata/phaseentry.h>
+#include <getdata/indexentry.h>
+#include <getdata/polynomentry.h>
+#include <getdata/constentry.h>
+#include <getdata/carrayentry.h>
+#include <getdata/stringentry.h>
+#include <getdata/mplexentry.h>
+#include <getdata/multiplyentry.h>
+#include <getdata/divideentry.h>
+#include <getdata/recipentry.h>
+#include <getdata/windowentry.h>
+
+namespace GetData {
+  
+  class Entry;
+  class RawEntry;
+
+  class Dirfile {
+    friend class Entry;
+    friend class RawEntry;
+    friend class LincomEntry;
+    friend class LinterpEntry;
+    friend class BitEntry;
+    friend class SBitEntry;
+    friend class MultiplyEntry;
+    friend class DivideEntry;
+    friend class RecipEntry;
+    friend class PhaseEntry;
+    friend class PolynomEntry;
+    friend class WindowEntry;
+    friend class MplexEntry;
+    friend class ConstEntry;
+    friend class CarrayEntry;
+    friend class StringEntry;
+    friend class IndexEntry;
+    friend class Fragment;
+
+    public:
+      Dirfile();
+
+      Dirfile(const char *dirfilename, unsigned long flags = GD_RDONLY,
+          gd_parser_callback_t sehandler = NULL, void* extra = NULL);
+
+      Dirfile(DIRFILE *D);
+
+      ~Dirfile();
+
+      int Add(GetData::Entry &entry) const;
+
+      int AddAlias(const char *field_code, const char *target,
+          int fragment_index = 0) const;
+
+      int AddSpec(const char *spec, int fragment_index = 0) const;
+
+      const char** Aliases(const char* field_code) const;
+
+      const char* AliasTarget(const char* field_code) const;
+
+      int AlterSpec(const char* spec, int recode = 0) const;
+
+      gd_off64_t BoF(const char *field_code) const;
+
+      size_t CarrayLen(const char *field_code) const;
+
+      const gd_carray_t *Carrays(DataType type = Float64) const;
+
+      int Close();
+
+      const void *Constants(DataType type = Float64) const;
+
+      int Delete(const char* field_code, int flags = 0) const;
+
+      int DeleteAlias(const char* field_code, int flags = 0) const;
+
+      int DeSync(unsigned int flags = 0);
+
+      int Discard();
+
+      GetData::Entry* Entry(const char *field_code) const;
+
+      const char **EntryList(const char *parent = NULL, int type = 0,
+          unsigned int flags = 0) const;
+
+      gd_off64_t EoF(const char *field_code) const;
+
+      int Error() const;
+
+      int ErrorCount() const;
+
+      const char *ErrorString();
+      const char *ErrorString(size_t n) gd_deprecated;
+
+      unsigned long Flags(unsigned long set = 0, unsigned long reset = 0);
+
+      const char **FieldList() const;
+
+      const char **FieldListByType(EntryType type) const;
+
+      int Flush(const char *field_code = NULL) const;
+
+      GetData::Fragment *Fragment(int index) const;
+
+      int FragmentIndex(const char* field_code) const;
+
+      double FrameNum(const char* field_code, double value,
+          gd_off64_t frame_start = 0, gd_off64_t frame_end = 0) const;
+
+      int GetCarray(const char *field_code, DataType type, void *data_out,
+          unsigned int start = 0, size_t len = 0) const;
+
+      int GetConstant(const char *field_code, DataType type, void *data_out)
+        const;
+
+      size_t GetData(const char *field_code, gd_off64_t first_frame,
+          gd_off64_t first_sample, size_t num_frames, size_t num_samples,
+          DataType type, void* data_out) const;
+
+      size_t GetString(const char *field_code, size_t len, char *data_out)
+        const;
+
+      int Hide(const char* field_code) const;
+
+      int Hidden(const char* field_code) const;
+
+      int Include(const char *file, int fragment_index = 0,
+          unsigned long flags = 0) const;
+
+      int IncludeAffix(const char *file, int fragment_index = 0,
+          const char* prefix = NULL, const char* suffix = NULL,
+          unsigned long flags = 0) const;
+
+      char *LinterpTableName(const char *field_code);
+
+      int MAdd(GetData::Entry &entry, const char *parent) const;
+
+      int MAddAlias(const char* parent, const char* name, const char* target)
+        const;
+
+      int MAddSpec(const char *spec, const char *parent) const;
+
+      int MAlterSpec(const char *line, const char *parent, int recode = 0)
+        const;
+
+      const gd_carray_t *MCarrays(const char *parent, DataType type = Float64)
+        const;
+
+      const void *MConstants(const char *parent, DataType type = Float64) const;
+
+      int MetaFlush() const;
+
+      const char **MFieldList(const char *parent) const;
+
+      const char **MFieldListByType(const char *parent, EntryType type) const;
+
+      void MplexLookback(int lookback) const;
+
+      const char **MStrings(const char *parent) const;
+
+      int MoveAlias(const char* field_code, int new_fragment) const;
+
+      const char **MVectorList(const char *parent) const;
+
+      int NAliases(const char* field_code) const;
+
+      unsigned int NEntries(const char *parent = NULL, int type = 0,
+          unsigned int flags = 0) const;
+
+      unsigned int NFields() const;
+
+      unsigned int NFieldsByType(EntryType type) const;
+
+      unsigned int NMFields(const char *parent) const;
+
+      unsigned int NMFieldsByType(const char *parent, EntryType type) const;
+
+      unsigned int NMVectors(const char *parent) const;
+
+      const char* Name() const;
+
+      DataType NativeType(const char* field_code) const;
+
+      int NFragments() const;
+
+      gd_off64_t NFrames() const;
+
+      unsigned int NVectors() const;
+
+      int PutCarray(const char *field_code, DataType type, const void *data_in,
+          unsigned int start = 0, size_t len = 0) const;
+
+      int PutConstant(const char *field_code, DataType type,
+          const void *data_in) const;
+
+      size_t PutData(const char *field_code, gd_off64_t first_frame,
+          gd_off64_t first_sample, size_t num_frames, size_t num_samples,
+          DataType type, const void* data_in) const;
+
+      size_t PutString(const char *field_code, const char *data_in) const;
+
+      int RawClose(const char *field_code = NULL) const;
+
+      GetData::RawEntry *Reference(const char* field_code = NULL) const;
+
+      const char *ReferenceFilename();
+
+      unsigned int SamplesPerFrame(const char *field_code) const;
+
+      gd_off64_t Seek(const char* field_code, gd_off64_t frame_num,
+          gd_off64_t sample_num, int flags) const;
+
+      void SetCallback(gd_parser_callback_t sehandler, void* extra = NULL)
+        const;
+
+      int Standards(int version = GD_VERSION_CURRENT) const;
+
+      const char **Strings() const;
+
+      int Sync(const char *field_code = NULL) const;
+
+      gd_off64_t Tell(const char* field_code) const;
+
+      char *StrTok(const char *string = NULL);
+
+      int UnHide(const char* field_code) const;
+
+      int UnInclude(int fragment_index, int del = 0) const;
+
+      int Validate(const char* field_code) const;
+
+      int VerbosePrefix(const char *prefix = NULL) const;
+
+      const char **VectorList() const;
+
+    private:
+      DIRFILE* D; 
+
+      char *error_string;
+      char *reference_name;
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/divideentry.h b/bindings/cxx/getdata/divideentry.h
new file mode 100644
index 0000000..2b4a4e7
--- /dev/null
+++ b/bindings/cxx/getdata/divideentry.h
@@ -0,0 +1,52 @@
+// Copyright (C) 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_DIVIDEENTRY_H
+#define GETDATA_DIVIDEENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class DivideEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      DivideEntry() : Entry() { E.field_type = GD_DIVIDE_ENTRY; };
+
+      DivideEntry(const char* field_code, const char* in_field1,
+          const char* in_field2, int fragment_index = 0);
+
+      virtual const char *Input(int index = 0) const {
+        return E.in_fields[(index == 0) ? 0 : 1];
+      };
+
+      int SetInput(const char* field, int index);
+
+    private:
+      DivideEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/entry.h b/bindings/cxx/getdata/entry.h
new file mode 100644
index 0000000..93af1c1
--- /dev/null
+++ b/bindings/cxx/getdata/entry.h
@@ -0,0 +1,255 @@
+// Copyright (C) 2008-2012 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_ENTRY_H
+#define GETDATA_ENTRY_H
+
+#include <getdata/dirfile.h>
+#include <complex>
+
+namespace GetData {
+
+  class Dirfile;
+
+  enum DataType {
+    Null      = GD_NULL,      Unknown    = GD_UNKNOWN,
+    UInt8     = GD_UINT8,     Int8       = GD_INT8,
+    UInt16    = GD_UINT16,    Int16      = GD_INT16,
+    UInt32    = GD_UINT32,    Int32      = GD_INT32,
+    UInt64    = GD_UINT64,    Int64      = GD_INT64,
+    Float32   = GD_FLOAT32,   Float64    = GD_FLOAT64,
+    Complex64 = GD_COMPLEX64, Complex128 = GD_COMPLEX128
+  };
+
+  enum EntryType {
+    NoEntryType       = GD_NO_ENTRY,
+    RawEntryType      = GD_RAW_ENTRY,
+    LincomEntryType   = GD_LINCOM_ENTRY,
+    LinterpEntryType  = GD_LINTERP_ENTRY,
+    BitEntryType      = GD_BIT_ENTRY,
+    MultiplyEntryType = GD_MULTIPLY_ENTRY,
+    PhaseEntryType    = GD_PHASE_ENTRY,
+    SBitEntryType     = GD_SBIT_ENTRY,
+    PolynomEntryType  = GD_POLYNOM_ENTRY,
+    ConstEntryType    = GD_CONST_ENTRY,
+    CarrayEntryType   = GD_CARRAY_ENTRY,
+    StringEntryType   = GD_STRING_ENTRY,
+    IndexEntryType    = GD_INDEX_ENTRY,
+    DivideEntryType   = GD_DIVIDE_ENTRY,
+    RecipEntryType    = GD_RECIP_ENTRY,
+    WindowEntryType   = GD_WINDOW_ENTRY,
+    MplexEntryType    = GD_MPLEX_ENTRY
+  };
+
+  enum WindOpType {
+    WindOpEq = GD_WINDOP_EQ,
+    WindOpNe = GD_WINDOP_NE,
+    WindOpGe = GD_WINDOP_GE,
+    WindOpGt = GD_WINDOP_GT,
+    WindOpLe = GD_WINDOP_LE,
+    WindOpLt = GD_WINDOP_LT,
+    WindOpSet = GD_WINDOP_SET,
+    WindOpClr = GD_WINDOP_CLR
+  };
+
+  class Entry {
+    friend class Dirfile;
+
+    public:
+      Entry();
+
+      virtual ~Entry();
+
+      /* Generic data */
+      int Associated() const { return (D != NULL); };
+
+      const char *Name() const { return E.field; };
+
+      EntryType Type() const { return (EntryType)E.field_type; };
+      
+      void Dissociate() { D = NULL; };
+
+      int FragmentIndex() const { return E.fragment_index; };
+
+      int Move(int new_fragment, int move_data = 0);
+
+      int Rename(const char* new_name, int move_data = 0);
+
+      /* Specific data */
+      virtual const char *Input(int index = 0) const {
+        return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+          E.in_fields[index] : NULL;
+      };
+
+      virtual int ComplexScalars() const {
+        return (E.field_type == GD_LINCOM_ENTRY ||
+            E.field_type == GD_POLYNOM_ENTRY ||
+            E.field_type == GD_RECIP_ENTRY) ? E.comp_scal : 0;
+      }
+
+      virtual const char *Scalar(int index = 0) const;
+
+      virtual int ScalarIndex(int index = 0) const;
+
+      /* RAW methods */
+      virtual unsigned int SamplesPerFrame() const {
+        return (E.field_type == GD_RAW_ENTRY) ? E.u.raw.spf : 0;
+      };
+
+      virtual DataType RawType() const {
+        return (E.field_type == GD_RAW_ENTRY) ? (DataType)E.u.raw.data_type :
+          Unknown;
+      };
+
+      /* LINCOM methods */
+      virtual int NFields() const {
+        return (E.field_type == GD_LINCOM_ENTRY) ? E.u.lincom.n_fields : 0;
+      };
+
+      virtual double Scale(int index = 0) const {
+        return (E.field_type == GD_LINCOM_ENTRY &&
+            CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+          E.u.lincom.m[index] : 0;
+      }
+
+      virtual std::complex<double> CScale(int index = 0) const {
+        return (E.field_type == GD_LINCOM_ENTRY &&
+            CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+          ? std::complex<double>(E.u.lincom.cm[index][0],
+              E.u.lincom.cm[index][1]) : 0;
+      }
+
+      virtual double Offset(int index = 0) const {
+        return (E.field_type == GD_LINCOM_ENTRY &&
+            CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+          E.u.lincom.b[index] : 0;
+      }
+
+      virtual std::complex<double> COffset(int index = 0) const {
+        return (E.field_type == GD_LINCOM_ENTRY &&
+            CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+          ? std::complex<double>(E.u.lincom.cb[index][0],
+              E.u.lincom.cb[index][1]) : 0;
+      }
+
+      /* LINTERP methods */
+      virtual const char *Table() const {
+        return (E.field_type == GD_LINTERP_ENTRY) ? E.u.linterp.table : NULL;
+      };
+
+      /* (S)BIT methods */
+      virtual int FirstBit() const {
+        return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.bitnum : -1;
+      };
+
+      virtual int NumBits() const {
+        return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.numbits : -1;
+      };
+
+      /* PHASE methods */
+      virtual gd_shift_t Shift() const {
+        return (E.field_type == GD_PHASE_ENTRY) ? E.u.phase.shift : 0;
+      };
+
+      /* CONST methods */
+      virtual DataType ConstType() const {
+        return (E.field_type == GD_CONST_ENTRY || E.field_type ==
+            GD_CARRAY_ENTRY) ? (DataType)E.u.scalar.const_type : Unknown;
+      };
+
+      /* CARRAY methods */
+      virtual size_t ArrayLen() const {
+        return (E.field_type == GD_CARRAY_ENTRY) ? E.u.scalar.array_len : 0;
+      };
+
+      /* POLYNOM methods */
+      virtual int PolyOrd() const {
+        return (E.field_type == GD_POLYNOM_ENTRY) ? E.u.polynom.poly_ord : 0;
+      };
+
+      virtual double Coefficient(int index = 0) const {
+        return (E.field_type == GD_POLYNOM_ENTRY && index <=
+            E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
+      }
+
+      virtual std::complex<double> CCoefficient(int index = 0) const {
+        return (E.field_type == GD_POLYNOM_ENTRY && index <=
+            E.u.polynom.poly_ord) ?
+          std::complex<double>(E.u.polynom.ca[index][0],
+              E.u.polynom.ca[index][1]) : 0;
+      }
+
+      /* RECIP methods */
+      virtual double Dividend() const {
+        return (E.field_type == GD_RECIP_ENTRY) ? E.u.recip.dividend : 0;
+      };
+
+      virtual std::complex<double> CDividend() const {
+        return (E.field_type == GD_RECIP_ENTRY) ?
+          std::complex<double>(E.u.recip.cdividend[0], E.u.recip.cdividend[1]) :
+          0;
+      };
+
+      /* WINDOW methods */
+      virtual WindOpType WindOp() const {
+        return (E.field_type == GD_WINDOW_ENTRY) ? (WindOpType)E.u.window.windop
+          : (WindOpType)0;
+      }
+
+      virtual gd_triplet_t Threshold() const {
+        gd_triplet_t zero;
+        zero.r = 0;
+        return (E.field_type == GD_WINDOW_ENTRY) ? E.u.window.threshold : zero;
+      }
+
+      /* MPLEX methods */
+      virtual int CountVal() const {
+        return (E.field_type == GD_MPLEX_ENTRY) ? E.u.mplex.count_val : 0;
+      }
+
+      virtual int Period() const {
+        return (E.field_type == GD_MPLEX_ENTRY) ? E.u.mplex.period : 0;
+      }
+
+      /* deprecated member alias */
+      virtual int gd_deprecated CountMax() const { return Period(); }
+
+      /* Set methods */
+      void SetName(const char* name);
+
+      void SetFragmentIndex(int fragment_index);
+
+    protected:
+      Entry(const Dirfile *dirfile, const char* field_code);
+
+      static int CheckIndex(gd_entype_t field_type, int n_fields,
+          int index);
+
+      void SetDirfile(const GetData::Dirfile* dirfile);
+
+      void SetScalar(int n, const char *code);
+
+      gd_entry_t E;
+      const Dirfile* D;
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/fragment.h b/bindings/cxx/getdata/fragment.h
new file mode 100644
index 0000000..be06adc
--- /dev/null
+++ b/bindings/cxx/getdata/fragment.h
@@ -0,0 +1,94 @@
+// Copyright (C) 2008, 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_FRAGMENT_H
+#define GETDATA_FRAGMENT_H
+
+#include <getdata/dirfile.h>
+#include <sys/types.h>
+
+namespace GetData {
+
+  enum EncodingScheme {
+    AutoEncoding  = GD_AUTO_ENCODED, RawEncoding   = GD_UNENCODED,
+    TextEncoding  = GD_TEXT_ENCODED, SlimEncoding  = GD_SLIM_ENCODED,
+    GzipEncoding  = GD_GZIP_ENCODED, Bzip2Encoding = GD_BZIP2_ENCODED,
+    SieEncoding   = GD_SIE_ENCODED,  ZzipEncoding  = GD_ZZIP_ENCODED,
+    ZzslimEncoding = GD_ZZSLIM_ENCODED, UnsupportedEncoding = GD_ENC_UNSUPPORTED
+  };
+
+  class Dirfile;
+
+  class Fragment {
+    friend class Dirfile;
+
+    public:
+      virtual ~Fragment();
+
+      EncodingScheme Encoding() const { return enc; };
+
+      unsigned long Endianness() const { return end; };
+
+      gd_off64_t FrameOffset() const { return off; };
+
+      int Index() const { return ind; }
+
+      const char* Name() const { return name; }
+
+      int Parent() const { return parent; }
+
+      const char *Prefix() { return prefix; };
+
+      int Protection() const { return prot; }
+
+      int ReWrite() const;
+
+      const char *Suffix() { return suffix; };
+
+      int SetEncoding(EncodingScheme encoding, int recode = 0);
+
+      int SetEndianness(unsigned long byte_sex, int recode = 0);
+
+      int SetFrameOffset(gd_off64_t offset, int recode = 0);
+
+      int SetPrefix(const char *preix);
+
+      int SetProtection(int protection_level);
+
+      int SetSuffix(const char *suffix);
+
+    protected:
+      Fragment(const Dirfile *dirfile, int index);
+
+      const Dirfile *D;
+      EncodingScheme enc;
+      unsigned long end;
+      int ind;
+      int prot;
+      gd_off64_t off;
+      const char* name;
+      char* prefix;
+      char* suffix;
+      int parent;
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/indexentry.h b/bindings/cxx/getdata/indexentry.h
new file mode 100644
index 0000000..35aa046
--- /dev/null
+++ b/bindings/cxx/getdata/indexentry.h
@@ -0,0 +1,40 @@
+// Copyright (C) 2008, 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_INDEXENTRY_H
+#define GETDATA_INDEXENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class IndexEntry : public Entry {
+    friend class Dirfile;
+
+    private:
+      IndexEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/lincomentry.h b/bindings/cxx/getdata/lincomentry.h
new file mode 100644
index 0000000..b795140
--- /dev/null
+++ b/bindings/cxx/getdata/lincomentry.h
@@ -0,0 +1,94 @@
+// Copyright (C) 2008-2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_LINCOMENTRY_H
+#define GETDATA_LINCOMENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class LincomEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      LincomEntry() : Entry() { E.field_type = GD_LINCOM_ENTRY; };
+
+      LincomEntry(const char* field_code, int n_fields, const char** in_fields,
+          double* m, double* b, int fragment_index = 0);
+
+      LincomEntry(const char* field_code, int n_fields, const char** in_fields,
+          std::complex<double>* cm, std::complex<double>* cb,
+          int fragment_index = 0);
+
+      virtual const char *Input(int index = 0) const {
+        return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? 
+            E.in_fields[index] : NULL;
+      };
+
+      virtual int ComplexScalars() const { return E.comp_scal; }
+
+      virtual int NFields() const { return E.u.lincom.n_fields; };
+
+      virtual double Scale(int index = 0) const {
+        return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+          E.u.lincom.m[index] : 0;
+      };
+
+      virtual std::complex<double> CScale(int index = 0) const {
+        return (CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+          ? std::complex<double>(E.u.lincom.cm[index][0],
+              E.u.lincom.cm[index][1]) : 0;
+      };
+
+      virtual double Offset(int index = 0) const {
+        return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+          E.u.lincom.b[index] : 0;
+      };
+
+      virtual std::complex<double> COffset(int index = 0) const {
+        return (CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+          ? std::complex<double>(E.u.lincom.cb[index][0],
+              E.u.lincom.cb[index][1]) : 0;
+      };
+
+      virtual const char *Scalar(int index = 0) const;
+
+      virtual int ScalarIndex(int index = 0) const;
+
+      int SetNFields(int nfields);
+      int SetInput(const char* field, int index = 0);
+      int SetScale(double scale, int index = 0);
+      int SetScale(const char* scale, int index = 0);
+      int SetScale(std::complex<double> scale, int index = 0);
+      int SetOffset(double offset, int index = 0);
+      int SetOffset(const char* scale, int index = 0);
+      int SetOffset(std::complex<double> offset, int index = 0);
+
+    private:
+      LincomEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/linterpentry.h b/bindings/cxx/getdata/linterpentry.h
new file mode 100644
index 0000000..48151db
--- /dev/null
+++ b/bindings/cxx/getdata/linterpentry.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2008, 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_LINTERPENTRY_H
+#define GETDATA_LINTERPENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class LinterpEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      LinterpEntry() : Entry() { E.field_type = GD_LINTERP_ENTRY; };
+
+      LinterpEntry(const char* field_code, const char* in_field,
+          const char* table, int fragment_index = 0);
+
+      virtual const char *Input() const { return E.in_fields[0]; };
+
+      virtual const char *Table() const { return E.u.linterp.table; };
+
+      int SetInput(const char* field);
+      int SetTable(const char* table, int move_table = 0);
+
+    private:
+      LinterpEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/mplexentry.h b/bindings/cxx/getdata/mplexentry.h
new file mode 100644
index 0000000..f1e7029
--- /dev/null
+++ b/bindings/cxx/getdata/mplexentry.h
@@ -0,0 +1,74 @@
+// 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
+//
+
+#ifndef GETDATA_MPLEXENTRY_H
+#define GETDATA_MPLEXENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class MplexEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      MplexEntry() : Entry() { E.field_type = GD_MPLEX_ENTRY; };
+
+      MplexEntry(const char* field_code, const char* in_field,
+          const char *check_field, int count_val, int period,
+          int fragment_index = 0);
+
+      virtual const char *Input(int index = 0) const {
+        return E.in_fields[(index == 0) ? 0 : 1];
+      };
+
+      virtual const char *Scalar() const { return E.scalar[0]; }
+
+      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+
+      virtual int CountVal() const { return E.u.mplex.count_val; };
+
+      virtual int Period() const { return E.u.mplex.period; };
+
+      int SetInput(const char* field, int index);
+      virtual int SetCountVal(int count_val);
+      virtual int SetCountVal(const char* count_val);
+      virtual int SetPeriod(int period);
+      virtual int SetPeriod(const char* period);
+
+      /* deprecated member aliases */
+      virtual int gd_deprecated CountMax() const { return Period(); };
+      virtual int gd_deprecated SetCountMax(int period) {
+        return SetPeriod(period);
+      }
+      virtual int gd_deprecated SetCountMax(const char* period) {
+        return SetPeriod(period);
+      };
+
+    private:
+      MplexEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/multiplyentry.h b/bindings/cxx/getdata/multiplyentry.h
new file mode 100644
index 0000000..b589050
--- /dev/null
+++ b/bindings/cxx/getdata/multiplyentry.h
@@ -0,0 +1,52 @@
+// Copyright (C) 2008, 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_MULTIPLYENTRY_H
+#define GETDATA_MULTIPLYENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class MultiplyEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      MultiplyEntry() : Entry() { E.field_type = GD_MULTIPLY_ENTRY; };
+
+      MultiplyEntry(const char* field_code, const char* in_field1,
+          const char* in_field2, int fragment_index = 0);
+
+      virtual const char *Input(int index = 0) const {
+        return E.in_fields[(index == 0) ? 0 : 1];
+      };
+
+      int SetInput(const char* field, int index);
+
+    private:
+      MultiplyEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/phaseentry.h b/bindings/cxx/getdata/phaseentry.h
new file mode 100644
index 0000000..14f0bc7
--- /dev/null
+++ b/bindings/cxx/getdata/phaseentry.h
@@ -0,0 +1,58 @@
+// Copyright (C) 2008-2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_PHASEENTRY_H
+#define GETDATA_PHASEENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class PhaseEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      PhaseEntry() : Entry() { E.field_type = GD_PHASE_ENTRY; };
+
+      PhaseEntry(const char* field_code, const char* in_field, gd_shift_t shift,
+          int fragment_index = 0);
+
+      virtual const char *Input() const { return E.in_fields[0]; };
+
+      virtual gd_shift_t Shift() const { return E.u.phase.shift; };
+
+      int SetInput(const char* field);
+      int SetShift(gd_shift_t shift);
+      int SetShift(const char* shift);
+
+      const char *Scalar() const { return E.scalar[0]; };
+
+      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+
+    private:
+      PhaseEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/polynomentry.h b/bindings/cxx/getdata/polynomentry.h
new file mode 100644
index 0000000..1d6630e
--- /dev/null
+++ b/bindings/cxx/getdata/polynomentry.h
@@ -0,0 +1,75 @@
+// Copyright (C) 2009, 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_POLYNOMENTRY_H
+#define GETDATA_POLYNOMENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class PolynomEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      PolynomEntry() : Entry() { E.field_type = GD_POLYNOM_ENTRY; };
+
+      PolynomEntry(const char* field_code, int poly_ord, const char* in_field,
+          double* a, int fragment_index = 0);
+
+      PolynomEntry(const char* field_code, int poly_ord, const char* in_field,
+          std::complex<double>* ca, int fragment_index = 0);
+
+      virtual const char *Input() const { return E.in_fields[0]; };
+
+      virtual int ComplexScalars() const { return E.comp_scal; }
+
+      virtual int PolyOrd() const { return E.u.polynom.poly_ord; };
+
+      virtual double Coefficient(int index = 0) const {
+        return (index <= E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
+      };
+
+      virtual std::complex<double> CCoefficient(int index = 0) const {
+        return (index <= E.u.polynom.poly_ord)
+          ? std::complex<double>(E.u.polynom.ca[index][0],
+              E.u.polynom.ca[index][1]) : 0;
+      };
+
+      virtual const char *Scalar(int index = 0) const;
+
+      virtual int ScalarIndex(int index = 0) const;
+
+      int SetPolyOrd(int poly_ord);
+      int SetInput(const char* field);
+      int SetCoefficient(double coeff, int index = 0);
+      int SetCoefficient(const char* coeff, int index = 0);
+      int SetCoefficient(std::complex<double> coeff, int index = 0);
+
+    private:
+      PolynomEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/rawentry.h b/bindings/cxx/getdata/rawentry.h
new file mode 100644
index 0000000..758fcd0
--- /dev/null
+++ b/bindings/cxx/getdata/rawentry.h
@@ -0,0 +1,66 @@
+// Copyright (C) 2008-2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_RAWENTRY_H
+#define GETDATA_RAWENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class RawEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      RawEntry() : Entry() {
+        E.field_type = GD_RAW_ENTRY;
+        filename = NULL;
+      };
+
+      RawEntry(const char* field_code, DataType data_type, unsigned int spf,
+          int fragment_index = 0);
+
+      virtual ~RawEntry();
+
+      virtual unsigned int SamplesPerFrame() const { return E.u.raw.spf; };
+
+      virtual DataType RawType() const { return (DataType)E.u.raw.data_type; };
+
+      const char* FileName();
+      int SetSamplesPerFrame(unsigned int spf, int recode = 0);
+      int SetSamplesPerFrame(const char *spf, int recode = 0);
+      int SetType(DataType type, int recode = 0);
+
+      virtual const char *Scalar() const { return E.scalar[0]; };
+
+      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+
+    private:
+      RawEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { filename = NULL; };
+
+      char *filename;
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/recipentry.h b/bindings/cxx/getdata/recipentry.h
new file mode 100644
index 0000000..3d87417
--- /dev/null
+++ b/bindings/cxx/getdata/recipentry.h
@@ -0,0 +1,69 @@
+// Copyright (C) 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_RECIPENTRY_H
+#define GETDATA_RECIPENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class RecipEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      RecipEntry() : Entry() { E.field_type = GD_RECIP_ENTRY; };
+
+      RecipEntry(const char* field_code, const char* in_field,
+          double dividend, int fragment_index = 0);
+
+      RecipEntry(const char* field_code, const char* in_field,
+          std::complex<double> cdividend, int fragment_index = 0);
+
+      virtual const char *Input() const { return E.in_fields[0]; };
+
+      virtual const char *Scalar() const { return E.scalar[0]; }
+
+      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+
+      virtual int ComplexScalars() const { return E.comp_scal; }
+
+      virtual double Dividend() const { return E.u.recip.dividend; };
+
+      virtual std::complex<double> CDividend() const {
+        return std::complex<double>(E.u.recip.cdividend[0],
+            E.u.recip.cdividend[1]);
+      };
+
+      virtual int SetInput(const char* field);
+      virtual int SetDividend(double coeff);
+      virtual int SetDividend(const char* coeff);
+      virtual int SetDividend(std::complex<double> coeff);
+
+    private:
+      RecipEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/sbitentry.h b/bindings/cxx/getdata/sbitentry.h
new file mode 100644
index 0000000..ae8a75b
--- /dev/null
+++ b/bindings/cxx/getdata/sbitentry.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2008-2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_SBITENTRY_H
+#define GETDATA_SBITENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class SBitEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      SBitEntry() : Entry() { E.field_type = GD_SBIT_ENTRY; };
+
+      SBitEntry(const char* field_code, const char* in_field, int bitnum,
+          int numbits = 1, int fragment_index = 0);
+
+      virtual const char *Input() const { return E.in_fields[0]; };
+
+      virtual int FirstBit() const { return E.u.bit.bitnum; };
+
+      virtual int NumBits() const { return E.u.bit.numbits; };
+
+      int SetInput(const char* field);
+      int SetFirstBit(int first_bit);
+      int SetFirstBit(const char* first_bit);
+      int SetNumBits(int num_bits);
+      int SetNumBits(const char* num_bits);
+
+      virtual const char *Scalar(int index = 0) const;
+
+      virtual int ScalarIndex(int index = 0) const;
+
+    private:
+      SBitEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/stringentry.h b/bindings/cxx/getdata/stringentry.h
new file mode 100644
index 0000000..1b3662f
--- /dev/null
+++ b/bindings/cxx/getdata/stringentry.h
@@ -0,0 +1,45 @@
+// Copyright (C) 2008, 2010 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_STRINGENTRY_H
+#define GETDATA_STRINGENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class StringEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      StringEntry() : Entry() { E.field_type = GD_STRING_ENTRY; };
+
+      StringEntry(const char* field_code, int fragment_index = 0);
+
+    private:
+      StringEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/getdata/windowentry.h b/bindings/cxx/getdata/windowentry.h
new file mode 100644
index 0000000..61b67c7
--- /dev/null
+++ b/bindings/cxx/getdata/windowentry.h
@@ -0,0 +1,66 @@
+// Copyright (C) 2011-2012 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GETDATA_WINDOWENTRY_H
+#define GETDATA_WINDOWENTRY_H
+
+#include <getdata/entry.h>
+
+namespace GetData {
+
+  class Dirfile;
+
+  class WindowEntry : public Entry {
+    friend class Dirfile;
+
+    public:
+      WindowEntry() : Entry() { E.field_type = GD_WINDOW_ENTRY; };
+
+      WindowEntry(const char* field_code, const char* in_field,
+          const char *check_Field, WindOpType windop, gd_triplet_t threshold,
+          int fragment_index = 0);
+
+      virtual const char *Input(int index = 0) const {
+        return E.in_fields[(index == 0) ? 0 : 1];
+      };
+
+      virtual const char *Scalar() const { return E.scalar[0]; }
+
+      virtual int ScalarIndex() const { return E.scalar_ind[0]; };
+
+      virtual WindOpType WindOp() const {
+        return (WindOpType)E.u.window.windop;
+      };
+
+      virtual gd_triplet_t Threshold() const { return E.u.window.threshold; };
+
+      int SetInput(const char* field, int index);
+      virtual int SetWindOp(WindOpType windop);
+      virtual int SetThreshold(gd_triplet_t threshold);
+      virtual int SetThreshold(const char* threshold);
+
+    private:
+      WindowEntry(const GetData::Dirfile *dirfile, const char* field_code) :
+        Entry(dirfile, field_code) { };
+  };
+}
+
+#endif
diff --git a/bindings/cxx/indexentry.cpp b/bindings/cxx/indexentry.cpp
new file mode 100644
index 0000000..c20dec1
--- /dev/null
+++ b/bindings/cxx/indexentry.cpp
@@ -0,0 +1,21 @@
+// 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
new file mode 100644
index 0000000..06a913d
--- /dev/null
+++ b/bindings/cxx/internal.h
@@ -0,0 +1,61 @@
+// Copyright (C) 2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#ifdef HAVE_CONFIG_H
+#include "gd_config.h"
+#endif
+#undef GETDATA_LEGACY_API
+#include "getdata/dirfile.h"
+
+#include <cstring>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+
+/* debugging macros */
+#ifdef GETDATA_DEBUG
+extern "C" const char* gd_colnil(void);
+extern "C" const char* gd_coladd(void);
+extern "C" const char* gd_colsub(void);
+#define dtracevoid() printf("%s %s()\n", gd_coladd(), __FUNCTION__)
+#define dtrace(fmt, ...) printf("%s %s(" fmt ")\n", gd_coladd(), \
+    __FUNCTION__, ##__VA_ARGS__)
+#define dprintf(fmt, ...) printf("%s %s:%i " fmt "\n", gd_colnil(), \
+    __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define dreturnvoid() printf("%s %s = (nil)\n", gd_colsub(), __FUNCTION__)
+#define dreturn(fmt, ...) printf("%s %s = " fmt "\n", gd_colsub(), \
+    __FUNCTION__, ##__VA_ARGS__)
+#define dwatch(fmt, v) printf("%s %s = " fmt "\n", gd_colnil(), #v, v)
+#else
+#define dtracevoid()
+#define dtrace(...)
+#define dprintf(...)
+#define dreturnvoid()
+#define dreturn(...)
+#define dwatch(...)
+#endif
+
+#ifdef _MSC_VER
+#define __gd_unused 
+#else
+#define __gd_unused __attribute__ (( unused ))
+#endif
+
+using namespace GetData;
diff --git a/bindings/cxx/lincomentry.cpp b/bindings/cxx/lincomentry.cpp
new file mode 100644
index 0000000..00b04bf
--- /dev/null
+++ b/bindings/cxx/lincomentry.cpp
@@ -0,0 +1,221 @@
+// Copyright (C) 2008-2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+LincomEntry::LincomEntry(const char* field_code, int n_fields,
+    const char** in_fields, double* m, double* b, int fragment_index) :
+  Entry()
+{
+  int i;
+
+  E.field = strdup(field_code);
+  E.field_type = GD_LINCOM_ENTRY;
+  E.u.lincom.n_fields = n_fields;
+  E.fragment_index = fragment_index;
+  E.comp_scal = 0;
+  for (i = 0; i < n_fields; ++i) {
+    E.in_fields[i] = strdup(in_fields[i]);
+    E.u.lincom.m[i] = m[i];
+    E.u.lincom.b[i] = b[i];
+  }
+}
+
+LincomEntry::LincomEntry(const char* field_code, int n_fields,
+    const char** in_fields, std::complex<double>* cm, std::complex<double>* cb,
+    int fragment_index) : Entry()
+{
+  int i;
+
+  E.field = strdup(field_code);
+  E.field_type = GD_LINCOM_ENTRY;
+  E.u.lincom.n_fields = n_fields;
+  E.fragment_index = fragment_index;
+  E.comp_scal = 1;
+  for (i = 0; i < n_fields; ++i) {
+    E.in_fields[i] = strdup(in_fields[i]);
+    E.u.lincom.cm[i][0] = cm[i].real();
+    E.u.lincom.cm[i][1] = cm[i].imag();
+    E.u.lincom.cb[i][0] = cb[i].real();
+    E.u.lincom.cb[i][1] = cb[i].imag();
+  }
+}
+
+int LincomEntry::SetInput(const char* field, int index)
+{
+  if (index < 0 || index >= GD_MAX_LINCOM)
+    return -1;
+
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return -1;
+
+  free(E.in_fields[index]);
+  E.in_fields[index] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int LincomEntry::SetScale(double scale, int index)
+{
+  if (index < 0 || index >= GD_MAX_LINCOM)
+    return -1;
+
+  E.u.lincom.cm[index][0] = E.u.lincom.m[index] = scale;
+  E.u.lincom.cm[index][1] = 0;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int LincomEntry::SetScale(const char *scale, int index)
+{
+  int r = 0;
+
+  if (index < 0 || index >= GD_MAX_LINCOM)
+    return -1;
+
+  SetScalar(index, scale);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r) {
+      r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.lincom.cm + index);
+      E.u.lincom.m[index] = E.u.lincom.cm[index][0];
+    }
+  }
+  
+  return r;
+}
+
+int LincomEntry::SetScale(std::complex<double> scale, int index)
+{
+  if (index < 0 || index >= GD_MAX_LINCOM)
+    return -1;
+
+  E.u.lincom.m[index] = E.u.lincom.cm[index][0] = scale.real();
+  E.u.lincom.cm[index][1] = scale.imag();
+  E.comp_scal = 1;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int LincomEntry::SetOffset(double offset, int index)
+{
+  if (index < 0 || index >= GD_MAX_LINCOM)
+    return -1;
+
+  E.u.lincom.cb[index][0] = E.u.lincom.b[index] = offset;
+  E.u.lincom.cb[index][1] = 0;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int LincomEntry::SetOffset(const char *scale, int index)
+{
+  int r = 0;
+
+  if (index < 0 || index >= GD_MAX_LINCOM)
+    return -1;
+
+  SetScalar(index + GD_MAX_LINCOM, scale);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r) {
+      r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.lincom.cb + index);
+      E.u.lincom.b[index] = E.u.lincom.cb[index][0];
+    }
+  }
+  
+  return r;
+}
+
+int LincomEntry::SetOffset(std::complex<double> offset, int index)
+{
+  if (index < 0 || index >= GD_MAX_LINCOM)
+    return -1;
+
+  E.u.lincom.b[index] = E.u.lincom.cb[index][0] = offset.real();
+  E.u.lincom.cb[index][1] = offset.imag();
+  E.comp_scal = 1;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int LincomEntry::SetNFields(int nfields)
+{
+  int old_n = E.u.lincom.n_fields;
+
+  if (nfields < 1 || nfields > GD_MAX_LINCOM)
+    return -1;
+
+  if (nfields > old_n) {
+    int i;
+
+    for (i = old_n; i < nfields; ++i) {
+      free(E.in_fields[i]);
+      E.in_fields[i] = strdup("INDEX");
+      E.u.lincom.m[i] = E.u.lincom.b[i] = 0;
+    }
+  }
+
+  E.u.lincom.n_fields = nfields;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+
+  return 0;
+}
+
+const char *LincomEntry::Scalar(int index) const
+{
+  if (index < 0 || index >= E.u.lincom.n_fields)
+    return NULL;
+
+  return E.scalar[index];
+}
+
+int LincomEntry::ScalarIndex(int index) const
+{
+  if (index < 0 || index >= E.u.lincom.n_fields)
+    return 0;
+
+  return E.scalar_ind[index];
+}
diff --git a/bindings/cxx/linterpentry.cpp b/bindings/cxx/linterpentry.cpp
new file mode 100644
index 0000000..541437a
--- /dev/null
+++ b/bindings/cxx/linterpentry.cpp
@@ -0,0 +1,65 @@
+// Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+LinterpEntry::LinterpEntry(const char* field_code, const char* in_field,
+    const char* table, int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_LINTERP_ENTRY;
+  E.in_fields[0] = strdup(in_field);
+  E.u.linterp.table = strdup(table);
+  E.fragment_index = fragment_index;
+}
+
+int LinterpEntry::SetInput(const char* field)
+{
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return 0;
+
+  free(E.in_fields[0]);
+  E.in_fields[0] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int LinterpEntry::SetTable(const char* table, int move_table)
+{
+  char* ptr = strdup(table);
+
+  if (ptr == NULL)
+    return 0;
+
+  free(E.u.linterp.table);
+  E.u.linterp.table = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, move_table);
+  
+  return 0;
+}
diff --git a/bindings/cxx/mplexentry.cpp b/bindings/cxx/mplexentry.cpp
new file mode 100644
index 0000000..341d9ff
--- /dev/null
+++ b/bindings/cxx/mplexentry.cpp
@@ -0,0 +1,126 @@
+// 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 "internal.h"
+
+MplexEntry::MplexEntry(const char* field_code, const char* in_field,
+    const char* count, int count_val, int period, int fragment_index) : Entry()
+{
+  dtrace("\"%s\", \"%s\", \"%s\", %i, %i, %i", field_code,
+      in_field, count, count_val, period, fragment_index);
+
+  E.field = strdup(field_code);
+  E.field_type = GD_MPLEX_ENTRY;
+  E.in_fields[0] = strdup(in_field);
+  E.in_fields[1] = strdup(count);
+  E.scalar[0] = E.scalar[1] = 0;
+  E.u.mplex.count_val = count_val;
+  E.u.mplex.period = period;
+  E.fragment_index = fragment_index;
+
+  dreturnvoid();
+}
+
+int MplexEntry::SetInput(const char* field, int index)
+{
+  if (index < 0 || index > 1)
+    return -1;
+
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return -1;
+
+  free(E.in_fields[index]);
+  E.in_fields[index] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int MplexEntry::SetCountVal(int count_val)
+{
+  int ret = 0;
+
+  dtrace("%u", count_val);
+
+  E.u.mplex.count_val = count_val;
+
+  if (D != NULL)
+    ret = gd_alter_entry(D->D, E.field, &E, 0);
+  
+  dreturn("%i", ret);
+  return ret;
+}
+
+int MplexEntry::SetPeriod(int period)
+{
+  int ret = 0;
+
+  dtrace("%u", period);
+
+  E.u.mplex.period = period;
+
+  if (D != NULL)
+    ret = gd_alter_entry(D->D, E.field, &E, 0);
+  
+  dreturn("%i", ret);
+  return ret;
+}
+
+int MplexEntry::SetCountVal(const char *count_val)
+{
+  int r = 0;
+
+  dtrace("\"%s\"", count_val);
+
+  SetScalar(0, count_val);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r)
+      r = gd_get_constant(D->D, count_val, GD_UINT16, &E.u.mplex.count_val);
+  }
+  
+  dreturn("%i", r);
+  return r;
+}
+
+int MplexEntry::SetPeriod(const char *period)
+{
+  int r = 0;
+
+  dtrace("\"%s\"", period);
+
+  SetScalar(1, period);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r)
+      r = gd_get_constant(D->D, period, GD_UINT16, &E.u.mplex.period);
+  }
+  
+  dreturn("%i", r);
+  return r;
+}
diff --git a/bindings/cxx/multiplyentry.cpp b/bindings/cxx/multiplyentry.cpp
new file mode 100644
index 0000000..fe6884a
--- /dev/null
+++ b/bindings/cxx/multiplyentry.cpp
@@ -0,0 +1,52 @@
+// Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+MultiplyEntry::MultiplyEntry(const char* field_code, const char* in_field1,
+    const char* in_field2, int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_MULTIPLY_ENTRY;
+  E.in_fields[0] = strdup(in_field1);
+  E.in_fields[1] = strdup(in_field2);
+  E.fragment_index = fragment_index;
+}
+
+int MultiplyEntry::SetInput(const char* field, int index)
+{
+  if (index < 0 || index > 1)
+    return -1;
+
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return -1;
+
+  free(E.in_fields[index]);
+  E.in_fields[index] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
diff --git a/bindings/cxx/phaseentry.cpp b/bindings/cxx/phaseentry.cpp
new file mode 100644
index 0000000..71006bf
--- /dev/null
+++ b/bindings/cxx/phaseentry.cpp
@@ -0,0 +1,75 @@
+// Copyright (C) 2008-2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+PhaseEntry::PhaseEntry(const char* field_code, const char* in_field,
+    gd_shift_t shift, int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_PHASE_ENTRY;
+  E.in_fields[0] = strdup(in_field);
+  E.u.phase.shift = shift;
+  E.fragment_index = fragment_index;
+}
+
+int PhaseEntry::SetInput(const char* field)
+{
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return 0;
+
+  free(E.in_fields[0]);
+  E.in_fields[0] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int PhaseEntry::SetShift(gd_shift_t shift)
+{
+  E.u.phase.shift = shift;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int PhaseEntry::SetShift(const char *shift)
+{
+  int r = 0;
+
+  SetScalar(0, shift);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r)
+      r = gd_get_constant(D->D, shift, GD_INT64, &E.u.phase.shift);
+  }
+  
+  return r;
+}
diff --git a/bindings/cxx/polynomentry.cpp b/bindings/cxx/polynomentry.cpp
new file mode 100644
index 0000000..3ce0c4c
--- /dev/null
+++ b/bindings/cxx/polynomentry.cpp
@@ -0,0 +1,160 @@
+// Copyright (C) 2009, 2010, 2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+PolynomEntry::PolynomEntry(const char* field_code, int poly_ord,
+    const char* in_field, double* a, int fragment_index) : Entry()
+{
+  int i;
+
+  E.field = strdup(field_code);
+  E.field_type = GD_POLYNOM_ENTRY;
+  E.u.polynom.poly_ord = poly_ord;
+  E.fragment_index = fragment_index;
+  E.comp_scal = 0;
+  E.in_fields[0] = strdup(in_field);
+  for (i = 0; i <= poly_ord; ++i)
+    E.u.polynom.a[i] = a[i];
+}
+
+PolynomEntry::PolynomEntry(const char* field_code, int poly_ord,
+    const char* in_field, std::complex<double>* ca, int fragment_index) :
+  Entry()
+{
+  int i;
+
+  E.field = strdup(field_code);
+  E.field_type = GD_POLYNOM_ENTRY;
+  E.u.polynom.poly_ord = poly_ord;
+  E.fragment_index = fragment_index;
+  E.comp_scal = 1;
+  E.in_fields[0] = strdup(in_field);
+  for (i = 0; i <= poly_ord; ++i) {
+    E.u.polynom.ca[i][0] = ca[i].real();
+    E.u.polynom.ca[i][1] = ca[i].imag();
+  }
+}
+
+int PolynomEntry::SetInput(const char* field)
+{
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return -1;
+
+  free(E.in_fields[0]);
+  E.in_fields[0] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int PolynomEntry::SetCoefficient(double coeff, int index)
+{
+  if (index < 0 || index > GD_MAX_POLYORD)
+    return -1;
+
+  E.u.polynom.ca[index][0] = E.u.polynom.a[index] = coeff;
+  E.u.polynom.ca[index][1] = 0;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int PolynomEntry::SetCoefficient(const char *scale, int index)
+{
+  int r = 0;
+
+  if (index < 0 || index > GD_MAX_POLYORD)
+    return -1;
+
+  SetScalar(index, scale);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r) {
+      r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.polynom.ca + index);
+      E.u.polynom.a[index] = E.u.polynom.ca[index][0];
+    }
+  }
+  
+  return r;
+}
+
+int PolynomEntry::SetCoefficient(std::complex<double> coeff, int index)
+{
+  if (index < 0 || index > GD_MAX_POLYORD)
+    return -1;
+
+  E.u.polynom.a[index] = E.u.polynom.ca[index][0] = coeff.real();
+  E.u.polynom.ca[index][1] = coeff.imag();
+  E.comp_scal = 1;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int PolynomEntry::SetPolyOrd(int poly_ord)
+{
+  int old_n = E.u.polynom.poly_ord;
+
+  if (poly_ord < 2 || poly_ord > GD_MAX_POLYORD)
+    return -1;
+
+  if (poly_ord > old_n) {
+    int i;
+
+    for (i = old_n + 1; i <= poly_ord; ++i)
+      E.u.polynom.a[i] = 0;
+  }
+
+  E.u.polynom.poly_ord = poly_ord;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+
+  return 0;
+}
+
+const char *PolynomEntry::Scalar(int index) const
+{
+  if (index < 0 || index > E.u.polynom.poly_ord)
+    return NULL;
+
+  return E.scalar[index];
+}
+
+int PolynomEntry::ScalarIndex(int index) const
+{
+  if (index < 0 || index > E.u.polynom.poly_ord)
+    return 0;
+
+  return E.scalar_ind[index];
+}
diff --git a/bindings/cxx/rawentry.cpp b/bindings/cxx/rawentry.cpp
new file mode 100644
index 0000000..cfd1a72
--- /dev/null
+++ b/bindings/cxx/rawentry.cpp
@@ -0,0 +1,82 @@
+// Copyright (C) 2008-2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+RawEntry::RawEntry(const char* field_code, DataType data_type, unsigned int spf,
+      int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_RAW_ENTRY;
+  E.u.raw.spf = spf;
+  E.u.raw.data_type = (gd_type_t)data_type;
+  E.fragment_index = fragment_index;
+  filename = NULL;
+}
+
+RawEntry::~RawEntry()
+{
+  free(filename);
+}
+
+int RawEntry::SetSamplesPerFrame(unsigned int spf, int recode)
+{
+  E.u.raw.spf = spf;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, recode);
+  
+  return 0;
+}
+
+int RawEntry::SetSamplesPerFrame(const char *spf, int recode)
+{
+  int r = 0;
+
+  SetScalar(0, spf);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, recode);
+
+    if (!r)
+      r = gd_get_constant(D->D, spf, GD_UINT16, &E.u.raw.spf);
+  }
+  
+  return r;
+}
+
+int RawEntry::SetType(DataType type, int recode)
+{
+  E.u.raw.data_type = (gd_type_t)type;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, recode);
+  
+  return 0;
+}
+
+const char* RawEntry::FileName()
+{
+  free(filename);
+  filename = gd_raw_filename(D->D, E.field);
+  return filename;
+}
diff --git a/bindings/cxx/recipentry.cpp b/bindings/cxx/recipentry.cpp
new file mode 100644
index 0000000..58a6ccc
--- /dev/null
+++ b/bindings/cxx/recipentry.cpp
@@ -0,0 +1,106 @@
+// Copyright (C) 2010-2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+RecipEntry::RecipEntry(const char* field_code, const char* in_field1,
+    double dividend, int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_RECIP_ENTRY;
+  E.in_fields[0] = strdup(in_field1);
+  E.scalar[0] = 0;
+  E.u.recip.cdividend[0] = E.u.recip.dividend = dividend;
+  E.u.recip.cdividend[1] = 0;
+  E.comp_scal = 0;
+  E.fragment_index = fragment_index;
+}
+
+RecipEntry::RecipEntry(const char* field_code, const char* in_field1,
+    std::complex<double> dividend, int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_RECIP_ENTRY;
+  E.in_fields[0] = strdup(in_field1);
+  E.scalar[0] = 0;
+  E.u.recip.cdividend[0] = E.u.recip.dividend = dividend.real();
+  E.u.recip.cdividend[1] = dividend.imag();
+  E.comp_scal = 1;
+  E.fragment_index = fragment_index;
+}
+
+int RecipEntry::SetInput(const char* field)
+{
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return -1;
+
+  free(E.in_fields[0]);
+  E.in_fields[0] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int RecipEntry::SetDividend(double dividend)
+{
+  E.u.recip.cdividend[0] = E.u.recip.dividend = dividend;
+  E.u.recip.cdividend[1] = 0;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int RecipEntry::SetDividend(const char *scale)
+{
+  int r = 0;
+
+  SetScalar(0, scale);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r) {
+      r = gd_get_constant(D->D, scale, GD_COMPLEX128, &E.u.recip.cdividend);
+      E.u.recip.dividend = E.u.recip.cdividend[0];
+    }
+  }
+  
+  return r;
+}
+
+int RecipEntry::SetDividend(std::complex<double> dividend)
+{
+  E.u.recip.dividend = E.u.recip.cdividend[0] = dividend.real();
+  E.u.recip.cdividend[1] = dividend.imag();
+  E.comp_scal = 1;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
diff --git a/bindings/cxx/sbitentry.cpp b/bindings/cxx/sbitentry.cpp
new file mode 100644
index 0000000..6246614
--- /dev/null
+++ b/bindings/cxx/sbitentry.cpp
@@ -0,0 +1,118 @@
+// Copyright (C) 2008-2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+SBitEntry::SBitEntry(const char* field_code, const char* in_field,
+    int bitnum, int numbits, int fragment_index) : Entry()
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_BIT_ENTRY;
+  E.in_fields[0] = strdup(in_field);
+  E.u.bit.bitnum = bitnum;
+  E.u.bit.numbits = numbits;
+  E.fragment_index = fragment_index;
+}
+
+int SBitEntry::SetInput(const char* field)
+{
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return 0;
+
+  free(E.in_fields[0]);
+  E.in_fields[0] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int SBitEntry::SetFirstBit(int first_bit)
+{
+  E.u.bit.bitnum = first_bit;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int SBitEntry::SetNumBits(int num_bits)
+{
+  E.u.bit.numbits = num_bits;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+const char *SBitEntry::Scalar(int index) const
+{
+  if (index != 0 && index != 1)
+    return NULL;
+
+  return E.scalar[index];
+}
+
+int SBitEntry::ScalarIndex(int index) const
+{
+  if (index != 0 && index != 1)
+    return 0;
+
+  return E.scalar_ind[index];
+}
+
+int SBitEntry::SetFirstBit(const char *first_bit)
+{
+  int r = 0;
+
+  SetScalar(0, first_bit);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r)
+      r = gd_get_constant(D->D, first_bit, GD_INT16, &E.u.bit.bitnum);
+  }
+  
+  return r;
+}
+
+int SBitEntry::SetNumBits(const char *num_bits)
+{
+  int r = 0;
+
+  SetScalar(1, num_bits);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r)
+      r = gd_get_constant(D->D, num_bits, GD_INT16, &E.u.bit.numbits);
+  }
+  
+  return r;
+}
diff --git a/bindings/cxx/stringentry.cpp b/bindings/cxx/stringentry.cpp
new file mode 100644
index 0000000..15898bd
--- /dev/null
+++ b/bindings/cxx/stringentry.cpp
@@ -0,0 +1,30 @@
+// Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+using namespace GetData;
+
+StringEntry::StringEntry(const char* field_code, int fragment_index)
+{
+  E.field = strdup(field_code);
+  E.field_type = GD_STRING_ENTRY;
+  E.fragment_index = fragment_index;
+}
diff --git a/bindings/cxx/test/Makefile.am b/bindings/cxx/test/Makefile.am
new file mode 100644
index 0000000..0720984
--- /dev/null
+++ b/bindings/cxx/test/Makefile.am
@@ -0,0 +1,48 @@
+# Copyright (C) 2008-2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign serial-tests
+
+if CXX_WALL
+WALL=-Wall
+endif
+
+if CXX_WEXTRA
+WEXTRA=-Wextra
+endif
+
+AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src
+LDADD=../libgetdata++.la
+TESTS=big_test
+
+big_test_SOURCES=big_test.cpp
+
+check_PROGRAMS=${TESTS}
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	rm -rf *odirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~
diff --git a/bindings/cxx/test/Makefile.in b/bindings/cxx/test/Makefile.in
new file mode 100644
index 0000000..5b134cd
--- /dev/null
+++ b/bindings/cxx/test/Makefile.in
@@ -0,0 +1,823 @@
+# 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@
+TESTS = big_test$(EXEEXT)
+check_PROGRAMS = $(am__EXEEXT_1)
+subdir = bindings/cxx/test
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__EXEEXT_1 = big_test$(EXEEXT)
+am_big_test_OBJECTS = big_test.$(OBJEXT)
+big_test_OBJECTS = $(am_big_test_OBJECTS)
+big_test_LDADD = $(LDADD)
+big_test_DEPENDENCIES = ../libgetdata++.la
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+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
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_ at AM_V@)
+am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
+SOURCES = $(big_test_SOURCES)
+DIST_SOURCES = $(big_test_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008-2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign serial-tests
+ at CXX_WALL_TRUE@WALL = -Wall
+ at CXX_WEXTRA_TRUE@WEXTRA = -Wextra
+AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src
+LDADD = ../libgetdata++.la
+big_test_SOURCES = big_test.cpp
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/cxx/test/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/cxx/test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+big_test$(EXEEXT): $(big_test_OBJECTS) $(big_test_DEPENDENCIES) $(EXTRA_big_test_DEPENDENCIES) 
+	@rm -f big_test$(EXEEXT)
+	$(AM_V_CXXLD)$(CXXLINK) $(big_test_OBJECTS) $(big_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/big_test.Po at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \
+	check-local clean clean-checkPROGRAMS clean-generic \
+	clean-libtool clean-local cscopelist-am ctags ctags-am \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am
+
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	rm -rf *odirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/cxx/test/big_test.cpp b/bindings/cxx/test/big_test.cpp
new file mode 100644
index 0000000..b57d82e
--- /dev/null
+++ b/bindings/cxx/test/big_test.cpp
@@ -0,0 +1,1809 @@
+// Copyright (C) 2009-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
+//
+#ifdef HAVE_CONFIG_H
+#include "gd_config.h"
+#endif
+#undef GETDATA_LEGACY_API
+
+#include "getdata/dirfile.h"
+#include "internal.h"
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <iostream>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#if MKDIR_NO_MODE
+#ifdef HAVE__MKDIR
+#define mkdir(f,m) _mkdir(f)
+#else
+#define mkdir(f,m) mkdir(f)
+#endif
+#endif
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+using namespace std;
+using namespace GetData;
+
+static int ne = 0;
+
+template <class T> static void CheckT(char c, int i, int t, int n, T v, T g,
+    int r)
+{
+  if (r) {
+    ne++;
+    cerr << c;
+    if (i != -1)
+      cerr << "(" << i << ")";
+    cerr << "[" << t;
+    if (n != -1)
+      cerr << ", " << n;
+    cerr << "] = " << v << " (expected " << g << ")" << endl;
+  }
+}
+
+static void CheckError(const Dirfile *d, int t, int n, int g)
+{
+  int e = d->Error();
+  CheckT<int>('e', -1, t, n, e, g, e != g);
+}
+
+static void CheckInt(int i, int t, int n, int v, int g)
+{
+  CheckT<int>('n', i, t, n, v, g, v != g);
+}
+
+template <class T> static void CheckFloat(char c, int i, int t, int n, T v, T g)
+{
+  CheckT<T>(c, i, t, n, v, g, (abs((v) - (g)) > 1e-10));
+}
+#define CHECK_ERROR(t,g) CheckError(d,t,-1,g)
+#define CHECK_ERROR2(t,n,g) CheckError(d,t,n,g)
+#define CHECK_OK(t) CHECK_ERROR(t,GD_E_OK)
+#define CHECK_OK2(t,n) CHECK_ERROR2(t,n,GD_E_OK)
+
+#define CHECK_NONNULL(t,v) CheckT<const void*>('p', -1, t, -1, 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)
+
+#define CHECK_INT_ARRAY(t,m,v,g) \
+  for (i = 0; i < m; ++i) CheckInt(i, t, -1, v, g)
+
+#define CHECK_DOUBLE(t,v,g) CheckFloat<double>('d', -1, t, -1, v, g)
+#define CHECK_DOUBLE2(t,n,v,g) CheckFloat<double>('d', -1, t, n, v, 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_STRING2(t,n,v,g) \
+  CheckT<const char*>('s', -1, t, n, v, g, (strcmp((v), (g))))
+
+#define CHECK_STRING_ARRAY(t,m,v,g) \
+  for (i = 0; i < m; ++i) \
+CheckT<const char*>('s', i, t, -1, v, g, (strcmp((v), (g))))
+
+#define CHECK_EOSTRING(t,v,g) \
+  CheckT<const char*>('S', -1, t, -1, v, g, \
+      (strcmp((v) + strlen(v) - strlen(g), (g))))
+
+#define CHECK_COMPLEX2(t,n,v,g) \
+  CheckFloat<complex<double> >('c', -1, t, n, 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)
+{
+  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* format_data =
+    "/ENDIAN little\n"
+    "data RAW INT8 8\n"
+    "lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const\n"
+    "/META data mstr STRING \"This is a string constant.\"\n"
+    "/META data mconst CONST COMPLEX128 3.3;4.4\n"
+    "/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5\n"
+    "/META data mlut LINTERP DATA ./lut\n"
+    "const CONST FLOAT64 5.5\n"
+    "carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6\n"
+    "linterp LINTERP data ./lut\n"
+    "polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const\n"
+    "bit BIT data 3 4\n"
+    "sbit SBIT data 5 6\n"
+    "mplex MPLEX data sbit 1 10\n"
+    "mult MULTIPLY data sbit\n"
+    "div DIVIDE mult bit\n"
+    "recip RECIP div 6.5;4.3\n"
+    "phase PHASE data 11\n"
+    "window WINDOW linterp mult LT 4.1\n"
+    "/ALIAS alias data\n"
+    "string STRING \"Zaphod Beeblebrox\"\n";
+  const char* form2_data = "const2 CONST INT8 -19\n";
+  const int nfields = 17;
+  unsigned char c[8];
+  unsigned char data_data[80];
+  signed char sc;
+  int m, n, i;
+  float fl;
+  double dp, p[6], q[6];
+  const double *qp;
+  complex<double> cq[6];
+  const char **list;
+  const char* str;
+  char* tok;
+  char buf[GD_MAX_LINE_LENGTH];
+  Dirfile *d;
+  Entry *ent;
+  RawEntry rent, *rep;
+  LincomEntry lent, *lep;
+  LinterpEntry nent, *nep;
+  BitEntry bent, *bep;
+  MultiplyEntry ment, *mep;
+  PhaseEntry pent, *pep;
+  PolynomEntry yent, *yep;
+  DivideEntry dent, *dep;
+  RecipEntry oent, *oep;
+  SBitEntry sent, *sep;
+  ConstEntry cent, *cep;
+  CarrayEntry aent, *aep;
+  StringEntry gent;
+  WindowEntry went, *wep;
+  MplexEntry xent, *xep;
+  Fragment *frag;
+  gd_triplet_t thresh;
+  const gd_carray_t *carrays;
+
+  char* fields[nfields + 9] = {(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};
+  char *strings[3];
+
+  unlink(data);
+  unlink(new1);
+  unlink(format);
+  unlink(format1);
+  unlink(form2);
+  rmdir(filedir);
+
+  // Write the test dirfile
+  mkdir(filedir, 0777);
+
+  for (n = 0; n < 80; ++n)
+    data_data[n] = (unsigned char)n + 1;
+
+  n = open(format, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666);
+  write(n, format_data, strlen(format_data));
+  close(n);
+
+  n = open(form2, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666);
+  write(n, form2_data, strlen(form2_data));
+  close(n);
+
+  n = open(data, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666);
+  write(n, data_data, 80);
+  close(n);
+
+  // 0: Dirfile::Error check
+  d = new Dirfile("x");
+  CHECK_ERROR(0, GD_E_OPEN);
+  delete d;
+
+  // 1: Dirfile::Dirfile check
+  d = new Dirfile(filedir, GD_RDWR);
+  CHECK_OK(1);
+
+  // 2: Dirfile::GetData check
+  n = d->GetData("data", 5, 0, 1, 0, UInt8, c);
+  CHECK_OK(2);
+  CHECK_INT(2,n,8);
+  CHECK_INT_ARRAY(2,8,c[i],41 + i);
+
+  // 3: Dirfile::GetConstant check
+  n = d->GetConstant("const", Float64, &dp);
+  CHECK_OK(3);
+  CHECK_INT(3,n,0);
+  CHECK_DOUBLE(3,dp,5.5);
+
+  // 6: Dirfile::NFields check
+  n = d->NFields();
+  CHECK_OK(6);
+  CHECK_INT(6,n,nfields);
+
+  // 8: Dirfile::FieldList check
+  list = d->FieldList();
+  CHECK_OK(8);
+  CHECK_STRING_ARRAY(8,n,list[i],fields[i]);
+
+  // 9: Dirfile::NFields check
+  n = d->NMFields("data");
+  CHECK_OK(9);
+  CHECK_INT(9,n,4);
+
+  // 10: 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]);
+
+  // 11: Dirfile::NFrames check
+  n = d->NFrames();
+  CHECK_OK(11);
+  CHECK_INT(11,n,10);
+
+  // 12: Dirfile::SamplesPerFrame check
+  n = d->SamplesPerFrame("data");
+  CHECK_OK(12);
+  CHECK_INT(12,n,8);
+
+  // 13: Dirfile::PutData check
+  c[0] = 13;
+  c[1] = 14;
+  c[2] = 15;
+  c[3] = 16;
+  n = d->PutData("data", 5, 1, 0, 4, UInt8, c);
+  CHECK_OK2(13,1);
+  CHECK_INT2(13,1,n,4);
+
+  n = d->GetData("data", 5, 0, 1, 0, UInt8, c);
+  CHECK_OK2(13,2);
+  CHECK_INT2(13,2,n,8);
+  CHECK_INT_ARRAY(13,8,c[i],(i == 0 || i > 4) ? 41 + i : 12 + i);
+
+  // 14: Dirfile::ErrorString check
+  d->GetData("x", 5, 0, 1, 0, Null, NULL);
+  str = d->ErrorString();
+  CHECK_STRING(14,str,"Field not found: x");
+
+  // 16: Dirfile::Entry / RawEntry check
+  ent = d->Entry("data");
+  CHECK_OK(16);
+  CHECK_INT2(16,1,ent->Type(),RawEntryType);
+  CHECK_INT2(16,2,ent->FragmentIndex(),0);
+  CHECK_INT2(16,3,ent->SamplesPerFrame(),8);
+  CHECK_INT2(16,4,ent->RawType(),Int8);
+  delete ent;
+
+  // 18: Dirfile::Entry / LincomEntry check
+  cq[0] = 1.1;
+  cq[1] = 2.2;
+  cq[2] = 2.2;
+  cq[3] = complex<double>(3.3, 4.4);
+  cq[4] = 5.5;
+  cq[5] = 5.5;
+  ent = d->Entry("lincom");
+  CHECK_OK(18);
+  CHECK_INT2(18,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(18,2,ent->NFields(),3);
+  CHECK_INT2(18,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(18,4,ent->Input(0),"data");
+  CHECK_STRING2(18,5,ent->Input(1),"INDEX");
+  CHECK_STRING2(18,6,ent->Input(2),"linterp");
+  CHECK_INT2(18,7,ent->ComplexScalars(),1);
+  CHECK_COMPLEX_ARRAY(18,3,ent->CScale(i),cq[i * 2]);
+  CHECK_COMPLEX_ARRAY(18,3,ent->COffset(i),cq[i * 2 + 1]);
+  delete ent;
+
+  // 20: Dirfile::Entry / PolynomEntry check
+  ent = d->Entry("polynom");
+  CHECK_OK(20);
+  CHECK_INT2(20,1,ent->Type(),PolynomEntryType);
+  CHECK_INT2(20,2,ent->PolyOrd(),5);
+  CHECK_INT2(20,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(20,4,ent->Input(),"data");
+  CHECK_INT2(20,7,ent->ComplexScalars(),1);
+  CHECK_COMPLEX_ARRAY(20,6,ent->CCoefficient(i),cq[i]);
+  delete ent;
+
+  // 21: Dirfile::Entry / LinterpEntry check
+  ent = d->Entry("linterp");
+  CHECK_OK(21);
+  CHECK_INT2(21,1,ent->Type(),LinterpEntryType);
+  CHECK_INT2(21,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(21,3,ent->Input(),"data");
+  CHECK_STRING2(21,4,ent->Table(),"./lut");
+  delete ent;
+
+  // 22: Dirfile::Entry / BitEntry check
+  ent = d->Entry("bit");
+  CHECK_OK(22);
+  CHECK_INT2(22,1,ent->Type(),BitEntryType);
+  CHECK_INT2(22,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(22,3,ent->Input(),"data");
+  CHECK_INT2(22,4,ent->NumBits(),4);
+  CHECK_INT2(22,5,ent->FirstBit(),3);
+  delete ent;
+
+  // 23: Dirfile::Entry / SBitEntry check
+  ent = d->Entry("sbit");
+  CHECK_OK(23);
+  CHECK_INT2(23,1,ent->Type(),SBitEntryType);
+  CHECK_INT2(23,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(23,3,ent->Input(),"data");
+  CHECK_INT2(23,4,ent->NumBits(),6);
+  CHECK_INT2(23,5,ent->FirstBit(),5);
+  delete ent;
+
+  // 24: Dirfile::Entry / MultiplyEntry check
+  ent = d->Entry("mult");
+  CHECK_OK(24);
+  CHECK_INT2(24,1,ent->Type(),MultiplyEntryType);
+  CHECK_INT2(24,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(24,3,ent->Input(0),"data");
+  CHECK_STRING2(24,4,ent->Input(1),"sbit");
+  delete ent;
+
+  // 25: Dirfile::Entry / PhaseEntry check
+  ent = d->Entry("phase");
+  CHECK_OK(25);
+  CHECK_INT2(25,1,ent->Type(),PhaseEntryType);
+  CHECK_INT2(25,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(25,3,ent->Input(),"data");
+  CHECK_INT2(25,4,ent->Shift(),11);
+  delete ent;
+
+  // 26: Dirfile::Entry / ConstEntry check
+  ent = d->Entry("const");
+  CHECK_OK(26);
+  CHECK_INT2(26,1,ent->Type(),ConstEntryType);
+  CHECK_INT2(26,2,ent->FragmentIndex(),0);
+  CHECK_INT2(26,3,ent->ConstType(),Float64);
+  delete ent;
+
+  // 134: Dirfile::Entry / StringEntry check
+  ent = d->Entry("string");
+  CHECK_OK(134);
+  CHECK_INT2(134,1,ent->Type(),StringEntryType);
+  CHECK_INT2(134,2,ent->FragmentIndex(),0);
+  delete ent;
+
+  // 27: Dirfile::FragmentIndex check
+  n = d->FragmentIndex("data");
+  CHECK_OK(27);
+  CHECK_INT(27,n,0);
+
+  // 28: Dirfile::Add / RawEntry check
+  rent.SetName("new1");
+  rent.SetFragmentIndex(0);
+  rent.SetSamplesPerFrame(3);
+  rent.SetType(Float64);
+  d->Add(rent);
+  CHECK_OK2(28,1);
+
+  ent = d->Entry("new1");
+  CHECK_OK2(28,2);
+  CHECK_INT2(28,1,ent->Type(),RawEntryType);
+  CHECK_INT2(28,2,ent->FragmentIndex(),0);
+  CHECK_INT2(28,3,ent->SamplesPerFrame(),3);
+  CHECK_INT2(28,4,ent->RawType(),Float64);
+  delete ent;
+
+  // 29: Dirfile::Add / LincomEntry check
+  q[0] = 9.9;
+  q[1] = 8.8;
+  q[2] = 7.7;
+  q[3] = 6.6;
+  lent.SetName("new2");
+  lent.SetFragmentIndex(0);
+  lent.SetNFields(2);
+  lent.SetInput("in1", 0);
+  lent.SetScale(q[0], 0);
+  lent.SetOffset(q[1], 0);
+  lent.SetInput("in2", 1);
+  lent.SetScale(q[2], 1);
+  lent.SetOffset(q[3], 1);
+  d->Add(lent);
+  CHECK_OK2(29,1);
+
+  ent = d->Entry("new2");
+  CHECK_OK2(29,2);
+  CHECK_INT2(29,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(29,2,ent->NFields(),2);
+  CHECK_INT2(29,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(29,4,ent->Input(0),"in1");
+  CHECK_STRING2(29,5,ent->Input(1),"in2");
+  CHECK_INT2(29,6,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(29,7,2,ent->Scale(i),q[i * 2]);
+  CHECK_DOUBLE_ARRAY(29,8,2,ent->Offset(i),q[i * 2 + 1]);
+  delete ent;
+
+  // 30: Dirfile::Add / LincomEntry check
+  cq[0] = complex<double>(1.1, 1.2);
+  cq[1] = complex<double>(1.3, 1.4);
+  cq[2] = complex<double>(1.4, 1.5);
+  cq[3] = complex<double>(1.6, 1.7);
+  lent.Dissociate();
+  lent.SetName("new3");
+  lent.SetFragmentIndex(0);
+  lent.SetNFields(2);
+  lent.SetInput("in1", 0);
+  lent.SetScale(cq[0], 0);
+  lent.SetOffset(cq[1], 0);
+  lent.SetInput("in2", 1);
+  lent.SetScale(cq[2], 1);
+  lent.SetOffset(cq[3], 1);
+  d->Add(lent);
+  CHECK_OK2(30,1);
+
+  ent = d->Entry("new3");
+  CHECK_OK2(30,2);
+  CHECK_INT2(30,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(30,2,ent->NFields(),2);
+  CHECK_INT2(30,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(30,4,ent->Input(0),"in1");
+  CHECK_STRING2(30,5,ent->Input(1),"in2");
+  CHECK_INT2(30,6,ent->ComplexScalars(),1);
+  CHECK_COMPLEX_ARRAY(30,2,ent->CScale(i),cq[i * 2]);
+  CHECK_COMPLEX_ARRAY(30,2,ent->COffset(i),cq[i * 2 + 1]);
+  delete ent;
+
+  // 31: Dirfile::Add / PolynomEntry check
+  q[0] = 3.9;
+  q[1] = 4.8;
+  q[2] = 5.7;
+  q[3] = 6.6;
+  yent.SetName("new4");
+  yent.SetFragmentIndex(0);
+  yent.SetPolyOrd(3);
+  yent.SetInput("in1");
+  yent.SetCoefficient(q[0], 0);
+  yent.SetCoefficient(q[1], 1);
+  yent.SetCoefficient(q[2], 2);
+  yent.SetCoefficient(q[3], 3);
+  d->Add(yent);
+  CHECK_OK2(31,1);
+
+  ent = d->Entry("new4");
+  CHECK_OK2(31,2);
+  CHECK_INT2(31,1,ent->Type(),PolynomEntryType);
+  CHECK_INT2(31,2,ent->PolyOrd(),3);
+  CHECK_INT2(31,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(31,4,ent->Input(),"in1");
+  CHECK_INT2(31,5,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(31,6,4,ent->Coefficient(i),q[i]);
+  delete ent;
+
+  // 32: Dirfile::Add / PolynomEntry check
+  cq[0] = complex<double>(3.1, 7);
+  cq[1] = complex<double>(4.2, 8);
+  cq[2] = complex<double>(5.2, 9);
+  cq[3] = complex<double>(6.3, 4.4);
+  yent.Dissociate();
+  yent.SetName("new5");
+  yent.SetFragmentIndex(0);
+  yent.SetPolyOrd(3);
+  yent.SetInput("in2");
+  yent.SetCoefficient(cq[0], 0);
+  yent.SetCoefficient(cq[1], 1);
+  yent.SetCoefficient(cq[2], 2);
+  yent.SetCoefficient(cq[3], 3);
+  d->Add(yent);
+  CHECK_OK2(32,1);
+
+  ent = d->Entry("new5");
+  CHECK_OK2(32,2);
+  CHECK_INT2(32,1,ent->Type(),PolynomEntryType);
+  CHECK_INT2(32,2,ent->PolyOrd(),3);
+  CHECK_INT2(32,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(32,4,ent->Input(),"in2");
+  CHECK_INT2(32,7,ent->ComplexScalars(),1);
+  CHECK_COMPLEX_ARRAY(32,4,ent->CCoefficient(i),cq[i]);
+  delete ent;
+
+  // 33: Dirfile::Add / LinterpEntry check
+  nent.SetName("new6");
+  nent.SetFragmentIndex(0);
+  nent.SetInput("in");
+  nent.SetTable("./some/table");
+  d->Add(nent);
+  CHECK_OK2(33,1);
+
+  ent = d->Entry("new6");
+  CHECK_OK2(33,2);
+  CHECK_INT2(33,1,ent->Type(),LinterpEntryType);
+  CHECK_INT2(33,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(33,3,ent->Input(),"in");
+  CHECK_STRING2(33,4,ent->Table(),"./some/table");
+  delete ent;
+
+  // 34: Dirfile::Add / BitEntry check
+  bent.SetName("new7");
+  bent.SetFragmentIndex(0);
+  bent.SetInput("in1");
+  bent.SetFirstBit(13);
+  bent.SetNumBits(12);
+  d->Add(bent);
+  CHECK_OK2(34,1);
+
+  ent = d->Entry("new7");
+  CHECK_OK(34);
+  CHECK_INT2(34,1,ent->Type(),BitEntryType);
+  CHECK_INT2(34,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(34,3,ent->Input(),"in1");
+  CHECK_INT2(34,4,ent->NumBits(),12);
+  CHECK_INT2(34,5,ent->FirstBit(),13);
+  delete ent;
+
+  // 35: Dirfile::Add / SBitEntry check
+  sent.SetName("new8");
+  sent.SetFragmentIndex(0);
+  sent.SetInput("in2");
+  sent.SetFirstBit(14);
+  sent.SetNumBits(15);
+  d->Add(sent);
+  CHECK_OK2(35,1);
+
+  ent = d->Entry("new8");
+  CHECK_OK(35);
+  CHECK_INT2(35,1,ent->Type(),SBitEntryType);
+  CHECK_INT2(35,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(35,3,ent->Input(),"in2");
+  CHECK_INT2(35,4,ent->NumBits(),15);
+  CHECK_INT2(35,5,ent->FirstBit(),14);
+  delete ent;
+
+  // 36: Dirfile::Add / MultiplyEntry check
+  ment.SetName("new9");
+  ment.SetFragmentIndex(0);
+  ment.SetInput("in1", 0);
+  ment.SetInput("in2", 1);
+  d->Add(ment);
+  CHECK_OK2(36,1);
+
+  ent = d->Entry("new9");
+  CHECK_OK2(36,2);
+  CHECK_INT2(36,1,ent->Type(),MultiplyEntryType);
+  CHECK_INT2(36,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(36,3,ent->Input(0),"in1");
+  CHECK_STRING2(36,4,ent->Input(1),"in2");
+  delete ent;
+
+  // 37: Dirfile::Add / PhaseEntry check
+  pent.SetName("new10");
+  pent.SetFragmentIndex(0);
+  pent.SetInput("in1");
+  pent.SetShift(22);
+  d->Add(pent);
+  CHECK_OK2(37,1);
+
+  ent = d->Entry("new10");
+  CHECK_OK(37);
+  CHECK_INT2(37,1,ent->Type(),PhaseEntryType);
+  CHECK_INT2(37,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(37,3,ent->Input(),"in1");
+  CHECK_INT2(37,4,ent->Shift(),22);
+  delete ent;
+
+  // 38: Dirfile::Add / ConstEntry check
+  cent.SetName("new11");
+  cent.SetFragmentIndex(0);
+  cent.SetType(Float64);
+  d->Add(cent);
+  CHECK_OK2(38,1);
+
+  ent = d->Entry("new11");
+  CHECK_OK2(38,2);
+  CHECK_INT2(38,1,ent->Type(),ConstEntryType);
+  CHECK_INT2(38,2,ent->FragmentIndex(),0);
+  CHECK_INT2(38,3,ent->ConstType(),Float64);
+  delete ent;
+
+  // 39: Fragment check
+  frag = d->Fragment(0);
+  CHECK_OK(39);
+  sprintf(buf, "dirfile%cformat", GD_DIRSEP);
+  CHECK_EOSTRING(39,frag->Name(), buf);
+  delete frag;
+
+  // 40: Dirfile::NFragments check
+  n = d->NFragments();
+  CHECK_OK(40);
+  CHECK_INT(40,n,1);
+
+  // 41: Dirfile::Include check
+  n = d->Include("form2");
+  CHECK_OK2(41,1);
+  CHECK_INT2(41,1,n,1);
+  n = d->GetConstant("const2", Int8, &sc);
+  CHECK_OK2(41,2);
+  CHECK_INT2(41,2,sc,-19);
+
+  // 42: Dirfile::NFieldsByType check
+  n = d->NFieldsByType(LincomEntryType);
+  CHECK_OK(42);
+  CHECK_INT(42,n,3);
+
+  // 43: Dirfile::FieldListByType check
+  fields[0] = (char*)"lincom";
+  fields[1] = (char*)"new2";
+  fields[2] = (char*)"new3";
+  list = d->FieldListByType(LincomEntryType);
+  CHECK_OK(43);
+  CHECK_STRING_ARRAY(43,n,list[i],fields[i]);
+
+  // 44: Dirfile::NVectors check
+  n = d->NVectors();
+  CHECK_OK(44);
+  CHECK_INT(44,n,24);
+
+  // 45: Dirfile::VectorList check
+  fields[0] = (char*)"INDEX";
+  fields[1] = (char*)"alias";
+  fields[2] = (char*)"bit";
+  fields[3] = (char*)"data";
+  fields[4] = (char*)"div";
+  fields[5] = (char*)"lincom";
+  fields[6] = (char*)"linterp";
+  fields[7] = (char*)"mplex";
+  fields[8] = (char*)"mult";
+  fields[9] = (char*)"new1";
+  fields[10] = (char*)"new10";
+  fields[11] = (char*)"new2";
+  fields[12] = (char*)"new3";
+  fields[13] = (char*)"new4";
+  fields[14] = (char*)"new5";
+  fields[15] = (char*)"new6";
+  fields[16] = (char*)"new7";
+  fields[17] = (char*)"new8";
+  fields[18] = (char*)"new9";
+  fields[19] = (char*)"phase";
+  fields[20] = (char*)"polynom";
+  fields[21] = (char*)"recip";
+  fields[22] = (char*)"sbit";
+  fields[23] = (char*)"window";
+  list = d->VectorList();
+  CHECK_OK(45);
+  CHECK_STRING_ARRAY(45,n,list[i],fields[i]);
+
+  // 126: Dirfile::MAdd check
+  q[0] = 9.9;
+  q[1] = 8.8;
+  q[2] = 7.7;
+  q[3] = 6.6;
+  lent.Dissociate();
+  lent.SetName("mnew1");
+  lent.SetNFields(2);
+  lent.SetInput("in1", 0);
+  lent.SetScale(q[0], 0);
+  lent.SetOffset(q[1], 0);
+  lent.SetInput("in2", 1);
+  lent.SetScale(q[2], 1);
+  lent.SetOffset(q[3], 1);
+  d->MAdd(lent, "data");
+  CHECK_OK2(126,1);
+
+  ent = d->Entry("data/mnew1");
+  CHECK_OK2(126,2);
+  CHECK_INT2(126,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(126,2,ent->NFields(),2);
+  CHECK_INT2(126,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(126,4,ent->Input(0),"in1");
+  CHECK_STRING2(126,5,ent->Input(1),"in2");
+  CHECK_INT2(126,6,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(126,7,2,ent->Scale(i),q[i * 2]);
+  CHECK_DOUBLE_ARRAY(126,8,2,ent->Offset(i),q[i * 2 + 1]);
+  delete ent;
+
+  // 56: Dirfile::GetString check
+  n = d->GetString("string", GD_MAX_LINE_LENGTH, buf);
+  CHECK_OK(56);
+  CHECK_INT(56,n,18);
+  CHECK_STRING(56,buf,"Zaphod Beeblebrox");
+
+  // 57: Dirfile::Add / StringEntry check
+  gent.SetName("new12");
+  gent.SetFragmentIndex(0);
+  d->Add(gent);
+  CHECK_OK2(57,1);
+
+  ent = d->Entry("new12");
+  CHECK_OK2(57,2);
+  CHECK_INT2(57,1,ent->Type(),StringEntryType);
+  CHECK_INT2(57,2,ent->FragmentIndex(),0);
+  delete ent;
+
+  n = d->GetString("new12", GD_MAX_LINE_LENGTH, buf);
+  CHECK_OK2(57,3);
+  CHECK_INT(57,n,1);
+  CHECK_STRING(57,buf,"");
+
+  // 59: Dirfile::AddSpec check
+  d->AddSpec("lorem STRING \"Lorem ipsum\"", 0);
+  CHECK_OK2(59,1);
+
+  n = d->GetString("lorem", GD_MAX_LINE_LENGTH, buf);
+  CHECK_OK2(59,2);
+  CHECK_INT(59,n,12);
+  CHECK_STRING(59,buf,"Lorem ipsum");
+
+  // 60: Dirfile::MAddSpec check
+  d->MAddSpec("ipsum STRING \"dolor sit amet.\"", "lorem");
+  CHECK_OK2(60,1);
+
+  n = d->GetString("lorem/ipsum", GD_MAX_LINE_LENGTH, buf);
+  CHECK_OK2(60,2);
+  CHECK_INT(60,n,16);
+  CHECK_STRING(60,buf,"dolor sit amet.");
+
+  // 61: Dirfile::PutConstant check
+  sc = 61;
+  n = d->PutConstant("const", Int8, &sc);
+  CHECK_OK2(61,1);
+  CHECK_INT2(61,1,n,0);
+
+  n = d->GetConstant("const", Float32, &fl);
+  CHECK_OK2(61,2);
+  CHECK_INT2(61,2,n,0);
+  CHECK_DOUBLE2(61,3,fl,61);
+
+  // 62: Dirfile::PutString check
+  n = d->PutString("string", "Arthur Dent");
+  CHECK_OK2(62,1);
+  CHECK_INT2(62,1,n,12);
+
+  n = d->GetString("string", GD_MAX_LINE_LENGTH, buf);
+  CHECK_OK2(62,2);
+  CHECK_INT2(62,2,n,12);
+  CHECK_STRING(62,buf,"Arthur Dent");
+
+  // 63: Dirfile::NMFieldsByType check
+  n = d->NMFieldsByType("data", LincomEntryType);
+  CHECK_OK(63);
+  CHECK_INT(63,n,1);
+
+  // 64: Dirfile::MFieldListByType check
+  fields[0] = (char*)"mnew1";
+  list = d->MFieldListByType("data", LincomEntryType);
+  CHECK_OK(64);
+  CHECK_STRING_ARRAY(64,n,list[i],fields[i]);
+
+  // 65: Dirfile::NMVectors check
+  n = d->NMVectors("data");
+  CHECK_OK(65);
+  CHECK_INT(65,n,2);
+
+  // 66: Dirfile::MVectorList check
+  fields[0] = (char*)"mlut";
+  fields[1] = (char*)"mnew1";
+  list = d->MVectorList("data");
+  CHECK_OK(66);
+  CHECK_STRING_ARRAY(66,n,list[i],fields[i]);
+
+  // 67: RawEntry check
+  rep = reinterpret_cast<RawEntry*>(d->Entry("new1"));
+  CHECK_OK2(67,1);
+  rep->SetType(Int32,0);
+  CHECK_OK2(67,2);
+  rep->SetSamplesPerFrame(4,0);
+  CHECK_OK2(67,3);
+
+  ent = d->Entry("new1");
+  CHECK_OK2(67,4);
+  CHECK_INT2(67,1,ent->Type(),RawEntryType);
+  CHECK_INT2(67,2,ent->FragmentIndex(),0);
+  CHECK_INT2(67,3,ent->SamplesPerFrame(),4);
+  CHECK_INT2(67,4,ent->RawType(),Int32);
+  delete ent;
+
+  // 68: LincomEntry check
+  lep = reinterpret_cast<LincomEntry*>(d->Entry("new2"));
+  CHECK_OK2(68,1);
+  lep->SetNFields(3);
+  CHECK_OK2(68,2);
+  lep->SetInput("in4",2);
+  CHECK_OK2(68,3);
+  lep->SetScale(1.96,2);
+  CHECK_OK2(68,4);
+  lep->SetOffset(0.22,2);
+  CHECK_OK2(68,5);
+  delete lep;
+
+  q[0] = 9.9;
+  q[1] = 8.8;
+  q[2] = 7.7;
+  q[3] = 6.6;
+  q[4] = 1.96;
+  q[5] = 0.22;
+  ent = d->Entry("new2");
+  CHECK_OK2(68,6);
+  CHECK_INT2(68,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(68,2,ent->NFields(),3);
+  CHECK_INT2(68,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(68,4,ent->Input(0),"in1");
+  CHECK_STRING2(68,5,ent->Input(1),"in2");
+  CHECK_STRING2(68,6,ent->Input(2),"in4");
+  CHECK_INT2(68,7,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(68,8,3,ent->Scale(i),q[i * 2]);
+  CHECK_DOUBLE_ARRAY(68,9,3,ent->Offset(i),q[i * 2 + 1]);
+  delete ent;
+
+  // 70: PolynomEntry check
+  yep = reinterpret_cast<PolynomEntry*>(d->Entry("new4"));
+  CHECK_OK2(70,1);
+  yep->SetInput("in4");
+  CHECK_OK2(70,2);
+  yep->SetPolyOrd(4);
+  CHECK_OK2(70,3);
+  yep->SetCoefficient(55.5,4);
+  CHECK_OK2(70,4);
+  delete yep;
+
+  q[0] = 3.9;
+  q[1] = 4.8;
+  q[2] = 5.7;
+  q[3] = 6.6;
+  q[4] = 55.5;
+  ent = d->Entry("new4");
+  CHECK_OK2(70,5);
+  CHECK_INT2(70,1,ent->Type(),PolynomEntryType);
+  CHECK_INT2(70,2,ent->PolyOrd(),4);
+  CHECK_INT2(70,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(70,4,ent->Input(),"in4");
+  CHECK_INT2(70,5,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(70,6,5,ent->Coefficient(i),q[i]);
+  delete ent;
+
+  // 72: LinterpEntry check
+  nep = reinterpret_cast<LinterpEntry*>(d->Entry("new6"));
+  CHECK_OK2(72,1);
+  nep->SetInput("in3");
+  CHECK_OK2(72,2);
+  nep->SetTable("./other/table");
+  CHECK_OK2(72,3);
+  delete nep;
+
+  ent = d->Entry("new6");
+  CHECK_OK2(72,2);
+  CHECK_INT2(72,1,ent->Type(),LinterpEntryType);
+  CHECK_INT2(72,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(72,3,ent->Input(),"in3");
+  CHECK_STRING2(72,4,ent->Table(),"./other/table");
+  delete ent;
+
+  // 73: BitEntry check
+  bep = reinterpret_cast<BitEntry*>(d->Entry("new7"));
+  CHECK_OK2(73,1);
+  bep->SetInput("in3");
+  CHECK_OK2(73,2);
+  bep->SetFirstBit(3);
+  CHECK_OK2(73,3);
+  bep->SetNumBits(2);
+  CHECK_OK2(73,4);
+  delete bep;
+
+  ent = d->Entry("new7");
+  CHECK_OK(73);
+  CHECK_INT2(73,1,ent->Type(),BitEntryType);
+  CHECK_INT2(73,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(73,3,ent->Input(),"in3");
+  CHECK_INT2(73,4,ent->NumBits(),2);
+  CHECK_INT2(73,5,ent->FirstBit(),3);
+  delete ent;
+
+  // 74: SBitEntry check
+  sep = reinterpret_cast<SBitEntry*>(d->Entry("new8"));
+  CHECK_OK2(74,1);
+  sep->SetInput("in4");
+  CHECK_OK2(74,2);
+  sep->SetFirstBit(1);
+  CHECK_OK2(74,3);
+  sep->SetNumBits(22);
+  CHECK_OK2(74,4);
+  delete sep;
+
+  ent = d->Entry("new8");
+  CHECK_OK(74);
+  CHECK_INT2(74,1,ent->Type(),SBitEntryType);
+  CHECK_INT2(74,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(74,3,ent->Input(),"in4");
+  CHECK_INT2(74,4,ent->NumBits(),22);
+  CHECK_INT2(74,5,ent->FirstBit(),1);
+  delete ent;
+
+  // 75: MultiplyEntry check
+  mep = reinterpret_cast<MultiplyEntry*>(d->Entry("new9"));
+  CHECK_OK2(75,1);
+  mep->SetInput("in4",0);
+  CHECK_OK2(75,2);
+  mep->SetInput("in5",1);
+  CHECK_OK2(75,3);
+  delete mep;
+
+  ent = d->Entry("new9");
+  CHECK_OK2(75,2);
+  CHECK_INT2(75,1,ent->Type(),MultiplyEntryType);
+  CHECK_INT2(75,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(75,3,ent->Input(0),"in4");
+  CHECK_STRING2(75,4,ent->Input(1),"in5");
+  delete ent;
+
+  // 76: PhsaeEntry check
+  pep = reinterpret_cast<PhaseEntry*>(d->Entry("new10"));
+  CHECK_OK2(76,1);
+  pep->SetInput("in2");
+  CHECK_OK2(76,2);
+  pep->SetShift(8);
+  CHECK_OK2(76,3);
+  delete pep;
+
+  ent = d->Entry("new10");
+  CHECK_OK(76);
+  CHECK_INT2(76,1,ent->Type(),PhaseEntryType);
+  CHECK_INT2(76,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(76,3,ent->Input(),"in2");
+  CHECK_INT2(76,4,ent->Shift(),8);
+  delete ent;
+
+  // 77: ConstEntry check
+  cep = reinterpret_cast<ConstEntry*>(d->Entry("new11"));
+  CHECK_OK2(77,1);
+  cep->SetType(Float32);
+  CHECK_OK2(77,2);
+  delete cep;
+
+  ent = d->Entry("new11");
+  CHECK_OK2(77,2);
+  CHECK_INT2(77,1,ent->Type(),ConstEntryType);
+  CHECK_INT2(77,2,ent->FragmentIndex(),0);
+  CHECK_INT2(77,3,ent->ConstType(),Float32);
+  delete ent;
+
+  // 78: Fragment::Encoding check
+  frag = d->Fragment(0);
+  CHECK_OK(78);
+  CHECK_INT(78,frag->Encoding(),RawEncoding);
+
+  // 79: Fragment::Endianness check
+  CHECK_INT(79,frag->Endianness(),GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
+  delete frag;
+
+  // 80: Dirfile::Name check
+  str = d->Name();
+  CHECK_OK(80);
+  CHECK_EOSTRING(80,str,"dirfile");
+
+  // 81: Fragment::Parent check
+  frag = d->Fragment(1);
+  CHECK_OK(81);
+  CHECK_INT(81,frag->Parent(),0);
+
+  // 82: Fragment::SetProtection check
+  frag->SetProtection(GD_PROTECT_DATA);
+  CHECK_OK(82);
+  delete frag;
+
+  // 83: Fragment::Protection check
+  frag = d->Fragment(1);
+  CHECK_OK(83);
+  CHECK_INT(83,frag->Protection(),GD_PROTECT_DATA);
+
+  // 84: RawEntry::FileName check
+  str = rep->FileName();
+  CHECK_OK(84);
+  sprintf(buf, "dirfile%cnew1", GD_DIRSEP);
+  CHECK_EOSTRING(84,str, buf);
+  delete rep;
+
+  // 85: Dirfile::Reference check
+  rep = d->Reference("new1");
+  CHECK_OK(85);
+  CHECK_STRING(85,rep->Name(),"new1");
+  delete rep;
+
+  // 135: Dirfile::ReferenceFilename check
+  str = d->ReferenceFilename();
+  CHECK_OK(135);
+  CHECK_EOSTRING(135,str, buf);
+  
+  // 87: Fragment::SetEncoding check
+  frag->SetEncoding(SlimEncoding,0);
+  CHECK_OK(87);
+  CHECK_INT(87,frag->Encoding(),SlimEncoding);
+
+  // 88: Fragment::SetEndianness check
+  frag->SetEndianness(GD_BIG_ENDIAN,0);
+  CHECK_OK(88);
+  CHECK_INT(88,frag->Endianness(),GD_BIG_ENDIAN);
+  delete frag;
+
+  // 89: Dirfile::AlterSpec check
+  d->AlterSpec("new10 PHASE in1 3");
+  CHECK_OK2(89,1);
+
+  ent = d->Entry("new10");
+  CHECK_OK2(89,2);
+  CHECK_INT2(89,1,ent->Type(),PhaseEntryType);
+  CHECK_INT2(89,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(89,3,ent->Input(),"in1");
+  CHECK_INT2(89,4,ent->Shift(),3);
+  delete ent;
+
+  //  90: Dirfile::Delete check
+  d->Delete("new10", 0);
+  CHECK_OK2(90,1);
+
+  ent = d->Entry("new10");
+  CHECK_ERROR2(90,2,GD_E_BAD_CODE);
+  delete ent;
+
+  // 91: Dirfile::MAlterSpec check
+  d->MAlterSpec("mnew1 LINCOM 2 in4 1 2 in5 3 4", "data", 0);
+  CHECK_OK2(91,1);
+
+  ent = d->Entry("data/mnew1");
+  CHECK_OK2(91,2);
+  CHECK_INT2(91,1,ent->Type(),LincomEntryType);
+  CHECK_INT2(91,2,ent->NFields(),2);
+  CHECK_INT2(91,3,ent->FragmentIndex(),0);
+  CHECK_STRING2(91,4,ent->Input(0),"in4");
+  CHECK_STRING2(91,5,ent->Input(1),"in5");
+  CHECK_INT2(91,6,ent->ComplexScalars(),0);
+  CHECK_DOUBLE_ARRAY(91,7,2,ent->Scale(i),i * 2 + 1);
+  CHECK_DOUBLE_ARRAY(91,8,2,ent->Offset(i),i * 2 + 2);
+  delete ent;
+
+  // 92: Entry::Move check
+  ent = d->Entry("new9");
+  CHECK_OK2(92,1);
+  ent->Move(1,0);
+  CHECK_OK2(92,2);
+  CHECK_INT(92,ent->FragmentIndex(),1);
+
+  // 93: Entry::Rename check
+  ent->Rename("newer",0);
+  CHECK_OK2(93,1);
+  delete ent;
+
+  ent = d->Entry("new9");
+  CHECK_ERROR2(93,2,GD_E_BAD_CODE);
+  delete ent;
+
+  ent = d->Entry("newer");
+  CHECK_OK2(93,3);
+  CHECK_INT2(93,1,ent->Type(),MultiplyEntryType);
+  CHECK_INT2(93,2,ent->FragmentIndex(),1);
+  CHECK_STRING2(93,3,ent->Input(0),"in4");
+  CHECK_STRING2(93,4,ent->Input(1),"in5");
+  delete ent;
+
+  // 94: Dirfile::UnInclude check
+  d->UnInclude(1,0);
+  CHECK_OK2(94,1);
+
+  ent = d->Entry("newer");
+  CHECK_ERROR2(94,2,GD_E_BAD_CODE);
+  delete ent;
+
+  // 95: Fragment::FrameOffset check
+  frag = d->Fragment(0);
+  CHECK_OK(95);
+  CHECK_INT(95,frag->FrameOffset(),0);
+
+  // 96: Fragment::SetFrameOffset check
+  frag->SetFrameOffset(33,0);
+  CHECK_OK(96);
+  CHECK_INT(96,frag->FrameOffset(),33);
+
+  // 97: Dirfile::NativeType check
+  n = d->NativeType("data");
+  CHECK_OK(97);
+  CHECK_INT(97,n,Int8);
+
+  // 99: Dirfile::Validate check
+  n = d->Validate("new7");
+  CHECK_ERROR(99,GD_E_BAD_CODE);
+  CHECK_INT(99,n,-1);
+
+  // 101: Dirfile::FrameNum check
+  delete d->Reference("data");
+  dp = d->FrameNum("data", 33.3, 6);
+  CHECK_OK(101);
+  CHECK_DOUBLE(101,dp,37.0375);
+
+  // 86: Dirfile::EoF check
+  n = d->EoF("lincom");
+  CHECK_OK(86);
+  CHECK_INT(86,n,344);
+  
+  // 142: Dirfile::BoF check
+  n = d->BoF("lincom");
+  CHECK_OK(142);
+  CHECK_INT(142,n,264);
+  
+  // 143: Dirfile::Entry / DivideEntry check
+  ent = d->Entry("div");
+  CHECK_OK(143);
+  CHECK_INT2(143,1,ent->Type(),DivideEntryType);
+  CHECK_INT2(143,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(143,3,ent->Input(0),"mult");
+  CHECK_STRING2(143,4,ent->Input(1),"bit");
+  delete ent;
+  
+  // 145: Dirfile::Entry / RecipEntry check
+  ent = d->Entry("recip");
+  CHECK_OK(145);
+  CHECK_INT2(145,1,ent->Type(),RecipEntryType);
+  CHECK_INT2(145,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(145,3,ent->Input(0),"div");
+  CHECK_INT2(145,4,ent->ComplexScalars(),1);
+  CHECK_COMPLEX2(145,5,ent->CDividend(),complex<double>(6.5,4.3));
+  delete ent;
+
+  // 146: Dirfile::Add / DivideEntry check
+  dent.SetName("new14");
+  dent.SetFragmentIndex(0);
+  dent.SetInput("in1", 0);
+  dent.SetInput("in2", 1);
+  d->Add(dent);
+  CHECK_OK2(146,1);
+
+  ent = d->Entry("new14");
+  CHECK_OK2(146,2);
+  CHECK_INT2(146,1,ent->Type(),DivideEntryType);
+  CHECK_INT2(146,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(146,3,ent->Input(0),"in1");
+  CHECK_STRING2(146,4,ent->Input(1),"in2");
+  delete ent;
+
+  // 147: Dirfile::Add / RecipEntry check
+  oent.SetName("new15");
+  oent.SetFragmentIndex(0);
+  oent.SetInput("in3");
+  oent.SetDividend(31.9);
+  d->Add(oent);
+
+  ent = d->Entry("new15");
+  CHECK_OK2(147,1);
+  CHECK_INT2(147,1,ent->Type(),RecipEntryType);
+  CHECK_INT2(147,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(147,3,ent->Input(0),"in3");
+  CHECK_INT2(147,4,ent->ComplexScalars(),0);
+  CHECK_DOUBLE2(147,5,ent->Dividend(),31.9);
+  delete ent;
+
+  // 148: Dirfile::Add / RecipEntry check
+  oent.Dissociate();
+  oent.SetName("new16");
+  oent.SetFragmentIndex(0);
+  oent.SetInput("in2");
+  oent.SetDividend(complex<double>(33.3,44.4));
+  d->Add(oent);
+
+  ent = d->Entry("new16");
+  CHECK_OK2(148,1);
+  CHECK_INT2(148,1,ent->Type(),RecipEntryType);
+  CHECK_INT2(148,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(148,3,ent->Input(0),"in2");
+  CHECK_INT2(148,4,ent->ComplexScalars(),1);
+  CHECK_COMPLEX2(148,5,ent->CDividend(),complex<double>(33.3,44.4));
+  delete ent;
+
+  // 152: DivideEntry check
+  dep = reinterpret_cast<DivideEntry*>(d->Entry("new14"));
+  CHECK_OK2(152,1);
+  dep->SetInput("in4",0);
+  CHECK_OK2(152,2);
+  dep->SetInput("in5",1);
+  CHECK_OK2(152,3);
+  delete dep;
+
+  ent = d->Entry("new14");
+  CHECK_OK2(152,2);
+  CHECK_INT2(152,1,ent->Type(),DivideEntryType);
+  CHECK_INT2(152,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(152,3,ent->Input(0),"in4");
+  CHECK_STRING2(152,4,ent->Input(1),"in5");
+  delete ent;
+
+  // 153: RecipEntry check
+  oep = reinterpret_cast<RecipEntry*>(d->Entry("new15"));
+  CHECK_OK2(153,1);
+  oep->SetInput("in1");
+  CHECK_OK2(153,2);
+  oep->SetDividend(complex<double>(1.01,9.33));
+  CHECK_OK2(153,3);
+  delete oep;
+
+  ent = d->Entry("new15");
+  CHECK_INT2(148,1,ent->Type(),RecipEntryType);
+  CHECK_INT2(148,2,ent->FragmentIndex(),0);
+  CHECK_STRING2(148,3,ent->Input(0),"in1");
+  CHECK_INT2(148,4,ent->ComplexScalars(),1);
+  CHECK_COMPLEX2(148,5,ent->CDividend(),complex<double>(1.01,9.33));
+  delete ent;
+
+  // 155: Fragment::ReWrite check
+  frag->ReWrite();
+  CHECK_OK(155);
+  delete frag;
+  
+  // 156: Invalid Dirfile check
+  Dirfile *id = new Dirfile();
+  CheckError(id,156,1,GD_E_OK);
+  id->NFragments();
+  CheckError(id,156,2,GD_E_BAD_DIRFILE);
+  delete id;
+
+  // 157: Dirfile::Standards check
+  n = d->Standards();
+  CHECK_OK2(157,1);
+  CHECK_INT(157,n,9);
+  d->Standards(0);
+  CHECK_ERROR2(157,2,GD_E_ARGUMENT);
+
+  // 158 gd_get_carray
+  n = d->GetCarray("carray", Float64, p);
+  CHECK_OK(158);
+  CHECK_INT(158,n,0);
+  CHECK_DOUBLE_ARRAY(158,1,6,p[i],1.1 * (i + 1));
+
+  // 159 gd_get_carray_slice (INT8)
+  n = d->GetCarray("carray", Float64, p, 2, 2);
+  CHECK_OK(159);
+  CHECK_INT(159,n,0);
+  CHECK_DOUBLE_ARRAY(159,1,2,p[i],1.1 * (i + 3));
+
+  // 167 gd_carrays
+  carrays = d->Carrays(Float64);
+  CHECK_OK(167);
+  CHECK_NONNULL(167,carrays);
+  CHECK_INT2(167,1,carrays[0].n,6);
+  CHECK_DOUBLE_ARRAY(167,2,6,((double*)carrays[0].d)[i],1.1 * (i + 1));
+  CHECK_INT2(167,2,carrays[1].n,0);
+
+  // 168 gd_put_carray
+  p[0] = 9.6;
+  p[1] = 8.5;
+  p[2] = 7.4;
+  p[3] = 6.3;
+  p[4] = 5.2;
+  p[5] = 4.1;
+  n = d->PutCarray("carray", Float64, p);
+  CHECK_OK2(168, 1);
+
+  n = d->GetCarray("carray", Float64, q);
+  CHECK_OK2(168,2);
+  CHECK_INT(168,n,0);
+  CHECK_DOUBLE_ARRAY(168,1,6,q[i],9.6 - i * 1.1);
+
+  // 169 gd_put_carray_slice (INT8)
+  p[0] = 2.2;
+  p[1] = 3.3;
+  n = d->PutCarray("carray", Float64, p, 2, 2);
+  CHECK_OK2(168, 1);
+
+  n = d->GetCarray("carray", Float64, q);
+  CHECK_OK2(168,2);
+  CHECK_INT(168,n,0);
+  CHECK_DOUBLE_ARRAY(168,1,6,q[i],(i == 2 || i == 3) ? i * 1.1 : 9.6 - i * 1.1);
+
+  // 177 gd_carray_len
+  n = (int)d->CarrayLen("carray");
+  CHECK_OK(177);
+  CHECK_INT(177,n,6);
+
+  // 178 gd_entry (CARRAY)
+  ent = d->Entry("const");
+  CHECK_OK(178);
+  CHECK_INT2(178,1,ent->Type(),ConstEntryType);
+  CHECK_INT2(178,2,ent->FragmentIndex(),0);
+  CHECK_INT2(178,3,ent->ConstType(),Float64);
+  delete ent;
+
+  // 179 gd_add_carray
+  aent.SetName("new17");
+  aent.SetFragmentIndex(0);
+  aent.SetType(Float64);
+  aent.SetArrayLen(4);
+  d->Add(aent);
+  CHECK_OK2(179,1);
+
+  ent = d->Entry("new17");
+  CHECK_OK2(179,2);
+  CHECK_INT2(179,1,ent->Type(),CarrayEntryType);
+  CHECK_INT2(179,2,ent->FragmentIndex(),0);
+  CHECK_INT2(179,3,ent->ConstType(),Float64);
+  CHECK_INT2(179,4,ent->ArrayLen(),4);
+  delete ent;
+
+  // 180: gd_madd_carray
+  aent.Dissociate();
+  aent.SetName("mnew17");
+  aent.SetFragmentIndex(0);
+  aent.SetType(Float64);
+  aent.SetArrayLen(2);
+  d->MAdd(aent, "data");
+  CHECK_OK2(180,1);
+
+  ent = d->Entry("data/mnew17");
+  CHECK_OK2(180,2);
+  CHECK_INT2(180,1,ent->Type(),CarrayEntryType);
+  CHECK_INT2(180,2,ent->FragmentIndex(),0);
+  CHECK_INT2(180,3,ent->ConstType(),Float64);
+  CHECK_INT2(180,4,ent->ArrayLen(),2);
+  delete ent;
+
+  // 181 gd_alter_carray
+  aep = reinterpret_cast<CarrayEntry*>(d->Entry("new17"));
+  CHECK_OK2(181,1);
+  aep->SetType(Float32);
+  CHECK_OK2(181,2);
+  aep->SetArrayLen(12);
+  CHECK_OK2(181,3);
+  delete aep;
+
+  ent = d->Entry("new17");
+  CHECK_OK2(181,2);
+  CHECK_INT2(181,1,ent->Type(),CarrayEntryType);
+  CHECK_INT2(181,2,ent->FragmentIndex(),0);
+  CHECK_INT2(181,3,ent->ConstType(),Float32);
+  CHECK_INT2(181,4,ent->ArrayLen(),12);
+  delete ent;
+
+  // 183: gd_constants
+  p[0] = 61.;
+  p[1] = 0.;
+  n = d->NFieldsByType(ConstEntryType);
+  qp = reinterpret_cast<const double *>(d->Constants());
+  CHECK_OK(183);
+  CHECK_DOUBLE_ARRAY(183,0,n,qp[i],p[i]);
+
+  // 184: gd_mconstants
+  p[0] = 3.3;
+  p[1] = 0.;
+  n = d->NMFieldsByType("data", ConstEntryType);
+  qp = reinterpret_cast<const double *>(d->MConstants("data"));
+  CHECK_OK(184);
+  CHECK_DOUBLE_ARRAY(184,0,n,qp[i],p[i]);
+
+  // 199: gd_strings
+  strings[0] = (char *)"Lorem ipsum";
+  strings[1] = (char *)"";
+  strings[2] = (char *)"Arthur Dent";
+  n = d->NFieldsByType(StringEntryType);
+  list = d->Strings();
+  CHECK_OK(199);
+  CHECK_STRING_ARRAY(199,n,list[i],strings[i]);
+
+  // 200: gd_strings
+  strings[0] = (char *)"This is a string constant.";
+  n = d->NMFieldsByType("data", StringEntryType);
+  list = d->MStrings("data");
+  CHECK_OK(200);
+  CHECK_STRING_ARRAY(200,n,list[i],strings[i]);
+
+  // 203: gd_seek
+  n = d->Seek("data", 35, 0, GD_SEEK_SET);
+  CHECK_OK2(203,0);
+  m = d->GetData("data", GD_HERE, 0, 1, 0, UInt8, c);
+  CHECK_OK2(203,1);
+  CHECK_INT2(203,0,n,280);
+  CHECK_INT2(203,1,m,8);
+  CHECK_INT_ARRAY(203,8,c[i],17 + i);
+
+  // 204: gd_tell
+  n = d->Tell("data");
+  CHECK_OK(204);
+  CHECK_INT(204,n,288);
+
+  // 205: gd_hide check
+  n = d->Hide("data");
+  CHECK_OK(205);
+
+  // 206: gd_hidden check
+  n = d->Hidden("data");
+  CHECK_OK2(206, 1);
+  CHECK_INT2(206, 1, n, 1);
+
+  n = d->Hidden("lincom");
+  CHECK_OK2(206, 2);
+  CHECK_INT2(206, 2, n, 0);
+
+  // 207: gd_unhide check
+  n = d->UnHide("data");
+  CHECK_OK2(206, 1);
+  n = d->Hidden("data");
+  CHECK_OK2(206, 2);
+  CHECK_INT2(206, 2, n, 0);
+
+  // 208: gd_sync check
+  d->Sync("data");
+  CHECK_OK(208);
+
+  // 209: gd_flush check
+  d->Flush("data");
+  CHECK_OK(209);
+
+  // 210: gd_metaflush check
+  d->MetaFlush();
+  CHECK_OK(210);
+
+  // 211: gd_entry (WINDOW) check
+  ent = d->Entry("window");
+  CHECK_OK(211);
+  CHECK_INT2(211, 1, ent->Type(), WindowEntryType);
+  CHECK_INT2(211, 2, ent->FragmentIndex(), 0);
+  CHECK_INT2(211, 3, ent->WindOp(), WindOpLt);
+  CHECK_STRING2(211, 4, ent->Input(0), "linterp");
+  CHECK_STRING2(211, 5, ent->Input(1), "mult");
+  CHECK_DOUBLE2(211, 6, ent->Threshold().r, 4.1);
+  delete ent;
+
+  // 212: Dirfile::Add / WindowEntry check
+  went.SetName("new18");
+  went.SetFragmentIndex(0);
+  went.SetInput("in1", 0);
+  went.SetInput("in2", 1);
+  went.SetWindOp(WindOpNe);
+  thresh.i = 32;
+  went.SetThreshold(thresh);
+  d->Add(went);
+  CHECK_OK2(212, 1);
+
+  ent = d->Entry("new18");
+  CHECK_OK2(212, 2);
+  CHECK_INT2(212, 1, ent->Type(), WindowEntryType);
+  CHECK_INT2(212, 2, ent->FragmentIndex(), 0);
+  CHECK_INT2(212, 3, ent->WindOp(), WindOpNe);
+  CHECK_STRING2(212, 4, ent->Input(0), "in1");
+  CHECK_STRING2(212, 5, ent->Input(1), "in2");
+  CHECK_INT2(212, 6, ent->Threshold().i, 32);
+  delete ent;
+
+  // 214: gd_madd_window_i check
+  went.Dissociate();
+  went.SetName("mnew18");
+  went.SetInput("in2", 0);
+  went.SetInput("in3", 1);
+  went.SetWindOp(WindOpSet);
+  thresh.u = 128;
+  went.SetThreshold(thresh);
+  d->MAdd(went, "data");
+  CHECK_OK2(214, 1);
+
+  ent = d->Entry("data/mnew18");
+  CHECK_OK2(214, 2);
+  CHECK_INT2(214, 1, ent->Type(), WindowEntryType);
+  CHECK_INT2(214, 2, ent->FragmentIndex(), 0);
+  CHECK_INT2(214, 3, ent->WindOp(), WindOpSet);
+  CHECK_STRING2(214, 4, ent->Input(0), "in2");
+  CHECK_STRING2(214, 5, ent->Input(1), "in3");
+  CHECK_INT2(214, 6, ent->Threshold().u, 128);
+  delete ent;
+
+  // 217: gd_alter_window_r check
+  wep = reinterpret_cast<WindowEntry*>(d->Entry("new18"));
+  wep->SetInput("in3", 0);
+  wep->SetInput("in4", 1);
+  wep->SetWindOp(WindOpGe);
+  thresh.r = 32e3;
+  wep->SetThreshold(thresh);
+  CHECK_OK2(217, 1);
+  delete wep;
+
+  ent = d->Entry("new18");
+  CHECK_OK2(217, 2);
+  CHECK_INT2(217, 1, ent->Type(), WindowEntryType);
+  CHECK_INT2(217, 2, ent->FragmentIndex(), 0);
+  CHECK_INT2(217, 3, ent->WindOp(), WindOpGe);
+  CHECK_STRING2(217, 4, ent->Input(0), "in3");
+  CHECK_STRING2(217, 5, ent->Input(1), "in4");
+  CHECK_DOUBLE2(217, 6, ent->Threshold().r, 32e3);
+  delete ent;
+
+  // 218: gd_alias_target check
+  str = d->AliasTarget("alias");
+  CHECK_OK(218);
+  CHECK_STRING(218, str, "data");
+
+  // 219: gd_add_alias check
+  d->AddAlias("new20", "data", 0);
+  CHECK_OK2(219, 1);
+
+  str = d->AliasTarget("new20");
+  CHECK_OK2(219, 2);
+  CHECK_STRING(219, str, "data");
+
+  // 220: gd_madd_alias check
+  d->MAddAlias("data", "mnew20", "data");
+  CHECK_OK2(220, 1);
+
+  str = d->AliasTarget("data/mnew20");
+  CHECK_OK2(220, 2);
+  CHECK_STRING(220, str, "data");
+
+  // 221: gd_naliases check
+  n = d->NAliases("data");
+  CHECK_OK(221);
+  CHECK_INT(221, n, 4);
+
+  // 222: gd_aliases check
+  fields[1] = (char*)"data";
+  fields[2] = (char*)"alias";
+  fields[3] = (char*)"data/mnew20";
+  fields[4] = (char*)"new20";
+  list = d->Aliases("data");
+  CHECK_OK(222);
+  CHECK_STRING_ARRAY(222,i,list[i],fields[i]);
+
+  // 223: gd_include_affix check
+  d->IncludeAffix("format1", 0, "A", "Z", GD_CREAT | GD_EXCL);
+  CHECK_OK(223);
+
+  // 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);
+
+  CHECK_STRING2(226, 1, frag->Prefix(), "A");
+  CHECK_STRING2(226, 2, frag->Suffix(), "Z");
+
+  // 227: gd_alter_affixes check
+  frag->SetPrefix("B");
+  CHECK_OK2(227, 1);
+  frag->SetSuffix("C");
+  CHECK_OK2(227, 2);
+
+  CHECK_STRING2(227, 3, frag->Prefix(), "B");
+  CHECK_STRING2(227, 3, frag->Suffix(), "C");
+  delete frag;
+
+  // 228: gd_entry (MPLEX) check
+  ent = d->Entry("mplex");
+  CHECK_OK(228);
+  CHECK_INT2(228, 1, ent->Type(), MplexEntryType);
+  CHECK_INT2(228, 2, ent->FragmentIndex(), 0);
+  CHECK_INT2(228, 3, ent->CountVal(), 1);
+  CHECK_STRING2(228, 4, ent->Input(0), "data");
+  CHECK_STRING2(228, 5, ent->Input(1), "sbit");
+  CHECK_INT2(228, 6, ent->Period(), 10);
+  delete ent;
+
+  // 229: Dirfile::Add / MplexEntry check
+  xent.SetName("new21");
+  xent.SetFragmentIndex(0);
+  xent.SetInput("in1", 0);
+  xent.SetInput("in2", 1);
+  xent.SetCountVal(5);
+  xent.SetPeriod(6);
+  d->Add(xent);
+  CHECK_OK2(229, 1);
+
+  ent = d->Entry("new21");
+  CHECK_OK2(229, 2);
+  CHECK_INT2(229, 1, ent->Type(), MplexEntryType);
+  CHECK_INT2(229, 2, ent->FragmentIndex(), 0);
+  CHECK_INT2(229, 3, ent->CountVal(), 5);
+  CHECK_STRING2(229, 4, ent->Input(0), "in1");
+  CHECK_STRING2(229, 5, ent->Input(1), "in2");
+  CHECK_INT2(229, 6, ent->Period(), 6);
+  delete ent;
+
+  // 230: gd_madd_mplex check
+  xent.Dissociate();
+  xent.SetName("mnew21");
+  xent.SetInput("in2", 0);
+  xent.SetInput("in3", 1);
+  xent.SetCountVal(0);
+  xent.SetPeriod(12);
+  d->MAdd(xent, "data");
+  CHECK_OK2(230, 1);
+
+  ent = d->Entry("data/mnew21");
+  CHECK_OK2(230, 2);
+  CHECK_INT2(230, 1, ent->Type(), MplexEntryType);
+  CHECK_INT2(230, 2, ent->FragmentIndex(), 0);
+  CHECK_INT2(230, 3, ent->CountVal(), 0);
+  CHECK_STRING2(230, 4, ent->Input(0), "in2");
+  CHECK_STRING2(230, 5, ent->Input(1), "in3");
+  CHECK_INT2(230, 6, ent->Period(), 12);
+  delete ent;
+
+  // 231: gd_alter_mplex check
+  xep = reinterpret_cast<MplexEntry*>(d->Entry("new21"));
+  xep->SetInput("in3", 0);
+  xep->SetInput("in4", 1);
+  xep->SetCountVal(3);
+  xep->SetPeriod(7);
+  CHECK_OK2(231, 1);
+  delete xep;
+
+  ent = d->Entry("new21");
+  CHECK_OK2(231, 2);
+  CHECK_INT2(231, 1, ent->Type(), MplexEntryType);
+  CHECK_INT2(231, 2, ent->FragmentIndex(), 0);
+  CHECK_INT2(231, 3, ent->CountVal(), 3);
+  CHECK_STRING2(231, 4, ent->Input(0), "in3");
+  CHECK_STRING2(231, 5, ent->Input(1), "in4");
+  CHECK_INT2(231, 6, ent->Period(), 7);
+  delete ent;
+
+  // 232: gd_tokenise
+  tok = d->StrTok("\"test1 test2\" test3\\ test4");
+  CHECK_OK2(232, 1);
+  CHECK_STRING2(232, 2, tok, "test1 test2");
+  free(tok);
+
+  tok = d->StrTok();
+  CHECK_OK2(232, 3);
+  CHECK_STRING2(232, 4, tok, "test3 test4");
+  free(tok);
+
+  // 233: gd_raw_close check
+  d->RawClose("data");
+  CHECK_OK(233);
+
+  // 234: gd_desync check
+  n = d->DeSync();
+  CHECK_OK(234);
+  CHECK_INT(234, n, 0);
+
+  // 235: gd_flags check
+  n = d->Flags(GD_PRETTY_PRINT, 0);
+  CHECK_OK(235);
+  CHECK_INT(235, n, GD_PRETTY_PRINT);
+
+  // 236: gd_verbose_prefix
+  d->VerbosePrefix("big_test: ");
+  CHECK_OK(236);
+
+  // 237: gd_nentries
+  n = d->NEntries("data", GD_SCALAR_ENTRIES,
+      GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS);
+  CHECK_OK2(237, 1);
+  CHECK_INT2(237, 1, n, 4);
+  n = d->NEntries(NULL, GD_VECTOR_ENTRIES,
+      GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS);
+  CHECK_OK2(237, 2);
+  CHECK_INT2(237, 2, n, 26);
+
+  // 239: gd_entry_list
+  fields[0] = (char*)"INDEX";
+  fields[1] = (char*)"bit";
+  fields[2] = (char*)"data";
+  fields[3] = (char*)"div";
+  fields[4] = (char*)"lincom";
+  fields[5] = (char*)"linterp";
+  fields[6] = (char*)"mplex";
+  fields[7] = (char*)"mult";
+  fields[8] = (char*)"new1";
+  fields[9] = (char*)"new14";
+  fields[10] = (char*)"new15";
+  fields[11] = (char*)"new16";
+  fields[12] = (char*)"new18";
+  fields[13] = (char*)"new2";
+  fields[14] = (char*)"new21";
+  fields[15] = (char*)"new3";
+  fields[16] = (char*)"new4";
+  fields[17] = (char*)"new5";
+  fields[18] = (char*)"new6";
+  fields[19] = (char*)"new7";
+  fields[20] = (char*)"new8";
+  fields[21] = (char*)"phase";
+  fields[22] = (char*)"polynom";
+  fields[23] = (char*)"recip";
+  fields[24] = (char*)"sbit";
+  fields[25] = (char*)"window";
+  list = d->EntryList(NULL, GD_VECTOR_ENTRIES,
+      GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS);
+  CHECK_OK(239);
+  CHECK_STRING_ARRAY(239,n,list[i],fields[i]);
+
+  // 240: gd_mplex_lookback
+  d->MplexLookback(GD_LOOKBACK_ALL);
+  CHECK_OK(240);
+
+  // 241: gd_linterp_tablename check
+  tok = d->LinterpTableName("linterp");
+  CHECK_OK(241);
+  sprintf(buf, "dirfile%clut", GD_DIRSEP);
+  CHECK_EOSTRING(241,tok,buf);
+  free(tok);
+
+  // 242: gd_carrays
+  carrays = d->MCarrays("data", Float64);
+  CHECK_OK(242);
+  CHECK_NONNULL(242,carrays);
+  CHECK_INT2(242,1,carrays[0].n,5);
+  CHECK_DOUBLE_ARRAY(242,2,5,((double*)carrays[0].d)[i],(1.9 + i * 0.9));
+  CHECK_INT2(242,3,carrays[1].n,2);
+  CHECK_DOUBLE_ARRAY(242,4,2,((double*)carrays[1].d)[i],0);
+  CHECK_INT2(242,5,carrays[2].n,0);
+
+  // 243: NULL return from gd_reference
+  id = new Dirfile(FILEDIR "/empty", GD_RDWR | GD_CREAT | GD_EXCL);
+  CHECK_OK2(243, 1);
+
+  rep = id->Reference();
+  CHECK_OK2(243, 2);
+  CHECK_NULL(243, rep);
+
+  id->Discard();
+
+
+
+
+
+
+
+  // ===================================================================
+  d->Discard();
+  delete d;
+  unlink(FILEDIR "/empty/format");
+  rmdir(FILEDIR "/empty");
+  unlink(data);
+  unlink(new1);
+  unlink(format);
+  unlink(format1);
+  unlink(form2);
+  rmdir(filedir);
+
+  if (ne) {
+    cerr << "ne = " << ne << endl;
+    return 1;
+  }
+
+  return 0;
+}
diff --git a/bindings/cxx/windowentry.cpp b/bindings/cxx/windowentry.cpp
new file mode 100644
index 0000000..3c0a020
--- /dev/null
+++ b/bindings/cxx/windowentry.cpp
@@ -0,0 +1,126 @@
+// Copyright (C) 2011-2012 D. V. Wiebe
+//
+///////////////////////////////////////////////////////////////////////////
+//
+// This file is part of the GetData project.
+//
+// GetData is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License as published by the
+// Free Software Foundation; either version 2.1 of the License, or (at your
+// option) any later version.
+//
+// GetData is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with GetData; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+#include "internal.h"
+
+WindowEntry::WindowEntry(const char* field_code, const char* in_field,
+    const char* check, WindOpType windop, gd_triplet_t threshold,
+    int fragment_index) : Entry()
+{
+  dtrace("\"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}, %i", field_code,
+      in_field, check, (unsigned)windop, threshold.r,
+      (unsigned long long)threshold.u, (long long)threshold.i, fragment_index);
+
+  E.field = strdup(field_code);
+  E.field_type = GD_WINDOW_ENTRY;
+  E.in_fields[0] = strdup(in_field);
+  E.in_fields[1] = strdup(check);
+  E.scalar[0] = 0;
+  E.u.window.windop = (gd_windop_t)windop;
+  E.u.window.threshold = threshold;
+  E.fragment_index = fragment_index;
+
+  dreturnvoid();
+}
+
+int WindowEntry::SetInput(const char* field, int index)
+{
+  if (index < 0 || index > 1)
+    return -1;
+
+  char* ptr = strdup(field);
+
+  if (ptr == NULL)
+    return -1;
+
+  free(E.in_fields[index]);
+  E.in_fields[index] = ptr;
+
+  if (D != NULL)
+    return gd_alter_entry(D->D, E.field, &E, 0);
+  
+  return 0;
+}
+
+int WindowEntry::SetWindOp(WindOpType windop)
+{
+  int ret = 0;
+
+  dtrace("0x%X", (unsigned)windop);
+
+  E.u.window.windop = (gd_windop_t)windop;
+
+  if (D != NULL)
+    ret = gd_alter_entry(D->D, E.field, &E, 0);
+  
+  dreturn("%i", ret);
+  return ret;
+}
+
+int WindowEntry::SetThreshold(gd_triplet_t threshold)
+{
+  int ret = 0;
+
+  dtrace("{%g,%llX,%lli}", threshold.r, (unsigned long long)threshold.u,
+      (long long)threshold.i);
+
+  E.u.window.threshold = threshold;
+
+  if (D != NULL)
+    ret = gd_alter_entry(D->D, E.field, &E, 0);
+  
+  dreturn("%i", ret);
+  return ret;
+}
+
+int WindowEntry::SetThreshold(const char *threshold)
+{
+  int r = 0;
+
+  dtrace("\"%s\"", threshold);
+
+  SetScalar(0, threshold);
+
+  if (D != NULL) {
+    r = gd_alter_entry(D->D, E.field, &E, 0);
+
+    if (!r) {
+      switch(E.u.window.windop) {
+        case GD_WINDOP_EQ:
+        case GD_WINDOP_NE:
+          r = gd_get_constant(D->D, threshold, GD_INT64,
+              &E.u.window.threshold.i);
+          break;
+        case GD_WINDOP_SET:
+        case GD_WINDOP_CLR:
+          r = gd_get_constant(D->D, threshold, GD_UINT64,
+              &E.u.window.threshold.u);
+          break;
+        default:
+          r = gd_get_constant(D->D, threshold, GD_FLOAT64,
+              &E.u.window.threshold.r);
+          break;
+      }
+    }
+  }
+  
+  dreturn("%i", r);
+  return r;
+}
diff --git a/bindings/f77/Makefile.am b/bindings/f77/Makefile.am
new file mode 100644
index 0000000..fc42d0b
--- /dev/null
+++ b/bindings/f77/Makefile.am
@@ -0,0 +1,114 @@
+# Copyright (C) 2008-2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+
+SED = @SED@
+DIFF = @DIFF@
+
+if FC_WEXTRA
+FC_WEXTRA=-Wextra
+endif
+
+if FC_WALL
+FC_WALL=-Wall
+endif
+
+if CC_WEXTRA
+CC_WEXTRA=-Wextra
+endif
+
+if CC_WALL
+CC_WALL=-Wall
+endif
+
+if MAKE_F95BINDINGS
+F95_INC=getdata.mod
+F95_LIB=libf95getdata.la
+endif
+
+FCFLAGS += $(FC_WALL) $(FC_WEXTRA)
+EXTRA_DIST=getdata.f.in getdata.f90.in
+
+SUBDIRS = test
+
+BUILT_SOURCES=getdata.f $(F95_INC)
+LIBS=
+
+nodist_include_HEADERS=getdata.f $(F95_INC)
+
+lib_LTLIBRARIES=libfgetdata.la $(F95_LIB)
+libfgetdata_la_CPPFLAGS = ${CC_WALL} $(CC_WEXTRA) -I$(top_srcdir)/src
+libfgetdata_la_SOURCES = fgetdata.c fgetdata.h
+libfgetdata_la_LIBADD=../../src/libgetdata.la
+libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@
+
+nodist_libf95getdata_la_SOURCES=getdata.f90
+libf95getdata_la_LIBADD=libfgetdata.la
+libf95getdata_la_LDFLAGS = -version-info @F95GETDATA_VERSION@
+
+getdata.mod: getdata.o
+
+clean-local:
+	rm -rf getdata.mod make_parameters.sed.in make_parameters.stamp \
+		make_parameters.sed getdata.f getdata.f90 getdata.mod
+	rm -rf *~
+
+make_parameters.sed.in: ../make_parameters ../../src/getdata.h
+	../make_parameters f > $@
+
+../make_parameters: ../make_parameters.c
+	cd .. && ${MAKE} make_parameters
+
+make_parameters.sed: make_parameters.stamp
+	@if test ! -f $@; then \
+		rm -f make_parameters.stamp; \
+		$(MAKE) make_parameters.stamp; \
+		fi
+
+if HAVE_DIFF
+
+make_parameters.stamp: make_parameters.sed.in
+	@if $(DIFF) make_parameters.sed make_parameters.sed.in >/dev/null 2>&1; then \
+		echo "make_parameters.sed is unchanged"; \
+		else \
+		rm -f make_parameters.sed; \
+		cp make_parameters.sed.in make_parameters.sed; \
+		fi; \
+		touch make_parameters.stamp
+
+else
+
+make_parameters.stamp: make_parameters.sed.in
+		@rm -f make_parameters.sed; \
+		cp make_parameters.sed.in make_parameters.sed; \
+		touch make_parameters.stamp
+
+endif
+
+getdata.f: $(srcdir)/getdata.f.in make_parameters.sed
+	rm -f $@
+	$(SED) -f make_parameters.sed $(srcdir)/getdata.f.in > $@
+	chmod a-w $@
+
+getdata.f90: $(srcdir)/getdata.f90.in make_parameters.sed
+	rm -f $@
+	$(SED) -f make_parameters.sed $(srcdir)/getdata.f90.in > $@
+	chmod a-w $@
diff --git a/bindings/f77/Makefile.in b/bindings/f77/Makefile.in
new file mode 100644
index 0000000..dcb216b
--- /dev/null
+++ b/bindings/f77/Makefile.in
@@ -0,0 +1,996 @@
+# 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/f77
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libf95getdata_la_DEPENDENCIES = libfgetdata.la
+nodist_libf95getdata_la_OBJECTS = getdata.lo
+libf95getdata_la_OBJECTS = $(nodist_libf95getdata_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libf95getdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=FC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(FCLD) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(libf95getdata_la_LDFLAGS) \
+	$(LDFLAGS) -o $@
+ at MAKE_F95BINDINGS_TRUE@am_libf95getdata_la_rpath = -rpath $(libdir)
+libfgetdata_la_DEPENDENCIES = ../../src/libgetdata.la
+am_libfgetdata_la_OBJECTS = libfgetdata_la-fgetdata.lo
+libfgetdata_la_OBJECTS = $(am_libfgetdata_la_OBJECTS)
+libfgetdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libfgetdata_la_LDFLAGS) $(LDFLAGS) -o \
+	$@
+AM_V_P = $(am__v_P_ 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 = 
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+AM_V_FC = $(am__v_FC_ at AM_V@)
+am__v_FC_ = $(am__v_FC_ at AM_DEFAULT_V@)
+am__v_FC_0 = @echo "  FC      " $@;
+am__v_FC_1 = 
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_FCLD = $(am__v_FCLD_ at AM_V@)
+am__v_FCLD_ = $(am__v_FCLD_ at AM_DEFAULT_V@)
+am__v_FCLD_0 = @echo "  FCLD    " $@;
+am__v_FCLD_1 = 
+SOURCES = $(nodist_libf95getdata_la_SOURCES) $(libfgetdata_la_SOURCES)
+DIST_SOURCES = $(libfgetdata_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+HEADERS = $(nodist_include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@ $(FC_WALL) $(FC_WEXTRA)
+FFLAGS = @FFLAGS@
+FGETDATA_VERSION = @FGETDATA_VERSION@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+GD_FDIRSEP = @GD_FDIRSEP@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_DEBUG = @GETDATA_DEBUG@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GETDATA_MAJOR = @GETDATA_MAJOR@
+GETDATA_MINOR = @GETDATA_MINOR@
+GETDATA_REVISION = @GETDATA_REVISION@
+GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+GZIP_LIBS = @GZIP_LIBS@
+IDL = @IDL@
+IDL_CFLAGS = @IDL_CFLAGS@
+IDL_LIBS = @IDL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JOT = @JOT@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBLTDL = @LIBLTDL@
+LIBOBJS = @LIBOBJS@
+LIBS = 
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTDLINCL = @LTDLINCL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+LZMA_LIBS = @LZMA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATLAB = @MATLAB@
+MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@
+MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@
+MEX = @MEX@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008-2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+ at FC_WEXTRA_TRUE@FC_WEXTRA = -Wextra
+ at FC_WALL_TRUE@FC_WALL = -Wall
+ at CC_WEXTRA_TRUE@CC_WEXTRA = -Wextra
+ at CC_WALL_TRUE@CC_WALL = -Wall
+ at MAKE_F95BINDINGS_TRUE@F95_INC = getdata.mod
+ at MAKE_F95BINDINGS_TRUE@F95_LIB = libf95getdata.la
+EXTRA_DIST = getdata.f.in getdata.f90.in
+SUBDIRS = test
+BUILT_SOURCES = getdata.f $(F95_INC)
+nodist_include_HEADERS = getdata.f $(F95_INC)
+lib_LTLIBRARIES = libfgetdata.la $(F95_LIB)
+libfgetdata_la_CPPFLAGS = ${CC_WALL} $(CC_WEXTRA) -I$(top_srcdir)/src
+libfgetdata_la_SOURCES = fgetdata.c fgetdata.h
+libfgetdata_la_LIBADD = ../../src/libgetdata.la
+libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@
+nodist_libf95getdata_la_SOURCES = getdata.f90
+libf95getdata_la_LIBADD = libfgetdata.la
+libf95getdata_la_LDFLAGS = -version-info @F95GETDATA_VERSION@
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .f90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/f77/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/f77/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libf95getdata.la: $(libf95getdata_la_OBJECTS) $(libf95getdata_la_DEPENDENCIES) $(EXTRA_libf95getdata_la_DEPENDENCIES) 
+	$(AM_V_FCLD)$(libf95getdata_la_LINK) $(am_libf95getdata_la_rpath) $(libf95getdata_la_OBJECTS) $(libf95getdata_la_LIBADD) $(LIBS)
+
+libfgetdata.la: $(libfgetdata_la_OBJECTS) $(libfgetdata_la_DEPENDENCIES) $(EXTRA_libfgetdata_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libfgetdata_la_LINK) -rpath $(libdir) $(libfgetdata_la_OBJECTS) $(libfgetdata_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libfgetdata_la-fgetdata.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 $@ $<
+
+libfgetdata_la-fgetdata.lo: fgetdata.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfgetdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libfgetdata_la-fgetdata.lo -MD -MP -MF $(DEPDIR)/libfgetdata_la-fgetdata.Tpo -c -o libfgetdata_la-fgetdata.lo `test -f 'fgetdata.c' || echo '$(srcdir)/'`fgetdata.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libfgetdata_la-fgetdata.Tpo $(DEPDIR)/libfgetdata_la-fgetdata.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='fgetdata.c' object='libfgetdata_la-fgetdata.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfgetdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libfgetdata_la-fgetdata.lo `test -f 'fgetdata.c' || echo '$(srcdir)/'`fgetdata.c
+
+.f90.o:
+	$(AM_V_FC)$(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+	$(AM_V_FC)$(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+	$(AM_V_FC)$(LTFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-nodist_includeHEADERS: $(nodist_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+	done
+
+uninstall-nodist_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-nodist_includeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES uninstall-nodist_includeHEADERS
+
+.MAKE: $(am__recursive_targets) all check install install-am \
+	install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libLTLIBRARIES \
+	clean-libtool clean-local cscopelist-am ctags ctags-am \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLTLIBRARIES install-man \
+	install-nodist_includeHEADERS install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
+	uninstall-nodist_includeHEADERS
+
+
+getdata.mod: getdata.o
+
+clean-local:
+	rm -rf getdata.mod make_parameters.sed.in make_parameters.stamp \
+		make_parameters.sed getdata.f getdata.f90 getdata.mod
+	rm -rf *~
+
+make_parameters.sed.in: ../make_parameters ../../src/getdata.h
+	../make_parameters f > $@
+
+../make_parameters: ../make_parameters.c
+	cd .. && ${MAKE} make_parameters
+
+make_parameters.sed: make_parameters.stamp
+	@if test ! -f $@; then \
+		rm -f make_parameters.stamp; \
+		$(MAKE) make_parameters.stamp; \
+		fi
+
+ at HAVE_DIFF_TRUE@make_parameters.stamp: make_parameters.sed.in
+ at HAVE_DIFF_TRUE@	@if $(DIFF) make_parameters.sed make_parameters.sed.in >/dev/null 2>&1; then \
+ at HAVE_DIFF_TRUE@		echo "make_parameters.sed is unchanged"; \
+ at HAVE_DIFF_TRUE@		else \
+ at HAVE_DIFF_TRUE@		rm -f make_parameters.sed; \
+ at HAVE_DIFF_TRUE@		cp make_parameters.sed.in make_parameters.sed; \
+ at HAVE_DIFF_TRUE@		fi; \
+ at HAVE_DIFF_TRUE@		touch make_parameters.stamp
+
+ at HAVE_DIFF_FALSE@make_parameters.stamp: make_parameters.sed.in
+ at HAVE_DIFF_FALSE@		@rm -f make_parameters.sed; \
+ at HAVE_DIFF_FALSE@		cp make_parameters.sed.in make_parameters.sed; \
+ at HAVE_DIFF_FALSE@		touch make_parameters.stamp
+
+getdata.f: $(srcdir)/getdata.f.in make_parameters.sed
+	rm -f $@
+	$(SED) -f make_parameters.sed $(srcdir)/getdata.f.in > $@
+	chmod a-w $@
+
+getdata.f90: $(srcdir)/getdata.f90.in make_parameters.sed
+	rm -f $@
+	$(SED) -f make_parameters.sed $(srcdir)/getdata.f90.in > $@
+	chmod a-w $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/f77/fgetdata.c b/bindings/f77/fgetdata.c
new file mode 100644
index 0000000..3ddaf48
--- /dev/null
+++ b/bindings/f77/fgetdata.c
@@ -0,0 +1,4046 @@
+/* Copyright (C) 2008-2015 D. V. Wiebe
+ *
+ *************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "fgetdata.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/* convert scalar_ind from C to FORTRAN */
+#define GDF_SCIND_C2F(out,in) do { \
+  (out) = (in); if ((out) >= 0) (out)++; \
+} while (0)
+
+/* convert scalar ind from FORTRAN to C */
+#define GDF_SCIND_F2C(out,in) do { \
+  (out) = (in); if ((out) > 0) (out)--; \
+} while (0)
+
+/* Fortran 77 has no facility to take a pointer to a DIRFILE* object.
+ * Instead, we keep a list of them here.  If we ever run out of these,
+ * the caller will be abort()ed. */
+static DIRFILE* f77dirfiles[GDF_N_DIRFILES];
+static int f77dirfiles_initialised = 0;
+
+/* casting data pointers to function pointers is prohibited in C.  This
+ * container is used to get around that */
+static struct _GDF_callback_container {
+  _GDF_callback_t func;
+} f77callbacks[GDF_N_DIRFILES];
+
+/* initialise the f77dirfiles array */
+static void _GDF_InitDirfiles(void)
+{
+  int i;
+
+  dtracevoid();
+
+  for (i = 1; i < GDF_N_DIRFILES; ++i)
+    f77dirfiles[i] = NULL;
+
+  /* we keep entry zero as a generic, invalid dirfile to return if
+   * dirfile lookup fails */
+  f77dirfiles[0] = gd_invalid_dirfile();
+
+  f77dirfiles_initialised = 1;
+  dreturnvoid();
+}
+
+/* make a C string */
+static char *_GDF_CString(char **out, const char *in, int l)
+{
+  int i;
+
+  dtrace("%p, %p, %i", out, in, l);
+
+  if (l < 0) {
+    *out = NULL;
+    dreturn("%p", NULL);
+    return *out;
+  }
+
+  *out = (char*)malloc(l + 1);
+  for (i = 0; i < l; ++i)
+    (*out)[i] = in[i];
+  (*out)[l] = '\0';
+
+  dreturn("\"%s\"", *out);
+  return *out;
+}
+
+/* convert an int to a DIRFILE* */
+static DIRFILE* _GDF_GetDirfile(int d)
+{
+  dtrace("%i", d);
+
+  if (!f77dirfiles_initialised)
+    _GDF_InitDirfiles();
+
+  if (d < 0 || d >= GDF_N_DIRFILES || f77dirfiles[d] == NULL) {
+    dreturn("%p [0]", f77dirfiles[0]);
+    return f77dirfiles[0];
+  }
+
+  dreturn("%p", f77dirfiles[d]);
+  return f77dirfiles[d];
+}
+
+/* convert a new DIRFILE* into an int */
+static int _GDF_SetDirfile(DIRFILE* D)
+{
+  int i;
+
+  dtrace("%p", D);
+
+  if (!f77dirfiles_initialised)
+    _GDF_InitDirfiles();
+
+  for (i = 1; i < GDF_N_DIRFILES; ++i)
+    if (f77dirfiles[i] == NULL) {
+      f77dirfiles[i] = D;
+      f77callbacks[i].func = NULL;
+      dreturn("%i", i);
+      return i;
+    }
+
+  /* out of f77dirfiles space: complain and abort */
+  fputs("libfgetdata: DIRFILE space exhausted.", stderr);
+  abort();
+}
+
+/* delete the supplied dirfile */
+static void _GDF_ClearDirfile(int d)
+{
+  dtrace("%i", d);
+
+  if (d != 0)
+    f77dirfiles[d] = NULL;
+
+  dreturnvoid();
+}
+
+/* create a 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;
+
+  switch(op) {
+    case GD_WINDOP_EQ:
+    case GD_WINDOP_NE:
+      t.i = *(int32_t*)data;
+      dreturn("%lli", (long long)t.i);
+      break;
+    case GD_WINDOP_SET:
+    case GD_WINDOP_CLR:
+      t.u = *(int32_t*)data;
+      dreturn("%llu", (unsigned long long)t.u);
+      break;
+    default:
+      t.r = *(double*)data;
+      dreturn("%g", t.r);
+      break;
+  }
+
+  return t;
+}
+
+/* create a Fortran space padded string */
+static int _GDF_FString(char *dest, int32_t *dlen, const char *src)
+{
+  int i, slen;
+
+  dtrace("%p, %i, \"%s\"", dest, *dlen, src);
+
+  if (src == NULL) {
+    *dlen = 0;
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  slen = strlen(src);
+
+  if (slen <= *dlen) {
+    for (i = 0; i < slen; ++i)
+      dest[i] = src[i];
+
+    for (; i < *dlen; ++i)
+      dest[i] = ' ';
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  *dlen = slen;
+  dreturn("%i", -1);
+  return -1;
+}
+
+/* callback wrapper */
+static int _GDF_Callback(gd_parser_data_t* pdata, void *f77_callback)
+{
+  struct _GDF_callback_container *c =
+    (struct _GDF_callback_container*)f77_callback;
+
+  int unit;
+  int r = GD_SYNTAX_ABORT;
+
+  dtrace("%p, %p", pdata, f77_callback);
+
+  if (c != NULL && c->func != NULL) {
+    unit = _GDF_SetDirfile((DIRFILE*)pdata->dirfile);
+
+    (c->func)(&r, &unit, &pdata->suberror, pdata->line, &pdata->linenum,
+        pdata->filename);
+
+    pdata->line[GD_MAX_LINE_LENGTH - 1] = '\0';
+
+    _GDF_ClearDirfile(unit);
+  }
+
+  dreturn("%i", r);
+  return r;
+}
+
+/* gd_open wrapper */
+void F77_FUNC(gdopen, GDOPEN) (int32_t *dirfile, const char *dirfilename,
+    const int32_t *dirfilename_l, const int32_t *flags)
+{
+  char *out;
+
+  dtrace("%p, %p, %i, %i", dirfile, dirfilename, *dirfilename_l, *flags);
+
+  *dirfile = _GDF_SetDirfile(gd_open(_GDF_CString(&out, dirfilename,
+          *dirfilename_l), *flags));
+
+  free(out);
+
+  dreturn("%i", *dirfile);
+}
+
+/* gd_close wrapper */
+void F77_FUNC(gdclos, GDCLOS) (const int32_t *dirfile)
+{
+  dtrace("%i", *dirfile);
+
+  if (*dirfile != 0) {
+    gd_close(_GDF_GetDirfile(*dirfile));
+
+    _GDF_ClearDirfile(*dirfile);
+  }
+
+  dreturnvoid();
+}
+
+/* gd_flush wrapper */
+void F77_FUNC(gdflsh, GDFLSH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l);
+
+  if (*field_code_l == 0)
+    gd_flush(_GDF_GetDirfile(*dirfile), NULL);
+  else {
+    char *out;
+    gd_flush(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l));
+    free(out);
+  }
+
+  dreturnvoid();
+}
+
+/* gd_getdata wrapper */
+void F77_FUNC(gdgetd, GDGETD) (int32_t *n_read, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l,
+    const int32_t *first_frame, const int32_t *first_sample,
+    const int32_t *num_frames, const int32_t *num_samples,
+    const int32_t *return_type, void *data_out)
+{
+  char *out;
+
+  dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%x, %p", n_read, *dirfile,
+      field_code, *field_code_l, *first_frame, *first_sample, *num_frames,
+      *num_samples, *return_type, data_out);
+
+  *n_read = gd_getdata(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+        *field_code_l), *first_frame, *first_sample, *num_frames,
+      *num_samples, (gd_type_t)*return_type, data_out);
+  free(out);
+
+  dreturn("%i", *n_read);
+}
+
+/* Return the maximum field name length */
+void F77_FUNC(gdfdnx, GDFDNX) (int32_t *max, const int32_t *dirfile)
+{
+  const char **fl;
+  size_t len = 0;
+  DIRFILE* D;
+  unsigned int i, nfields;
+
+  dtrace("%p, %i", max, *dirfile);
+
+  D = _GDF_GetDirfile(*dirfile);
+  nfields = gd_nfields(D);
+
+  if (!gd_error(D)) {
+    fl = gd_field_list(D);
+
+    for (i = 0; i < nfields; ++i)
+      if (strlen(fl[i]) > len)
+        len = strlen(fl[i]);
+  }
+
+  *max = len;
+  dreturn("%i", *max);
+}
+
+/* Return the maximum field name length for a meta list */
+void F77_FUNC(gdmfnx, GDMFNX) (int32_t *max, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l)
+{
+  const char **fl;
+  unsigned int i, nfields;
+  size_t len = 0;
+  DIRFILE* D = _GDF_GetDirfile(*dirfile);
+  char *pa;
+
+  dtrace("%p, %i, %p, %i", max, *dirfile, parent, *parent_l);
+
+  _GDF_CString(&pa, parent, *parent_l);
+  nfields = gd_nmfields(D, pa);
+
+  if (!gd_error(D)) {
+    fl = gd_mfield_list(D, pa);
+
+    for (i = 0; i < nfields; ++i)
+      if (strlen(fl[i]) > len)
+        len = strlen(fl[i]);
+  }
+
+  *max = len;
+
+  free(pa);
+  dreturn("%i", *max);
+}
+
+/* gd_field_list wrapper -- this only returns one field name */
+void F77_FUNC(gdfldn, GDFLDN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const int32_t *field_num)
+{
+  const char** fl;
+  DIRFILE* D;
+  unsigned int nfields;
+
+  dtrace("%p, %p, %i, %i", name, name_l, *dirfile, *field_num);
+  
+  D = _GDF_GetDirfile(*dirfile);
+  nfields = gd_nfields(D);
+
+  if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) {
+    fl = gd_field_list(D);
+    _GDF_FString(name, name_l, fl[*field_num - 1]);
+  } else
+    *name_l = 0;
+
+  dreturn("%i", *name_l);
+}
+
+/* gd_mfield_list wrapper -- this only returns one field name */
+void F77_FUNC(gdmfdn, GDMFDN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *field_num)
+{
+  const char** fl;
+  unsigned int nfields;
+  DIRFILE* D = _GDF_GetDirfile(*dirfile);
+  char *pa;
+
+  dtrace("%p, %p, %i, %p, %i, %i", name, name_l, *dirfile, parent, *parent_l,
+      *field_num);
+
+  _GDF_CString(&pa, parent, *parent_l);
+  nfields = gd_nmfields(D, pa);
+
+  if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) {
+    fl = gd_mfield_list(D, pa);
+    _GDF_FString(name, name_l, fl[*field_num - 1]);
+  } else
+    *name_l = 0;
+
+  free(pa);
+
+  dreturn("%i", *name_l);
+}
+
+/* gd_nfields wrapper */
+void F77_FUNC(gdnfld, GDNFLD) (int32_t *nfields, const int32_t *dirfile)
+{
+  *nfields = gd_nfields(_GDF_GetDirfile(*dirfile));
+}
+
+/* gd_bof wrapper */
+void F77_FUNC(gdgbof, GDGBOF) (int32_t *bof, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+  dtrace("%p, %i, %p, %i", bof, *dirfile, field_code, *field_code_l);
+
+  *bof = gd_bof(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+
+  free(fc);
+  dreturn("%i", *bof);
+}
+
+/* gd_eof wrapper */
+void F77_FUNC(gdgeof, GDGEOF) (int32_t *eof, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+  dtrace("%p, %i, %p, %i", eof, *dirfile, field_code, *field_code_l);
+
+  *eof = gd_eof(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+  free(fc);
+
+  dreturn("%i", *eof);
+}
+
+/* gd_nframes wrapper */
+void F77_FUNC(gdnfrm, GDNFRM) (int32_t *nframes, const int32_t *dirfile)
+{
+  *nframes = gd_nframes(_GDF_GetDirfile(*dirfile));
+}
+
+/* gd_spf wrapper */
+void F77_FUNC(gdgspf, GDGSPF) (int32_t *spf, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  dtrace("%p, %i, %p, %i", spf, *dirfile, field_code, *field_code_l);
+
+  *spf = gd_spf(_GDF_GetDirfile(*dirfile),
+      _GDF_CString(&out, field_code, *field_code_l));
+  free(out);
+  dreturn("%i", *spf);
+}
+
+/* gd_putdata wrapper */
+void F77_FUNC(gdputd, GDPUTD) (int32_t *n_wrote, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l,
+    const int32_t *first_frame, const int32_t *first_sample,
+    const int32_t *num_frames, const int32_t *num_samples,
+    const int32_t *data_type, const void *data_in)
+{
+  char *out;
+  dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%x, %p", n_wrote, *dirfile,
+      field_code, *field_code_l, *first_frame, *first_sample, *num_frames,
+      *num_samples, *data_type, data_in);
+
+  *n_wrote = gd_putdata(_GDF_GetDirfile(*dirfile), _GDF_CString(&out,
+        field_code, *field_code_l), *first_frame, *first_sample, *num_frames,
+      *num_samples, (gd_type_t)*data_type, data_in);
+  free(out);
+
+  dreturn("%i", *n_wrote);
+}
+
+/* return the error number */
+void F77_FUNC(gderor, GDEROR) (int32_t *error, const int32_t *dirfile)
+{
+  dtrace("%p, %i", error, *dirfile);
+
+  *error = gd_error(_GDF_GetDirfile(*dirfile));
+
+  dreturn("%i", *error);
+}
+
+/* gd_error_count wrapper */
+void F77_FUNC(gdecnt, GDECNT) (int32_t *error_count, const int32_t *dirfile)
+{
+  dtrace("%p, %i", error_count, *dirfile);
+
+  *error_count = gd_error_count(_GDF_GetDirfile(*dirfile));
+
+  dreturn("%i", *error_count);
+}
+
+/* gd_error_string wrapper */
+void F77_FUNC(gdestr, GDESTR) (const int32_t *dirfile, char *buffer,
+    const int32_t *len)
+{
+  int i;
+  gd_error_string(_GDF_GetDirfile(*dirfile), buffer, *len);
+
+  /* space pad */
+  for (i = 0; i < *len && buffer[i]; ++i)
+    ;
+
+  for (; i < *len; ++i)
+    buffer[i] = ' ';
+}
+
+/* gd_entry_type wrapper */
+void F77_FUNC(gdenty, GDENTY) (int32_t *type, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p, %i", type, *dirfile, field_code, *field_code_l);
+
+  *type = (int)gd_entry_type(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc,
+        field_code, *field_code_l));
+
+  free(fc);
+
+  dreturn("%i", *type);
+}
+
+/* gd_entry wrapper for RAW */
+void F77_FUNC(gdgerw, GDGERW) (int32_t *spf, int32_t *dtype,
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %p, %p, %i, %p, %i", spf, dtype, fragment_index, *dirfile,
+      field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_RAW_ENTRY)
+    *spf = 0;
+  else {
+    *spf = E.EN(raw,spf);
+    *dtype = E.EN(raw,data_type);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for LINCOM */
+void F77_FUNC(gdgelc, GDGELC) (int32_t *nfields,
+    char *infield1, int32_t *infield1_l, double *m1, double *b1,
+    char *infield2, int32_t *infield2_l, double *m2, double *b2,
+    char *infield3, int32_t *infield3_l, double *m3, double *b3,
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %i, %p, %i",
+      nfields, infield1, infield1_l, m1, b1, infield2, infield2_l, m2, b2,
+      infield3, infield3_l, m3, b3, fragment_index, *dirfile, field_code,
+      *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_LINCOM_ENTRY)
+    *nfields = 0;
+  else {
+    *nfields = E.EN(lincom,n_fields);
+    *fragment_index = E.fragment_index;
+
+    _GDF_FString(infield1, infield1_l, E.in_fields[0]);
+    *m1 = E.EN(lincom,m)[0];
+    *b1 = E.EN(lincom,b)[0];
+
+    if (E.EN(lincom,n_fields) > 1) {
+      _GDF_FString(infield2, infield2_l, E.in_fields[1]);
+      *m2 = E.EN(lincom,m)[1];
+      *b2 = E.EN(lincom,b)[1];
+    }
+
+    if (E.EN(lincom,n_fields) > 2) {
+      _GDF_FString(infield3, infield3_l, E.in_fields[2]);
+      *m3 = E.EN(lincom,m)[2];
+      *b3 = E.EN(lincom,b)[2];
+    }
+
+    gd_free_entry_strings(&E);
+  }
+  free(out);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdgecl, GDGECL) (int32_t *nfields,
+    char *infield1, int32_t *infield1_l, GD_DCOMPLEXP(m1), GD_DCOMPLEXP(b1),
+    char *infield2, int32_t *infield2_l, GD_DCOMPLEXP(m2), GD_DCOMPLEXP(b2),
+    char *infield3, int32_t *infield3_l, GD_DCOMPLEXP(m3), GD_DCOMPLEXP(b3),
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  char *fc;
+  gd_entry_t E;
+
+  dtrace("%p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %i, %p, %i",
+      nfields, infield1, infield1_l, m1, b1, infield2, infield2_l, m2, b2,
+      infield3, infield3_l, m3, b3, fragment_index, *dirfile, field_code,
+      *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+          *field_code_l), &E))
+    *nfields = 0;
+  else if (E.field_type != GD_LINCOM_ENTRY) {
+    *nfields = 0;
+    gd_free_entry_strings(&E);
+  } else {
+    *nfields = E.EN(lincom,n_fields);
+    *fragment_index = E.fragment_index;
+
+    _GDF_FString(infield1, infield1_l, E.in_fields[0]);
+    gd_cs2cp_(m1, E.EN(lincom,cm)[0]);
+    gd_cs2cp_(b1, E.EN(lincom,cb)[0]);
+
+    if (E.EN(lincom,n_fields) > 1) {
+      _GDF_FString(infield2, infield2_l, E.in_fields[1]);
+      gd_cs2cp_(m2, E.EN(lincom,cm)[1]);
+      gd_cs2cp_(b2, E.EN(lincom,cb)[1]);
+    }
+
+    if (E.EN(lincom,n_fields) > 2) {
+      _GDF_FString(infield3, infield3_l, E.in_fields[2]);
+      gd_cs2cp_(m3, E.EN(lincom,cm)[2]);
+      gd_cs2cp_(b3, E.EN(lincom,cb)[2]);
+    }
+    gd_free_entry_strings(&E);
+  }
+
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for POLYNOM */
+void F77_FUNC(gdgepn, GDGEPN) (int32_t *poly_ord, char *infield,
+    int32_t *infield_l, double *a0, double *a1, double *a2, double *a3,
+    double *a4, double *a5, int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %p, %i, %p, %p, %p, %p, %p, %p, %p, %i, %p, %i", poly_ord,
+      infield, *infield_l, a0, a1, a2, a3, a4, a5, fragment_index, *dirfile,
+      field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY)
+    *poly_ord = 0;
+  else {
+    *poly_ord = E.EN(polynom,poly_ord);
+    *fragment_index = E.fragment_index;
+
+    _GDF_FString(infield, infield_l, E.in_fields[0]);
+
+    switch (E.EN(polynom,poly_ord)) {
+      case 5:
+        *a5 = E.EN(polynom,a)[5];
+      case 4:
+        *a4 = E.EN(polynom,a)[4];
+      case 3:
+        *a3 = E.EN(polynom,a)[3];
+      case 2:
+        *a2 = E.EN(polynom,a)[2];
+      case 1:
+        *a1 = E.EN(polynom,a)[1];
+        *a0 = E.EN(polynom,a)[0];
+    }
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+  dreturnvoid();
+}
+
+void F77_FUNC(gdgecp, GDGECP) (int32_t *poly_ord, char *infield,
+    int32_t *infield_l, GD_DCOMPLEXP(a0), GD_DCOMPLEXP(a1), GD_DCOMPLEXP(a2),
+    GD_DCOMPLEXP(a3), GD_DCOMPLEXP(a4), GD_DCOMPLEXP(a5),
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %p, %i, %p, %p, %p, %p, %p, %p, %p, %i, %p, %i", poly_ord,
+      infield, *infield_l, a0, a1, a2, a3, a4, a5, fragment_index, *dirfile,
+      field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY)
+    *poly_ord = 0;
+  else {
+    *poly_ord = E.EN(polynom,poly_ord);
+    *fragment_index = E.fragment_index;
+
+    _GDF_FString(infield, infield_l, E.in_fields[0]);
+
+    switch (E.EN(polynom,poly_ord)) {
+      case 5:
+        gd_cs2cp_(a5, E.EN(polynom,ca)[5]);
+      case 4:
+        gd_cs2cp_(a4, E.EN(polynom,ca)[4]);
+      case 3:
+        gd_cs2cp_(a3, E.EN(polynom,ca)[3]);
+      case 2:
+        gd_cs2cp_(a2, E.EN(polynom,ca)[2]);
+      case 1:
+        gd_cs2cp_(a1, E.EN(polynom,ca)[1]);
+        gd_cs2cp_(a0, E.EN(polynom,ca)[0]);
+    }
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for LINTERP */
+void F77_FUNC(gdgelt, GDGELT) (char *in_field, int32_t *in_field_l, char *table,
+    int32_t *table_l, int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %i, %p, %i, %p, %i, %p, %i", in_field, *in_field_l, table,
+      *table_l, fragment_index, *dirfile, field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_LINTERP_ENTRY)
+    *in_field_l = 0;
+  else {
+    _GDF_FString(table, table_l, E.EN(linterp,table));
+    _GDF_FString(in_field, in_field_l, E.in_fields[0]);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for BIT */
+void F77_FUNC(gdgebt, GDGEBT) (char *in_field, int32_t *in_field_l,
+    int32_t *bitnum, int32_t *numbits, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, bitnum,
+      numbits, fragment_index, *dirfile, field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_BIT_ENTRY)
+    *in_field_l = 0;
+  else {
+    _GDF_FString(in_field, in_field_l, E.in_fields[0]);
+    *bitnum = E.EN(bit,bitnum);
+    *numbits = E.EN(bit,numbits);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for SBIT */
+void F77_FUNC(gdgesb, GDGESB) (char *in_field, int32_t *in_field_l,
+    int32_t *bitnum, int32_t *numbits, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, bitnum,
+      numbits, fragment_index, *dirfile, field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_SBIT_ENTRY)
+    *in_field_l = 0;
+  else {
+    _GDF_FString(in_field, in_field_l, E.in_fields[0]);
+    *bitnum = E.EN(bit,bitnum);
+    *numbits = E.EN(bit,numbits);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+  dreturnvoid();
+}
+
+/* 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)
+{
+  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_MULTIPLY_ENTRY)
+    *in_field1_l = 0;
+  else {
+    _GDF_FString(in_field1, in_field1_l, E.in_fields[0]);
+    _GDF_FString(in_field2, in_field2_l, E.in_fields[1]);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for DIVIDE */
+void F77_FUNC(gdgedv, GDGEDV) (char *in_field1, 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);
+
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for WINDOW */
+void F77_FUNC(gdgewd, GDGEWD) (char *in_field, int32_t *in_field_l,
+    char *check_field, int32_t *check_field_l, int32_t *windop,
+    int32_t *ithreshold, double *rthreshold, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+  gd_entry_t E;
+
+  dtrace("%p, %i, %p, %i, %p, %p, %p, %p, %i, %p, %i", in_field, *in_field_l,
+      check_field, *check_field_l, windop, ithreshold, rthreshold,
+      fragment_index, *dirfile, field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+          *field_code_l), &E) || E.field_type != GD_WINDOW_ENTRY)
+    *in_field_l = 0;
+  else {
+    _GDF_FString(in_field, in_field_l, E.in_fields[0]);
+    _GDF_FString(check_field, check_field_l, E.in_fields[1]);
+    *windop = E.EN(window,windop);
+    switch (E.EN(window,windop)) {
+      case GD_WINDOP_EQ:
+      case GD_WINDOP_NE:
+        *ithreshold = E.EN(window,threshold.i);
+        break;
+      case GD_WINDOP_SET:
+      case GD_WINDOP_CLR:
+        *ithreshold = E.EN(window,threshold.u);
+        break;
+      default:
+        *rthreshold = E.EN(window,threshold.r);
+        break;
+    }
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for MPLEX */
+void F77_FUNC(gdgemx, GDGEMX) (char *in_field, int32_t *in_field_l,
+    char *count_field, int32_t *count_field_l, int32_t *val, int32_t *period,
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  char *fc;
+  gd_entry_t E;
+
+  dtrace("%p, %i, %p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l,
+      count_field, *count_field_l, val, period, fragment_index, *dirfile,
+      field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+          *field_code_l), &E) || E.field_type != GD_MPLEX_ENTRY)
+    *in_field_l = 0;
+  else {
+    _GDF_FString(in_field, in_field_l, E.in_fields[0]);
+    _GDF_FString(count_field, count_field_l, E.in_fields[1]);
+    *val = E.EN(mplex,count_val);
+    *period = E.EN(mplex,period);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for RECIP */
+void F77_FUNC(gdgerc, GDGERC) (char *in_field, int32_t *in_field_l,
+    double *dividend, int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, dividend,
+      fragment_index, *dirfile, field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_RECIP_ENTRY)
+    *in_field_l = 0;
+  else {
+    _GDF_FString(in_field, in_field_l, E.in_fields[0]);
+    *dividend = E.EN(recip,dividend);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdgecr, GDGECR) (char *in_field, int32_t *in_field_l,
+    GD_DCOMPLEXP(cdividend), int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, cdividend,
+      fragment_index, *dirfile, field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_RECIP_ENTRY)
+    *in_field_l = 0;
+  else {
+    _GDF_FString(in_field, in_field_l, E.in_fields[0]);
+    gd_cs2cp_(cdividend, E.EN(recip,cdividend));
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for PHASE */
+void F77_FUNC(gdgeph, GDGEPH) (char *in_field, int32_t *in_field_l,
+    int32_t *shift, int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, shift,
+      fragment_index, *dirfile, field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_PHASE_ENTRY)
+    *in_field_l = 0;
+  else {
+    _GDF_FString(in_field, in_field_l, E.in_fields[0]);
+    *shift = E.EN(phase,shift);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for CONST */
+void F77_FUNC(gdgeco, GDGECO) (int32_t *data_type, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %p, %i, %p, %i", data_type, fragment_index, *dirfile, field_code,
+      *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_CONST_ENTRY)
+    *data_type = 0;
+  else {
+    *data_type = E.EN(scalar,const_type);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+  dreturnvoid();
+}
+
+/* gd_entry wrapper for CARRAY */
+void F77_FUNC(gdgeca, GDGECA) (int32_t *data_type, int32_t *array_len,
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  char *out;
+  gd_entry_t E;
+
+  dtrace("%p, %p, %p, %i, %p, %i", data_type, array_len, fragment_index,
+      *dirfile, field_code, *field_code_l);
+
+  if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l), &E) || E.field_type != GD_CARRAY_ENTRY)
+    *data_type = 0;
+  else {
+    *data_type = E.EN(scalar,const_type);
+    *array_len = E.EN(scalar,array_len);
+    *fragment_index = E.fragment_index;
+    gd_free_entry_strings(&E);
+  }
+
+  free(out);
+  dreturnvoid();
+}
+
+/* gd_fragment_index wrapper */
+void F77_FUNC(gdfrgi, GDFRGI) (int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+  dtrace("%p, %i, %p, %i", fragment_index, *dirfile, field_code,
+      *field_code_l);
+
+  *fragment_index = gd_fragment_index(_GDF_GetDirfile(*dirfile),
+      _GDF_CString(&fc, field_code, *field_code_l));
+
+  free(fc);
+
+  dreturn("%i", *fragment_index);
+}
+
+/* gd_add_raw wrapper */
+void F77_FUNC(gdadrw, GDADRW) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf,
+    const int32_t *fragment_index)
+{
+  char *out;
+
+  dtrace("%i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      *data_type, *spf, *fragment_index);
+
+  gd_add_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+        *field_code_l), (gd_type_t)(*data_type), (unsigned int)*spf,
+      *fragment_index);
+  free(out);
+  dreturnvoid();
+}
+
+/* gd_add_lincom wrapper */
+void F77_FUNC(gdadlc, GDADLC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const double *b1,
+    const char *in_field2, const int32_t *in_field2_l, const double *m2,
+    const double *b2, const char *in_field3, const int32_t *in_field3_l,
+    const double *m3, const double *b3, const int32_t *fragment_index)
+{
+  char *fc;
+  char *in_fields[3] = {NULL, NULL, NULL};
+  double m[3] = {0, 0, 0};
+  double b[3] = {0, 0, 0};
+  const int nf = *n_fields;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, %p, %i",
+      *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l,
+      m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3,
+      *fragment_index);
+
+  if (nf > 0) {
+    _GDF_CString(in_fields, in_field1, *in_field1_l);
+    m[0] = *m1;
+    b[0] = *b1;
+  }
+
+  if (nf > 1) {
+    _GDF_CString(in_fields + 1, in_field2, *in_field2_l);
+    m[1] = *m2;
+    b[1] = *b2;
+  }
+
+  if (nf > 2) {
+    _GDF_CString(in_fields + 2, in_field3, *in_field3_l);
+    m[2] = *m3;
+    b[2] = *b3;
+  }
+
+  gd_add_lincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), nf, (const char**)in_fields, m, b, *fragment_index);
+  free(fc);
+  free(in_fields[0]);
+  free(in_fields[1]);
+  free(in_fields[2]);
+  dreturnvoid();
+}
+
+void F77_FUNC(gdadcl, GDADCL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+    const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2),
+    const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l,
+    const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3),
+    const int32_t *fragment_index)
+{
+  char *fc;
+  char *in_fields[3] = {NULL, NULL, NULL};
+#ifdef GD_NO_C99_API
+  double cm[6] = {0, 0, 0, 0, 0, 0};
+  double cb[6] = {0, 0, 0, 0, 0, 0};
+#else
+  double complex cm[3] = {0, 0, 0};
+  double complex cb[3] = {0, 0, 0};
+#endif
+  const int nf = *n_fields;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, %p, %i",
+      *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l,
+      m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3,
+      *fragment_index);
+
+  if (nf > 0) {
+    _GDF_CString(in_fields, in_field1, *in_field1_l);
+    gd_cp2ca_(cm, 0, m1);
+    gd_cp2ca_(cb, 0, b1);
+  }
+
+  if (nf > 1) {
+    _GDF_CString(in_fields + 1, in_field2, *in_field2_l);
+    gd_cp2ca_(cm, 1, m2);
+    gd_cp2ca_(cb, 1, b2);
+  }
+
+  if (nf > 2) {
+    _GDF_CString(in_fields + 2, in_field3, *in_field3_l);
+    gd_cp2ca_(cm, 2, m3);
+    gd_cp2ca_(cb, 2, b3);
+  }
+
+  gd_add_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), nf, (const char**)in_fields, cm, cb, *fragment_index);
+  free(fc);
+  free(in_fields[0]);
+  free(in_fields[1]);
+  free(in_fields[2]);
+  dreturnvoid();
+}
+
+/* gd_add_polynom wrapper */
+void F77_FUNC(gdadpn, GDADPN) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const double *a1,
+    const double *a2, const double *a3, const double *a4, const double *a5,
+    const int32_t *fragment_index)
+{
+  char *fc, *inf;
+  double a[6] = {0, 0, 0, 0, 0, 0};
+  const int po = (*poly_ord > 5) ? 5 : *poly_ord;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, field_code,
+      *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5);
+
+  _GDF_CString(&inf, in_field, *in_field_l);
+
+  switch (po) {
+    case 5:
+      a[5] = *a5;
+    case 4:
+      a[4] = *a4;
+    case 3:
+      a[3] = *a3;
+    case 2:
+      a[2] = *a2;
+    case 1:
+      a[1] = *a1;
+      a[0] = *a0;
+  }
+
+  gd_add_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), po, inf, a, *fragment_index);
+  free(fc);
+  free(inf);
+  dreturnvoid();
+}
+
+void F77_FUNC(gdadcp, GDADCP) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1),
+    const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3),
+    const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5),
+    const int32_t *fragment_index)
+{
+  char *fc, *inf;
+#ifdef GD_NO_C99_API
+  double ca[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+#else
+  double complex ca[6] = {0, 0, 0, 0, 0, 0};
+#endif
+  const int po = (*poly_ord > 5) ? 5 : *poly_ord;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, field_code,
+      *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5);
+
+  _GDF_CString(&inf, in_field, *in_field_l);
+
+  switch (po) {
+    case 5:
+      gd_cp2ca_(ca, 5, a5);
+    case 4:
+      gd_cp2ca_(ca, 4, a4);
+    case 3:
+      gd_cp2ca_(ca, 3, a3);
+    case 2:
+      gd_cp2ca_(ca, 2, a2);
+    case 1:
+      gd_cp2ca_(ca, 1, a1);
+      gd_cp2ca_(ca, 0, a0);
+  }
+
+  gd_add_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), po, inf, ca, *fragment_index);
+  free(fc);
+  free(inf);
+  dreturnvoid();
+}
+
+/* gd_add_linterp wrapper */
+void F77_FUNC(gdadlt, GDADLT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *table, const int32_t *table_l,
+    const int32_t *fragment_index)
+{
+  char *fc, *in, *tab;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, table, *table_l, *fragment_index);
+
+  gd_add_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
+      _GDF_CString(&tab, table, *table_l), *fragment_index);
+  free(fc);
+  free(in);
+  free(tab);
+  dreturnvoid();
+}
+
+/* gd_add_bit wrapper */
+void F77_FUNC(gdadbt, GDADBT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits,
+    const int32_t *fragment_index)
+{
+  char *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, *bitnum, *numbits, *fragment_index);
+
+  gd_add_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
+      *bitnum, *numbits, *fragment_index);
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_add_sbit wrapper */
+void F77_FUNC(gdadsb, GDADSB) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits,
+    const int32_t *fragment_index)
+{
+  char *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, *bitnum, *numbits, *fragment_index);
+
+  gd_add_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
+      *bitnum, *numbits, *fragment_index);
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_add_multiply wrapper */
+void F77_FUNC(gdadmt, GDADMT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l, const int32_t *fragment_index)
+{
+  char *fc, *in1, *in2;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field1, *in_field1_l, in_field2, *in_field2_l, *fragment_index);
+
+  gd_add_multiply(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l),
+      _GDF_CString(&in2, in_field2, *in_field2_l), *fragment_index);
+
+  free(fc);
+  free(in1);
+  free(in2);
+  dreturnvoid();
+}
+
+/* gd_add_divide wrapper */
+void F77_FUNC(gdaddv, GDADDV) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l, const int32_t *fragment_index)
+{
+  char *fc, *in1, *in2;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field1, *in_field1_l, in_field2, *in_field2_l, *fragment_index);
+
+  gd_add_divide(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l),
+      _GDF_CString(&in2, in_field2, *in_field2_l), *fragment_index);
+
+  free(fc);
+  free(in1);
+  free(in2);
+
+  dreturnvoid();
+}
+
+/* gd_add_recip wrapper */
+void F77_FUNC(gdadrc, GDADRC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend,
+    const int32_t *fragment_index)
+{
+  char *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %g, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, *dividend, *fragment_index);
+
+  gd_add_recip(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *dividend,
+      *fragment_index);
+
+  free(fc);
+  free(in);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdadcr, GDADCR) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(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);
+
+#ifdef GD_NO_C99_API
+  gd_add_crecip89(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l), cdividend,
+      *fragment_index);
+#else
+  gd_add_crecip(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *cdividend,
+      *fragment_index);
+#endif
+
+  free(fc);
+  free(in);
+
+  dreturnvoid();
+}
+
+/* gd_add_phase wrapper */
+void F77_FUNC(gdadph, GDADPH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift,
+    const int32_t *fragment_index)
+{
+  char *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, *shift, *fragment_index);
+
+  gd_add_phase(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *shift,
+      *fragment_index);
+
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_fragmentname wrapper */
+void F77_FUNC(gdfrgn, GDFRGN) (char *filename, int32_t *filename_l,
+    const int32_t *dirfile, const int32_t *index)
+{
+  dtrace("%p, %i, %i, %i", filename, *filename_l, *dirfile, *index);
+  _GDF_FString(filename, filename_l, gd_fragmentname(_GDF_GetDirfile(*dirfile),
+        *index));
+  dreturnvoid();
+}
+
+/* gd_nfragments wrapper */
+void F77_FUNC(gdnfrg, GDNFRG) (int32_t *nformats, const int32_t *dirfile)
+{
+  *nformats = gd_nfragments(_GDF_GetDirfile(*dirfile));
+}
+
+/* gd_metaflush wrapper */
+void F77_FUNC(gdmfls, GDMFLS) (const int32_t *dirfile)
+{
+  dtrace("%i", *dirfile);
+
+  gd_metaflush(_GDF_GetDirfile(*dirfile));
+
+  dreturnvoid();
+}
+
+/* gd_rewrite_fragment wrapper */
+void F77_FUNC(gdrfrg, GDRFRG) (const int32_t *dirfile, const int32_t *fragment)
+{
+  dtrace("%i, %i", *dirfile, *fragment);
+
+  gd_rewrite_fragment(_GDF_GetDirfile(*dirfile), *fragment);
+
+  dreturnvoid();
+}
+
+/* gd_include wrapper */
+void F77_FUNC(gdincl, GDINCL) (const int32_t *dirfile, const char *file,
+    const int32_t *file_l, const int32_t *fragment_index, const int32_t *flags)
+{
+  char *fi;
+
+  dtrace("%i, %p, %i, %i, 0x%X", *dirfile, file, *file_l, *fragment_index,
+      *flags);
+
+  gd_include(_GDF_GetDirfile(*dirfile), _GDF_CString(&fi, file, *file_l),
+      *fragment_index, *flags);
+
+  free(fi);
+  dreturnvoid();
+}
+
+/* gd_nfield_by_type wrapper */
+void F77_FUNC(gdnfdt, GDNFDT) (int32_t *nfields, const int32_t *dirfile,
+    const int32_t *type)
+{
+  dtrace("%p, %i, 0x%x", nfields, *dirfile, *type);
+
+  *nfields = gd_nfields_by_type(_GDF_GetDirfile(*dirfile), (gd_entype_t)*type);
+
+  dreturn("%i", *nfields);
+}
+
+/* gd_nvectors wrapper */
+void F77_FUNC(gdnvec, GDNVEC) (int32_t *nvectors, const int32_t *dirfile)
+{
+  *nvectors = gd_nvectors(_GDF_GetDirfile(*dirfile));
+}
+
+/* gd_field_list_by_type wrapper -- this only returns one field name */
+void F77_FUNC(gdfdnt, GDFDNT) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const int32_t *type, const int32_t *field_num)
+{
+  const char** fl;
+  DIRFILE* D;
+  unsigned int nfields;
+
+  dtrace("%p, %p, %i, 0x%X, %i", name, name_l, *dirfile, *type, *field_num);
+
+  D = _GDF_GetDirfile(*dirfile);
+  nfields = gd_nfields_by_type(D, (gd_entype_t)*type);
+
+  if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) {
+    fl = gd_field_list_by_type(D, (gd_entype_t)*type);
+    _GDF_FString(name, name_l, fl[*field_num - 1]);
+  } else
+    *name_l = 0;
+
+  dreturn("%i", *name_l);
+}
+
+/* gd_vector_list wrapper -- this only returns one field name */
+void F77_FUNC(gdvecn, GDVECN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const int32_t *field_num)
+{
+  const char** fl;
+  DIRFILE *D;
+  unsigned int nfields;
+
+  dtrace("%p, %p, %i, %i", name, name_l, *dirfile, *field_num);
+
+  D = _GDF_GetDirfile(*dirfile);
+  nfields = gd_nvectors(D);
+
+  if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) {
+    fl = gd_vector_list(D);
+    _GDF_FString(name, name_l, fl[*field_num - 1]);
+  } else
+    *name_l = 0;
+
+  dreturn("%i", *name_l);
+}
+
+/* gd_mfield_list_by_type wrapper -- this only returns one field name */
+void F77_FUNC(gdmfdt, GDMFDT) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *type, const int32_t *field_num)
+{
+  const char **fl;
+  unsigned int nfields;
+  DIRFILE *D;
+  char *pa;
+
+  dtrace("%p, %i, %i, %p, %i, 0x%X, %i", name, *name_l, *dirfile, parent,
+      *parent_l, *type, *field_num);
+
+  D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&pa, parent, *parent_l);
+
+  nfields = gd_nmfields_by_type(D, pa, (gd_entype_t)*type);
+  if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) {
+    fl = gd_mfield_list_by_type(D, pa, (gd_entype_t)*type);
+    _GDF_FString(name, name_l, fl[*field_num - 1]);
+  } else
+    *name_l = 0;
+
+  free(pa);
+  dreturnvoid();
+}
+
+/* gd_mvector_list wrapper -- this only returns one field name */
+void F77_FUNC(gdmven, GDMVEN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *field_num)
+{
+  const char** fl;
+  unsigned int nfields;
+  DIRFILE* D;
+  char *pa;
+
+  dtrace("%p, %p, %i, %i", name, name_l, *dirfile, *field_num);
+
+  D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&pa, parent, *parent_l);
+
+  nfields = gd_nmvectors(D, pa);
+  if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) {
+    fl = gd_mvector_list(D, pa);
+    _GDF_FString(name, name_l, fl[*field_num - 1]);
+  } else
+    *name_l = 0;
+
+  free(pa);
+  dreturn("%i", *name_l);
+}
+
+/* gd_madd_lincom wrapper */
+void F77_FUNC(gdmdlc, GDMDLC) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const double *b1,
+    const char *in_field2, const int32_t *in_field2_l, const double *m2,
+    const double *b2, const char *in_field3, const int32_t *in_field3_l,
+    const double *m3, const double *b3)
+{
+  char *pa, *fc;
+  char *in_fields[3] = {NULL, NULL, NULL};
+  double m[3] = {0, 0, 0};
+  double b[3] = {0, 0, 0};
+  const int nf = *n_fields;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, "
+      "%p", *dirfile, parent, *parent_l, field_code, *field_code_l, *n_fields,
+      in_field1, *in_field1_l, m1, b1, in_field2, *in_field2_l, m2, b2,
+      in_field3, *in_field3_l, m3, b3);
+
+  if (nf > 0) {
+    _GDF_CString(in_fields, in_field1, *in_field1_l);
+    m[0] = *m1;
+    b[0] = *b1;
+  }
+
+  if (nf > 1) {
+    _GDF_CString(in_fields + 1, in_field2, *in_field2_l);
+    m[1] = *m2;
+    b[1] = *b2;
+  }
+
+  if (nf > 2) {
+    _GDF_CString(in_fields + 2, in_field3, *in_field3_l);
+    m[2] = *m3;
+    b[2] = *b3;
+  }
+
+  gd_madd_lincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l), nf,
+      (const char**)in_fields, m, b);
+  free(pa);
+  free(fc);
+  free(in_fields[0]);
+  free(in_fields[1]);
+  free(in_fields[2]);
+  dreturnvoid();
+}
+
+void F77_FUNC(gdmdcl, GDMDCL) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+    const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2),
+    const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l,
+    const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3))
+{
+  char *pa, *fc;
+  char *in_fields[3] = {NULL, NULL, NULL};
+#ifdef GD_NO_C99_API
+  double cm[6] = {0, 0, 0, 0, 0, 0};
+  double cb[6] = {0, 0, 0, 0, 0, 0};
+#else
+  double complex cm[3] = {0, 0, 0};
+  double complex cb[3] = {0, 0, 0};
+#endif
+  const int nf = *n_fields;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, "
+      "%p", *dirfile, parent, *parent_l, field_code, *field_code_l, *n_fields,
+      in_field1, *in_field1_l, m1, b1, in_field2, *in_field2_l, m2, b2,
+      in_field3, *in_field3_l, m3, b3);
+
+  if (nf > 0) {
+    _GDF_CString(in_fields, in_field1, *in_field1_l);
+    gd_cp2ca_(cm, 0, m1);
+    gd_cp2ca_(cb, 0, b1);
+  }
+
+  if (nf > 1) {
+    _GDF_CString(in_fields + 1, in_field2, *in_field2_l);
+    gd_cp2ca_(cm, 1, m2);
+    gd_cp2ca_(cb, 1, b2);
+  }
+
+  if (nf > 2) {
+    _GDF_CString(in_fields + 2, in_field3, *in_field3_l);
+    gd_cp2ca_(cm, 2, m3);
+    gd_cp2ca_(cb, 2, b3);
+  }
+
+  gd_madd_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l), nf,
+      (const char**)in_fields, cm, cb);
+  free(pa);
+  free(fc);
+  free(in_fields[0]);
+  free(in_fields[1]);
+  free(in_fields[2]);
+  dreturnvoid();
+}
+
+/* gd_madd_polynom wrapper */
+void F77_FUNC(gdmdpn, GDMDPN) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const double *a1,
+    const double *a2, const double *a3, const double *a4, const double *a5)
+{
+  char *pa, *fc, *inf;
+  double a[6] = {0, 0, 0, 0, 0, 0};
+  const int po = (*poly_ord > 5) ? 5 : *poly_ord;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile,
+      parent, *parent_l, field_code, *field_code_l, *poly_ord, in_field,
+      *in_field_l, a0, a1, a2, a3, a4, a5);
+
+  _GDF_CString(&inf, in_field, *in_field_l);
+
+  switch (po) {
+    case 5:
+      a[5] = *a5;
+    case 4:
+      a[4] = *a4;
+    case 3:
+      a[3] = *a3;
+    case 2:
+      a[2] = *a2;
+    default:
+      a[1] = *a1;
+      a[0] = *a0;
+  }
+
+  gd_madd_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l), po, inf, a);
+  free(pa);
+  free(fc);
+  free(inf);
+  dreturnvoid();
+}
+
+void F77_FUNC(gdmdcp, GDMDCP) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1),
+    const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3),
+    const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5))
+{
+  char *pa, *fc, *inf;
+#ifdef GD_NO_C99_API
+  double ca[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+#else
+  double complex ca[6] = {0, 0, 0, 0, 0, 0};
+#endif
+  int po = *poly_ord;
+  if (po > 5)
+    po = 5;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile,
+      parent, *parent_l, field_code, *field_code_l, *poly_ord, in_field,
+      *in_field_l, a0, a1, a2, a3, a4, a5);
+
+  _GDF_CString(&inf, in_field, *in_field_l);
+
+  switch (po) {
+    case 5:
+      gd_cp2ca_(ca, 5, a5);
+    case 4:
+      gd_cp2ca_(ca, 4, a4);
+    case 3:
+      gd_cp2ca_(ca, 3, a3);
+    case 2:
+      gd_cp2ca_(ca, 2, a2);
+    case 1:
+      gd_cp2ca_(ca, 1, a1);
+      gd_cp2ca_(ca, 0, a0);
+  }
+
+  gd_madd_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l), po, inf, ca);
+  free(pa);
+  free(fc);
+  free(inf);
+  dreturnvoid();
+}
+
+/* gd_madd_linterp wrapper */
+void F77_FUNC(gdmdlt, GDMDLT) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *table, const int32_t *table_l)
+{
+  char *pa, *fc, *in, *tab;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, in_field, *in_field_l, table, *table_l);
+
+  gd_madd_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&tab, table,
+        *table_l));
+  free(pa);
+  free(fc);
+  free(in);
+  free(tab);
+  dreturnvoid();
+}
+
+/* gd_madd_bit wrapper */
+void F77_FUNC(gdmdbt, GDMDBT) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits)
+{
+  char *pa, *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, in_field, *in_field_l, *bitnum, *numbits);
+
+  gd_madd_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in, in_field, *in_field_l), *bitnum, *numbits);
+  free(pa);
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_madd_sbit wrapper */
+void F77_FUNC(gdmdsb, GDMDSB) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits)
+{
+  char *pa, *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, in_field, *in_field_l, *bitnum, *numbits);
+
+  gd_madd_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in, in_field, *in_field_l), *bitnum, *numbits);
+  free(pa);
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_madd_multiply wrapper */
+void F77_FUNC(gdmdmt, GDMDMT) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l)
+{
+  char *pa, *fc, *in1, *in2;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, in_field1, *in_field1_l, in_field2,
+      *in_field2_l);
+
+  gd_madd_multiply(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in1, in_field1, *in_field1_l), _GDF_CString(&in2, in_field2,
+        *in_field2_l));
+
+  free(pa);
+  free(fc);
+  free(in1);
+  free(in2);
+  dreturnvoid();
+}
+
+/* gd_madd_divide wrapper */
+void F77_FUNC(gdmddv, GDMDDV) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l)
+{
+  char *pa, *fc, *in1, *in2;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, in_field1, *in_field1_l, in_field2,
+      *in_field2_l);
+
+  gd_madd_divide(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in1, in_field1, *in_field1_l), _GDF_CString(&in2, in_field2,
+        *in_field2_l));
+
+  free(pa);
+  free(fc);
+  free(in1);
+  free(in2);
+
+  dreturnvoid();
+}
+
+/* gd_madd_recip wrapper */
+void F77_FUNC(gdmdrc, GDMDRC) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend)
+{
+  char *pa, *fc, *in1;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %g", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, in_field, *in_field_l, *dividend);
+
+  gd_madd_recip(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in1, in_field, *in_field_l), *dividend);
+
+  free(pa);
+  free(fc);
+  free(in1);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdmdcr, GDMDCR) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(cdividend))
+{
+  char *pa, *fc, *in1;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %g;%g", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, in_field, *in_field_l, crealp(cdividend),
+      cimagp(cdividend));
+
+#ifdef GD_NO_C99_API
+  gd_madd_crecip89(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in1, in_field, *in_field_l), cdividend);
+#else
+  gd_madd_crecip(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in1, in_field, *in_field_l), *cdividend);
+#endif
+
+  free(pa);
+  free(fc);
+  free(in1);
+
+  dreturnvoid();
+}
+
+/* gd_madd_phase wrapper */
+void F77_FUNC(gdmdph, GDMDPH) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift)
+{
+  char *pa, *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, in_field, *in_field_l, *shift);
+
+  gd_madd_phase(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in, in_field, *in_field_l), *shift);
+
+  free(pa);
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_add_const wrapper */
+void F77_FUNC(gdadco, GDADCO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type,
+    const int32_t *data_type, const void *value, const int32_t *fragment_index)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %i, %i, %p, %i", *dirfile, field_code, *field_code_l,
+      *const_type, *data_type, value, *fragment_index);
+
+  gd_add_const(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (gd_type_t)*const_type, (gd_type_t)*data_type, value,
+      *fragment_index);
+
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_madd_const wrapper */
+void F77_FUNC(gdmdco, GDMDCO) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type,
+    const int32_t *data_type, const void *value)
+{
+  char *pa, *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %i, %p", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, *const_type, *data_type, value);
+
+  gd_madd_const(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      (gd_type_t)*const_type, (gd_type_t)*data_type, value);
+
+  free(pa);
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_add_carray wrapper */
+void F77_FUNC(gdadca, GDADCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type, int32_t *array_len,
+    const int32_t *data_type, const void *value, const int32_t *fragment_index)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %x, %i, %x, %p, %i", *dirfile, field_code,
+      *field_code_l, *const_type, *array_len, *data_type, value,
+      *fragment_index);
+
+  gd_add_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (gd_type_t)*const_type, *array_len,
+      (gd_type_t)*data_type, value, *fragment_index);
+
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_madd_carray wrapper */
+void F77_FUNC(gdmdca, GDMDCA) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type,
+    const int32_t *array_len, const int32_t *data_type, const void *value)
+{
+  char *pa, *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %x, %i, %x, %p", *dirfile, parent, *parent_l,
+      field_code, *field_code_l, *const_type, *array_len, *data_type, value);
+
+  gd_madd_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      (gd_type_t)*const_type, *array_len, (gd_type_t)*data_type, value);
+
+  free(pa);
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_add_string wrapper */
+void F77_FUNC(gdadst, GDADST) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *value, const int32_t *value_l,
+    const int32_t *fragment_index)
+{
+  char *fc, *va;
+
+  dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, value,
+      *value_l, *fragment_index);
+
+  gd_add_string(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&va, value, *value_l), *fragment_index);
+
+  free(fc);
+  free(va);
+  dreturnvoid();
+}
+
+/* gd_madd_string wrapper */
+void F77_FUNC(gdmdst, GDMDST) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *value, const int32_t *value_l)
+{
+  char *pa, *fc, *va;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l, field_code,
+      *field_code_l, value, *value_l);
+
+  gd_madd_string(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&va, value, *value_l));
+
+  free(pa);
+  free(fc);
+  free(va);
+  dreturnvoid();
+}
+
+/* gd_add_spec wrapper */
+void F77_FUNC(gdadsp, GDADSP) (const int32_t *dirfile, const char *spec,
+    const int32_t *spec_l, const int32_t *fragment_index)
+{
+  char *sp;
+
+  dtrace("%i, %p, %i, %i", *dirfile, spec, *spec_l, *fragment_index);
+
+  gd_add_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(&sp, spec, *spec_l),
+      *fragment_index);
+
+  free(sp);
+  dreturnvoid();
+}
+
+/* gd_madd_spec wrapper */
+void F77_FUNC(gdmdsp, GDMDSP) (const int32_t *dirfile, const char *spec,
+    const int32_t *spec_l, const char *parent, const int32_t *parent_l)
+{
+  char *pa, *sp;
+
+  dtrace("%i, %p, %i, %p, %i", *dirfile, spec, *spec_l, parent, *parent_l);
+
+  gd_madd_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(&sp, spec,
+        *spec_l), _GDF_CString(&pa, parent, *parent_l));
+
+  free(pa);
+  free(sp);
+
+  dreturnvoid();
+}
+
+/* gd_get_constant wrapper */
+void F77_FUNC(gdgtco, GDGTCO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *return_type, void *data_out)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %i, %p", *dirfile, field_code, *field_code_l,
+      *return_type, data_out);
+
+  gd_get_constant(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (gd_type_t)*return_type, data_out);
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_get_carray wrapper */
+void F77_FUNC(gdgtca, GDGTCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *return_type, void *data_out)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l,
+      *return_type, data_out);
+
+  gd_get_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (gd_type_t)*return_type, data_out);
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_get_carray_slice wrapper */
+void F77_FUNC(gdgcas, GDGCAS) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *start, const int32_t *n,
+    const int32_t *return_type, void *data_out)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %i, %i, %x, %p", *dirfile, field_code, *field_code_l,
+      *start, *n, *return_type, data_out);
+
+  gd_get_carray_slice(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), *start - 1, (size_t)*n, (gd_type_t)*return_type,
+      data_out);
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_carray_len wrapper */
+void F77_FUNC(gdcaln, GDCALN) (int32_t *len, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p, %i", len, *dirfile, field_code, *field_code_l);
+
+  *len = gd_carray_len(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_get_string wrapper */
+void F77_FUNC(gdgtst, GDGTST) (int32_t *size, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l, const int32_t *len,
+    char *data_out)
+{
+  char *fc, *out;
+  int l = *len;
+
+  dtrace("%p, %i, %p, %i, %i, %p", size, *dirfile, field_code, *field_code_l,
+      *len, data_out);
+
+  out = (char*)malloc(l + 1);
+
+  *size = gd_get_string(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (size_t)*len, out) - 1;
+
+  _GDF_FString(data_out, &l, out);
+  free(fc);
+  free(out);
+
+  dreturn("%i", *size);
+}
+
+/* gd_put_constant wrapper */
+void F77_FUNC(gdptco, GDPTCO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const void *data_in)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l, *data_type,
+      data_in);
+
+  gd_put_constant(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (gd_type_t)*data_type, data_in);
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_put_carray wrapper */
+void F77_FUNC(gdptca, GDPTCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const void *data_in)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %x, %p", *dirfile, field_code, *field_code_l, *data_type,
+      data_in);
+
+  gd_put_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (gd_type_t)*data_type, data_in);
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_put_carray_slice wrapper */
+void F77_FUNC(gdpcas, GDPCAS) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *start, const int32_t *n,
+    const int32_t *data_type, const void *data_in)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %i, %i, %x, %p", *dirfile, field_code, *field_code_l,
+      *start, *n, *data_type, data_in);
+
+  gd_put_carray_slice(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), *start - 1, (size_t)*n, (gd_type_t)*data_type, data_in);
+  free(fc);
+
+  dreturnvoid();
+}
+
+/* gd_put_string wrapper */
+void F77_FUNC(gdptst, GDPTST) (int32_t *n_wrote, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l, const int32_t *len,
+    const char *data_in)
+{
+  char *fc, *in;
+  dtrace("%p, %i, %p, %i, %i, %p", n_wrote, *dirfile, field_code, *field_code_l,
+      *len, data_in);
+
+  *n_wrote = gd_put_string(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc,
+        field_code, *field_code_l), _GDF_CString(&in, data_in, *len)) - 1;
+  free(fc);
+  free(in);
+  dreturn("%i", *n_wrote);
+}
+
+/* gd_nmfields wrapper */
+void F77_FUNC(gdnmfd, GDNMFD) (int32_t *nfields, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l)
+{
+  char *pa;
+  dtrace("%p, %i, %p, %i", nfields, *dirfile, parent, *parent_l);
+
+  *nfields = gd_nmfields(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l));
+  free(pa);
+  dreturn("%i", *nfields);
+}
+
+/* gd_nmfields_by_type wrapper */
+void F77_FUNC(gdnmft, GDNMFT) (int32_t *nfields, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l, const int32_t *type)
+{
+  char *pa;
+  dtrace("%p, %i, %p, %i, 0x%x", nfields, *dirfile, parent, *parent_l, *type);
+
+  *nfields = gd_nmfields_by_type(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa,
+        parent, *parent_l), (gd_entype_t)*type);
+  free(pa);
+
+  dreturn("%i", *nfields);
+}
+
+/* gd_nmvectors wrapper */
+void F77_FUNC(gdnmve, GDNMVE) (int32_t *nvectors, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l)
+{
+  char *pa;
+
+  dtrace("%p, %i, %p, %i", nvectors, *dirfile, parent, *parent_l);
+
+  *nvectors = gd_nmvectors(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l));
+  free(pa);
+
+  dreturn("%i", *nvectors);
+}
+
+/* gd_discard wrapper */
+void F77_FUNC(gddscd, GDDSCD) (const int32_t *dirfile)
+{
+  dtrace("%i", *dirfile);
+
+  if (*dirfile != 0) {
+    gd_discard(_GDF_GetDirfile(*dirfile));
+
+    _GDF_ClearDirfile(*dirfile);
+  }
+
+  dreturnvoid();
+}
+
+/* gd_cbopen wrapper */
+void F77_FUNC(gdcopn, GDCOPN) (int32_t *dirfile, const char *dirfilename,
+    const int32_t *dirfilename_l, const int32_t *flags,
+    const _GDF_callback_t callback)
+{
+  const struct _GDF_callback_container temp = { callback };
+  DIRFILE *D;
+  char *out;
+
+  dtrace("%p, %p, %i, %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);
+
+  /* save the callback */
+  f77callbacks[*dirfile].func = callback;
+  /* and tell getdata its new location */
+  gd_parser_callback(D, _GDF_Callback, f77callbacks + *dirfile);
+
+  free(out);
+  dreturn("%i", *dirfile);
+}
+
+/* gd_parser_callback wrapper */
+void F77_FUNC(gdclbk, GDCLBK) (const int32_t *dirfile,
+    const _GDF_callback_t callback)
+{
+  dtrace("%i, %p", *dirfile, callback);
+
+  /* ensure *dirfile is sane */
+  if (*dirfile < 0 || *dirfile >= GDF_N_DIRFILES) {
+    dreturnvoid();
+    return;
+  }
+
+  /* we only have to modify GetData's callback pointer if f77callbacks is
+   * NULL for this dirfile (inidicating no previous callback); otherwise, just
+   * update the saved callback pointer */
+  if (f77callbacks[*dirfile].func == NULL) {
+    f77callbacks[*dirfile].func = callback;
+    gd_parser_callback(_GDF_GetDirfile(*dirfile), _GDF_Callback,
+        f77callbacks + *dirfile);
+  } else
+    f77callbacks[*dirfile].func = callback;
+
+  dreturnvoid();
+}
+
+/* deregister a callback function (ie. gd_parser_callback(..., NULL) */
+void F77_FUNC(gdnocb, GDNOCB) (const int32_t *dirfile)
+{
+  dtrace("%i", *dirfile);
+
+  /* ensure *dirfile is sane */
+  if (*dirfile >= 0 && *dirfile < GDF_N_DIRFILES) {
+    f77callbacks[*dirfile].func = NULL;
+    gd_parser_callback(_GDF_GetDirfile(*dirfile), NULL, NULL);
+  }
+
+  dreturnvoid();
+}
+
+/* gd_alter_bit wrapper */
+void F77_FUNC(gdalbt, GDALBT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits)
+{
+  char *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, *bitnum, *numbits);
+
+  gd_alter_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *bitnum,
+      *numbits);
+
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_alter_sbit wrapper */
+void F77_FUNC(gdalsb, GDALSB) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits)
+{
+  char *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, *bitnum, *numbits);
+
+  gd_alter_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *bitnum,
+      *numbits);
+
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_alter_const wrapper */
+void F77_FUNC(gdalco, GDALCO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %i", *dirfile, field_code, *field_code_l, *const_type);
+
+  gd_alter_const(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (gd_type_t)*const_type);
+
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_alter_carray wrapper */
+void F77_FUNC(gdalca, GDALCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type,
+    const int32_t *array_len)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %x, %i", *dirfile, field_code, *field_code_l, *const_type,
+      *array_len);
+
+  gd_alter_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), (gd_type_t)*const_type, (size_t)*array_len);
+
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_alter_lincom wrapper */
+void F77_FUNC(gdallc, GDALLC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const double *b1,
+    const char *in_field2, const int32_t *in_field2_l, const double *m2,
+    const double *b2, const char *in_field3, const int32_t *in_field3_l,
+    const double *m3, const double *b3)
+{
+  char *fc = NULL;
+  char *in_fields[3] = {NULL, NULL, NULL};
+  double m[3] = {0, 0, 0};
+  double b[3] = {0, 0, 0};
+  const int nf = *n_fields;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g, %g, %p, %i, %g, %g, %p, %i, %g, %g",
+      *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l,
+      *m1, *b1, in_field2, *in_field2_l, *m2, *b2, in_field3, *in_field3_l, *m3,
+      *b3);
+
+  if (nf > 0) {
+    _GDF_CString(in_fields, in_field1, *in_field1_l);
+    m[0] = *m1;
+    b[0] = *b1;
+  }
+
+  if (nf > 1) {
+    _GDF_CString(in_fields + 1, in_field2, *in_field2_l);
+    m[1] = *m2;
+    b[1] = *b2;
+  }
+
+  if (nf > 2) {
+    _GDF_CString(in_fields + 2, in_field3, *in_field3_l);
+    m[2] = *m3;
+    b[2] = *b3;
+  }
+
+  gd_alter_lincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), nf, (const char**)in_fields, m, b);
+  free(fc);
+  free(in_fields[0]);
+  free(in_fields[1]);
+  free(in_fields[2]);
+  dreturnvoid();
+}
+
+/* gd_alter_clincom wrapper */
+void F77_FUNC(gdalcl, GDALCL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+    const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2),
+    const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l,
+    const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3))
+{
+  char *fc;
+  char *in_fields[3] = {NULL, NULL, NULL};
+#ifdef GD_NO_C99_API
+  double cm[6] = {0, 0, 0, 0, 0, 0};
+  double cb[6] = {0, 0, 0, 0, 0, 0};
+#else
+  double complex cm[3] = {0, 0, 0};
+  double complex cb[3] = {0, 0, 0};
+#endif
+  const int nf = *n_fields;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, %p",
+      *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l,
+      m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3);
+
+  if (nf > 0) {
+    _GDF_CString(in_fields, in_field1, *in_field1_l);
+    gd_cp2ca_(cm, 0, m1);
+    gd_cp2ca_(cb, 0, b1);
+  }
+
+  if (nf > 1) {
+    _GDF_CString(in_fields + 1, in_field2, *in_field2_l);
+    gd_cp2ca_(cm, 1, m2);
+    gd_cp2ca_(cb, 1, b2);
+  }
+
+  if (nf > 2) {
+    _GDF_CString(in_fields + 2, in_field3, *in_field3_l);
+    gd_cp2ca_(cm, 2, m3);
+    gd_cp2ca_(cb, 2, b3);
+  }
+
+  gd_alter_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), nf, (const char**)in_fields, cm, cb);
+  free(fc);
+  free(in_fields[0]);
+  free(in_fields[1]);
+  free(in_fields[2]);
+  dreturnvoid();
+}
+
+/* gd_alter_polynom wrapper */
+void F77_FUNC(gdalpn, GDALPN) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const double *a1,
+    const double *a2, const double *a3, const double *a4, const double *a5)
+{
+  char *fc, *inf;
+  double a[6] = {0, 0, 0, 0, 0, 0};
+  const int po = (*poly_ord > 5) ? 5 : *poly_ord;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %g, %g, %p, %p, %p, %p", *dirfile, field_code,
+      *field_code_l, *poly_ord, in_field, *in_field_l, *a0, *a1, a2, a3, a4,
+      a5);
+
+  _GDF_CString(&inf, in_field, *in_field_l);
+
+  switch (po) {
+    case 5:
+      a[5] = *a5;
+    case 4:
+      a[4] = *a4;
+    case 3:
+      a[3] = *a3;
+    case 2:
+      a[2] = *a2;
+    default:
+      a[1] = *a1;
+      a[0] = *a0;
+  }
+
+  gd_alter_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), po, inf, a);
+  free(fc);
+  free(inf);
+  dreturnvoid();
+}
+
+/* gd_alter_cpolynom wrapper */
+void F77_FUNC(gdalcp, GDALCP) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1),
+    const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3),
+    const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5))
+{
+  char *fc, *inf;
+#ifdef GD_NO_C99_API
+  double ca[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+#else
+  double complex ca[6] = {0, 0, 0, 0, 0, 0};
+#endif
+  const int po = (*poly_ord > 5) ? 5 : *poly_ord;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, field_code,
+      *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5);
+
+  _GDF_CString(&inf, in_field, *in_field_l);
+
+  switch (po) {
+    case 5:
+      gd_cp2ca_(ca, 5, a5);
+    case 4:
+      gd_cp2ca_(ca, 4, a4);
+    case 3:
+      gd_cp2ca_(ca, 3, a3);
+    case 2:
+      gd_cp2ca_(ca, 2, a2);
+    default:
+      gd_cp2ca_(ca, 1, a1);
+      gd_cp2ca_(ca, 0, a0);
+  }
+
+  gd_alter_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), po, inf, ca);
+  free(fc);
+  free(inf);
+  dreturnvoid();
+}
+
+/* gd_alter_multiply wrapper */
+void F77_FUNC(gdalmt, GDALMT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l)
+{
+  char *fc, *in1, *in2;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i", *dirfile, field_code, *field_code_l,
+      in_field1, *in_field1_l, in_field2, *in_field2_l);
+
+  gd_alter_multiply(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l),
+      _GDF_CString(&in2, in_field2, *in_field2_l));
+
+  free(fc);
+  free(in1);
+  free(in2);
+  dreturnvoid();
+}
+
+/* gd_alter_divide wrapper */
+void F77_FUNC(gdaldv, GDALDV) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l)
+{
+  char *fc, *in1, *in2;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i", *dirfile, field_code, *field_code_l,
+      in_field1, *in_field1_l, in_field2, *in_field2_l);
+
+  gd_alter_divide(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l),
+      _GDF_CString(&in2, in_field2, *in_field2_l));
+
+  free(fc);
+  free(in1);
+  free(in2);
+
+  dreturnvoid();
+}
+
+/* gd_alter_recip wrapper */
+void F77_FUNC(gdalrc, GDALRC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const double *dividend)
+{
+  char *fc, *in1;
+
+  dtrace("%i, %p, %i, %p, %i, %g", *dirfile, field_code, *field_code_l,
+      in_field1, *in_field1_l, *dividend);
+
+  gd_alter_recip(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l),
+      *dividend);
+
+  free(fc);
+  free(in1);
+
+  dreturnvoid();
+}
+
+void F77_FUNC(gdalcr, GDALCR) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(cdividend))
+{
+  char *fc, *in1;
+
+  dtrace("%i, %p, %i, %p, %i, %g;%g", *dirfile, field_code, *field_code_l,
+      in_field1, *in_field1_l, crealp(cdividend), cimagp(cdividend));
+
+#ifdef GD_NO_C99_API
+  gd_alter_crecip89(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l),
+      cdividend);
+#else
+  gd_alter_crecip(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l),
+      *cdividend);
+#endif
+
+  free(fc);
+  free(in1);
+
+  dreturnvoid();
+}
+
+/* gd_alter_phase wrapper */
+void F77_FUNC(gdalph, GDALPH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift)
+{
+  char *fc, *in;
+
+  dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, *shift);
+
+  gd_alter_phase(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *shift);
+
+  free(fc);
+  free(in);
+  dreturnvoid();
+}
+
+/* gd_encoding wrapper */
+void F77_FUNC(gdgenc, GDGENC) (int32_t *encoding, const int32_t *dirfile,
+    const int32_t *fragment)
+{
+  *encoding = gd_encoding(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* gd_endianness wrapper */
+void F77_FUNC(gdgend, GDGEND) (int32_t *endianness, const int32_t *dirfile,
+    const int32_t *fragment)
+{
+  *endianness = gd_endianness(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* dirfilename wrapper */
+void F77_FUNC(gdname, GDNAME) (char *name, int32_t *name_l,
+    const int32_t *dirfile)
+{
+  const char *dn = gd_dirfilename(_GDF_GetDirfile(*dirfile));
+  _GDF_FString(name, name_l, dn);
+}
+
+/* gd_parent_fragment wrapper */
+void F77_FUNC(gdpfrg, GDPFRG) (int32_t *parent, const int32_t *dirfile,
+    const int32_t *fragment)
+{
+  *parent = gd_parent_fragment(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* gd_alter_protection wrapper */
+void F77_FUNC(gdaprt, GDAPRT) (const int32_t *dirfile,
+    const int32_t *protection_level, const int32_t *fragment)
+{
+  gd_alter_protection(_GDF_GetDirfile(*dirfile), *protection_level, *fragment);
+}
+
+/* gd_protection wrapper */
+void F77_FUNC(gdgprt, GDGPRT) (int32_t *protection_level,
+    const int32_t *dirfile, const int32_t *fragment)
+{
+  *protection_level = gd_protection(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* gd_raw_filename wrapper */
+void F77_FUNC(gdrwfn, GDRWFN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  char *fc, *fn;
+
+  dtrace("%p, %i, %i, %p, %i", name, *name_l, *dirfile, field_code,
+      *field_code_l);
+
+  fn = gd_raw_filename(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+
+  _GDF_FString(name, name_l, fn);
+
+  free(fc);
+  free(fn);
+
+  dreturn("%i", *name_l);
+}
+
+/* gd_reference wrapper */
+void F77_FUNC(gdrefe, GDREFE) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+  const char *ref;
+
+  dtrace("%p, %p, %i, %p, %i", name, name_l, *dirfile, field_code,
+      *field_code_l);
+
+  _GDF_CString(&fc, field_code, *field_code_l);
+
+  /* F95 bindings pass an empty string instead of NULL */
+  if (*field_code_l == 0) {
+    free(fc);
+    fc = NULL;
+  }
+
+  ref = gd_reference(_GDF_GetDirfile(*dirfile), fc);
+
+  _GDF_FString(name, name_l, ref);
+
+  free(fc);
+  dreturn("%i", *name_l);
+}
+
+/* gd_alter_encoding wrapper */
+void F77_FUNC(gdaenc, GDAENC) (const int32_t *dirfile, const int32_t *encoding,
+    const int32_t *fragment, const int32_t *recode)
+{
+  gd_alter_encoding(_GDF_GetDirfile(*dirfile), *encoding, *fragment,
+      *recode);
+}
+
+/* gd_alter_endianness wrapper */
+void F77_FUNC(gdaend, GDAEND) (const int32_t *dirfile,
+    const int32_t *endianness, const int32_t *fragment, const int32_t *recode)
+{
+  gd_alter_endianness(_GDF_GetDirfile(*dirfile), *endianness, *fragment,
+      *recode);
+}
+
+/* gd_alter_linterp wrapper */
+void F77_FUNC(gdallt, GDALLT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *table, const int32_t *table_l,
+    const int32_t *recode)
+{
+  char *fc, *in, *tab;
+
+  dtrace("%i, %p, %i, %p, %i, %p %i, %i", *dirfile, field_code, *field_code_l,
+      in_field, *in_field_l, table, *table_l, *recode);
+
+  gd_alter_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
+      _GDF_CString(&tab, table, *table_l), *recode);
+  free(fc);
+  free(in);
+  free(tab);
+  dreturnvoid();
+}
+
+/* gd_alter_raw wrapper */
+void F77_FUNC(gdalrw, GDALRW) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf,
+    const int32_t *recode)
+{
+  char *out;
+
+  dtrace("%i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      *data_type, *spf, *recode);
+
+  gd_alter_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+        *field_code_l), (gd_type_t)(*data_type), (unsigned int)*spf, *recode);
+  free(out);
+  dreturnvoid();
+}
+
+/* gd_alter_spec wrapper */
+void F77_FUNC(gdalsp, GDALSP) (const int32_t *dirfile, const char *spec,
+    const int32_t *spec_l, const int32_t *move)
+{
+  char *sp;
+
+  dtrace("%i, %p, %i, %i", *dirfile, spec, *spec_l, *move);
+
+  gd_alter_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(&sp, spec, *spec_l),
+      *move);
+
+  free(sp);
+  dreturnvoid();
+}
+
+/* gd_delete wrapper */
+void F77_FUNC(gddele, GDDELE) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *flags)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %i", *dirfile, field_code, *field_code_l, *flags);
+
+  gd_delete(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), *flags);
+
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_malter_spec wrapper */
+void F77_FUNC(gdmlsp, GDMLSP) (const int32_t *dirfile, const char *spec,
+    const int32_t *spec_l, const char *parent, const int32_t *parent_l,
+    const int32_t *move)
+{
+  char *sp, *pa;
+
+  dtrace("%i, %p, %i, %p, %i, %i", *dirfile, spec, *spec_l, parent, *parent_l,
+      *move);
+
+  gd_malter_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(&sp, spec,
+        *spec_l), _GDF_CString(&pa, parent, *parent_l), *move);
+
+  free(pa);
+  free(sp);
+  dreturnvoid();
+}
+
+/* gd_move wrapper */
+void F77_FUNC(gdmove, GDMOVE) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *new_fragment,
+    const int32_t *move_data)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      *new_fragment, *move_data);
+
+  gd_move(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), *new_fragment, *move_data);
+
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_rename wrapper */
+void F77_FUNC(gdrenm, GDRENM) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *new_name,
+    const int32_t *new_name_l, const int32_t *move_data)
+{
+  char *fc, *nn;
+
+  dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
+      new_name, *new_name_l, *move_data);
+
+  gd_rename(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&nn, new_name, *new_name_l), *move_data);
+
+  free(nn);
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_uninclude wrapper */
+void F77_FUNC(gduinc, GDUINC) (const int32_t *dirfile, const int32_t *fragment,
+    const int32_t *del)
+{
+  gd_uninclude(_GDF_GetDirfile(*dirfile), *fragment, *del);
+}
+
+/* gd_alter_frameoffset wrapper */
+void F77_FUNC(gdafof, GDAFOF) (const int32_t *dirfile, const int32_t *offset,
+    const int32_t *fragment, const int32_t *recode)
+{
+  gd_alter_frameoffset(_GDF_GetDirfile(*dirfile), *offset, *fragment,
+      *recode);
+}
+
+/* gd_frameoffset wrapper */
+void F77_FUNC(gdgfof, GDGFOF) (int32_t *offset, const int32_t *dirfile,
+    const int32_t *fragment)
+{
+  *offset = gd_frameoffset(_GDF_GetDirfile(*dirfile), *fragment);
+}
+
+/* gd_native_type wrapper */
+void F77_FUNC(gdntyp, GDNTYP) (int32_t *type, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p, %i", type, *dirfile, field_code, *field_code_l);
+
+  *type = gd_native_type(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc,
+        field_code, *field_code_l));
+
+  free(fc);
+  dreturn("%i", *type);
+}
+
+/* returns the value of the comp_scal member */
+void F77_FUNC(gdcscl, GDCSCL) (int32_t *comp_scal, 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);
+
+  D = _GDF_GetDirfile(*dirfile);
+
+  *comp_scal = 0;
+
+  gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E);
+
+  if (!gd_error(D) && (E.field_type == GD_LINCOM_ENTRY ||
+        E.field_type == GD_POLYNOM_ENTRY || E.field_type == GD_RECIP_ENTRY))
+    *comp_scal = E.comp_scal;
+
+  gd_free_entry_strings(&E);
+  free(fc);
+
+  dreturn("%i", *comp_scal);
+}
+
+/* gd_validate wrapper */
+void F77_FUNC(gdvldt, GDVLDT) (int32_t *valid, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p, %i", valid, *dirfile, field_code, *field_code_l);
+
+  *valid = gd_validate(_GDF_GetDirfile(*dirfile),
+      _GDF_CString(&fc, field_code, *field_code_l));
+
+  free(fc);
+  dreturn("%i", *valid);
+}
+
+/* gd_framenum wrapper */
+void F77_FUNC(gdfnum, GDFNUM) (double *framenum, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l, const double *value)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p. %i, %g", framenum, *dirfile, field_code, *field_code_l,
+      *value);
+
+  *framenum = gd_framenum(_GDF_GetDirfile(*dirfile),
+      _GDF_CString(&fc, field_code, *field_code_l), *value);
+
+  free(fc);
+  dreturn("%g", *value);
+}
+
+/* gd_framenum_subset wrapper */
+void F77_FUNC(gdfnss, GDFNSS) (double *framenum, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l, const double *value,
+    const int32_t *start, const int32_t *end)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p, %i, %g, %i, %i", framenum, *dirfile, field_code,
+      *field_code_l, *value, *start, *end);
+
+  *framenum = gd_framenum_subset(_GDF_GetDirfile(*dirfile),
+      _GDF_CString(&fc, field_code, *field_code_l), *value, *start, *end);
+
+  free(fc);
+
+  dreturn("%g", *framenum);
+}
+
+/* retrieve a scalar parameter */
+void F77_FUNC(gdgsca, GDGSCA) (char *scalar, int32_t *scalar_l,
+    int32_t *scalar_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *index)
+{
+  char *fc;
+  int ok = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  dtrace("%p, %p, %p, %i, %p, %i, %i", scalar, scalar_l, scalar_index,
+      *dirfile, field_code, *field_code_l, *index);
+
+  D = _GDF_GetDirfile(*dirfile);
+
+  gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E);
+
+  free(fc);
+
+  if (!gd_error(D) && *index > 0) {
+    ok = 1;
+    switch (E.field_type) {
+      case GD_NO_ENTRY:
+      case GD_ALIAS_ENTRY:
+      case GD_LINTERP_ENTRY:
+      case GD_MULTIPLY_ENTRY:
+      case GD_DIVIDE_ENTRY:
+      case GD_INDEX_ENTRY:
+      case GD_CONST_ENTRY:
+      case GD_CARRAY_ENTRY:
+      case GD_STRING_ENTRY:
+        ok = 0;
+        break;
+      case GD_LINCOM_ENTRY:
+        if (*index > GD_MAX_LINCOM + E.EN(lincom,n_fields) ||
+            (*index > E.EN(lincom,n_fields) && *index <= GD_MAX_LINCOM))
+        {
+          ok = 0;
+        }
+        break;
+      case GD_POLYNOM_ENTRY:
+        if (*index > E.EN(polynom,poly_ord) + 1)
+          ok = 0;
+        break;
+      case GD_BIT_ENTRY:
+      case GD_SBIT_ENTRY:
+      case GD_MPLEX_ENTRY:
+        if (*index > 2)
+          ok = 0;
+        break;
+      case GD_RECIP_ENTRY:
+      case GD_RAW_ENTRY:
+      case GD_PHASE_ENTRY:
+      case GD_WINDOW_ENTRY:
+        if (*index > 1)
+          ok = 0;
+        break;
+    }
+  }
+
+  if (ok && E.scalar[*index - 1] == NULL)
+    ok = 0;
+
+  _GDF_FString(scalar, scalar_l, (ok) ? E.scalar[*index - 1] : "");
+  GDF_SCIND_C2F(*scalar_index, E.scalar_ind[*index - 1]);
+
+  gd_free_entry_strings(&E);
+
+  dreturnvoid();
+}
+
+/* set a scalar parameter */
+void F77_FUNC(gdasca, GDASCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *index, const char *scalar,
+    const int32_t *scalar_l, int32_t *scalar_index, int32_t *recode)
+{
+  int ok = 1;
+  char *fc;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l,
+      *index, scalar, *scalar_l, *scalar_index, *recode);
+
+  D = _GDF_GetDirfile(*dirfile);
+
+  if (*index < 1) {
+    dreturnvoid();
+    return;
+  }
+
+  if (gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E) == -1) {
+    dreturnvoid();
+    return;
+  }
+
+  switch (E.field_type) {
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_LINTERP_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+      ok = 0;
+      break;
+    case GD_LINCOM_ENTRY:
+      if (*index > GD_MAX_LINCOM + E.EN(lincom,n_fields) ||
+          (*index > E.EN(lincom,n_fields) && *index <= GD_MAX_LINCOM))
+      {
+        ok = 0;
+      }
+      break;
+    case GD_POLYNOM_ENTRY:
+      if (*index > E.EN(polynom,poly_ord) + 1)
+        ok = 0;
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (*index > 2)
+        ok = 0;
+      break;
+    case GD_RAW_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_RECIP_ENTRY:
+    case GD_WINDOW_ENTRY:
+      if (*index > 1)
+        ok = 0;
+      break;
+  }
+
+  if (!ok || gd_error(D)) {
+    dreturnvoid();
+    return;
+  }
+
+  free(E.scalar[*index - 1]);
+  _GDF_CString(E.scalar + *index - 1, scalar, *scalar_l);
+  GDF_SCIND_F2C(E.scalar_ind[*index - 1], *scalar_index);
+
+  gd_alter_entry(D, fc, &E, *recode);
+
+  gd_free_entry_strings(&E);
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_invalid_dirfile wrapper */
+void F77_FUNC(gdinvd, GDINVD) (int32_t *dirfile)
+{
+  dtrace("%p", dirfile);
+
+  *dirfile = _GDF_SetDirfile(gd_invalid_dirfile());
+
+  dreturn("%i", *dirfile);
+}
+
+/* gd_dirfile_standards wrapper */
+void F77_FUNC(gdstdv, GDSTDV) (int32_t *vers, const int32_t *dirfile)
+{
+  dtrace("%p, %i", vers, *dirfile);
+
+  *vers = gd_dirfile_standards(_GDF_GetDirfile(*dirfile), *vers);
+
+  dreturn("%i", *vers);
+}
+
+/* gd_seek wrapper */
+void F77_FUNC(gdseek, GDSEEK) (int32_t *pos, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l,
+    const int32_t *frame_num, const int32_t *sample_num, const int32_t *flags)
+{
+  char *fc;
+  dtrace("%p, %i, %p, %i, %i, %i, 0x%x", pos, *dirfile, field_code,
+      *field_code_l, *frame_num, *sample_num, *flags);
+
+  *pos = (int)gd_seek(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), *frame_num, *sample_num, *flags);
+
+  free(fc);
+  dreturn("%i", *pos);
+}
+
+/* gd_tell wrapper */
+void F77_FUNC(gdtell, GDTELL) (int32_t *pos, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+  dtrace("%p, %i, %p, %i", pos, *dirfile, field_code, *field_code_l);
+
+  *pos = (int)gd_tell(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+
+  free(fc);
+  dreturn("%i", *pos);
+}
+
+/* gd_constants wrapper -- this only returns one value */
+void F77_FUNC(gdcons, GDCONS) (void *value, const int32_t *dirfile,
+    const int32_t *return_type, const int32_t *field_num)
+{
+  const void *v;
+
+  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);
+
+  if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) {
+    v = gd_constants(D, (gd_type_t)*return_type);
+    if (!gd_error(D))
+      memcpy(value, (char*)v + (*field_num - 1) * GD_SIZE(*return_type),
+          GD_SIZE(*return_type));
+  }
+  dreturnvoid();
+}
+
+/* gd_mconstants wrapper -- this only returns one value */
+void F77_FUNC(gdmcos, GDMCOS) (void *value, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l, const int32_t *return_type,
+    const int32_t *field_num)
+{
+  const void *v;
+  DIRFILE *D;
+  char *pa;
+  unsigned int nfields;
+
+  dtrace("%p, %i, %p, %i, 0x%x, %i", value, *dirfile, parent, *parent_l,
+      *return_type, *field_num);
+
+  D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&pa, parent, *parent_l);
+  nfields = gd_nmfields_by_type(D, pa, GD_CONST_ENTRY);
+
+  if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) {
+    v = gd_mconstants(D, pa, (gd_type_t)*return_type);
+    if (!gd_error(D))
+      memcpy(value, (char*)v + (*field_num - 1) * GD_SIZE(*return_type),
+          GD_SIZE(*return_type));
+  }
+
+  free(pa);
+  dreturnvoid();
+}
+
+/* gd_strings wrapper -- this only returns one value */
+void F77_FUNC(gdstrs, GDSTRS) (char *value, int32_t *value_l,
+    const int32_t *dirfile, const int32_t *field_num)
+{
+  const char **v;
+
+  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);
+
+  if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) {
+    v = gd_strings(D);
+    _GDF_FString(value, value_l, gd_error(D) ? "" : v[*field_num - 1]);
+  } else
+    *value_l = 0;
+
+  dreturn("%i", *value_l);
+}
+
+/* gd_mstrings wrapper -- this only returns one value */
+void F77_FUNC(gdmsts, GDMSTS) (void *value, int32_t *value_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *field_num)
+{
+  const char **v;
+  char *pa;
+  DIRFILE *D;
+  unsigned int nfields;
+
+  dtrace("%p, %i, %i, %p, %i, %i", value, *value_l, *dirfile, parent,
+      *parent_l, *field_num);
+
+  D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&pa, parent, *parent_l);
+  nfields = gd_nmfields_by_type(D, pa, GD_STRING_ENTRY);
+
+  if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) {
+    v = gd_mstrings(D, pa);
+    _GDF_FString((char*)value, value_l,
+        gd_error(D) ? "" : ((char**)v)[*field_num - 1]);
+  } else
+    *value_l = 0;
+
+  free(pa);
+  dreturnvoid();
+}
+
+/* Return the maximum string value length */
+void F77_FUNC(gdstrx, GDSTRX) (int32_t *max, const int32_t *dirfile)
+{
+  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);
+
+  if (!gd_error(D)) {
+    v = gd_strings(D);
+
+    for (i = 0; i < nfields; ++i)
+      if (strlen(v[i]) > len)
+        len = strlen(v[i]);
+  }
+
+  *max = (int)len;
+
+  dreturn("%i", *max);
+}
+
+/* Return the maximum meta string value length */
+void F77_FUNC(gdmstx, GDMSTX) (int32_t *max, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l)
+{
+  const char **v;
+  size_t len = 0;
+  DIRFILE *D;
+  char *pa;
+  unsigned int i, nfields;
+
+  dtrace("%p, %i, %p, %i", max, *dirfile, parent, *parent_l);
+
+  D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&pa, parent, *parent_l);
+  nfields = gd_nmfields_by_type(D, pa, GD_STRING_ENTRY);
+
+  if (!gd_error(D)) {
+    v = gd_mstrings(D, pa);
+
+    for (i = 0; i < nfields; ++i)
+      if (strlen(v[i]) > len)
+        len = strlen(v[i]);
+  }
+
+  *max = (int)len;
+
+  free(pa);
+
+  dreturn("%i", *max);
+}
+
+/* gd_add_alias wrapper */
+void F77_FUNC(gdadal, GDADAL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *target, const int32_t *target_l,
+    const int32_t *fragment_index)
+{
+  char *tg, *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
+      target, *target_l, *fragment_index);
+
+  gd_add_alias(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&tg, target, *target_l), *fragment_index);
+
+  free(fc);
+  free(tg);
+
+  dreturnvoid();
+}
+
+/* gd_add_window wrapper */
+void F77_FUNC(gdadwd, GDADWD) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold,
+    const int32_t *fragment_index)
+{
+  char *in, *cf, *fc;
+  gd_triplet_t t;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %i", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, check_field, *check_field_l,
+      *windop, threshold, *fragment_index);
+
+  t = _GDF_SetTriplet((gd_windop_t)*windop, threshold);
+
+  gd_add_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
+      _GDF_CString(&cf, check_field, *check_field_l), (gd_windop_t)*windop, t,
+      *fragment_index);
+
+  free(fc);
+  free(cf);
+  free(in);
+
+  dreturnvoid();
+}
+
+/* gd_madd_window wrapper */
+void F77_FUNC(gdmdwd, GDMDWD) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold)
+{
+  char *in, *cf, *fc, *pa;
+  gd_triplet_t t;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i, %i, %p", *dirfile, parent,
+      *parent_l, field_code, *field_code_l, in_field, *in_field_l, check_field,
+      *check_field_l, *windop, threshold);
+
+  t = _GDF_SetTriplet((gd_windop_t)*windop, threshold);
+
+  gd_madd_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), _GDF_CString(&fc, field_code, *field_code_l),
+      _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&cf, check_field,
+        *check_field_l), (gd_windop_t)*windop, t);
+
+  free(pa);
+  free(fc);
+  free(cf);
+  free(in);
+
+  dreturnvoid();
+}
+
+/* gd_add_mplex wrapper */
+void F77_FUNC(gdadmx, GDADMX) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *count_field,
+    const int32_t *count_field_l, const int32_t *val, const int32_t *max,
+    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);
+
+  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,
+      *fragment_index);
+
+  free(fc);
+  free(cf);
+  free(in);
+
+  dreturnvoid();
+}
+
+/* gd_madd_mplex wrapper */
+void F77_FUNC(gdmdmx, GDMDMX) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *count_field,
+    const int32_t *count_field_l, const int32_t *val, const int32_t *max)
+{
+  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);
+
+  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);
+
+  free(pa);
+  free(fc);
+  free(cf);
+  free(in);
+
+  dreturnvoid();
+}
+
+/* gd_alias_target */
+void F77_FUNC(gdatrg, GDATRG) (char *target, int32_t *target_l,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  const char *targ;
+  char *fc;
+
+  dtrace("%p, %i, %i, %p, %i", target, *target_l, *dirfile, field_code,
+      *field_code_l);
+
+  targ = gd_alias_target(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc,
+        field_code, *field_code_l));
+
+  _GDF_FString(target, target_l, targ);
+
+  free(fc);
+
+  dreturn("%i", *target_l);
+}
+
+/* Return the maximum alias length */
+void F77_FUNC(gdalsx, GDALSX) (int32_t *max, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  const char **al;
+  size_t len = 0;
+  char *fc;
+  unsigned int i, nalias;
+
+  dtrace("%p, %i, %p, %i", max, *dirfile, field_code, *field_code_l);
+
+  DIRFILE* D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&fc, field_code, *field_code_l);
+
+  nalias = gd_naliases(D, fc);
+
+  if (!gd_error(D)) {
+    al = gd_aliases(D, fc);
+
+    for (i = 0; i < nalias; ++i)
+      if (strlen(al[i]) > len)
+        len = strlen(al[i]);
+  }
+
+  *max = len;
+  free(fc);
+  dreturn("%zu", len);
+}
+
+/* gd_naliases */
+void F77_FUNC(gdnals, GDNALS) (int32_t *nalias, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p, %i", nalias, *dirfile, field_code, *field_code_l);
+
+  *nalias = gd_naliases(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+
+  free(fc);
+  dreturn("%i", *nalias);
+}
+
+
+/* gd_aliases -- this only returns one alias */
+void F77_FUNC(gdalss, GDALSS) (char *alias, int32_t *alias_l,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l,
+    const int32_t *num)
+{
+  const char **al;
+  char *fc;
+  unsigned int nalias;
+
+  dtrace("%p, %i, %i, %p, %i, %i", alias, *alias_l, *dirfile, field_code,
+      *field_code_l, *num);
+
+  DIRFILE* D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&fc, field_code, *field_code_l);
+
+  nalias = gd_naliases(D, fc);
+
+  if (!gd_error(D) && *num > 0 && *num <= (int)nalias) {
+    al = gd_aliases(D, fc);
+    _GDF_FString(alias, alias_l, al[*num - 1]);
+  } else 
+    *alias_l = 0;
+
+  free(fc);
+  dreturn("%i", *alias_l);
+}
+
+/* gd_alter_affixes */
+void F77_FUNC(gdaafx, GDAAFX) (const int32_t *dirfile, const int32_t *index,
+    const char *prefix, const int32_t *prefix_l, const char *suffix,
+    const int32_t *suffix_l)
+{
+  char *px, *sx;
+
+  dtrace("%i, %i, %p, %i, %p, %i", *dirfile, *index, prefix, *prefix_l,
+      suffix, *suffix_l);
+
+  gd_alter_affixes(_GDF_GetDirfile(*dirfile), *index, _GDF_CString(&px, prefix,
+        *prefix_l), _GDF_CString(&sx, suffix, *suffix_l));
+
+  free(sx);
+  free(px);
+
+  dreturnvoid();
+}
+
+/* gd_alter_window */
+void F77_FUNC(gdalwd, GDALWD) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold)
+{
+  char *fc, *in, *cf;
+  gd_triplet_t t;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p", *dirfile, field_code,
+      *field_code_l, in_field, *in_field_l, check_field, *check_field_l,
+      *windop, threshold);
+
+  t = _GDF_SetTriplet((gd_windop_t)*windop, threshold);
+
+  gd_alter_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
+      _GDF_CString(&cf, check_field, *check_field_l), (gd_windop_t)*windop, t);
+
+  free(cf);
+  free(in);
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_alter_mplex */
+void F77_FUNC(gdalmx, GDALMX) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *count_field,
+    const int32_t *count_field_l, const int32_t *val, const int32_t *max)
+{
+  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);
+
+  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);
+
+  free(cf);
+  free(in);
+  free(fc);
+  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)
+{
+  char *px, *sx;
+
+  dtrace("%p, %i, %p, %i, %i, %i", prefix, *prefix_l, suffix, *suffix_l,
+      *dirfile, *index);
+
+  if (!gd_fragment_affixes(_GDF_GetDirfile(*dirfile), *index, &px, &sx)) {
+    _GDF_FString(prefix, prefix_l, px);
+    _GDF_FString(suffix, suffix_l, sx);
+    free(px);
+    free(sx);
+  } else
+    *prefix_l = *suffix_l = 0;
+
+  dreturnvoid();
+}
+
+/* gd_hidden */
+void F77_FUNC(gdhidn, GDHIDN) (int32_t *result, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%p, %i, %p, %i", result, *dirfile, field_code, *field_code_l);
+
+  *result = gd_hidden(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+
+  free(fc);
+  dreturn("%i", *result);
+}
+
+/* gd_hide */
+void F77_FUNC(gdhide, GDHIDE) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l);
+
+  gd_hide(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_unhide */
+void F77_FUNC(gduhid, GDUHID) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  char *fc;
+
+  dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l);
+
+  gd_unhide(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+        *field_code_l));
+
+  free(fc);
+  dreturnvoid();
+}
+
+/* gd_madd_alias wrapper */
+void F77_FUNC(gdmdal, GDMDAL) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *target, const int32_t *target_l)
+{
+  char *pa, *tg, *fc;
+
+  dtrace("%i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l, field_code,
+      *field_code_l, target, *target_l);
+
+  gd_madd_alias(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l),
+      _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&tg, target,
+        *target_l));
+
+  free(fc);
+  free(tg);
+  free(pa);
+
+  dreturnvoid();
+}
+
+/* gd_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,
+    const int32_t *prefix_l, const char *suffix, const int32_t *suffix_l,
+    const int32_t *flags)
+{
+  char *fi, *px, *sx;
+
+  dtrace("%i, %p, %i, %i, %p, %i, %p, %i, %i", *dirfile, file, *file_l,
+      *fragment_index, prefix, *prefix_l, suffix, *suffix_l, *flags);
+
+  gd_include_affix(_GDF_GetDirfile(*dirfile), _GDF_CString(&fi, file, *file_l),
+      *fragment_index, _GDF_CString(&px, prefix, *prefix_l), _GDF_CString(&sx,
+        suffix, *suffix_l), *flags);
+
+  free(sx);
+  free(px);
+  free(fi);
+  dreturnvoid();
+}
+
+/* gd_sync wrapper */
+void F77_FUNC(gdsync, GDSYNC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l);
+
+  if (*field_code_l == 0)
+    gd_sync(_GDF_GetDirfile(*dirfile), NULL);
+  else {
+    char *out;
+    gd_sync(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l));
+    free(out);
+  }
+
+  dreturnvoid();
+}
+
+/* gd_raw_close wrapper */
+void F77_FUNC(gdrclo, GDRCLO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l)
+{
+  dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l);
+
+  if (*field_code_l == 0)
+    gd_sync(_GDF_GetDirfile(*dirfile), NULL);
+  else {
+    char *out;
+    gd_raw_close(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
+          *field_code_l));
+    free(out);
+  }
+
+  dreturnvoid();
+}
+
+/* gd_strtok wrapper */
+void F77_FUNC(gdtoke, GDTOKE) (char *toke, int32_t *toke_l,
+    const int32_t *dirfile, const char *string, const int32_t *string_l)
+{
+  char *token, *st = NULL;
+  DIRFILE *D;
+
+  dtrace("%p, %p, %i, %p, %i", toke, toke_l, *dirfile, string, *string_l);
+
+  D = _GDF_GetDirfile(*dirfile);
+  if (*string_l > 0)
+    _GDF_CString(&st, string, *string_l);
+
+  token = gd_strtok(D, st);
+  free(st);
+
+  _GDF_FString(toke, toke_l, token);
+  free(token);
+
+  dreturn("%i", *toke_l);
+}
+
+/* gd_desync wrapper */
+void F77_FUNC(gddsyn, GDDSYN) (int32_t *desync, const int32_t *dirfile,
+    const int32_t *flags)
+{
+  dtrace("%p, %i, %i", desync, *dirfile, *flags);
+
+  *desync = gd_desync(_GDF_GetDirfile(*dirfile), *flags);
+
+  dreturn("%i", *desync);
+}
+
+/* gd_flags wrapper */
+void F77_FUNC(gdflag, GDFLAG) (int32_t *flags, const int32_t *dirfile,
+    const int32_t *set,
+    const int32_t *reset)
+{
+  dtrace("%p, %i, 0x%X, 0x%X", flags, *dirfile, *set, *reset);
+
+  *flags = gd_flags(_GDF_GetDirfile(*dirfile), *set, *reset);
+
+  dreturn("%i", *flags);
+}
+
+/* gd_verbose_prefix wrapper */
+void F77_FUNC(gdvbpx, GDVBPX) (const int32_t *dirfile, const char *prefix,
+    const int32_t *prefix_l)
+{
+  char *px;
+
+  dtrace("%i, %p, %i", *dirfile, prefix, *prefix_l);
+
+  gd_verbose_prefix(_GDF_GetDirfile(*dirfile), _GDF_CString(&px, prefix,
+        *prefix_l));
+  free(px);
+
+  dreturnvoid();
+}
+
+/* gd_mplex_lookback wrapper */
+void F77_FUNC(gdmxlb, GDMXLB) (const int32_t *dirfile, const int32_t *lookback)
+{
+  dtrace("%i, %i", *dirfile, *lookback);
+
+  gd_mplex_lookback(_GDF_GetDirfile(*dirfile), *lookback);
+
+  dreturnvoid();
+}
+
+/* gd_nentries wrapper */
+void F77_FUNC(gdnent, GDNENT) (int32_t *nentries, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l, const int32_t *type,
+    const int32_t *flags)
+{
+  char *pa;
+
+  dtrace("%p, %i, %p, %i, 0x%X, 0x%X", nentries, *dirfile, parent, *parent_l,
+      *type, *flags);
+
+  *nentries = gd_nentries(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
+        *parent_l), (unsigned int)*type, (unsigned int)*flags);
+
+  free(pa);
+  dreturn("%i", *nentries);
+}
+
+/* Return the maximum field name length */
+void F77_FUNC(gdentx, GDENTX) (int32_t *max, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l, const int32_t *type,
+    const int32_t *flags)
+{
+  const char **el;
+  char *pa;
+  size_t len = 0;
+  DIRFILE* D;
+  unsigned int i, nentries;
+  const unsigned int utype = (unsigned int)*type;
+  const unsigned int uflags = (unsigned int)*flags;
+
+  dtrace("%p, %i, %p, %i, 0x%X, 0x%X", max, *dirfile, parent, *parent_l, utype,
+      uflags);
+
+  D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&pa, parent, *parent_l);
+  nentries = gd_nentries(D, pa, utype, uflags);
+
+  if (!gd_error(D)) {
+    el = gd_entry_list(D, pa, utype, uflags);
+
+    for (i = 0; i < nentries; ++i)
+      if (strlen(el[i]) > len)
+        len = strlen(el[i]);
+  }
+
+  *max = len;
+  free(pa);
+  dreturn("%i", *max);
+}
+
+/* gd_entry_list wrapper -- this only returns one entry name */
+void F77_FUNC(gdentn, GDENTN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *type, const int32_t *flags, const int32_t *field_num)
+{
+  const char** el;
+  char *pa;
+  DIRFILE* D;
+  unsigned int nentries;
+  const unsigned int utype = (unsigned int)*type;
+  const unsigned int uflags = (unsigned int)*flags;
+
+  dtrace("%p, %p, %i, %p, %i, 0x%X, 0x%X, %i", name, name_l, *dirfile, parent,
+      *parent_l, utype, uflags, *field_num);
+
+  D = _GDF_GetDirfile(*dirfile);
+  _GDF_CString(&pa, parent, *parent_l);
+  nentries = gd_nentries(D, pa, utype, uflags);
+
+  if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nentries) {
+    el = gd_entry_list(D, pa, utype, uflags);
+    _GDF_FString(name, name_l, el[*field_num - 1]);
+  } else
+    *name_l = 0;
+
+  free(pa);
+  dreturn("%i", *name_l);
+}
+
+/* gd_linterp_tablename wrapper */
+void F77_FUNC(gdlttn, GDLTTN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *field_code, const int32_t *field_code_l)
+{
+  char *fc, *fn;
+
+  dtrace("%p, %i, %i, %p, %i", name, *name_l, *dirfile, field_code,
+      *field_code_l);
+
+  fn = gd_linterp_tablename(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc,
+        field_code, *field_code_l));
+
+  _GDF_FString(name, name_l, fn);
+
+  free(fc);
+  free(fn);
+
+  dreturn("%i", *name_l);
+}
diff --git a/bindings/f77/fgetdata.h b/bindings/f77/fgetdata.h
new file mode 100644
index 0000000..0b91d45
--- /dev/null
+++ b/bindings/f77/fgetdata.h
@@ -0,0 +1,753 @@
+/* Copyright (C) 2008-2012 D. V. Wiebe
+ *
+ *************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifndef FGETDATA_H
+#define FGETDATA_H
+
+#include "internal.h"
+
+/* If F77_FUNC isn't defined, we have no knowledge of the F77 mangling scheme */
+#ifndef F77_FUNC
+# error The F77_FUNC macro must be defined to build the F77 bindings
+#endif
+
+/* disable the "unspecified order" remark in ICC */
+#ifdef __INTEL_COMPILER
+#  pragma warning (disable : 981)
+#endif
+
+#define GDF_N_DIRFILES 1024
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef void(*_GDF_callback_t)(int32_t*, const int32_t*, const int32_t*, char*,
+    const int32_t*, const char*);
+
+/* Forward declarations to keep icc happy */
+void F77_FUNC(gdopen, GDOPEN) (int32_t *dirfile, const char *dirfilename,
+    const int32_t *dirfilename_l, const int32_t *flags);
+
+void F77_FUNC(gdclos, GDCLOS) (const int32_t *dirfile);
+
+void F77_FUNC(gdflsh, GDFLSH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdgetd, GDGETD) (int32_t *n_read, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l,
+    const int32_t *first_frame, const int32_t *first_sample,
+    const int32_t *num_frames, const int32_t *num_samples,
+    const int32_t *return_type, void *data_out);
+
+void F77_FUNC(gdfdnx, GDFDNX) (int32_t *max, const int32_t *dirfile);
+
+void F77_FUNC(gdfldn, GDFLDN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const int32_t *field_num);
+
+void F77_FUNC(gdnfld, GDNFLD) (int32_t *nfields, const int32_t *dirfile);
+
+void F77_FUNC(gdnfrm, GDNFRM) (int32_t *nframes, const int32_t *dirfile);
+
+void F77_FUNC(gdgspf, GDGSPF) (int32_t *spf, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdputd, GDPUTD) (int32_t *n_wrote, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l,
+    const int32_t *first_frame, const int32_t *first_sample,
+    const int32_t *num_frames, const int32_t *num_samples,
+    const int32_t *data_type, const void *data_in);
+
+void F77_FUNC(gderor, GDEROR) (int32_t *error, const int32_t *dirfile);
+
+void F77_FUNC(gdestr, GDESTR) (const int32_t *dirfile, char *buffer,
+    const int32_t *len);
+
+void F77_FUNC(gdenty, GDENTY) (int32_t *type, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgecl, GDGECL) (int32_t *nfields,
+    char *infield1, int32_t *infield1_l, GD_DCOMPLEXP(m1), GD_DCOMPLEXP(b1),
+    char *infield2, int32_t *infield2_l, GD_DCOMPLEXP(m2), GD_DCOMPLEXP(b2),
+    char *infield3, int32_t *infield3_l, GD_DCOMPLEXP(m3), GD_DCOMPLEXP(b3),
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdgecp, GDGECP) (int32_t *poly_ord,
+    char *infield, int32_t *infield_l, GD_DCOMPLEXP(a0), GD_DCOMPLEXP(a1),
+    GD_DCOMPLEXP(a2), GD_DCOMPLEXP(a3), GD_DCOMPLEXP(a4),
+    GD_DCOMPLEXP(a5), int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgerw, GDGERW) (int32_t *spf, int32_t *dtype,
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdgelc, GDGELC) (int32_t *nfields,
+    char *infield1, int32_t *infield1_l, double *m1, double *b1,
+    char *infield2, int32_t *infield2_l, double *m2, double *b2,
+    char *infield3, int32_t *infield3_l, double *m3, double *b3,
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdgepn, GDGEPN) (int32_t *nfields, char *infield,
+    int32_t *infield_l, double *a0, double *a1, double *a2, double *a3,
+    double *a4, double *a5, int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgelt, GDGELT) (char *in_field, int32_t *in_field_l, char *table,
+    int32_t *table_l, int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgebt, GDGEBT) (char *in_field, int32_t *in_field_l,
+    int32_t *bitnum, int32_t *numbits, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdgesb, GDGESB) (char *in_field, int32_t *in_field_l,
+    int32_t *bitnum, int32_t *numbits, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdgemt, GDGEMT) (char *in_field1, int32_t *in_field1_l,
+    char *in_field2, int32_t *in_field2_l, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdgeph, GDGEPH) (char *in_field, int32_t *in_field_l,
+    int32_t *shift, int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdadrw, GDADRW) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdadlc, GDADLC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const double *b1,
+    const char *in_field2, const int32_t *in_field2_l, const double *m2,
+    const double *b2, const char *in_field3, const int32_t *in_field3_l,
+    const double *m3, const double *b3, const int32_t *fragment_index);
+
+void F77_FUNC(gdadpn, GDADPN) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const double *a1,
+    const double *a2, const double *a3, const double *a4, const double *a5,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdadlt, GDADLT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *table, const int32_t *table_l,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdadbt, GDADBT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdadmt, GDADMT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l, const int32_t *fragment_index);
+
+void F77_FUNC(gdadph, GDADPH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdfrgn, GDFRGN) (char *filename, int32_t *filename_l,
+    const int32_t *dirfile, const int32_t *index);
+
+void F77_FUNC(gdnfrg, GDNFRG) (int32_t *nformats, const int32_t *dirfile);
+
+void F77_FUNC(gdmfls, GDMFLS) (const int32_t *dirfile);
+
+void F77_FUNC(gdincl, GDINCL) (const int32_t *dirfile, const char *file,
+    const int32_t *file_l, const int32_t *fragment_index, const int32_t *flags);
+
+void F77_FUNC(gdnfdt, GDNFDT) (int32_t *nfields, const int32_t *dirfile,
+    const int32_t *type);
+
+void F77_FUNC(gdnvec, GDNVEC) (int32_t *nvectors, const int32_t *dirfile);
+
+void F77_FUNC(gdfdnt, GDFDNT) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const int32_t *type, const int32_t *field_num);
+
+void F77_FUNC(gdvecn, GDVECN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const int32_t *field_num);
+
+void F77_FUNC(gdmdlc, GDMDLC) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const double *b1,
+    const char *in_field2, const int32_t *in_field2_l, const double *m2,
+    const double *b2, const char *in_field3, const int32_t *in_field3_l,
+    const double *m3, const double *b3);
+
+void F77_FUNC(gdmdpn, GDMDPN) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const double *a1,
+    const double *a2, const double *a3, const double *a4, const double *a5);
+
+void F77_FUNC(gdmdlt, GDMDLT) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *table, const int32_t *table_l);
+
+void F77_FUNC(gdmdbt, GDMDBT) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits);
+
+void F77_FUNC(gdmdsb, GDMDSB) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits);
+
+void F77_FUNC(gdmdmt, GDMDMT) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l);
+
+void F77_FUNC(gdmdph, GDMDPH) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift);
+
+void F77_FUNC(gdadco, GDADCO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type,
+    const int32_t *data_type, const void *value, const int32_t *fragment_index);
+
+void F77_FUNC(gdmdco, GDMDCO) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type,
+    const int32_t *data_type, const void *value);
+
+void F77_FUNC(gdadst, GDADST) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *value, const int32_t *value_l,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdmdst, GDMDST) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *value, const int32_t *value_l);
+
+void F77_FUNC(gdadsp, GDADSP) (const int32_t *dirfile, const char *spec,
+    const int32_t *spec_l, const int32_t *fragment_index);
+
+void F77_FUNC(gdmdsp, GDMDSP) (const int32_t *dirfile, const char *spec,
+    const int32_t *spec_l, const char *parent, const int32_t *parent_l);
+
+void F77_FUNC(gdfrgi, GDFRGI) (int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgtco, GDGTCO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *return_type, void *data_out);
+
+void F77_FUNC(gdgtca, GDGTCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *return_type, void *data_out);
+
+void F77_FUNC(gdcaln, GDCALN) (int32_t *len, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgcas, GDGCAS) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *start, const int32_t *n,
+    const int32_t *return_type, void *data_out);
+
+void F77_FUNC(gdgtst, GDGTST) (int32_t *size, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l, const int32_t *len,
+    char *data_out);
+
+void F77_FUNC(gdptco, GDPTCO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const void *data_in);
+
+void F77_FUNC(gdptca, GDPTCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const void *data_in);
+
+void F77_FUNC(gdptst, GDPTST) (int32_t *n_read, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l, const int32_t *len,
+    const char *data_out);
+
+void F77_FUNC(gdnmfd, GDNMFD) (int32_t *nfields, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l);
+
+void F77_FUNC(gdnmft, GDNMFT) (int32_t *nfields, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l, const int32_t *type);
+
+void F77_FUNC(gdnmve, GDNMVE) (int32_t *nvectors, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l);
+
+void F77_FUNC(gdgeco, GDGECO) (int32_t *data_type, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdmfnx, GDMFNX) (int32_t *max, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l);
+
+void F77_FUNC(gdmfdn, GDMFDN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *field_num);
+
+void F77_FUNC(gdmfdt, GDMFDT) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *type, const int32_t *field_num);
+
+void F77_FUNC(gdmven, GDMVEN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *field_num);
+
+void F77_FUNC(gddscd, GDDSCD) (const int32_t *dirfile);
+
+void F77_FUNC(gdcopn, GDCOPN) (int32_t *dirfile, const char *dirfilename,
+    const int32_t *dirfilename_l, const int32_t *flags,
+    const _GDF_callback_t callback);
+
+void F77_FUNC(gdclbk, GDCLBK) (const int32_t *dirfile,
+    const _GDF_callback_t callback);
+
+void F77_FUNC(gdalbt, GDALBT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits);
+
+void F77_FUNC(gdalco, GDALCO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type);
+
+void F77_FUNC(gdalca, GDALCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type,
+    const int32_t *array_len);
+
+void F77_FUNC(gdallc, GDALLC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const double *m1, const double *b1,
+    const char *in_field2, const int32_t *in_field2_l, const double *m2,
+    const double *b2, const char *in_field3, const int32_t *in_field3_l,
+    const double *m3, const double *b3);
+
+void F77_FUNC(gdalpn, GDALPN) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const double *a0, const double *a1,
+    const double *a2, const double *a3, const double *a4, const double *a5);
+
+void F77_FUNC(gdalmt, GDALMT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l);
+
+void F77_FUNC(gdalph, GDALPH) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *shift);
+
+void F77_FUNC(gdgenc, GDGENC) (int32_t *encoding, const int32_t *dirfile,
+    const int32_t *fragment);
+
+void F77_FUNC(gdgend, GDGEND) (int32_t *endianness, const int32_t *dirfile,
+    const int32_t *fragment);
+
+void F77_FUNC(gdname, GDNAME) (char *name, int32_t *name_l,
+    const int32_t *dirfile);
+
+void F77_FUNC(gdpfrg, GDPFRG) (int32_t *parent, const int32_t *dirfile,
+    const int32_t *fragment);
+
+void F77_FUNC(gdprot, GDPROT) (const int32_t *dirfile, const int32_t *fragment, 
+    const int32_t *protection_level);
+
+void F77_FUNC(gdgprt, GDGPRT) (int32_t *protection_level,
+    const int32_t *dirfile, const int32_t *fragment);
+
+void F77_FUNC(gdrwfn, GDRWFN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdrefe, GDREFE) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdaenc, GDAENC) (const int32_t *dirfile, const int32_t *encoding,
+    const int32_t *fragment, const int32_t *recode);
+
+void F77_FUNC(gdaend, GDAEND) (const int32_t *dirfile,
+    const int32_t *endianness, const int32_t *fragment, const int32_t *recode);
+
+void F77_FUNC(gdallt, GDALLT) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *table, const int32_t *table_l,
+    const int32_t *recode);
+
+void F77_FUNC(gdalrw, GDALRW) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf,
+    const int32_t *recode);
+
+void F77_FUNC(gdalsp, GDALSP) (const int32_t *dirfile, const char *spec,
+    const int32_t *spec_l, const int32_t *fragment_index);
+
+void F77_FUNC(gddele, GDDELE) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *flags);
+
+void F77_FUNC(gdmlsp, GDMLSP) (const int32_t *dirfile, const char *spec,
+    const int32_t *spec_l, const char *parent, const int32_t *parent_l,
+    const int32_t *recode);
+
+void F77_FUNC(gdmove, GDMOVE) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *new_fragment,
+    const int32_t *move_data);
+
+void F77_FUNC(gdrenm, GDRENM) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *new_name,
+    const int32_t *new_name_l, const int32_t *move_data);
+
+void F77_FUNC(gduinc, GDUINC) (const int32_t *dirfile, const int32_t *fragment,
+    const int32_t *del);
+
+void F77_FUNC(gdafof, GDAFOF) (const int32_t *dirfile, const int32_t *offset,
+    const int32_t *fragment, const int32_t *recode);
+
+void F77_FUNC(gdgfof, GDGFOF) (int32_t *offset, const int32_t *dirfile,
+    const int32_t *fragment);
+
+void F77_FUNC(gdadcl, GDADCL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+    const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2),
+    const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l,
+    const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3),
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdadcp, GDADCP) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1),
+    const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3),
+    const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5),
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdmdcl, GDMDCL) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+    const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2),
+    const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l,
+    const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3));
+
+void F77_FUNC(gdmdcp, GDMDCP) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1),
+    const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3),
+    const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5));
+
+void F77_FUNC(gdntyp, GDNTYP) (int32_t *type, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdalcl, GDALCL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+    const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2),
+    const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l,
+    const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3));
+
+void F77_FUNC(gdalcp, GDALCP) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1),
+    const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3),
+    const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5));
+
+void F77_FUNC(gdcscl, GDCSCL) (int32_t *comp_scal, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdvldt, GDVLDT) (int32_t *valid, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdfnum, GDFNUM) (double *framenum, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l, const double *value);
+
+void F77_FUNC(gdfnss, GDFNSS) (double *framenum, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l, const double *value,
+    const int32_t *start, const int32_t *end);
+
+void F77_FUNC(gdgsca, GDGSCA) (char *scalar, int32_t *scalar_l,
+    int32_t *scalar_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *index);
+
+void F77_FUNC(gdasca, GDASCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *index, const char *scalar,
+    const int32_t *scalar_l, int32_t *scalar_index, int32_t *recode);
+
+void F77_FUNC(gdalsb, GDALSB) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits);
+
+void F77_FUNC(gdadsb, GDADSB) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdinvd, GDINVD) (int32_t *dirfile);
+
+void F77_FUNC(gdstdv, GDSTDV) (int32_t *vers, const int32_t *dirfile);
+
+void F77_FUNC(gdgbof, GDGBOF) (int32_t *bof, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgeof, GDGEOF) (int32_t *eof, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgedv, GDGEDV) (char *in_field1, int32_t *in_field1_l,
+    char *in_field2, int32_t *in_field2_l, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdgerc, GDGERC) (char *in_field, int32_t *in_field_l,
+    double *dividend, int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdgecr, GDGECR) (char *in_field, int32_t *in_field_l,
+    GD_DCOMPLEXP(cdividend), int32_t *fragment_index, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdaddv, GDADDV) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l, const int32_t *fragment_index);
+
+void F77_FUNC(gdadrc, GDADRC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdadcr, GDADCR) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(cdividend),
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdmddv, GDMDDV) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l);
+
+void F77_FUNC(gdrfrg, GDRFRG) (const int32_t *dirfile, const int32_t *fragment);
+
+void F77_FUNC(gdmdrc, GDMDRC) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const double *dividend);
+
+void F77_FUNC(gdmdcr, GDMDCR) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const GD_DCOMPLEXP(cdividend));
+
+void F77_FUNC(gdaldv, GDALDV) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const char *in_field2,
+    const int32_t *in_field2_l);
+
+void F77_FUNC(gdalrc, GDALRC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const double *dividend);
+
+void F77_FUNC(gdalcr, GDALCR) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field1,
+    const int32_t *in_field1_l, const GD_DCOMPLEXP(cdividend));
+
+void F77_FUNC(gdaprt, GDAPRT) (const int32_t *dirfile,
+    const int32_t *protection_level, const int32_t *fragment);
+
+void F77_FUNC(gdgeca, GDGECA) (int32_t *data_type, int32_t *array_len,
+    int32_t *fragment_index, const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdadca, GDADCA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type, int32_t *array_len,
+    const int32_t *data_type, const void *value, const int32_t *fragment_index);
+
+void F77_FUNC(gdmdca, GDMDCA) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const int32_t *const_type,
+    const int32_t *array_len, const int32_t *data_type, const void *value);
+
+void F77_FUNC(gdpcas, GDPCAS) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *start, const int32_t *n,
+    const int32_t *data_type, const void *data_in);
+
+void F77_FUNC(gdseek, GDSEEK) (int32_t *pos, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l,
+    const int32_t *frame_num, const int32_t *sample_num, const int32_t *flags);
+
+void F77_FUNC(gdtell, GDTELL) (int32_t *pos, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdcons, GDCONS) (void *value, const int32_t *dirfile,
+    const int32_t *return_type, const int32_t *field_num);
+
+void F77_FUNC(gdmcos, GDMCOS) (void *value, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l, const int32_t *return_type,
+    const int32_t *field_num);
+
+void F77_FUNC(gdstrs, GDSTRS) (char *value, int32_t *value_l,
+    const int32_t *dirfile, const int32_t *field_num);
+
+void F77_FUNC(gdmsts, GDMSTS) (void *value, int32_t *value_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *field_num);
+
+void F77_FUNC(gdstrx, GDSTRX) (int32_t *max, const int32_t *dirfile);
+
+void F77_FUNC(gdmstx, GDMSTX) (int32_t *max, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l);
+
+void F77_FUNC(gdadwd, GDADWD) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop,
+    const void *threshold, const int32_t *fragment_index);
+
+void F77_FUNC(gdmdwd, GDMDWD) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold);
+
+void F77_FUNC(gdalwd, GDALWD) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *check_field,
+    const int32_t *check_field_l, const int32_t *windop, const void *threshold);
+
+void F77_FUNC(gdadmx, GDADMX) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *in_field,
+    const int32_t *in_field_l, const char *count_field,
+    const int32_t *count_field_l, const int32_t *val, const int32_t *max,
+    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);
+
+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);
+
+void F77_FUNC(gdsync, GDSYNC) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdrclo, GDRCLO) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdinca, GDINCA) (const int32_t *dirfile, const char *file,
+    const int32_t *file_l, const int32_t *fragment_index, const char *prefix,
+    const int32_t *prefix_l, const char *suffix, const int32_t *suffix_l,
+    const int32_t *flags);
+
+void F77_FUNC(gdmova, GDMOVA) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *new_fragment);
+
+void F77_FUNC(gdmdal, GDMDAL) (const int32_t *dirfile, const char *parent,
+    const int32_t *parent_l, const char *field_code,
+    const int32_t *field_code_l, const char *target, const int32_t *target_l);
+
+void F77_FUNC(gduhid, GDUHID) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdhide, GDHIDE) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdhidn, GDHIDN) (int32_t *result, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdfraf, GDFRAF) (char *prefix, int32_t *prefix_l, char *suffix,
+    int32_t *suffix_l, const int32_t *dirfile, const int32_t *index);
+
+void F77_FUNC(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);
+
+void F77_FUNC(gdalss, GDALSS) (char *alias, int32_t *alias_l,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const int32_t *num);
+
+void F77_FUNC(gdnals, GDNALS) (int32_t *nalias, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdalsx, GDALSX) (int32_t *max, const int32_t *dirfile,
+    const char *field_code, const int32_t *field_code_l);
+
+void F77_FUNC(gdatrg, GDATRG) (char *target, int32_t *target_l,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdadal, GDADAL) (const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l, const char *target, const int32_t *target_l,
+    const int32_t *fragment_index);
+
+void F77_FUNC(gdnocb, GDNOCB) (const int32_t *dirfile);
+
+void F77_FUNC(gddsyn, GDDSYN) (int32_t *desync, const int32_t *dirfile,
+    const int32_t *flags);
+
+void F77_FUNC(gdflag, GDFLAG) (int32_t *flags, const int32_t *dirfile,
+    const int32_t *set, const int32_t *reset);
+
+void F77_FUNC(gdvbpx, GDVBPX) (const int32_t *dirfile, const char *prefix,
+    const int32_t *prefix_l);
+
+void F77_FUNC(gdmxlb, GDMXLB) (const int32_t *dirfile, const int32_t *lookback);
+
+void F77_FUNC(gdnent, GDNENT) (int32_t *nentries, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l, const int32_t *type,
+    const int32_t *flags);
+
+void F77_FUNC(gdentx, GDENTX) (int32_t *max, const int32_t *dirfile,
+    const char *parent, const int32_t *parent_l, const int32_t *type,
+    const int32_t *flags);
+
+void F77_FUNC(gdentn, GDENTN) (char *name, int32_t *name_l,
+    const int32_t *dirfile, const char *parent, const int32_t *parent_l,
+    const int32_t *type, const int32_t *flags, const int32_t *field_num);
+
+void F77_FUNC(gdgewd, GDGEWD) (char *in_field, int32_t *in_field_l,
+    char *check_field, int32_t *check_field_l, int32_t *windop,
+    int32_t *ithreshold, double *rthreshold, int32_t *fragment_index,
+    const int32_t *dirfile, const char *field_code,
+    const int32_t *field_code_l);
+
+void F77_FUNC(gdecnt, GDECNT) (int32_t *error_count, const int32_t *dirfile);
+
+void F77_FUNC(gdtoke, GDTOKE) (char *toke, int32_t *toke_l,
+    const int32_t *dirfile, const char *string, const int32_t *string_l);
+
+void F77_FUNC(gdgemx, GDGEMX) (char *in_field, int32_t *in_field_l,
+    char *count_field, int32_t *count_field_l, int32_t *val, int32_t *max,
+    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);
+#ifdef __cplusplus
+}
+#endif
diff --git a/bindings/f77/getdata.f.in b/bindings/f77/getdata.f.in
new file mode 100644
index 0000000..f228e2e
--- /dev/null
+++ b/bindings/f77/getdata.f.in
@@ -0,0 +1,378 @@
+C     Copyright (C) 2008-2012 D. V. Wiebe
+C
+C     CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+C
+C     This file is part of the GetData project.
+C
+C     GetData is free software; you can redistribute it and/or modify it under
+C     the terms of the GNU Lesser General Public License as published by the
+C     Free Software Foundation; either version 2.1 of the License, or (at your
+C     option) any later version.
+C    
+C     GetData is distributed in the hope that it will be useful, but WITHOUT
+C     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+C     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+C     License for more details.
+C    
+C     You should have received a copy of the GNU Lesser General Public License
+C     along with GetData; if not, write to the Free Software Foundation, Inc.,
+C     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+C
+
+C     Fortran 77 parameters for GetData.  This file defines handy
+C     constants useful to Fortran programs.
+
+      @PARAMETERS@
+
+C Externals
+C     Corresponding to gd_alter_affixes(3)
+      EXTERNAL GDAAFX
+C     Corresponding to gd_add_alias(3)
+      EXTERNAL GDADAL
+C     Corresponding to gd_add_bit(3)
+      EXTERNAL GDADBT
+C     Corresponding to gd_add_carray(3)
+      EXTERNAL GDADCA
+C     Corresponding to gd_add_clincom(3)
+      EXTERNAL GDADCL
+C     Corresponding to gd_add_const(3)
+      EXTERNAL GDADCO
+C     Corresponding to gd_add_cpolynom(3)
+      EXTERNAL GDADCP
+C     Corresponding to gd_add_crecip(3)
+      EXTERNAL GDADCR
+C     Corresponding to gd_add_divide(3)
+      EXTERNAL GDADDV
+C     Corresponding to gd_add_lincom(3)
+      EXTERNAL GDADLC
+C     Corresponding to gd_add_linterp(3)
+      EXTERNAL GDADLT
+C     Corresponding to gd_add_multiply(3)
+      EXTERNAL GDADMT
+C     Corresponding to gd_add_mplex(3)
+      EXTERNAL GDADMX
+C     Corresponding to gd_add_phase(3)
+      EXTERNAL GDADPH
+C     Corresponding to gd_add_polynom(3)
+      EXTERNAL GDADPN
+C     Corresponding to gd_add_recip(3)
+      EXTERNAL GDADRC
+C     Corresponding to gd_add_raw(3)
+      EXTERNAL GDADRW
+C     Corresponding to gd_add_sbit(3)
+      EXTERNAL GDADSB
+C     Corresponding to gd_add_spec(3)
+      EXTERNAL GDADSP
+C     Corresponding to gd_add_string(3)
+      EXTERNAL GDADST
+C     Corresponding to gd_add_window(3)
+      EXTERNAL GDADWD
+C     Correpsonding to gd_alter_encoding(3)
+      EXTERNAL GDAENC
+C     Correpsonding to gd_alter_endianness(3)
+      EXTERNAL GDAEND
+C     Correpsonding to gd_alter_frameoffset(3)
+      EXTERNAL GDAFOF
+C     Correpsonding to gd_alter_bit(3)
+      EXTERNAL GDALBT
+C     Correpsonding to gd_alter_carray(3)
+      EXTERNAL GDALCA
+C     Correpsonding to gd_alter_clincom(3)
+      EXTERNAL GDALCL
+C     Correpsonding to gd_alter_const(3)
+      EXTERNAL GDALCO
+C     Correpsonding to gd_alter_cpolynom(3)
+      EXTERNAL GDALCP
+C     Correpsonding to gd_alter_crecip(3)
+      EXTERNAL GDALCR
+C     Correpsonding to gd_alter_divide(3)
+      EXTERNAL GDALDV
+C     Correpsonding to gd_alter_lincom(3)
+      EXTERNAL GDALLC
+C     Correpsonding to gd_alter_linterp(3)
+      EXTERNAL GDALLT
+C     Correpsonding to gd_alter_multiply(3)
+      EXTERNAL GDALMT
+C     Corresponding to gd_alter_mplex(3)
+      EXTERNAL GDALMX
+C     Correpsonding to gd_alter_phase(3)
+      EXTERNAL GDALPH
+C     Correpsonding to gd_alter_polynom(3)
+      EXTERNAL GDALPN
+C     Correpsonding to gd_alter_recip(3)
+      EXTERNAL GDALRC
+C     Correpsonding to gd_alter_raw(3)
+      EXTERNAL GDALRW
+C     Correpsonding to gd_alter_sbit(3)
+      EXTERNAL GDALSB
+C     Correpsonding to gd_alter_spec(3)
+      EXTERNAL GDALSP
+C     Correpsonding to gd_aliases(3)
+      EXTERNAL GDALSS
+C     Returns the maximum alias length
+      EXTERNAL GDALSX
+C     Corresponding to gd_alter_window(3)
+      EXTERNAL GDALWD
+C     Corresponding to gd_alter_protection(3)
+      EXTERNAL GDAPRT
+C     Alter a scalar parameter
+      EXTERNAL GDASCA
+C     Corresponding to gd_alias_target(3)
+      EXTERNAL GDATRG
+C     Corresponding to gd_carray_len(3)
+      EXTERNAL GDCALN
+C     Corresponding to gd_parser_callback(3)
+      EXTERNAL GDCLBK
+C     Corresponding to gd_close(3)
+      EXTERNAL GDCLOS
+C     Corresponding to gd_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)
+      EXTERNAL GDDSCD
+C     Corresponding to gd_desync(3)
+      EXTERNAL GDDSYN
+C     Corresponding to gd_error_count(3)
+      EXTERNAL GDECNT
+C     Corresponding to gd_entry_list(3) (sort of)
+      EXTERNAL GDENTN
+C     Returns the maximum entry name length
+      EXTERNAL GDENTX
+C     Corresponding to gd_entry_type(3)
+      EXTERNAL GDENTY
+C     Corresponding to gd_error(3)
+      EXTERNAL GDEROR
+C     Corresponding to gd_error_string(3)
+      EXTERNAL GDESTR
+C     Corresponding to gd_field_list_by_type(3) (sort of)
+      EXTERNAL GDFDNT
+C     Returns the maximum field name length
+      EXTERNAL GDFDNX
+C     Corresponding to gd_flags(3)
+      EXTERNAL GDFLAG
+C     Corresponding to gd_field_list(3) (sort of)
+      EXTERNAL GDFLDN
+C     Corresponding to gd_flush(3)
+      EXTERNAL GDFLSH
+C     Corresponding to gd_framenum_subset(3)
+      EXTERNAL GDFNSS
+C     Corresponding to gd_framenum(3)
+      EXTERNAL GDFNUM
+C     Corresponding to gd_fragment_affixes(3)
+      EXTERNAL GDFRAF
+C     Corresponding to gd_fragment_index(3)
+      EXTERNAL GDFRGI
+C     Corresponding to gd_fragmentname(3)
+      EXTERNAL GDFRGN
+C     Corresponding to gd_bof(3)
+      EXTERNAL GDGBOF
+C     Corresponding to gd_get_carray_slice(3)
+      EXTERNAL GDGCAS
+C     Corresponding to gd_entry(3) for BIT fields
+      EXTERNAL GDGEBT
+C     Corresponding to gd_entry(3) for CARRAY fields
+      EXTERNAL GDGECA
+C     Corresponding to gd_entry(3) for complex valued LINCOM fields
+      EXTERNAL GDGECL
+C     Corresponding to gd_entry(3) for CONST fields
+      EXTERNAL GDGECO
+C     Corresponding to gd_entry(3) for complex valued POLYNOM fields
+      EXTERNAL GDGECP
+C     Corresponding to gd_entry(3) for complex valued RECIP fields
+      EXTERNAL GDGECR
+C     Corresponding to gd_entry(3) for LINCOM fields
+      EXTERNAL GDGELC
+C     Corresponding to gd_entry(3) for LINTERP fields
+      EXTERNAL GDGELT
+C     Corresponding to gd_entry(3) for MULTIPLY fields
+      EXTERNAL GDGEMT
+C     Corresponding to gd_encoding(3)
+      EXTERNAL GDGENC
+C     Corresponding to gd_endianness(3)
+      EXTERNAL GDGEND
+C     Corresponding to gd_eof(3)
+      EXTERNAL GDGEOF
+C     Corresponding to gd_entry(3) for PHASE fields
+      EXTERNAL GDGEPH
+C     Corresponding to gd_entry(3) for POLYNOM fields
+      EXTERNAL GDGEPN
+C     Corresponding to gd_entry(3) for RECIP fields
+      EXTERNAL GDGERC
+C     Corresponding to gd_entry(3) for RAW fields
+      EXTERNAL GDGERW
+C     Corresponding to gd_entry(3) for SBIT fields
+      EXTERNAL GDGESB
+C     Corresponding to gd_getdata(3)
+      EXTERNAL GDGETD
+C     Corresponding to gd_entry(3) for WINDOW fields
+      EXTERNAL GDGEWD
+C     Correpsonding to gd_frameoffset(3)
+      EXTERNAL GDGFOF
+C     Corresponding to gd_protection(3)
+      EXTERNAL GDGPRT
+C     Retrieve a scalar parameter
+      EXTERNAL GDGSCA
+C     Corresponding to gd_spf(3)
+      EXTERNAL GDGSPF
+C     Corresponding to gd_get_carray(3)
+      EXTERNAL GDGTCA
+C     Corresponding to gd_get_constant(3)
+      EXTERNAL GDGTCO
+C     Corresponding to gd_get_string(3)
+      EXTERNAL GDGTST
+C     Corresponding to gd_hide(3)
+      EXTERNAL GDHIDE
+C     Corresponding to gd_hidden(3)
+      EXTERNAL GDHIDN
+C     Corresponding to gd_include_affixes(3)
+      EXTERNAL GDINCA
+C     Corresponding to gd_include(3)
+      EXTERNAL GDINCL
+C     Corresponding to gd_invalid_dirfile(3)
+      EXTERNAL GDINVD
+C     Corresponding to gd_linterp_tablename(3)
+      EXTERNAL GDLTTN
+C     Corresponding to gd_mconstants(3) (sort of)
+      EXTERNAL GDMCOS
+C     Corresponding to gd_madd_alias(3)
+      EXTERNAL GDMDAL
+C     Corresponding to gd_madd_bit(3)
+      EXTERNAL GDMDBT
+C     Corresponding to gd_madd_carray(3)
+      EXTERNAL GDMDCA
+C     Corresponding to complex valued gd_madd_clincom(3)
+      EXTERNAL GDMDCL
+C     Corresponding to gd_madd_const(3)
+      EXTERNAL GDMDCO
+C     Corresponding to gd_madd_cpolynom(3)
+      EXTERNAL GDMDCP
+C     Corresponding to gd_madd_crecip(3)
+      EXTERNAL GDMDCR
+C     Corresponding to gd_madd_divide(3)
+      EXTERNAL GDMDDV
+C     Corresponding to gd_madd_lincom(3)
+      EXTERNAL GDMDLC
+C     Corresponding to gd_madd_linterp(3)
+      EXTERNAL GDMDLT
+C     Corresponding to gd_madd_multiply(3)
+      EXTERNAL GDMDMT
+C     Corresponding to gd_madd_mplex(3)
+      EXTERNAL GDMDMX
+C     Corresponding to gd_madd_phase(3)
+      EXTERNAL GDMDPH
+C     Corresponding to gd_madd_polynom(3)
+      EXTERNAL GDMDPN
+C     Corresponding to gd_madd_recip(3)
+      EXTERNAL GDMDRC
+C     Corresponding to gd_madd_sbit(3)
+      EXTERNAL GDMDSB
+C     Corresponding to gd_madd_spec(3)
+      EXTERNAL GDMDSP
+C     Corresponding to gd_madd_string(3)
+      EXTERNAL GDMDST
+C     Corresponding to gd_madd_window(3)
+      EXTERNAL GDMDWD
+C     Corresponding to gd_mfield_list(3) (sort of)
+      EXTERNAL GDMFDN
+C     Corresponding to gd_mfield_list_by_type(3) (sort of)
+      EXTERNAL GDMFDT
+C     Corresponding to gd_metaflush(3)
+      EXTERNAL GDMFLS
+C     Returns the maximum field name length for a meta field list
+      EXTERNAL GDMFNX
+C     Correpsonding to gd_malter_spec(3)
+      EXTERNAL GDMLSP
+C     Correpsonding to gd_move_alias(3)
+      EXTERNAL GDMOVA
+C     Correpsonding to gd_move(3)
+      EXTERNAL GDMOVE
+C     Corresponding to gd_mstrings(3) (sort of)
+      EXTERNAL GDMSTS
+C     Returns the maximum length of the longest string metafield for a
+C     field
+      EXTERNAL GDMSTX
+C     Corresponding to gd_mvector_list(3) (sort of)
+      EXTERNAL GDMVEN
+C     Corresponding to gd_mplex_lookback(3)
+      EXTERNAL GDMXLB
+C     Corresponding to gd_naliases(3)
+      EXTERNAL GDNALS
+C     Corresponding to gd_dirfilename(3)
+      EXTERNAL GDNAME
+C     Corresponding to gd_nentries(3)
+      EXTERNAL GDNENT
+C     Corresponding to gd_nfields_by_type(3)
+      EXTERNAL GDNFDT
+C     Corresponding to gd_nfields(3)
+      EXTERNAL GDNFLD
+C     Corresponding to gd_nfragments(3)
+      EXTERNAL GDNFRG
+C     Corresponding to gd_nframes(3)
+      EXTERNAL GDNFRM
+C     Corresponding to gd_nmfields(3)
+      EXTERNAL GDNMFD
+C     Corresponding to gd_nmfields_by_type(3)
+      EXTERNAL GDNMFT
+C     Corresponding to gd_nmvectors(3)
+      EXTERNAL GDNMVE
+C     Deregister a callback function (ie. gd_parser_callback(..., NULL))
+      EXTERNAL GDNOCB
+C     Corresponding to gd_native_type(3)
+      EXTERNAL GDNTYP
+C     Corresponding to gd_nvectors(3)
+      EXTERNAL GDNVEC
+C     Corresponding to gd_open(3)
+      EXTERNAL GDOPEN
+C     Corresponding to gd_put_carray_slice(3)
+      EXTERNAL GDPCAS
+C     Corresponding to gd_parent_fragment(3)
+      EXTERNAL GDPFRG
+C     Corresponding to gd_put_carray(3)
+      EXTERNAL GDPTCA
+C     Corresponding to gd_put_constant(3)
+      EXTERNAL GDPTCO
+C     Corresponding to gd_put_string(3)
+      EXTERNAL GDPTST
+C     Corresponding to gd_putdata(3)
+      EXTERNAL GDPUTD
+C     Corresponding to gd_raw_close(3)
+      EXTERNAL GDRCLO
+C     Corresponding to gd_reference(3)
+      EXTERNAL GDREFE
+C     Correpsonding to gd_rename(3)
+      EXTERNAL GDRENM
+C     Corresponding to gd_rewrite_fragment(3)
+      EXTERNAL GDRFRG
+C     Corresponding to gd_raw_filename(3)
+      EXTERNAL GDRWFN
+C     Corresponding to gd_seek(3)
+      EXTERNAL GDSEEK
+C     Corresponding to gd_dirfile_standards(3)
+      EXTERNAL GDSTDV
+C     Corresponding to gd_strings(3) (sort of)
+      EXTERNAL GDSTRS
+C     Returns the length of the longest string field
+      EXTERNAL GDSTRX
+C     Corresponding to gd_sync(3)
+      EXTERNAL GDSYNC
+C     Corresponding to gd_tell(3)
+      EXTERNAL GDTELL
+C     Corresponding to gd_strtok(3)
+      EXTERNAL GDTOKE
+C     Corresponding to gd_unhide(3)
+      EXTERNAL GDUHID
+C     Corresponding to gd_uninclude(3)
+      EXTERNAL GDUINC
+C     Corresponding to gd_verbose_prefix(3)
+      EXTERNAL GDVBPX
+C     Corresponding to gd_vector_list(3) (sort of)
+      EXTERNAL GDVECN
+C     Corresponding to gd_validate(3)
+      EXTERNAL GDVLDT
diff --git a/bindings/f77/getdata.f90.in b/bindings/f77/getdata.f90.in
new file mode 100644
index 0000000..0df5478
--- /dev/null
+++ b/bindings/f77/getdata.f90.in
@@ -0,0 +1,2886 @@
+! 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
+!
+! -*- F95 -*-
+
+module getdata
+implicit none
+
+ at PARAMETERS95@
+
+integer, parameter :: GD_FIELD_LEN=@GD_MAX_LINE_LENGTH@
+
+type gd_entry
+  integer :: field_type, n_fields, spf, data_type, bitnum, numbits, shift
+  integer :: fragment_index, comp_scal, poly_ord, array_len, windop, ithreshold
+  integer :: count_val, period
+  character (len=GD_FIELD_LEN), dimension(3) :: field
+  character (len=GD_FIELD_LEN), dimension(6) :: scalar
+  integer, dimension(6) :: scalar_ind
+  double precision, dimension(3) :: m, b
+  double precision, dimension(6) :: a
+  double precision :: dividend, rthreshold
+  double complex, dimension(3) :: cm, cb
+  double complex, dimension(6) :: ca
+  double complex :: cdividend
+end type
+
+contains
+function fgd_open (dirfilename, flags)
+  integer :: fgd_open
+  character (len=*), intent (in) :: dirfilename
+  integer, intent (in) :: flags
+
+  ! call f77 library
+  call gdopen(fgd_open, TRIM(dirfilename), LEN_TRIM(dirfilename), flags)
+end function
+
+function fgd_cbopen (dirfilename, flags, sehandler)
+  integer :: fgd_cbopen
+  character (len=*), intent (in) :: dirfilename
+  integer, intent (in) :: flags
+  interface
+    subroutine sehandler(act, dirfile_unit, suberror, line)
+      integer, intent (out) :: act
+      integer, intent (in) :: dirfile_unit, suberror
+      character (len=@GD_MAX_LINE_LENGTH@), intent (inout) :: line
+    end subroutine
+  end interface
+
+  ! call f77 library
+  call gdcopn(fgd_cbopen, TRIM(dirfilename), LEN_TRIM(dirfilename), flags, &
+  sehandler)
+end function
+
+subroutine fgd_discard (dirfile)
+  integer, intent(in) :: dirfile
+
+  ! call f77 library
+  call gddscd(dirfile)
+end subroutine
+
+subroutine fgd_close (dirfile)
+  integer, intent(in) :: dirfile
+
+  ! call f77 library
+  call gdclos(dirfile)
+end subroutine
+
+subroutine fgd_flush (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  ! call f77 library -- this will take care of figuring out whether
+  !                     field_code is empty or not
+  call gdflsh(dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end subroutine
+
+! getdata with return_type=GD_NULL
+function fgd_getdata_n (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples)
+  integer :: fgd_getdata_n
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_n, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_NULL, 0)
+end function
+
+! getdata with return_type=GD_INT8
+function fgd_getdata_i1 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_out)
+  integer :: fgd_getdata_i1
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  integer*1, dimension(:), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_i1, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_INT8, data_out)
+end function
+
+! getdata with return_type=GD_INT16
+function fgd_getdata_i2 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_out)
+  integer :: fgd_getdata_i2
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  integer*2, dimension(:), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_i2, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_INT16, data_out)
+end function
+
+! getdata with return_type=GD_INT32
+function fgd_getdata_i4 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_out)
+  integer :: fgd_getdata_i4
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  integer*4, dimension(:), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_i4, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_INT32, data_out)
+end function
+
+! getdata with return_type=GD_INT64
+function fgd_getdata_i8 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_out)
+  integer :: fgd_getdata_i8
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  integer*8, dimension(:), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_i8, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_INT64, data_out)
+end function
+
+! getdata with return_type=GD_FLOAT32
+function fgd_getdata_r4 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_out)
+  integer :: fgd_getdata_r4
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  real*4, dimension(:), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_r4, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_FLOAT32, data_out)
+end function
+
+! getdata with return_type=GD_FLOAT64
+function fgd_getdata_r8 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_out)
+  integer :: fgd_getdata_r8
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  double precision, dimension(:), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_r8, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_FLOAT64, data_out)
+end function
+
+! getdata with return_type=GD_COMPLEX64
+function fgd_getdata_c8 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_out)
+  integer :: fgd_getdata_c8
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  complex, dimension(:), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_c8, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_COMPLEX64, data_out)
+end function
+
+! getdata with return_type=GD_COMPLEX128
+function fgd_getdata_c16 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_out)
+  integer :: fgd_getdata_c16
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  double complex, dimension(:), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgetd(fgd_getdata_c16, dirfile, TRIM(field_code), &
+  LEN_TRIM(field_code), first_frame, first_sample, num_frames, num_samples, &
+  GD_COMPLEX128, data_out)
+end function
+
+!get_constant with return_type=GD_NULL
+subroutine fgd_get_constant_n (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_NULL, 0)
+end subroutine
+
+!get_constant with return_type=GD_INT8
+subroutine fgd_get_constant_i1 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  integer*1, intent(out)  :: data_out
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT8, &
+  data_out)
+end subroutine
+
+!get_constant with return_type=GD_INT16
+subroutine fgd_get_constant_i2 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  integer*2, intent(out)  :: data_out
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT16, &
+  data_out)
+end subroutine
+
+!get_constant with return_type=GD_INT32
+subroutine fgd_get_constant_i4 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  integer*4, intent(out)  :: data_out
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT32, &
+  data_out)
+end subroutine
+
+!get_constant with return_type=GD_INT64
+subroutine fgd_get_constant_i8 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  integer*8, intent(out)  :: data_out
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT64, &
+  data_out)
+end subroutine
+
+!get_constant with return_type=GD_FLOAT32
+subroutine fgd_get_constant_r4 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  real*4, intent(out)  :: data_out
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT32, &
+  data_out)
+end subroutine
+
+!get_constant with return_type=GD_FLOAT64
+subroutine fgd_get_constant_r8 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  double precision, intent(out)  :: data_out
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT64, &
+  data_out)
+end subroutine
+
+!get_constant with return_type=GD_COMPLEX64
+subroutine fgd_get_constant_c8 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  complex, intent(out)  :: data_out
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX64, &
+  data_out)
+end subroutine
+
+!get_constant with return_type=GD_COMPLEX128
+subroutine fgd_get_constant_c16 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  double complex, intent(out)  :: data_out
+  
+  ! call f77 library
+  call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX128, &
+  data_out)
+end subroutine
+
+function fgd_get_string (dirfile, field_code, length, data_out)
+  integer :: fgd_get_string
+  integer, intent(in) :: dirfile, length
+  character (len=*), intent(in) :: field_code
+  character (len=*), intent(out) :: data_out
+
+  ! call f77 library
+  call gdgtst(fgd_get_string, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  length, data_out)
+end function
+
+function fgd_nfields (dirfile)
+  integer :: fgd_nfields
+  integer, intent(in) :: dirfile
+
+  ! call f77 library
+  call gdnfld(fgd_nfields, dirfile)
+end function
+
+function fgd_nfields_by_type (dirfile, entype)
+  integer :: fgd_nfields_by_type
+  integer, intent(in) :: dirfile, entype
+
+  call gdnfdt(fgd_nfields_by_type, dirfile, entype)
+end function
+
+function fgd_nvectors (dirfile)
+  integer :: fgd_nvectors
+  integer, intent(in) :: dirfile
+
+  call gdnvec(fgd_nvectors, dirfile)
+end function
+
+function fgd_nmfields (dirfile, parent)
+  integer :: fgd_nmfields
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: parent
+
+  ! call f77 library
+  call gdnmfd(fgd_nmfields, dirfile, TRIM(parent), LEN_TRIM(parent))
+end function
+
+function fgd_nmfields_by_type (dirfile, parent, entype)
+  integer :: fgd_nmfields_by_type
+  integer, intent(in) :: dirfile, entype
+  character (len=*), intent(in) :: parent
+
+  call gdnmft(fgd_nmfields_by_type, dirfile, TRIM(parent), &
+  LEN_TRIM(parent), entype)
+end function
+
+function fgd_nmvectors (dirfile, parent)
+  integer :: fgd_nmvectors
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: parent
+
+  call gdnmve(fgd_nmvectors, dirfile, TRIM(parent), LEN_TRIM(parent))
+end function
+
+function fgd_field_name_max (dirfile)
+  integer :: fgd_field_name_max
+  integer, intent(in) :: dirfile
+
+  ! call f77 library
+  call gdfdnx(fgd_field_name_max, dirfile)
+end function
+
+function fgd_mfield_name_max (dirfile, parent)
+  integer :: fgd_mfield_name_max
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: parent
+
+  ! call f77 library
+  call gdmfnx(fgd_mfield_name_max, dirfile, TRIM(parent), LEN_TRIM(parent))
+end function
+
+subroutine fgd_field_list (field_list, dirfile, field_len)
+  character(len=*), dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile
+  integer, intent(inout) :: field_len
+  integer :: max_len, nfields, i
+
+  ! make sure the field list is large enough
+  max_len = fgd_field_name_max(dirfile)
+
+  if (field_len .lt. max_len) then
+    field_len = max_len
+  else
+    nfields = fgd_nfields(dirfile)
+    do i=1,nfields
+      ! call f77 library
+      call gdfldn(field_list(i), field_len, dirfile, i)
+    end do
+  end if
+end subroutine
+
+subroutine fgd_field_list_by_type (field_list, dirfile, entype, field_len)
+  character(len=*), dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile, entype
+  integer, intent(inout) :: field_len
+  integer :: max_len, nfields, i
+
+  ! make sure the field list is large enough
+  max_len = fgd_field_name_max(dirfile)
+
+  if (field_len .lt. max_len) then
+    field_len = max_len
+  else
+    nfields = fgd_nfields_by_type(dirfile, entype)
+    do i=1,nfields
+      ! call f77 library
+      call gdfdnt(field_list(i), field_len, dirfile, entype, i)
+    end do
+  end if
+end subroutine
+
+subroutine fgd_vector_list (field_list, dirfile, field_len)
+  character(len=*), dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile
+  integer, intent(inout) :: field_len
+  integer :: max_len, nfields, i
+
+  ! make sure the field list is large enough
+  max_len = fgd_field_name_max(dirfile)
+
+  if (field_len .lt. max_len) then
+    field_len = max_len
+  else
+    nfields = fgd_nvectors(dirfile)
+    do i=1,nfields
+      ! call f77 library
+      call gdvecn(field_list(i), field_len, dirfile, i)
+    end do
+  end if
+end subroutine
+
+subroutine fgd_mfield_list (field_list, dirfile, parent, field_len)
+  character(len=*), dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile
+  integer, intent(inout) :: field_len
+  integer :: max_len, nfields, i
+  character (len=*), intent(in) :: parent
+
+  ! make sure the field list is large enough
+  max_len = fgd_mfield_name_max(dirfile, parent)
+
+  if (field_len .lt. max_len) then
+    field_len = max_len
+  else
+    nfields = fgd_nmfields(dirfile, parent)
+    do i=1,nfields
+      ! call f77 library
+      call gdmfdn(field_list(i), field_len, dirfile, TRIM(parent), &
+      LEN_TRIM(parent), i)
+    end do
+  end if
+end subroutine
+
+subroutine fgd_mfield_list_by_type (field_list, dirfile, parent, entype, &
+field_len)
+  character(len=*), dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile, entype
+  integer, intent(inout) :: field_len
+  integer :: max_len, nfields, i
+  character (len=*), intent(in) :: parent
+
+  ! make sure the field list is large enough
+  max_len = fgd_mfield_name_max(dirfile, parent)
+
+  if (field_len .lt. max_len) then
+    field_len = max_len
+  else
+    nfields = fgd_nmfields_by_type(dirfile, parent, entype)
+    do i=1,nfields
+      ! call f77 library
+      call gdmfdt(field_list(i), field_len, dirfile, TRIM(parent), &
+      LEN_TRIM(parent), entype, i)
+    end do
+  end if
+end subroutine
+
+subroutine fgd_mvector_list (field_list, dirfile, parent, field_len)
+  character(len=*), dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile
+  integer, intent(inout) :: field_len
+  integer :: max_len, nfields, i
+  character (len=*), intent(in) :: parent
+
+  ! make sure the field list is large enough
+  max_len = fgd_mfield_name_max(dirfile, parent)
+
+  if (field_len .lt. max_len) then
+    field_len = max_len
+  else
+    nfields = fgd_nmvectors(dirfile, parent)
+    do i=1,nfields
+      ! call f77 library
+      call gdmven(field_list(i), field_len, dirfile, TRIM(parent), &
+      LEN_TRIM(parent), i)
+    end do
+  end if
+end subroutine
+
+function fgd_bof (dirfile, field_code)
+  integer :: fgd_bof
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  ! call f77 library
+  call gdgbof(fgd_bof, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+function fgd_eof (dirfile, field_code)
+  integer :: fgd_eof
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  ! call f77 library
+  call gdgeof(fgd_eof, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+function fgd_nframes (dirfile)
+  integer :: fgd_nframes
+  integer, intent(in) :: dirfile
+
+  ! call f77 library
+  call gdnfrm(fgd_nframes, dirfile)
+end function
+
+function fgd_spf (dirfile, field_code)
+  integer :: fgd_spf
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  ! call f77 library
+  call gdgspf(fgd_spf, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+! putdata with data_type=GD_INT8
+function fgd_putdata_i1 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_in)
+  integer :: fgd_putdata_i1
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  integer*1, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  call gdputd(fgd_putdata_i1, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_INT8, data_in)
+end function
+
+! putdata with data_type=GD_INT16
+function fgd_putdata_i2 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_in)
+  integer :: fgd_putdata_i2
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  integer*2, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  call gdputd(fgd_putdata_i2, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_INT16, data_in)
+end function
+
+! putdata with data_type=GD_INT32
+function fgd_putdata_i4 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_in)
+  integer :: fgd_putdata_i4
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  integer*4, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  call gdputd(fgd_putdata_i4, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_INT32, data_in)
+end function
+
+! putdata with data_type=GD_INT64
+function fgd_putdata_i8 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_in)
+  integer :: fgd_putdata_i8
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  integer*8, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  call gdputd(fgd_putdata_i8, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_INT64, data_in)
+end function
+
+! putdata with data_type=GD_FLOAT32
+function fgd_putdata_r4 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_in)
+  integer :: fgd_putdata_r4
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  real*4, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  call gdputd(fgd_putdata_r4, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_FLOAT32, data_in)
+end function
+
+! putdata with data_type=GD_FLOAT64
+function fgd_putdata_r8 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_in)
+  integer :: fgd_putdata_r8
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  double precision, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  call gdputd(fgd_putdata_r8, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_FLOAT64, data_in)
+end function
+
+! putdata with data_type=GD_COMPLEX64
+function fgd_putdata_c8 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_in)
+  integer :: fgd_putdata_c8
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  complex, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  call gdputd(fgd_putdata_c8, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  first_frame, first_sample, num_frames, num_samples, GD_COMPLEX64, data_in)
+end function
+
+! putdata with data_type=GD_COMPLEX128
+function fgd_putdata_c16 (dirfile, field_code, first_frame, first_sample, &
+  num_frames, num_samples, data_in)
+  integer :: fgd_putdata_c16
+  integer, intent(in) :: dirfile, first_frame, first_sample, num_frames
+  character (len=*), intent(in) :: field_code
+  integer, intent(in) :: num_samples
+  double complex, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  call gdputd(fgd_putdata_c16, dirfile, TRIM(field_code), &
+  LEN_TRIM(field_code), first_frame, first_sample, num_frames, num_samples, &
+  GD_COMPLEX128, data_in)
+end function
+
+! put_constant with data_type=GD_INT8
+subroutine fgd_put_constant_i1 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  integer*1, intent(in) :: data_in
+
+  ! call f77 library
+  call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT8, data_in)
+end subroutine
+
+! put_constant with data_type=GD_INT16
+subroutine fgd_put_constant_i2 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  integer*2, intent(in) :: data_in
+
+  ! call f77 library
+  call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT16, &
+  data_in)
+end subroutine
+
+! put_constant with data_type=GD_INT32
+subroutine fgd_put_constant_i4 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  integer*4, intent(in) :: data_in
+
+  ! call f77 library
+  call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT32, &
+  data_in)
+end subroutine
+
+! put_constant with data_type=GD_INT64
+subroutine fgd_put_constant_i8 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  integer*8, intent(in) :: data_in
+
+  ! call f77 library
+  call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT64, &
+  data_in)
+end subroutine
+
+! put_constant with data_type=GD_FLOAT32
+subroutine fgd_put_constant_r4 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  real*4, intent(in) :: data_in
+
+  ! call f77 library
+  call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT32, &
+  data_in)
+end subroutine
+
+! put_constant with data_type=GD_FLOAT64
+subroutine fgd_put_constant_r8 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  double precision, intent(in) :: data_in
+
+  ! call f77 library
+  call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT64, &
+  data_in)
+end subroutine
+
+! put_constant with data_type=GD_COMPLEX64
+subroutine fgd_put_constant_c8 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  complex, intent(in) :: data_in
+
+  ! call f77 library
+  call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX64, &
+  data_in)
+end subroutine
+
+! put_constant with data_type=GD_COMPLEX128
+subroutine fgd_put_constant_c16 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  double complex, intent(in) :: data_in
+
+  ! call f77 library
+  call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX128, &
+  data_in)
+end subroutine
+
+function fgd_put_string (dirfile, field_code, data_in)
+  integer :: fgd_put_string
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code, data_in
+
+  call gdptst(fgd_put_string, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  LEN_TRIM(data_in), TRIM(data_in))
+end function
+
+function fgd_error (dirfile)
+  integer :: fgd_error
+  integer, intent(in) :: dirfile
+
+  ! call f77 library
+  call gderor(fgd_error, dirfile)
+end function
+
+function fgd_error_count (dirfile)
+  integer :: fgd_error_count
+  integer, intent(in) :: dirfile
+
+  ! call f77 library
+  call gdecnt(fgd_error_count, dirfile)
+end function
+
+subroutine fgd_error_string (dirfile, buffer, len)
+  integer, intent(in) :: dirfile, len
+  character (len=*), intent(out) :: buffer
+
+  ! call f77 library
+  call gdestr(dirfile, buffer, len)
+end subroutine
+
+function fgd_entry (dirfile, field_code, ent)
+  integer :: fgd_entry
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  type(gd_entry), intent(out) :: ent
+  integer :: i
+
+  ! the call may modify the lengths, so don't use parameters
+  integer :: len1 = GD_FIELD_LEN
+  integer :: len2 = GD_FIELD_LEN
+  integer :: len3 = GD_FIELD_LEN
+
+  ! get field type from f77 library
+  call gdenty(fgd_entry, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+
+  if (fgd_entry .EQ. GD_RAW_ENTRY) then
+    ! raw
+    call gdgerw(ent%spf, ent%data_type, ent%fragment_index, dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code))
+    call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 1)
+  else if (fgd_entry .EQ. GD_LINCOM_ENTRY) then
+    ! lincom
+    call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+    if (ent%comp_scal .NE. 0) then
+      call gdgecl(ent%n_fields, ent%field(1), len1, ent%cm(1), ent%cb(1), &
+      ent%field(2), len2, ent%cm(2), ent%cb(2), ent%field(3), len3, ent%cm(3), &
+      ent%cb(3), ent%fragment_index, dirfile, TRIM(field_code), &
+      LEN_TRIM(field_code))
+    else
+      call gdgelc(ent%n_fields, ent%field(1), len1, ent%m(1), ent%b(1), &
+      ent%field(2), len2, ent%m(2), ent%b(2), ent%field(3), len3, ent%m(3), &
+      ent%b(3), ent%fragment_index, dirfile, TRIM(field_code), &
+      LEN_TRIM(field_code))
+    end if
+    do i=1,6
+      len1 = GD_FIELD_LEN
+      call gdgsca(ent%scalar(i), len1, ent%scalar_ind(i), dirfile, &
+      TRIM(field_code), LEN_TRIM(field_code), i)
+    end do
+  else if (fgd_entry .EQ. GD_LINTERP_ENTRY) then
+    ! linterp
+    call gdgelt(ent%field(1), len1, ent%field(2), len2, ent%fragment_index, &
+    dirfile, TRIM(field_code), LEN_TRIM(field_code))
+  else if (fgd_entry .EQ. GD_BIT_ENTRY) then
+    ! bit
+    call gdgebt(ent%field(1), len1, ent%bitnum, ent%numbits, &
+    ent%fragment_index, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+    len1 = GD_FIELD_LEN
+    call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 1)
+    len1 = GD_FIELD_LEN
+    call gdgsca(ent%scalar(2), len1, ent%scalar_ind(1), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 2)
+  else if (fgd_entry .EQ. GD_SBIT_ENTRY) then
+    ! sbit
+    call gdgesb(ent%field(1), len1, ent%bitnum, ent%numbits, &
+    ent%fragment_index, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+    call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 1)
+    len1 = GD_FIELD_LEN
+    call gdgsca(ent%scalar(2), len1, ent%scalar_ind(2), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 2)
+  else if (fgd_entry .EQ. GD_MULTIPLY_ENTRY) then
+    ! multiply
+    call gdgemt(ent%field(1), len1, ent%field(2), len2, ent%fragment_index, &
+    dirfile, TRIM(field_code), LEN_TRIM(field_code))
+  else if (fgd_entry .EQ. GD_DIVIDE_ENTRY) then
+    ! divide
+    call gdgedv(ent%field(1), len1, ent%field(2), len2, ent%fragment_index, &
+    dirfile, TRIM(field_code), LEN_TRIM(field_code))
+  else if (fgd_entry .EQ. GD_PHASE_ENTRY) then
+    !phase
+    call gdgeph(ent%field(1), len1, ent%shift, ent%fragment_index, dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code))
+    len1 = GD_FIELD_LEN
+    call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 1)
+  else if (fgd_entry .EQ. GD_POLYNOM_ENTRY) then
+    ! polynom
+    call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+    if (ent%comp_scal .NE. 0) then
+      call gdgecp(ent%poly_ord, ent%field(1), len1, ent%ca(1), ent%ca(2), &
+      ent%ca(3), ent%ca(4), ent%ca(5), ent%ca(6), ent%fragment_index, dirfile, &
+      TRIM(field_code), LEN_TRIM(field_code))
+    else
+      call gdgepn(ent%poly_ord, ent%field(1), len1, ent%a(1), ent%a(2), &
+      ent%a(3), ent%a(4), ent%a(5), ent%a(6), ent%fragment_index, dirfile, &
+      TRIM(field_code), LEN_TRIM(field_code))
+    end if
+    do i=1,6
+      len1 = GD_FIELD_LEN
+      call gdgsca(ent%scalar(i), len1, ent%scalar_ind(1), dirfile, &
+      TRIM(field_code), LEN_TRIM(field_code), i)
+    end do
+  else if (fgd_entry .EQ. GD_RECIP_ENTRY) then
+    ! recip
+    call gdcscl(ent%comp_scal, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+    if (ent%comp_scal .NE. 0) then
+      call gdgecr(ent%field(1), len1, ent%cdividend, ent%fragment_index, &
+      dirfile, TRIM(field_code), LEN_TRIM(field_code))
+    else
+      call gdgerc(ent%field(1), len1, ent%dividend, ent%fragment_index, &
+      dirfile, TRIM(field_code), LEN_TRIM(field_code))
+    end if
+    len1 = GD_FIELD_LEN
+    call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 1)
+  else if (fgd_entry .EQ. GD_WINDOW_ENTRY) then
+    ! window
+    call gdgewd(ent%field(1), len1, ent%field(2), len2, ent%windop, &
+    ent%ithreshold, ent%rthreshold, ent%fragment_index, dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code))
+
+    len1 = GD_FIELD_LEN
+    call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 1)
+  else if (fgd_entry .EQ. GD_MPLEX_ENTRY) then
+    ! mplex
+    call gdgemx(ent%field(1), len1, ent%field(2), len2, ent%count_val, &
+    ent%period, ent%fragment_index, dirfile, TRIM(field_code), &
+    LEN_TRIM(field_code))
+
+    len1 = GD_FIELD_LEN
+    call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 1)
+
+    len1 = GD_FIELD_LEN
+    call gdgsca(ent%scalar(2), len1, ent%scalar_ind(2), dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code), 2)
+  else if (fgd_entry .EQ. GD_CONST_ENTRY) then
+    !const
+    call gdgeco(ent%data_type, ent%fragment_index, dirfile, TRIM(field_code), &
+    LEN_TRIM(field_code))
+  else if (fgd_entry .EQ. GD_CARRAY_ENTRY) then
+    !carray
+    call gdgeca(ent%data_type, ent%array_len, ent%fragment_index, dirfile, &
+    TRIM(field_code), LEN_TRIM(field_code))
+  else if (fgd_entry .EQ. GD_STRING_ENTRY) then
+    !string
+    call gdfrgi(ent%fragment_index, dirfile, TRIM(field_code), &
+    LEN_TRIM(field_code))
+  else
+    ! on the off chance we got a type we weren't prepared to deal with
+    fgd_entry = GD_NO_ENTRY
+  end if
+  ent%field_type = fgd_entry
+end function
+
+function fgd_entry_type (dirfile, field_code)
+  integer :: fgd_entry_type
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  call gdenty(fgd_entry_type, dirfile, TRIM(field_code), &
+  LEN_TRIM(field_code))
+end function
+
+function fgd_fragment_index (dirfile, field_code)
+  integer :: fgd_fragment_index
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  call gdfrgi(fgd_fragment_index, dirfile, TRIM(field_code), &
+  LEN_TRIM(field_code))
+end function
+
+subroutine fgd_add (dirfile, field_code, ent)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  type(gd_entry), intent(in) :: ent
+  integer*4 :: zero = 0
+  character (len=1) :: nil = ""
+
+  if (ent%field_type .EQ. GD_RAW_ENTRY) then
+    call gdadrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    ent%data_type, ent%spf, ent%fragment_index)
+  else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then
+    if (ent%comp_scal .EQ. 0) then
+      call gdadlc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%m(1), &
+      ent%b(1), TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%m(2), &
+      ent%b(2), TRIM(ent%field(3)), LEN_TRIM(ent%field(3)), ent%m(3), &
+      ent%b(3), ent%fragment_index)
+    else
+      call gdadcl(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cm(1), &
+      ent%cb(1), TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%cm(2), &
+      ent%cb(2), TRIM(ent%field(3)), LEN_TRIM(ent%field(3)), ent%cm(3), &
+      ent%cb(3), ent%fragment_index)
+    end if
+  else if (ent%field_type .EQ. GD_LINTERP_ENTRY) then
+    call gdadlt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
+    LEN_TRIM(ent%field(2)), ent%fragment_index)
+  else if (ent%field_type .EQ. GD_BIT_ENTRY) then
+    call gdadbt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, ent%numbits, &
+    ent%fragment_index)
+  else if (ent%field_type .EQ. GD_SBIT_ENTRY) then
+    call gdadsb(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, ent%numbits, &
+    ent%fragment_index)
+  else if (ent%field_type .EQ. GD_MULTIPLY_ENTRY) then
+    call gdadmt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
+    LEN_TRIM(ent%field(2)), ent%fragment_index)
+  else if (ent%field_type .EQ. GD_DIVIDE_ENTRY) then
+    call gdaddv(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
+    LEN_TRIM(ent%field(2)), ent%fragment_index)
+  else if (ent%field_type .EQ. GD_PHASE_ENTRY) then
+    call gdadph(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%shift, ent%fragment_index)
+  else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then
+    if (ent%comp_scal .EQ. 0) then
+      call gdadpn(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%a(1), &
+      ent%a(2), ent%a(3), ent%a(4), ent%a(5), ent%a(6), ent%fragment_index)
+    else
+      call gdadcp(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%ca(1), &
+      ent%ca(2), ent%ca(3), ent%ca(4), ent%ca(5), ent%ca(6), ent%fragment_index)
+    end if
+  else if (ent%field_type .EQ. GD_RECIP_ENTRY) then
+    if (ent%comp_scal .EQ. 0) then
+      call gdadcr(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%dividend, &
+      ent%fragment_index)
+    else
+      call gdadrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cdividend, &
+      ent%fragment_index)
+    end if
+  else if (ent%field_type .EQ. GD_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), &
+      TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
+      LEN_TRIM(ent%field(2)), ent%windop, ent%ithreshold, ent%fragment_index)
+    else
+      call gdadwd(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)
+    end if
+  else if (ent%field_type .EQ. GD_MPLEX_ENTRY) then
+    call gdadmx(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_CONST_ENTRY) then
+    call gdadco(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    ent%data_type, GD_INT32, zero, ent%fragment_index)
+  else if (ent%field_type .EQ. GD_CARRAY_ENTRY) then
+    call fgd_add_carray(dirfile, field_code, ent%data_type, ent%array_len, &
+    ent%fragment_index)
+  else if (ent%field_type .EQ. GD_STRING_ENTRY) then
+    call gdadst(dirfile, TRIM(field_code), LEN_TRIM(field_code), nil, zero, &
+    ent%fragment_index)
+  end if
+end subroutine
+
+subroutine fgd_add_bit (dirfile, field_name, in_field, bitnum, numbits, &
+  fragment_index)
+  integer, intent(in) :: dirfile, bitnum, numbits, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdadbt(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), bitnum, numbits, fragment_index)
+end subroutine
+
+subroutine fgd_add_sbit (dirfile, field_name, in_field, bitnum, numbits, &
+  fragment_index)
+  integer, intent(in) :: dirfile, bitnum, numbits, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdadsb(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), bitnum, numbits, fragment_index)
+end subroutine
+
+subroutine fgd_add_const (dirfile, field_name, const_type, fragment_index)
+  integer, intent(in) :: dirfile, const_type, fragment_index
+  character (len=*), intent(in) :: field_name
+  integer*4 :: zero = 0
+
+  call gdadco(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, &
+  GD_INT32, zero, fragment_index)
+end subroutine
+
+subroutine fgd_add_lincom (dirfile, field_name, n_fields, in_field1, m1, b1, &
+  in_field2, m2, b2, in_field3, m3, b3, fragment_index)
+  integer, intent(in) :: dirfile, n_fields, fragment_index
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double precision, intent(in) :: m1, b1, m2, b2, m3, b3
+
+  call gdadlc(dirfile, TRIM(field_name), LEN_TRIM(field_name), n_fields, &
+  TRIM(in_field1), LEN_TRIM(in_field1), m1, b1, TRIM(in_field2), &
+  LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), LEN_TRIM(in_field3), m3, b3, &
+  fragment_index)
+end subroutine
+
+subroutine fgd_add_clincom (dirfile, field_name, n_fields, in_field1, m1, b1, &
+  in_field2, m2, b2, in_field3, m3, b3, fragment_index)
+  integer, intent(in) :: dirfile, n_fields, fragment_index
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double complex, intent(in) :: m1, b1, m2, b2, m3, b3
+
+  call gdadcl(dirfile, TRIM(field_name), LEN_TRIM(field_name), n_fields, &
+  TRIM(in_field1), LEN_TRIM(in_field1), m1, b1, TRIM(in_field2), &
+  LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), LEN_TRIM(in_field3), m3, b3, &
+  fragment_index)
+end subroutine
+
+subroutine fgd_add_polynom (dirfile, field_name, poly_ord, in_field, a0, a1, &
+  a2, a3, a4, a5, fragment_index)
+  integer, intent(in) :: dirfile, poly_ord, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+  double precision, intent(in) :: a0, a1, a2, a3, a4, a5
+
+  call gdadpn(dirfile, TRIM(field_name), LEN_TRIM(field_name), poly_ord, &
+  TRIM(in_field), LEN_TRIM(in_field), a0, a1, a2, a3, a4, a5, &
+  fragment_index)
+end subroutine
+
+subroutine fgd_add_cpolynom (dirfile, field_name, poly_ord, in_field, a0, a1, &
+  a2, a3, a4, a5, fragment_index)
+  integer, intent(in) :: dirfile, poly_ord, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+  double complex, intent(in) :: a0, a1, a2, a3, a4, a5
+
+  call gdadcp(dirfile, TRIM(field_name), LEN_TRIM(field_name), poly_ord, &
+  TRIM(in_field), LEN_TRIM(in_field), a0, a1, a2, a3, a4, a5, &
+  fragment_index)
+end subroutine
+
+subroutine fgd_add_linterp (dirfile, field_name, in_field, table, &
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_name, in_field, table
+
+  call gdadlt(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), TRIM(table), LEN_TRIM(table), fragment_index)
+end subroutine
+
+subroutine fgd_add_multiply (dirfile, field_name, in_field1, in_field2, &
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_name, in_field1, in_field2
+
+  call gdadmt(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), LEN_TRIM(in_field2), &
+  fragment_index)
+end subroutine
+
+subroutine fgd_add_divide (dirfile, field_name, in_field1, in_field2, &
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_name, in_field1, in_field2
+
+  call gdaddv(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), LEN_TRIM(in_field2), &
+  fragment_index)
+end subroutine
+
+subroutine fgd_add_recip (dirfile, field_name, in_field, dividend, &
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  double precision, intent(in) :: dividend
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdadrc(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), dividend, fragment_index)
+end subroutine
+
+subroutine fgd_add_crecip (dirfile, field_name, in_field, cdividend, &
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  double complex, intent(in) :: cdividend
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdadcr(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), cdividend, fragment_index)
+end subroutine
+
+subroutine fgd_add_phase (dirfile, field_name, in_field, phase, fragment_index)
+  integer, intent(in) :: dirfile, phase, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdadph(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  TRIM(in_field), LEN_TRIM(in_field), phase, fragment_index)
+end subroutine
+
+subroutine fgd_add_raw (dirfile, field_code, data_type, spf, fragment_index)
+  integer, intent(in) :: dirfile, data_type, spf, fragment_index
+  character (len=*), intent(in) :: field_code
+
+  call gdadrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), data_type, spf, &
+  fragment_index)
+end subroutine
+
+subroutine fgd_add_string (dirfile, field_code, fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_code
+  
+  character (len=1) :: nil = ""
+
+  call gdadst(dirfile, TRIM(field_code), LEN_TRIM(field_code), nil, 0, &
+  fragment_index)
+end subroutine
+
+subroutine fgd_madd (dirfile, parent, field_code, ent)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code, parent
+  type(gd_entry), intent(in) :: ent
+  integer*4 :: zero = 0
+  character (len=1) :: nil = ""
+
+  if (ent%field_type .EQ. GD_LINCOM_ENTRY) then
+    if (ent%comp_scal .NE. 0) then
+      call gdmdcl(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+      LEN_TRIM(field_code), ent%n_fields, TRIM(ent%field(1)), &
+      LEN_TRIM(ent%field(1)), ent%cm(1), ent%cb(1), TRIM(ent%field(2)), &
+      LEN_TRIM(ent%field(2)), ent%cm(2), ent%cb(2), TRIM(ent%field(3)), &
+      LEN_TRIM(ent%field(3)), ent%cm(3), ent%cb(3))
+    else
+      call gdmdlc(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+      LEN_TRIM(field_code), ent%n_fields, TRIM(ent%field(1)), &
+      LEN_TRIM(ent%field(1)), ent%m(1), ent%b(1), TRIM(ent%field(2)), &
+      LEN_TRIM(ent%field(2)), ent%m(2), ent%b(2), TRIM(ent%field(3)), &
+      LEN_TRIM(ent%field(3)), ent%m(3), ent%b(3))
+    end if
+  else if (ent%field_type .EQ. GD_LINTERP_ENTRY) then
+    call gdmdlt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+    TRIM(ent%field(2)), LEN_TRIM(ent%field(2)))
+  else if (ent%field_type .EQ. GD_BIT_ENTRY) then
+    call gdmdbt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+    ent%bitnum, ent%numbits)
+  else if (ent%field_type .EQ. GD_SBIT_ENTRY) then
+    call gdmdsb(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+    ent%bitnum, ent%numbits)
+  else if (ent%field_type .EQ. GD_MULTIPLY_ENTRY) then
+    call gdmdmt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+    TRIM(ent%field(2)), LEN_TRIM(ent%field(2)))
+  else if (ent%field_type .EQ. GD_DIVIDE_ENTRY) then
+    call gdmddv(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+    TRIM(ent%field(2)), LEN_TRIM(ent%field(2)))
+  else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then
+    if (ent%comp_scal .NE. 0) then
+      call gdmdcp(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+      LEN_TRIM(field_code), ent%poly_ord, TRIM(ent%field(1)), &
+      LEN_TRIM(ent%field(1)), ent%ca(1), ent%ca(2), ent%ca(3), ent%ca(4), &
+      ent%ca(5), ent%ca(6))
+    else
+      call gdmdpn(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+      LEN_TRIM(field_code), ent%poly_ord, TRIM(ent%field(1)), &
+      LEN_TRIM(ent%field(1)), ent%a(1), ent%a(2), ent%a(3), ent%a(4), &
+      ent%a(5), ent%a(6))
+    end if
+  else if (ent%field_type .EQ. GD_RECIP_ENTRY) then
+    if (ent%comp_scal .NE. 0) then
+      call gdmdcr(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+      LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+      ent%cdividend)
+    else
+      call gdmdrc(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+      LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+      ent%dividend)
+    end if
+  else if (ent%field_type .EQ. GD_PHASE_ENTRY) then
+    call gdmdph(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%shift)
+  else if (ent%field_type .EQ. GD_WINDOW_ENTRY) then
+    if ((ent%windop .EQ. GD_WINDOP_EQ) .OR. (ent%windop .EQ. GD_WINDOP_NE) &
+    .OR. (ent%windop .EQ. GD_WINDOP_SET) .OR. (ent%windop .EQ. GD_WINDOP_CLR)) &
+    then
+      call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+      LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+      TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%windop, ent%ithreshold, &
+      ent%fragment_index)
+    else
+      call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+      LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+      TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%windop, ent%rthreshold, &
+      ent%fragment_index)
+    end if
+  else if (ent%field_type .EQ. GD_MPLEX_ENTRY) then
+    call gdmdmx(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), &
+    TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%count_val, ent%period)
+  else if (ent%field_type .EQ. GD_CONST_ENTRY) then
+    call gdmdco(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), ent%data_type, GD_INT32, zero)
+  else if (ent%field_type .EQ. GD_CARRAY_ENTRY) then
+    call fgd_madd_carray(dirfile, parent, field_code, ent%data_type, &
+    ent%array_len)
+  else if (ent%field_type .EQ. GD_STRING_ENTRY) then
+    call gdmdst(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), nil, zero)
+  end if
+end subroutine
+
+subroutine fgd_madd_bit (dirfile, parent, field_name, in_field, bitnum, &
+  numbits)
+  integer, intent(in) :: dirfile, bitnum, numbits
+  character (len=*), intent(in) :: field_name, in_field, parent
+
+  call gdmdbt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), bitnum, numbits)
+end subroutine
+
+subroutine fgd_madd_sbit (dirfile, parent, field_name, in_field, bitnum, &
+  numbits)
+  integer, intent(in) :: dirfile, bitnum, numbits
+  character (len=*), intent(in) :: field_name, in_field, parent
+
+  call gdmdsb(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), bitnum, numbits)
+end subroutine
+
+subroutine fgd_madd_const (dirfile, parent, field_name, const_type)
+  integer, intent(in) :: dirfile, const_type
+  character (len=*), intent(in) :: field_name, parent
+  integer*4 :: zero = 0
+
+  call gdmdco(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), const_type, GD_INT32, zero)
+end subroutine
+
+subroutine fgd_madd_lincom (dirfile, parent, field_name, n_fields, in_field1, &
+  m1, b1, in_field2, m2, b2, in_field3, m3, b3)
+  integer, intent(in) :: dirfile, n_fields
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  character (len=*), intent(in) :: parent
+  double precision, intent(in) :: m1, b1, m2, b2, m3, b3
+
+  call gdmdlc(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), n_fields, TRIM(in_field1), LEN_TRIM(in_field1), m1, &
+  b1, TRIM(in_field2), LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), &
+  LEN_TRIM(in_field3), m3, b3)
+end subroutine
+
+subroutine fgd_madd_clincom (dirfile, parent, field_name, n_fields, in_field1, &
+  m1, b1, in_field2, m2, b2, in_field3, m3, b3)
+  integer, intent(in) :: dirfile, n_fields
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  character (len=*), intent(in) :: parent
+  double complex, intent(in) :: m1, b1, m2, b2, m3, b3
+
+  call gdmdcl(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), n_fields, TRIM(in_field1), LEN_TRIM(in_field1), m1, &
+  b1, TRIM(in_field2), LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), &
+  LEN_TRIM(in_field3), m3, b3)
+end subroutine
+
+subroutine fgd_madd_polynom (dirfile, parent, field_name, poly_ord, in_field, &
+  a0, a1, a2, a3, a4, a5)
+  integer, intent(in) :: dirfile, poly_ord
+  character (len=*), intent(in) :: field_name, in_field
+  character (len=*), intent(in) :: parent
+  double precision, intent(in) :: a0, a1, a2, a3, a4, a5
+
+  call gdmdpn(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), poly_ord, TRIM(in_field), LEN_TRIM(in_field), a0, &
+  a1, a2, a3, a4, a5)
+end subroutine
+
+subroutine fgd_madd_cpolynom (dirfile, parent, field_name, poly_ord, in_field, &
+  a0, a1, a2, a3, a4, a5)
+  integer, intent(in) :: dirfile, poly_ord
+  character (len=*), intent(in) :: field_name, in_field
+  character (len=*), intent(in) :: parent
+  double complex, intent(in) :: a0, a1, a2, a3, a4, a5
+
+  call gdmdcp(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), poly_ord, TRIM(in_field), LEN_TRIM(in_field), a0, &
+  a1, a2, a3, a4, a5)
+end subroutine
+
+subroutine fgd_madd_linterp (dirfile, parent, field_name, in_field, table)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field, table, parent
+
+  call gdmdlt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), TRIM(table), &
+  LEN_TRIM(table))
+end subroutine
+
+subroutine fgd_madd_multiply (dirfile, parent, field_name, in_field1, in_field2)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, parent
+
+  call gdmdmt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), &
+  LEN_TRIM(in_field2))
+end subroutine
+
+subroutine fgd_madd_divide (dirfile, parent, field_name, in_field1, in_field2)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, parent
+
+  call gdmddv(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), &
+  LEN_TRIM(in_field2))
+end subroutine
+
+subroutine fgd_madd_recip (dirfile, parent, field_name, in_field, dividend)
+  integer, intent(in) :: dirfile
+  double precision, intent(in) :: dividend
+  character (len=*), intent(in) :: field_name, in_field, parent
+
+  call gdmdrc(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), dividend)
+end subroutine
+
+subroutine fgd_madd_crecip (dirfile, parent, field_name, in_field, cdividend)
+  integer, intent(in) :: dirfile
+  double complex, intent(in) :: cdividend
+  character (len=*), intent(in) :: field_name, in_field, parent
+
+  call gdmdcr(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), cdividend)
+end subroutine
+
+subroutine fgd_madd_phase (dirfile, parent, field_name, in_field, phase)
+  integer, intent(in) :: dirfile, phase
+  character (len=*), intent(in) :: field_name, in_field, parent
+
+  call gdmdph(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), phase)
+end subroutine
+
+subroutine fgd_madd_string (dirfile, parent, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code, parent
+  
+  character (len=1) :: nil = ""
+
+  call gdmdst(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+  LEN_TRIM(field_code), nil, 0)
+end subroutine
+
+subroutine fgd_add_spec (dirfile, spec, fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: spec
+
+  call gdadsp(dirfile, TRIM(spec), LEN_TRIM(spec), fragment_index)
+end subroutine
+
+subroutine fgd_madd_spec (dirfile, spec, parent)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: parent, spec
+
+  call gdmdsp(dirfile, TRIM(spec), LEN_TRIM(spec), TRIM(parent), &
+  LEN_TRIM(parent))
+end subroutine
+
+function fgd_fragmentname (dirfile, ind)
+  character (len=GD_MAX_LINE_LENGTH) :: fgd_fragmentname
+  integer, intent(in) :: dirfile, ind
+  integer :: l = GD_MAX_LINE_LENGTH
+
+  call gdfrgn(fgd_fragmentname, l, dirfile, ind)
+end function
+
+function fgd_nfragments (dirfile)
+  integer :: fgd_nfragments
+  integer, intent(in) :: dirfile
+
+  call gdnfrg(fgd_nfragments, dirfile)
+end function
+
+subroutine fgd_metaflush (dirfile)
+  integer, intent(in) :: dirfile
+
+  call gdmfls(dirfile)
+end subroutine
+
+subroutine fgd_rewrite_fragment (dirfile, fragment)
+  integer, intent(in) :: dirfile, fragment
+
+  call gdrfrg(dirfile, fragment)
+end subroutine
+
+subroutine fgd_include (dirfile, fragmentname, fragment_index, flags)
+  integer, intent(in) :: dirfile, fragment_index, flags
+  character (len=*), intent(in) :: fragmentname
+
+  call gdincl(dirfile, TRIM(fragmentname), LEN_TRIM(fragmentname), &
+  fragment_index, flags)
+end subroutine
+
+function fgd_reference (dirfile, field_code)
+  character (len=GD_FIELD_LEN) :: fgd_reference
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  integer :: l = GD_FIELD_LEN
+
+  call gdrefe(fgd_reference, l, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+
+  if (l .LE. 0) then
+    fgd_reference = ""
+  endif
+end function 
+
+subroutine fgd_parser_callback (dirfile, sehandler)
+  integer, intent(in) :: dirfile
+  interface
+    subroutine sehandler(act, dirfile_unit, suberror, line)
+      integer, intent (out) :: act
+      integer, intent (in) :: dirfile_unit, suberror
+      character (len=@GD_MAX_LINE_LENGTH@), intent (inout) :: line
+    end subroutine
+  end interface
+
+  call gdclbk(dirfile, sehandler)
+end subroutine
+
+function fgd_encoding (dirfile, fragment)
+  integer :: fgd_encoding
+  integer, intent(in) :: dirfile, fragment
+
+  call gdgenc(fgd_encoding, dirfile, fragment)
+end function
+
+subroutine fgd_alter_encoding (dirfile, encoding, fragment, recode)
+  integer, intent(in) :: dirfile, encoding, fragment, recode
+
+  call gdaenc(dirfile, encoding, fragment, recode)
+end subroutine
+
+function fgd_endianness (dirfile, fragment)
+  integer :: fgd_endianness
+  integer, intent(in) :: dirfile, fragment
+
+  call gdgend(fgd_endianness, dirfile, fragment)
+end function
+
+subroutine fgd_alter_endianness (dirfile, endianness, fragment, recode)
+  integer, intent(in) :: dirfile, endianness, fragment, recode
+
+  call gdaend(dirfile, endianness, fragment, recode)
+end subroutine
+
+function fgd_frameoffset (dirfile, fragment)
+  integer :: fgd_frameoffset
+  integer, intent(in) :: dirfile, fragment
+
+  call gdgfof(fgd_frameoffset, dirfile, fragment)
+end function
+
+subroutine fgd_alter_frameoffset (dirfile, frameoffset, fragment, recode)
+  integer, intent(in) :: dirfile, frameoffset, fragment, recode
+
+  call gdafof(dirfile, frameoffset, fragment, recode)
+end subroutine
+
+function fgd_protection (dirfile, fragment)
+  integer :: fgd_protection
+  integer, intent(in) :: dirfile, fragment
+
+  call gdgprt(fgd_protection, dirfile, fragment)
+end function
+
+subroutine fgd_alter_protection (dirfile, protection_level, fragment)
+  integer, intent(in) :: dirfile, protection_level, fragment
+
+  call gdaprt(dirfile, protection_level, fragment)
+end subroutine
+
+function fgd_parent_fragment (dirfile, fragment)
+  integer :: fgd_parent_fragment
+  integer, intent(in) :: dirfile, fragment
+
+  call gdpfrg(fgd_parent_fragment, dirfile, fragment)
+end function
+
+subroutine fgd_uninclude (dirfile, fragment, del)
+  integer, intent(in) :: dirfile, fragment, del
+
+  call gduinc(dirfile, fragment, del)
+end subroutine
+
+function fgd_raw_filename (dirfile, field_code)
+  character (len=GD_MAX_LINE_LENGTH) :: fgd_raw_filename
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  integer :: l = GD_MAX_LINE_LENGTH
+
+  call gdrwfn (fgd_raw_filename, l, dirfile, TRIM(field_code), &
+  LEN_TRIM(field_code))
+end function
+
+subroutine fgd_move (dirfile, field_code, new_fragment, move_data)
+  integer, intent(in) :: dirfile, new_fragment, move_data
+  character (len=*), intent(in) :: field_code
+
+  call gdmove (dirfile, TRIM(field_code), LEN_TRIM(field_code), new_fragment, &
+  move_data)
+end subroutine
+
+subroutine fgd_alter_entry (dirfile, field_code, ent, recode)
+  integer, intent(in) :: dirfile, recode
+  character (len=*), intent(in) :: field_code
+  type(gd_entry), intent(in) :: ent
+
+  if (ent%field_type .EQ. GD_RAW_ENTRY) then
+    call gdalrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    ent%data_type, ent%spf, recode)
+  else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then
+    if (ent%comp_scal .NE. 0) then
+      call gdalcl(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cm(1), &
+      ent%cb(1), TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%cm(2), &
+      ent%cb(2), TRIM(ent%field(3)), LEN_TRIM(ent%field(3)), ent%cm(3), &
+      ent%cb(3))
+    else
+      call gdallc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%m(1), &
+      ent%b(1), TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%m(2), &
+      ent%b(2), TRIM(ent%field(3)), LEN_TRIM(ent%field(3)), ent%m(3), ent%b(3))
+    end if
+  else if (ent%field_type .EQ. GD_LINTERP_ENTRY) then
+    call gdallt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
+    LEN_TRIM(ent%field(2)), recode)
+  else if (ent%field_type .EQ. GD_BIT_ENTRY) then
+    call gdalbt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, ent%numbits)
+  else if (ent%field_type .EQ. GD_SBIT_ENTRY) then
+    call gdalsb(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, ent%numbits)
+  else if (ent%field_type .EQ. GD_MULTIPLY_ENTRY) then
+    call gdalmt(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
+    LEN_TRIM(ent%field(2)))
+  else if (ent%field_type .EQ. GD_DIVIDE_ENTRY) then
+    call gdaldv(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), &
+    LEN_TRIM(ent%field(2)))
+  else if (ent%field_type .EQ. GD_PHASE_ENTRY) then
+    call gdalph(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%shift)
+  else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then
+    if (ent%comp_scal .NE. 0) then
+      call gdalcp(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%ca(1), &
+      ent%ca(2), ent%ca(3), ent%ca(4), ent%ca(5), ent%ca(6))
+    else
+      call gdalpn(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%a(1), &
+      ent%a(2), ent%a(3), ent%a(4), ent%a(5), ent%a(6))
+    end if
+  else if (ent%field_type .EQ. GD_RECIP_ENTRY) then
+    if (ent%comp_scal .NE. 0) then
+      call gdalcr(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cdividend)
+    else
+      call gdalrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+      TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%a(1), ent%dividend)
+    end if
+  else if (ent%field_type .EQ. GD_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 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)
+    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)
+    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_CONST_ENTRY) then
+    call gdalco(dirfile, TRIM(field_code), LEN_TRIM(field_code), ent%data_type)
+  else if (ent%field_type .EQ. GD_CARRAY_ENTRY) then
+    call gdalca(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    ent%data_type, ent%array_len)
+  end if
+end subroutine
+
+subroutine fgd_alter_bit (dirfile, field_name, in_field, bitnum, numbits)
+  integer, intent(in) :: dirfile, bitnum, numbits
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdalbt(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), bitnum, numbits)
+end subroutine
+
+subroutine fgd_alter_sbit (dirfile, field_name, in_field, bitnum, numbits)
+  integer, intent(in) :: dirfile, bitnum, numbits
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdalsb(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), bitnum, numbits)
+end subroutine
+
+subroutine fgd_alter_const (dirfile, field_name, const_type)
+  integer, intent(in) :: dirfile, const_type
+  character (len=*), intent(in) :: field_name
+
+  call gdalco(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type)
+end subroutine
+
+subroutine fgd_alter_lincom (dirfile, field_name, n_fields, in_field1, m1, b1, &
+  in_field2, m2, b2, in_field3, m3, b3)
+  integer, intent(in) :: dirfile, n_fields
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double precision, intent(in) :: m1, b1, m2, b2, m3, b3
+
+  call gdallc(dirfile, TRIM(field_name), LEN_TRIM(field_name), n_fields, &
+  TRIM(in_field1), LEN_TRIM(in_field1), m1, b1, TRIM(in_field2), &
+  LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), LEN_TRIM(in_field3), m3, b3)
+end subroutine
+
+subroutine fgd_alter_clincom (dirfile, field_name, n_fields, in_field1, m1, &
+  b1, in_field2, m2, b2, in_field3, m3, b3)
+  integer, intent(in) :: dirfile, n_fields
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double complex, intent(in) :: m1, b1, m2, b2, m3, b3
+
+  call gdalcl(dirfile, TRIM(field_name), LEN_TRIM(field_name), n_fields, &
+  TRIM(in_field1), LEN_TRIM(in_field1), m1, b1, TRIM(in_field2), &
+  LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), LEN_TRIM(in_field3), m3, b3)
+end subroutine
+
+subroutine fgd_alter_polynom (dirfile, field_name, poly_ord, in_field, a0, a1, &
+  a2, a3, a4, a5)
+  integer, intent(in) :: dirfile, poly_ord
+  character (len=*), intent(in) :: field_name, in_field
+  double precision, intent(in) :: a0, a1, a2, a3, a4, a5
+
+  call gdalpn(dirfile, TRIM(field_name), LEN_TRIM(field_name), poly_ord, &
+  TRIM(in_field), LEN_TRIM(in_field), a0, a1, a2, a3, a4, a5)
+end subroutine
+
+subroutine fgd_alter_cpolynom (dirfile, field_name, poly_ord, in_field, a0, &
+  a1, a2, a3, a4, a5)
+  integer, intent(in) :: dirfile, poly_ord
+  character (len=*), intent(in) :: field_name, in_field
+  double complex, intent(in) :: a0, a1, a2, a3, a4, a5
+
+  call gdalcp(dirfile, TRIM(field_name), LEN_TRIM(field_name), poly_ord, &
+  TRIM(in_field), LEN_TRIM(in_field), a0, a1, a2, a3, a4, a5)
+end subroutine
+
+subroutine fgd_alter_linterp (dirfile, field_name, in_field, table, move)
+  integer, intent(in) :: dirfile, move
+  character (len=*), intent(in) :: field_name, in_field, table
+
+  call gdallt(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), TRIM(table), LEN_TRIM(table), move)
+end subroutine
+
+subroutine fgd_alter_multiply (dirfile, field_name, in_field1, in_field2)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field1, in_field2
+
+  call gdalmt(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), LEN_TRIM(in_field2))
+end subroutine
+
+subroutine fgd_alter_divide (dirfile, field_name, in_field1, in_field2)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field1, in_field2
+
+  call gdaldv(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), LEN_TRIM(in_field2))
+end subroutine
+
+subroutine fgd_alter_recip (dirfile, field_name, in_field, dividend)
+  integer, intent(in) :: dirfile
+  double precision, intent(in) :: dividend
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdalrc(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  TRIM(in_field), LEN_TRIM(in_field), dividend)
+end subroutine
+
+subroutine fgd_alter_crecip (dirfile, field_name, in_field, cdividend)
+  integer, intent(in) :: dirfile
+  double complex, intent(in) :: cdividend
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdalcr(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  TRIM(in_field), LEN_TRIM(in_field), cdividend)
+end subroutine
+
+subroutine fgd_alter_phase (dirfile, field_name, in_field, phase)
+  integer, intent(in) :: dirfile, phase
+  character (len=*), intent(in) :: field_name, in_field
+
+  call gdalph(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  TRIM(in_field), LEN_TRIM(in_field), phase)
+end subroutine
+
+subroutine fgd_alter_raw (dirfile, field_code, data_type, spf, move)
+  integer, intent(in) :: dirfile, data_type, spf, move
+  character (len=*), intent(in) :: field_code
+
+  call gdalrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), data_type, spf, &
+  move)
+end subroutine
+
+subroutine fgd_alter_spec (dirfile, spec, recode)
+  integer, intent(in) :: dirfile, recode
+  character (len=*), intent(in) :: spec
+
+  call gdalsp(dirfile, TRIM(spec), LEN_TRIM(spec), recode)
+end subroutine
+
+subroutine fgd_malter_spec (dirfile, spec, parent, recode)
+  integer, intent(in) :: dirfile, recode
+  character (len=*), intent(in) :: parent, spec
+
+  call gdmlsp(dirfile, TRIM(spec), LEN_TRIM(spec), TRIM(parent), &
+  LEN_TRIM(parent), recode)
+end subroutine
+
+subroutine fgd_rename (dirfile, field_code, new_name, move_data)
+  integer, intent(in) :: dirfile, move_data
+  character (len=*), intent(in) :: field_code, new_name
+
+  call gdrenm(dirfile, TRIM(field_code), LEN_TRIM(field_code), TRIM(new_name), &
+  LEN_TRIM(new_name), move_data)
+end subroutine
+
+subroutine fgd_delete (dirfile, field_code, flags)
+  integer, intent(in) :: dirfile, flags
+  character (len=*), intent(in) :: field_code
+
+  call gddele(dirfile, TRIM(field_code), LEN_TRIM(field_code), flags)
+end subroutine
+
+function fgd_native_type (dirfile, field_code)
+  integer :: fgd_native_type
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  call gdntyp(fgd_native_type, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+function fgd_validate (dirfile, field_code)
+  integer :: fgd_validate
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  call gdvldt(fgd_validate, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+function fgd_framenum (dirfile, field_code, value)
+  double precision :: fgd_framenum
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  double precision, intent(in) :: value
+
+  call gdfnum(fgd_framenum, dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+  value)
+end function
+
+function fgd_framenum_subset (dirfile, field_code, value, frame_start, &
+frame_end)
+  double precision :: fgd_framenum_subset
+  integer, intent(in) :: dirfile, frame_start, frame_end
+  character (len=*), intent(in) :: field_code
+  double precision, intent(in) :: value
+
+  call gdfnss(fgd_framenum_subset, dirfile, TRIM(field_code), &
+  LEN_TRIM(field_code), value, frame_start, frame_end)
+end function
+
+subroutine fgd_dirfilename (dirfilename, l, dirfile, fragment_index)
+  character (len=*), intent(out) :: dirfilename
+  integer, intent(in) :: dirfile, fragment_index
+  integer, intent(inout) :: l
+
+  call gdname(dirfilename, l, dirfile, fragment_index)
+end subroutine
+
+function fgd_invalid_dirfile ()
+  integer :: fgd_invalid_dirfile
+
+  call gdinvd(fgd_invalid_dirfile)
+end function
+
+function fgd_dirfile_standards (dirfile, version)
+  integer :: fgd_dirfile_standards
+  integer, intent(in) :: dirfile, version
+
+  fgd_dirfile_standards = version
+
+  call gdstdv(fgd_dirfile_standards, dirfile)
+end function
+
+!gd_get_carray_slice with return_type=GD_NULL
+subroutine fgd_get_carray_n (dirfile, field_code, start, array_len)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_NULL, 0)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_NULL, 0)
+  end if
+end subroutine
+
+!gd_get_carray_slice with return_type=GD_INT8
+subroutine fgd_get_carray_i1 (dirfile, field_code, start, array_len, data_out)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer*1, dimension(:), intent(out)  :: data_out
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT8, &
+    data_out)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_INT8, data_out)
+  end if
+end subroutine
+
+!gd_get_carray_slice with return_type=GD_INT16
+subroutine fgd_get_carray_i2 (dirfile, field_code, start, array_len, data_out)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer*2, dimension(:), intent(out)  :: data_out
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT16, &
+    data_out)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_INT16, data_out)
+  end if
+end subroutine
+
+!gd_get_carray_slice with return_type=GD_INT32
+subroutine fgd_get_carray_i4 (dirfile, field_code, start, array_len, data_out)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer*4, dimension(:), intent(out)  :: data_out
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT32, &
+    data_out)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_INT32, data_out)
+  end if
+end subroutine
+
+!gd_get_carray_slice with return_type=GD_INT64
+subroutine fgd_get_carray_i8 (dirfile, field_code, start, array_len, data_out)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer*8, dimension(:), intent(out)  :: data_out
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT64, &
+    data_out)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_INT64, data_out)
+  end if
+end subroutine
+
+!gd_get_carray_slice with return_type=GD_FLOAT32
+subroutine fgd_get_carray_r4 (dirfile, field_code, start, array_len, data_out)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  real*4, dimension(:), intent(out)  :: data_out
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT32, &
+    data_out)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_FLOAT32, data_out)
+  end if
+end subroutine
+
+!gd_get_carray_slice with return_type=GD_FLOAT64
+subroutine fgd_get_carray_r8 (dirfile, field_code, start, array_len, data_out)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  double precision, dimension(:), intent(out)  :: data_out
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT64, &
+    data_out)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_FLOAT64, data_out)
+  end if
+end subroutine
+
+!gd_get_carray_slice with return_type=GD_COMPLEX64
+subroutine fgd_get_carray_c8 (dirfile, field_code, start, array_len, data_out)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  complex, dimension(:), intent(out)  :: data_out
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX64, &
+    data_out)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_COMPLEX64, data_out)
+  end if
+end subroutine
+
+!gd_get_carray_slice with return_type=GD_COMPLEX128
+subroutine fgd_get_carray_c16 (dirfile, field_code, start, array_len, data_out)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  double complex, dimension(:), intent(out)  :: data_out
+  
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    GD_COMPLEX128, data_out)
+  else
+    call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_COMPLEX128, data_out)
+  end if
+end subroutine
+
+! put_carray_slice with data_type=GD_INT8
+subroutine fgd_put_carray_i1 (dirfile, field_code, start, array_len, data_in)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer*1, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT8, &
+    data_in)
+  else
+    call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_INT8, data_in)
+  end if
+end subroutine
+
+! put_carray_slice with data_type=GD_INT16
+subroutine fgd_put_carray_i2 (dirfile, field_code, start, array_len, data_in)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer*2, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT16, &
+    data_in)
+  else
+    call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_INT16, data_in)
+  end if
+end subroutine
+
+! put_carray_slice with data_type=GD_INT32
+subroutine fgd_put_carray_i4 (dirfile, field_code, start, array_len, data_in)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer*4, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT32, &
+    data_in)
+  else
+    call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_INT32, data_in)
+  end if
+end subroutine
+
+! put_carray_slice with data_type=GD_INT64
+subroutine fgd_put_carray_i8 (dirfile, field_code, start, array_len, data_in)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer*8, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT64, &
+    data_in)
+  else
+    call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_INT64, data_in)
+  end if
+end subroutine
+
+! put_carray_slice with data_type=GD_FLOAT32
+subroutine fgd_put_carray_r4 (dirfile, field_code, start, array_len, data_in)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  real*4, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT32, &
+    data_in)
+  else
+    call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_FLOAT32, data_in)
+  end if
+end subroutine
+
+! put_carray_slice with data_type=GD_FLOAT64
+subroutine fgd_put_carray_r8 (dirfile, field_code, start, array_len, data_in)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  double precision, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT64, &
+    data_in)
+  else
+    call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_FLOAT64, data_in)
+  end if
+end subroutine
+
+! put_carray_slice with data_type=GD_COMPLEX64
+subroutine fgd_put_carray_c8 (dirfile, field_code, start, array_len, data_in)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  complex, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX64, &
+    data_in)
+  else
+    call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_COMPLEX64, data_in)
+  end if
+end subroutine
+
+! put_carray_slice with data_type=GD_COMPLEX128
+subroutine fgd_put_carray_c16 (dirfile, field_code, start, array_len, data_in)
+  integer, intent(in) :: dirfile, start, array_len
+  character (len=*), intent(in) :: field_code
+  double complex, dimension(:), intent(in) :: data_in
+
+  ! call f77 library
+  if (array_len .eq. 0) then
+    call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    GD_COMPLEX128, data_in)
+  else
+    call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, &
+    array_len, GD_COMPLEX128, data_in)
+  end if
+end subroutine
+
+function fgd_carray_len (dirfile, field_code)
+  integer :: fgd_carray_len
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  ! call f77 library
+  call gdcaln(fgd_carray_len, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+subroutine fgd_add_carray (dirfile, field_name, const_type, array_len, &
+fragment_index)
+  integer, intent(in) :: dirfile, const_type, fragment_index, array_len
+  character (len=*), intent(in) :: field_name
+  integer*1, dimension(array_len) :: zero
+
+  zero = 0
+
+  call gdadca(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, &
+  array_len, GD_INT8, zero, fragment_index)
+end subroutine
+
+subroutine fgd_madd_carray (dirfile, parent, field_name, const_type, array_len)
+  integer, intent(in) :: dirfile, const_type, array_len
+  character (len=*), intent(in) :: field_name, parent
+  integer*1, dimension(array_len) :: zero
+
+  zero = 0
+
+  call gdmdca(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), &
+  LEN_TRIM(field_name), const_type, array_len, GD_INT8, zero)
+end subroutine
+
+subroutine fgd_alter_carray (dirfile, field_name, const_type, array_len)
+  integer, intent(in) :: dirfile, const_type, array_len
+  character (len=*), intent(in) :: field_name
+  integer*1, dimension(array_len) :: zero
+
+  zero = 0
+
+  call gdalca(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, &
+  array_len)
+end subroutine
+
+function fgd_seek (dirfile, field_name, frame_num, sample_num, flags)
+  integer :: fgd_seek
+  integer, intent(in) :: dirfile, frame_num, sample_num, flags
+  character (len=*), intent(in) :: field_name
+  
+  call gdseek(fgd_seek, dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+  frame_num, sample_num, flags)
+end function
+
+function fgd_tell (dirfile, field_name)
+  integer :: fgd_tell
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name
+  
+  call gdtell(fgd_tell, dirfile, TRIM(field_name), LEN_TRIM(field_name))
+end function
+
+! gd_constants with return_type=GD_INT8
+subroutine fgd_constants_i1 (constants, dirfile)
+  integer*1, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+
+  nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdcons(constants(i), dirfile, GD_INT8, i)
+  end do
+end subroutine
+
+! gd_constants with return_type=GD_INT16
+subroutine fgd_constants_i2 (constants, dirfile)
+  integer*2, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+
+  nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdcons(constants(i), dirfile, GD_INT16, i)
+  end do
+end subroutine
+
+! gd_constants with return_type=GD_INT32
+subroutine fgd_constants_i4 (constants, dirfile)
+  integer*4, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+
+  nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdcons(constants(i), dirfile, GD_INT32, i)
+  end do
+end subroutine
+
+! gd_constants with return_type=GD_INT64
+subroutine fgd_constants_i8 (constants, dirfile)
+  integer*8, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+
+  nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdcons(constants(i), dirfile, GD_INT64, i)
+  end do
+end subroutine
+
+! gd_constants with return_type=GD_FLOAT32
+subroutine fgd_constants_r4 (constants, dirfile)
+  real*4, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+
+  nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdcons(constants(i), dirfile, GD_FLOAT32, i)
+  end do
+end subroutine
+
+! gd_constants with return_type=GD_FLOAT64
+subroutine fgd_constants_r8 (constants, dirfile)
+  real*8, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+
+  nfields = fgd_nfields_by_type(dirfile, GD_STRING_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdcons(constants(i), dirfile, GD_FLOAT64, i)
+  end do
+end subroutine
+
+! gd_constants with return_type=GD_COMPLEX64
+subroutine fgd_constants_c8 (constants, dirfile)
+  complex, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+
+  nfields = fgd_nfields_by_type(dirfile, GD_STRING_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdcons(constants(i), dirfile, GD_COMPLEX64, i)
+  end do
+end subroutine
+
+! gd_constants with return_type=GD_COMPLEX128
+subroutine fgd_constants_c16 (constants, dirfile)
+  double complex, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+
+  nfields = fgd_nfields_by_type(dirfile, GD_STRING_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdcons(constants(i), dirfile, GD_COMPLEX128, i)
+  end do
+end subroutine
+
+! gd_mconstants with return_type=GD_INT8
+subroutine fgd_mconstants_i1 (constants, dirfile, parent)
+  integer*1, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+  character (len=*), intent(in) :: parent
+
+  nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), &
+    GD_INT8, i)
+  end do
+end subroutine
+
+! gd_mconstants with return_type=GD_INT16
+subroutine fgd_mconstants_i2 (constants, dirfile, parent)
+  integer*2, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+  character (len=*), intent(in) :: parent
+
+  nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), &
+    GD_INT16, i)
+  end do
+end subroutine
+
+! gd_mconstants with return_type=GD_INT32
+subroutine fgd_mconstants_i4 (constants, dirfile, parent)
+  integer*4, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+  character (len=*), intent(in) :: parent
+
+  nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), &
+    GD_INT32, i)
+  end do
+end subroutine
+
+! gd_mconstants with return_type=GD_INT64
+subroutine fgd_mconstants_i8 (constants, dirfile, parent)
+  integer*8, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+  character (len=*), intent(in) :: parent
+
+  nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), &
+    GD_INT64, i)
+  end do
+end subroutine
+
+! gd_mconstants with return_type=GD_FLOAT32
+subroutine fgd_mconstants_r4 (constants, dirfile, parent)
+  real*4, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+  character (len=*), intent(in) :: parent
+
+  nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), &
+    GD_FLOAT32, i)
+  end do
+end subroutine
+
+! gd_mconstants with return_type=GD_FLOAT64
+subroutine fgd_mconstants_r8 (constants, dirfile, parent)
+  real*8, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+  character (len=*), intent(in) :: parent
+
+  nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), &
+    GD_FLOAT64, i)
+  end do
+end subroutine
+
+! gd_mconstants with return_type=GD_COMPLEX64
+subroutine fgd_mconstants_c8 (constants, dirfile, parent)
+  complex, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+  character (len=*), intent(in) :: parent
+
+  nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), &
+    GD_COMPLEX64, i)
+  end do
+end subroutine
+
+! gd_mconstants with return_type=GD_COMPLEX128
+subroutine fgd_mconstants_c16 (constants, dirfile, parent)
+  double complex, dimension(:), intent(out) :: constants
+  integer, intent(in) :: dirfile
+  integer :: nfields, i
+  character (len=*), intent(in) :: parent
+
+  nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY)
+  do i=1,nfields
+    ! call f77 library
+    call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), &
+    GD_COMPLEX128, i)
+  end do
+end subroutine
+
+function fgd_string_value_max (dirfile)
+  integer :: fgd_string_value_max
+  integer, intent(in) :: dirfile
+
+  ! call f77 library
+  call gdstrx(fgd_string_value_max, dirfile)
+end function
+
+subroutine fgd_strings (strings, dirfile, string_len)
+  character(len=*), dimension(:), intent(out) :: strings
+  integer, intent(in) :: dirfile
+  integer, intent(inout) :: string_len
+  integer :: max_len, nfields, i
+
+  ! make sure the string list is large enough
+  max_len = fgd_string_value_max(dirfile)
+
+  if (string_len .lt. max_len) then
+    string_len = max_len
+  else
+    nfields = fgd_nfields_by_type(dirfile, GD_STRING_ENTRY)
+    do i=1,nfields
+      ! call f77 library
+      call gdstrs(strings(i), string_len, dirfile, i)
+    end do
+  end if
+end subroutine
+
+function fgd_mstring_value_max (dirfile, parent)
+  integer :: fgd_mstring_value_max
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: parent
+
+  ! call f77 library
+  call gdmstx(fgd_mstring_value_max, dirfile, TRIM(parent), LEN_TRIM(parent))
+end function
+
+subroutine fgd_mstrings (strings, dirfile, parent, string_len)
+  character(len=*), dimension(:), intent(out) :: strings
+  integer, intent(in) :: dirfile
+  integer, intent(inout) :: string_len
+  integer :: max_len, nfields, i
+  character (len=*), intent(in) :: parent
+
+  ! make sure the field list is large enough
+  max_len = fgd_mstring_value_max(dirfile, parent)
+
+  if (string_len .lt. max_len) then
+    string_len = max_len
+  else
+    nfields = fgd_nmfields_by_type(dirfile, parent, GD_STRING_ENTRY)
+    do i=1,nfields
+      ! call f77 library
+      call gdmsts(strings(i), string_len, dirfile, TRIM(parent), &
+      LEN_TRIM(parent), i)
+    end do
+  end if
+end subroutine
+
+subroutine fgd_add_alias (dirfile, field_code, targ, fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character(len=*), intent(in) :: field_code, targ
+
+  call gdadal(dirfile, TRIM(field_code), LEN_TRIM(field_code), TRIM(targ), &
+  LEN_TRIM(targ), fragment_index)
+end subroutine
+
+subroutine fgd_add_window_i (dirfile, field_code, in_field, check_field, &
+  windop, threshold, fragment_index)
+  character(len=*), intent(in) :: field_code, in_field, check_field
+  integer, intent(in) :: dirfile, windop, threshold, fragment_index
+
+  ! convert to double precision, if necessary
+  if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. &
+  windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then
+    call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), &
+    LEN_TRIM(check_field), windop, 1d0 * threshold, fragment_index)
+  else
+    call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), &
+    LEN_TRIM(check_field), windop, threshold, fragment_index)
+  end if
+end subroutine
+
+subroutine fgd_add_window_r (dirfile, field_code, in_field, check_field, &
+  windop, threshold, fragment_index)
+  character(len=*), intent(in) :: field_code, in_field, check_field
+  integer, intent(in) :: dirfile, windop, fragment_index
+  double precision, intent(in) :: threshold
+
+  ! convert to integer, if necessary
+  if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. &
+  windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then
+    call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), &
+    LEN_TRIM(check_field), windop, threshold, fragment_index)
+  else
+    call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), &
+    TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), &
+    LEN_TRIM(check_field), windop, threshold, INT(fragment_index))
+  end if
+end subroutine
+
+subroutine fgd_madd_window_i (dirfile, parent, field_code, in_field, &
+  check_field, windop, threshold)
+  character(len=*), intent(in) :: parent, field_code, in_field, check_field
+  integer, intent(in) :: dirfile, windop, threshold
+
+  ! convert to double precision, if necessary
+  if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. &
+  windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then
+    call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), &
+    TRIM(check_field), LEN_TRIM(check_field), windop, 1d0 * threshold)
+  else
+    call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), &
+    TRIM(check_field), LEN_TRIM(check_field), windop, threshold)
+  end if
+end subroutine
+
+subroutine fgd_madd_window_r (dirfile, parent, field_code, in_field, &
+  check_field, windop, threshold)
+  character(len=*), intent(in) :: parent, field_code, in_field, check_field
+  integer, intent(in) :: dirfile, windop
+  double precision, intent(in) :: threshold
+
+  ! convert to integer, if necessary
+  if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. &
+  windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then
+    call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), &
+    TRIM(check_field), LEN_TRIM(check_field), windop, threshold)
+  else
+    call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+    LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), &
+    TRIM(check_field), LEN_TRIM(check_field), windop, INT(threshold))
+  end if
+end subroutine
+
+function fgd_alias_target (dirfile, field_code)
+  character (len=GD_MAX_LINE_LENGTH) :: fgd_alias_target
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: field_code
+  integer :: l = GD_MAX_LINE_LENGTH
+
+  call gdatrg(fgd_alias_target, l, dirfile, TRIM(field_code), &
+  LEN_TRIM(field_code))
+end function
+
+function fgd_naliases (dirfile, field_code)
+  integer :: fgd_naliases
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: field_code
+
+  call gdnals(fgd_naliases, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+function fgd_alias_max (dirfile, field_code)
+  integer :: fgd_alias_max
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: field_code
+
+  call gdalsx(fgd_alias_max, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+subroutine fgd_aliases (aliases, dirfile, field_code, alias_len)
+  character(len=*), dimension(:), intent(out) :: aliases
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: field_code
+  integer, intent(inout) :: alias_len
+  integer :: max_len, nalias, i
+
+  ! make sure the field list is large enough
+  max_len = fgd_alias_max(dirfile, field_code)
+
+  if (alias_len .lt. max_len) then
+    alias_len = max_len
+  else
+    nalias = fgd_naliases(dirfile, field_code)
+    do i=1,nalias
+      call gdalss(aliases(i), alias_len, dirfile, TRIM(field_code), &
+      LEN_TRIM(field_code), i)
+    end do
+  end if
+end subroutine
+
+subroutine fgd_alter_affixes (dirfile, fragment_index, prefix, suffix)
+  integer, intent(in) :: dirfile, fragment_index
+  character(len=*), intent(in) :: prefix, suffix
+
+  call gdaafx(dirfile, fragment_index, TRIM(prefix), LEN_TRIM(prefix), &
+  TRIM(suffix), LEN_TRIM(suffix))
+end subroutine
+
+subroutine fgd_alter_window_i (dirfile, field_name, in_field, check_field, &
+  windop, threshold)
+  integer, intent(in) :: dirfile, windop, threshold
+  character (len=*), intent(in) :: field_name, in_field, check_field
+
+  ! convert to double precision, if necessary
+  if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. &
+  windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then
+    call gdalwd(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+    TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), &
+    LEN_TRIM(check_field), windop, 1d0 * threshold)
+  else
+    call gdalwd(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+    TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), &
+    LEN_TRIM(check_field), windop, threshold)
+  end if
+end subroutine
+
+subroutine fgd_alter_window_r (dirfile, field_name, in_field, check_field, &
+  windop, threshold)
+  integer, intent(in) :: dirfile, windop
+  character (len=*), intent(in) :: field_name, in_field, check_field
+  double precision, intent(in) :: threshold
+
+  ! convert to integer, if necessary
+  if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. &
+  windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then
+    call gdalwd(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+    TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), &
+    LEN_TRIM(check_field), windop, threshold)
+  else
+    call gdalwd(dirfile, TRIM(field_name), LEN_TRIM(field_name), &
+    TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), &
+    LEN_TRIM(check_field), windop, INT(threshold))
+  end if
+end subroutine
+
+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
+  character (len=*), intent(in) :: field_code
+
+  call gdhidn(fgd_hidden, dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end function
+
+subroutine fgd_hide (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  call gdhide(dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end subroutine
+
+subroutine fgd_unhide (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  call gduhid(dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end subroutine
+
+subroutine fgd_madd_alias (dirfile, parent, field_code, targ)
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: parent, field_code, targ
+
+  call gdmdal(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+  LEN_TRIM(field_code), TRIM(targ), LEN_TRIM(targ))
+end subroutine
+
+subroutine fgd_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
+  character (len=*), intent(in) :: fragmentname, prefix, suffix
+
+  call gdinca(dirfile, TRIM(fragmentname), LEN_TRIM(fragmentname), &
+  fragment_index, TRIM(prefix), LEN_TRIM(prefix), TRIM(suffix), &
+  LEN_TRIM(suffix), flags)
+end subroutine
+
+subroutine fgd_sync (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  call gdsync(dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end subroutine
+
+subroutine fgd_raw_close (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  call gdrclo(dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end subroutine
+
+subroutine fgd_fragment_affixes (prefix, pl, suffix, sl, dirfile, &
+fragment_index)
+  character(len=*), intent(out) :: prefix, suffix
+  integer, intent(in) :: dirfile, fragment_index
+  integer, intent(inout) :: pl, sl
+
+  call gdfraf(prefix, pl, suffix, sl, dirfile, fragment_index)
+end subroutine
+  
+subroutine fgd_add_mplex (dirfile, field_code, in_field, count_field, &
+  count_val, period, fragment_index)
+  character(len=*), intent(in) :: field_code, in_field, count_field
+  integer, intent(in) :: dirfile, count_val, period, fragment_index
+
+  call gdadmx(dirfile, TRIM(field_code), LEN_TRIM(field_code), TRIM(in_field), &
+  LEN_TRIM(in_field), TRIM(count_field), LEN_TRIM(count_field), count_val, &
+  period, fragment_index)
+end subroutine
+
+subroutine fgd_madd_mplex (dirfile, parent, field_code, in_field, count_field, &
+  count_val, period)
+  character(len=*), intent(in) :: parent, field_code, in_field, count_field
+  integer, intent(in) :: dirfile, count_val, period
+
+  call gdmdmx(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), &
+  LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), TRIM(count_field), &
+  LEN_TRIM(count_field), count_val, period)
+end subroutine
+
+subroutine fgd_alter_mplex (dirfile, field_name, in_field, count_field, &
+  count_val, period)
+  integer, intent(in) :: dirfile, count_val, period
+  character (len=*), intent(in) :: field_name, in_field, count_field
+
+  call gdalmx(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), &
+  LEN_TRIM(in_field), TRIM(count_field), LEN_TRIM(count_field), count_val, &
+  period)
+end subroutine
+
+subroutine fgd_strtok (token, l, dirfile, string)
+  character (len=*), intent(out) :: token
+  integer, intent(inout) :: l
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: string
+
+  call gdtoke(token, l, dirfile, TRIM(string), LEN_TRIM(string))
+end subroutine
+
+function fgd_desync (dirfile, flags)
+  integer :: fgd_desync
+  integer, intent(in) :: dirfile, flags
+
+  call gddsyn(fgd_desync, dirfile, flags)
+end function
+
+function fgd_flags (dirfile, set, reset)
+  integer :: fgd_flags
+  integer, intent(in) :: dirfile, set, reset
+
+  call gdflag(fgd_flags, dirfile, set, reset)
+end function
+
+subroutine fgd_verbose_prefix(dirfile, prefix)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: prefix
+
+  call gdvbpx(dirfile, TRIM(prefix), LEN_TRIM(prefix))
+end subroutine
+
+subroutine fgd_mplex_lookback(dirfile, lookback)
+  integer, intent(in) :: dirfile, lookback
+
+  call gdmxlb(dirfile, lookback)
+end subroutine
+
+function fgd_nentries (dirfile, parent, entype, flags)
+  integer :: fgd_nentries
+  integer, intent(in) :: dirfile, entype, flags
+  character (len=*), intent(in) :: parent
+  integer :: parent_l
+
+  parent_l = LEN_TRIM(parent)
+  if (parent_l .EQ. 0) parent_l = -1
+
+  ! call f77 library
+  call gdnent(fgd_nentries, dirfile, TRIM(parent), parent_l, entype, flags)
+end function
+
+function fgd_entry_name_max (dirfile, parent, entype, flags)
+  integer :: fgd_entry_name_max
+  integer, intent(in) :: dirfile, entype, flags
+  character (len=*), intent(in) :: parent
+  integer :: parent_l
+
+  parent_l = LEN_TRIM(parent)
+  if (parent_l .EQ. 0) parent_l = -1
+
+  ! call f77 library
+  call gdentx(fgd_entry_name_max, dirfile, TRIM(parent), parent_l, entype, &
+  flags)
+end function
+
+subroutine fgd_entry_list (entry_list, dirfile, parent, entype, flags, &
+entry_len)
+  character(len=*), dimension(:), intent(out) :: entry_list
+  integer, intent(in) :: dirfile, entype, flags
+  integer, intent(inout) :: entry_len
+  character (len=*), intent(in) :: parent
+  integer :: max_len, nentries, i, parent_l
+
+  ! make sure the entry list is large enough
+  max_len = fgd_entry_name_max(dirfile, parent, entype, flags)
+  parent_l = LEN_TRIM(parent)
+  if (parent_l .EQ. 0) parent_l = -1
+
+  if (entry_len .lt. max_len) then
+    entry_len = max_len
+  else
+    nentries = fgd_nentries(dirfile, parent, entype, flags)
+    do i=1,nentries
+      ! call f77 library
+      call gdentn(entry_list(i), entry_len, dirfile, TRIM(parent), parent_l, &
+      entype, flags, i)
+    end do
+  end if
+end subroutine
+
+function fgd_linterp_tablename (dirfile, field_code)
+  character (len=GD_MAX_LINE_LENGTH) :: fgd_linterp_tablename
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  integer :: l = GD_MAX_LINE_LENGTH
+
+  call gdlttn (fgd_linterp_tablename, l, dirfile, TRIM(field_code), &
+  LEN_TRIM(field_code))
+end function
+
+end module
diff --git a/bindings/f77/test/Makefile.am b/bindings/f77/test/Makefile.am
new file mode 100644
index 0000000..5fb0698
--- /dev/null
+++ b/bindings/f77/test/Makefile.am
@@ -0,0 +1,71 @@
+# Copyright (C) 2008-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
+#
+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)
+F95LDADD=../libf95getdata.la $(F77LDADD)
+F77LDADD=../libfgetdata.la
+AM_LDFLAGS = -L..
+
+TESTS=gdcopn big_test $(F95TESTS)
+
+gdcopn_SOURCES=gdcopn.f
+gdcopn_LDADD=$(F77LDADD)
+
+big_test_SOURCES=big_test.f
+big_test_LDADD=$(F77LDADD)
+
+big_test95_SOURCES=big_test95.f90
+nodist_big_test95_SOURCES=../getdata.mod
+big_test95_LDADD=$(F95LDADD)
+
+check_PROGRAMS=$(TESTS)
+
+clean-local:
+	rm -rf test_dirfile
+	rm -rf *~
diff --git a/bindings/f77/test/Makefile.in b/bindings/f77/test/Makefile.in
new file mode 100644
index 0000000..2305a3d
--- /dev/null
+++ b/bindings/f77/test/Makefile.in
@@ -0,0 +1,868 @@
+# 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@
+TESTS = gdcopn$(EXEEXT) big_test$(EXEEXT) $(am__EXEEXT_1)
+check_PROGRAMS = $(am__EXEEXT_2)
+subdir = bindings/f77/test
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(srcdir)/test_getdata.f.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES = test_getdata.f
+CONFIG_CLEAN_VPATH_FILES =
+ at MAKE_F95BINDINGS_TRUE@am__EXEEXT_1 = big_test95$(EXEEXT)
+am__EXEEXT_2 = gdcopn$(EXEEXT) big_test$(EXEEXT) $(am__EXEEXT_1)
+am_big_test_OBJECTS = big_test.$(OBJEXT)
+big_test_OBJECTS = $(am_big_test_OBJECTS)
+big_test_DEPENDENCIES = $(F77LDADD)
+AM_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 = 
+am_big_test95_OBJECTS = big_test95.$(OBJEXT)
+nodist_big_test95_OBJECTS =
+big_test95_OBJECTS = $(am_big_test95_OBJECTS) \
+	$(nodist_big_test95_OBJECTS)
+big_test95_DEPENDENCIES = $(F95LDADD)
+am_gdcopn_OBJECTS = gdcopn.$(OBJEXT)
+gdcopn_OBJECTS = $(am_gdcopn_OBJECTS)
+gdcopn_DEPENDENCIES = $(F77LDADD)
+AM_V_P = $(am__v_P_ 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
+F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)
+LTF77COMPILE = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)
+AM_V_F77 = $(am__v_F77_ at AM_V@)
+am__v_F77_ = $(am__v_F77_ at AM_DEFAULT_V@)
+am__v_F77_0 = @echo "  F77     " $@;
+am__v_F77_1 = 
+F77LD = $(F77)
+F77LINK = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_F77LD = $(am__v_F77LD_ at AM_V@)
+am__v_F77LD_ = $(am__v_F77LD_ at AM_DEFAULT_V@)
+am__v_F77LD_0 = @echo "  F77LD   " $@;
+am__v_F77LD_1 = 
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+AM_V_FC = $(am__v_FC_ at AM_V@)
+am__v_FC_ = $(am__v_FC_ at AM_DEFAULT_V@)
+am__v_FC_0 = @echo "  FC      " $@;
+am__v_FC_1 = 
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_FCLD = $(am__v_FCLD_ at AM_V@)
+am__v_FCLD_ = $(am__v_FCLD_ at AM_DEFAULT_V@)
+am__v_FCLD_0 = @echo "  FCLD    " $@;
+am__v_FCLD_1 = 
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ 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 = $(big_test_SOURCES) $(big_test95_SOURCES) \
+	$(nodist_big_test95_SOURCES) $(gdcopn_SOURCES)
+DIST_SOURCES = $(big_test_SOURCES) $(big_test95_SOURCES) \
+	$(gdcopn_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@
+DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@
+DEFINE_gd_int16_t = @DEFINE_gd_int16_t@
+DEFINE_gd_int64_t = @DEFINE_gd_int64_t@
+DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@
+DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIFF = @DIFF@
+DLLTOOL = @DLLTOOL@
+DL_LIBRARY_PATH = @DL_LIBRARY_PATH@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+F95GETDATA_VERSION = @F95GETDATA_VERSION@
+FC = @FC@
+FCFLAGS = @FCFLAGS@ -I. -I.. $(F77_WALL) $(FC_WEXTRA) $(FC_ASSUME)
+FFLAGS = @FFLAGS@ -I. -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME) \
+	$(F77_FNO_BACKSLASH)
+FGETDATA_VERSION = @FGETDATA_VERSION@
+FGREP = @FGREP@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008-2010, 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
+#
+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
+ at MAKE_F95BINDINGS_TRUE@F95TESTS = big_test95
+BUILT_SOUCES = test_getdata.f
+F95LDADD = ../libf95getdata.la $(F77LDADD)
+F77LDADD = ../libfgetdata.la
+AM_LDFLAGS = -L..
+gdcopn_SOURCES = gdcopn.f
+gdcopn_LDADD = $(F77LDADD)
+big_test_SOURCES = big_test.f
+big_test_LDADD = $(F77LDADD)
+big_test95_SOURCES = big_test95.f90
+nodist_big_test95_SOURCES = ../getdata.mod
+big_test95_LDADD = $(F95LDADD)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .f .f90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/f77/test/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/f77/test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+test_getdata.f: $(top_builddir)/config.status $(srcdir)/test_getdata.f.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+big_test$(EXEEXT): $(big_test_OBJECTS) $(big_test_DEPENDENCIES) $(EXTRA_big_test_DEPENDENCIES) 
+	@rm -f big_test$(EXEEXT)
+	$(AM_V_F77LD)$(F77LINK) $(big_test_OBJECTS) $(big_test_LDADD) $(LIBS)
+
+big_test95$(EXEEXT): $(big_test95_OBJECTS) $(big_test95_DEPENDENCIES) $(EXTRA_big_test95_DEPENDENCIES) 
+	@rm -f big_test95$(EXEEXT)
+	$(AM_V_FCLD)$(FCLINK) $(big_test95_OBJECTS) $(big_test95_LDADD) $(LIBS)
+
+gdcopn$(EXEEXT): $(gdcopn_OBJECTS) $(gdcopn_DEPENDENCIES) $(EXTRA_gdcopn_DEPENDENCIES) 
+	@rm -f gdcopn$(EXEEXT)
+	$(AM_V_F77LD)$(F77LINK) $(gdcopn_OBJECTS) $(gdcopn_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.f.o:
+	$(AM_V_F77)$(F77COMPILE) -c -o $@ $<
+
+.f.obj:
+	$(AM_V_F77)$(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f.lo:
+	$(AM_V_F77)$(LTF77COMPILE) -c -o $@ $<
+
+.f90.o:
+	$(AM_V_FC)$(FCCOMPILE) -c -o $@ $<
+
+.f90.obj:
+	$(AM_V_FC)$(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+	$(AM_V_FC)$(LTFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+	clean-checkPROGRAMS clean-generic clean-libtool clean-local \
+	cscopelist-am ctags ctags-am distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am
+
+
+clean-local:
+	rm -rf test_dirfile
+	rm -rf *~
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/f77/test/big_test.f b/bindings/f77/test/big_test.f
new file mode 100644
index 0000000..46ea53b
--- /dev/null
+++ b/bindings/f77/test/big_test.f
@@ -0,0 +1,2182 @@
+C     Copyright (C) 2009-2012 D. V. Wiebe
+C
+C     CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+C
+C     This file is part of the GetData project.
+C
+C     GetData is free software; you can redistribute it and/or modify it under
+C     the terms of the GNU Lesser General Public License as published by the
+C     Free Software Foundation; either version 2.1 of the License, or (at your
+C     option) any later version.
+C
+C     GetData is distributed in the hope that it will be useful, but WITHOUT
+C     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+C     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+C     License for more details.
+C
+C     You should have received a copy of the GNU Lesser General Public License
+C     along with GetData; if not, write to the Free Software Foundation, Inc.,
+C     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+C
+
+C     General test
+C
+C     This very large test checks almost every procedure defined by the
+C     F77 bindings.  Procedures not tested include: GDCOPN GDMFLS GDCLOS
+C     GDCLBK GDDSCD (although this last one is used)
+
+C     Check functions
+      SUBROUTINE CHKERR(NE, T, D, V)
+      INCLUDE "getdata.f"
+      INTEGER NE, T, D, V, E
+      CALL GDEROR(E, D)
+
+      IF (E .NE. V) THEN
+        NE = NE + 1
+        WRITE(*, 9001) T, E, V
+      ENDIF
+ 9001 FORMAT('e[', i3, '] = ', i4, ', expected ', i4)
+      END SUBROUTINE
+
+      SUBROUTINE CHKINT(NE, T, N, V)
+      INTEGER NE, T, N, V
+
+      IF (N .NE. V) THEN
+        NE = NE + 1
+        WRITE(*, 9002) T, N, V
+      ENDIF
+ 9002 FORMAT('n[', i3, '] = ', i4, ', expected ', i4)
+      END SUBROUTINE
+
+      SUBROUTINE CHKER2(NE, T, I, D, V)
+      INCLUDE "getdata.f"
+      INTEGER NE, T, I, D, V, E
+      CALL GDEROR(E, D)
+
+      IF (E .NE. V) THEN
+        NE = NE + 1
+        WRITE(*, 9006) I, T, E, V
+      ENDIF
+ 9006 FORMAT('e(', i3, ')[', i3, '] = ', i4, ', expected ', i4)
+      END SUBROUTINE
+
+      SUBROUTINE CHKIN2(NE, T, I, N, V)
+      INTEGER NE, T, I, N, V
+
+      IF (N .NE. V) THEN
+        NE = NE + 1
+        WRITE(*, 9007) I, T, N, V
+      ENDIF
+ 9007 FORMAT('n(', i3, ')[', i3, '] = ', i4, ', expected ', i4)
+      END SUBROUTINE
+
+      SUBROUTINE CHKST2(NE, T, I, N, V)
+      INTEGER NE, T, I
+      CHARACTER*(*) N, V
+
+      IF (N .NE. V) THEN
+        NE = NE + 1
+        WRITE(*, 9008) I, T, N, V
+      ENDIF
+ 9008 FORMAT('s(', i3, ')[', i3, '] = "', a, '", expected "', a, '"')
+      END SUBROUTINE
+
+      SUBROUTINE CHKSTR(NE, T, N, V)
+      INTEGER NE, T
+      CHARACTER*(*) N, V
+
+      IF (N .NE. V) THEN
+        NE = NE + 1
+        WRITE(*, 9009) T, N, V
+      ENDIF
+ 9009 FORMAT('s[', i3, '] = "', 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
+        NE = NE + 1
+        WRITE(*, 9010) I, T, N, V
+      ENDIF
+ 9010 FORMAT('d(', i3, ')[', i3, '] = ', 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
+        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,
+     +', expected ', d16.10, ';', d16.10)
+      END SUBROUTINE
+
+      SUBROUTINE CHKDBL(NE, T, N, V)
+      INTEGER NE, T
+      REAL*8 N, V
+
+      IF (ABS(N - V) .GT. 1E-5) THEN
+        NE = NE + 1
+        WRITE(*, 9012) T, N, V
+      ENDIF
+ 9012 FORMAT('d[', i3, '] = ', 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
+        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,
+     +', expected ', d16.10, ';', d16.10)
+      END SUBROUTINE
+
+      SUBROUTINE CHKEOS(NE, T, N, V)
+      INTEGER NE, T, F
+      CHARACTER*(*) N, V
+
+      F = INDEX(N, V)
+      IF (F .EQ. 0) THEN
+        F = 1
+      ENDIF
+
+      CALL CHKSTR(NE, T, N(F:), V)
+      END SUBROUTINE
+
+      SUBROUTINE CHKEOK(NE, T, D)
+      INTEGER NE, T, D
+      INCLUDE "getdata.f"
+      CALL CHKERR(NE, T, D, GD_EOK)
+      END SUBROUTINE
+
+      SUBROUTINE CHKOK2(NE, T, I, D)
+      INTEGER NE, T, I, D
+      INCLUDE "getdata.f"
+      CALL CHKER2(NE, T, I, D, GD_EOK)
+      END SUBROUTINE
+
+
+
+
+      PROGRAM BIGTST
+      INCLUDE "getdata.f"
+      INCLUDE "test_getdata.f"
+
+      CHARACTER*12 fildir
+      PARAMETER (fildir = 'test_dirfile')
+      CHARACTER*19 frmat
+      PARAMETER (frmat = 'test_dirfile/format')
+      CHARACTER*18 frm2
+      PARAMETER (frm2 = 'test_dirfile/form2')
+      CHARACTER*17 dat
+      PARAMETER (dat = 'test_dirfile/data')
+      INTEGER flen
+      PARAMETER (flen = 11)
+      INTEGER nfields
+      PARAMETER (nfields = 17)
+      INTEGER slen
+      PARAMETER (slen = 26)
+      INTEGER plen
+      PARAMETER (plen = 4096)
+
+      CHARACTER*26 strings(3)
+      CHARACTER*11 fields(nfields + 9)
+      CHARACTER*11 fn
+      CHARACTER*26 str
+      CHARACTER*4096 path
+      INTEGER*1 c(8)
+      INTEGER*1 datdat(80)
+      INTEGER*1 k
+      INTEGER i
+      INTEGER d
+      INTEGER m
+      INTEGER n
+      INTEGER l
+      INTEGER j
+      INTEGER ne
+      REAL fl
+      REAL*8 dp
+      REAL*8 p(6), q(6)
+      COMPLEX*16 dc
+      COMPLEX*16 cp(6), cq(6)
+
+      CALL SYSTEM ( 'rm -rf ' // fildir )
+      CALL SYSTEM ( 'mkdir ' // fildir )
+
+      DO 10 k = 1, 80
+      datdat(k) = k
+   10 CONTINUE
+
+      fields(1) = 'INDEX  '
+      fields(2) = 'alias  '
+      fields(3) = 'bit    '
+      fields(4) = 'carray '
+      fields(5) = 'const  '
+      fields(6) = 'data   '
+      fields(7) = 'div    '
+      fields(8) = 'lincom '
+      fields(9) = 'linterp'
+      fields(10) = 'mplex  '
+      fields(11) = 'mult   '
+      fields(12) = 'phase  '
+      fields(13) = 'polynom'
+      fields(14) = 'recip  '
+      fields(15) = 'sbit   '
+      fields(16) = 'string '
+      fields(17) = 'window '
+
+C     Write the test dirfile
+      OPEN(1, FILE=frmat, STATUS='NEW')
+      WRITE(1, *) '/ENDIAN little'
+      WRITE(1, *) 'data RAW INT8 8'
+      WRITE(1, *) 'lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp
+     + const const'
+      WRITE(1, *) '/META data mstr STRING "This is a string constant."'
+      WRITE(1, *) '/META data mconst CONST COMPLEX128 3.3;4.4'
+      WRITE(1, *) '/META data mlut LINTERP DATA ./lut'
+      WRITE(1, *) 'const CONST FLOAT64 5.5'
+      WRITE(1, *) 'carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6'
+      WRITE(1, *) 'linterp LINTERP data ./lut'
+      WRITE(1, *) 'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4
+     + const const'
+      WRITE(1, *) 'bit BIT data 3 4'
+      WRITE(1, *) 'sbit SBIT data 5 6'
+      WRITE(1, *) 'mplex MPLEX data sbit 1 10'
+      WRITE(1, *) 'mult MULTIPLY data sbit'
+      WRITE(1, *) 'phase PHASE data 11'
+      WRITE(1, *) 'div DIVIDE mult bit'
+      WRITE(1, *) 'recip RECIP div 6.5;4.3'
+      WRITE(1, *) 'window WINDOW linterp mult LT 4.1'
+      WRITE(1, *) '/ALIAS alias data'
+      WRITE(1, *) 'string STRING "Zaphod Beeblebrox"'
+      CLOSE(1, STATUS='KEEP')
+
+      OPEN(1, FILE=frm2, STATUS='NEW')
+      WRITE(1, *) 'const2 CONST INT8 -19'
+      CLOSE(1, STATUS='KEEP')
+
+      OPEN(1, FILE=dat, FORM='UNFORMATTED', ACCESS='DIRECT', RECL=80,
+     +STATUS='NEW')
+      WRITE(1, REC=1) datdat
+      CLOSE(1, STATUS='KEEP')
+
+      ne = 0
+C     0: GDEROR check
+      CALL GDOPEN(d, "x", 1, GD_RO)
+      CALL CHKERR(ne, 0, d, GD_EOP)
+
+C     1: GDOPEN check
+      CALL GDOPEN(d, fildir, 12, GD_RW)
+      CALL CHKEOK(ne, 1, d)
+
+C     2: 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)
+
+      DO 20 i = 1, 8
+      CALL CHKIN2(ne, 2, i, INT(c(i)), 40 + i)
+   20 CONTINUE
+
+C     3: GDGTCO check
+      CALL GDGTCO(d, 'const', 5, GD_F32, fl)
+      CALL CHKEOK(ne, 3, d)
+      CALL CHKDBL(ne, 3, 1d0 * fl, 5.5d0)
+
+C     4: GDFDNX check
+      CALL GDFDNX(i, d)
+      CALL CHKEOK(ne, 4, d)
+      CALL CHKINT(ne, 4, i, 7)
+
+C     5: GDMFNX check
+      CALL GDMFNX(i, d, 'data', 4)
+      CALL CHKEOK(ne, 5, d)
+      CALL CHKINT(ne, 5, i, 6)
+
+C     6: GDNFLD check
+      CALL GDNFLD(n, d)
+      CALL CHKEOK(ne, 6, d)
+      CALL CHKINT(ne, 6, n, nfields)
+
+C     7: 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)
+
+C     8: GDFLDN check
+      DO 80 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
+
+C     9: GDNMFD check
+      CALL GDNMFD(n, d, 'data', 4)
+      CALL CHKEOK(ne, 9, d)
+      CALL CHKINT(ne, 9, n, 3)
+
+C     10: GDMFDN check
+      fields(1) = 'mstr'
+      fields(2) = 'mconst'
+      fields(3) = 'mlut'
+      DO 100 i = 1, n
+      l = flen
+      CALL GDMFDN(fn, l, d, 'data', 4, i)
+      CALL CHKOK2(ne, 10, i, d)
+      CALL CHKIN2(ne, 10, i, l, flen)
+      CALL CHKST2(ne, 10, i, fn, fields(i))
+  100 CONTINUE
+
+C     11: GDNFRM check
+      CALL GDNFRM(n, d)
+      CALL CHKEOK(ne, 11, d)
+      CALL CHKINT(ne, 11, n, 10)
+
+C     12: GDGSPF check
+      CALL GDGSPF(n, d, 'data', 4)
+      CALL CHKEOK(ne, 12, d)
+      CALL CHKINT(ne, 12, n, 8)
+
+C     13: GDPUTD check
+      c(1) = 13
+      c(2) = 14
+      c(3) = 15
+      c(4) = 16
+      c(5) = 17
+      c(6) = 18
+      c(7) = 19
+      c(8) = 20
+      CALL GDPUTD(n, d, 'data', 4, 5, 1, 0, 4, GD_I8, c)
+      CALL CHKEOK(ne, 13, d)
+      CALL CHKINT(ne, 13, n, 4)
+
+      CALL GDGETD(n, d, 'data', 4, 5, 0, 1, 0, GD_I8, c)
+
+      DO 130 i = 1, 8
+      IF (i .EQ. 1 .OR. i .GT. 5) THEN
+        n = 40 + i
+      ELSE
+        n = 11 + i
+      ENDIF
+      CALL CHKIN2(ne, 13, i, INT(c(i)), n)
+  130 CONTINUE
+
+C     14: 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')
+
+C     15: GDENTY check
+      CALL GDENTY(n, d, 'data', 4)
+      CALL CHKEOK(ne, 15, d)
+      CALL CHKINT(ne, 15, n, GD_RWE)
+
+C     16: 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)
+
+C     17: GDGELC check
+      l = flen
+      CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3),
+     +p(4), fields(3), l, p(5), p(6), n, d, 'lincom', 6)
+      CALL 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')
+
+      q(1) = 1.1
+      q(2) = 2.2
+      q(3) = 2.2
+      q(4) = 3.3
+      q(5) = 5.5
+      q(6) = 5.5
+      DO 170 i=1,6
+      CALL CHKDB2(ne, 17, i, p(i), q(i))
+  170 CONTINUE
+
+C     18: GDGECL check
+      l = flen
+      CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3),
+     +cp(4), fields(3), l, cp(5), cp(6), n, d, 'lincom', 6)
+      CALL 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
+      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')
+
+      q(1) = 1.1
+      q(2) = 2.2
+      q(3) = 2.2
+      q(4) = 3.3
+      q(5) = 5.5
+      q(6) = 5.5
+      DO 190 i=1,6
+      CALL CHKDB2(ne, 19, i, p(i), q(i))
+  190 CONTINUE
+
+C     20: GDGECP check
+      l = flen
+      CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6),
+     +n, d, 'polynom', 7)
+      CALL 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
+      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')
+
+C     22: 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')
+
+C     23: 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')
+
+C     24: 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')
+
+C     25: 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')
+
+C     26: 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)
+
+C     27: GDFRGI check
+      CALL GDFRGI(n, d, 'const', 5)
+      CALL CHKEOK(ne, 27, d)
+      CALL CHKINT(ne, 27, n, 0)
+
+C     28: GDADRW check
+      CALL GDADRW(d, 'new1', 4, GD_F64, 3, 0)
+      CALL CHKOK2(ne, 28, 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)
+
+C     29: GDADLC check
+      CALL GDADLC(d, 'new2', 4, 2, 'in1', 3, 9.9d0, 8.8d0, 'in2', 3,
+     +7.7d0, 6.6d0, '', 0, 0d0, 0d0, 0)
+      CALL CHKOK2(ne, 29, 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
+      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)
+      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)
+
+      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 GDADPN(d, 'new4', 4, 3, 'in1', 3, 3d3, 4d4, 5d5, 6d6, 0d0,
+     +0d0, 0)
+      CALL CHKOK2(ne, 31, 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')
+
+      q(1) = 3d3
+      q(2) = 4d4
+      q(3) = 5d5
+      q(4) = 6d6
+      q(5) = 5.5d0
+      q(6) = 5.5d0
+
+      DO 310 i=1,4
+      CALL CHKDB2(ne, 31, i, p(i), q(i))
+  310 CONTINUE
+
+C     32: GDADCP check
+      cq(1) = cmplx(3.1, 7.0)
+      cq(2) = cmplx(4.2, 8.0)
+      cq(3) = cmplx(5.2, 9.0)
+      cq(4) = cmplx(6.3, 4.4)
+      CALL GDADCP(d, 'new5', 4, 3, 'in1', 3, cq(1), cq(2), cq(3), cq(4),
+     +cq(5), cq(6), 0)
+      CALL CHKOK2(ne, 32, 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 GDADLT(d, "new6", 4, "in", 2, "./some/table", 12, 0)
+      CALL CHKOK2(ne, 33, 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')
+
+C     34: GDADBT check
+      CALL GDADBT(d, "new7", 4, "in", 2, 13, 12, 0)
+      CALL CHKOK2(ne, 34, 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 GDADSB(d, "new8", 4, "in", 2, 13, 12, 0)
+      CALL CHKOK2(ne, 35, 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 GDADMT(d, 'new9', 4, 'in1', 3, 'in2', 3, 0)
+      CALL CHKOK2(ne, 36, 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')
+
+C     37: GDADPH check
+      CALL GDADPH(d, 'new10', 5, 'in1', 3, 22, 0)
+      CALL CHKOK2(ne, 37, 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')
+
+C     38: GDADCO check
+      CALL GDADCO(d, 'new11', 5, GD_F64, GD_F32, -8.1, 0)
+      CALL CHKOK2(ne, 38, 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 GDGTCO(d, 'new11', 5, GD_F32, fl)
+      CALL CHKOK2(ne, 38, 3, d)
+      CALL CHKDBL(ne, 38, 1d0 * fl, -8.1d0)
+
+C     39: 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')
+
+C     40: GDNFRG check
+      CALL GDNFRG(n, d)
+      CALL CHKEOK(ne, 40, d)
+      CALL CHKINT(ne, 40, n, 1)
+
+C     41: GDINCL check
+      CALL GDINCL(d, 'form2', 5, 0, 0)
+      CALL CHKOK2(ne, 41, 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)
+
+C     42: GDNFDT check
+      CALL GDNFDT(n, d, GD_LCE)
+      CALL CHKEOK(ne, 42, d)
+      CALL CHKINT(ne, 42, n, 3)
+
+C     43: GDFDNT check
+      fields(1) = 'lincom'
+      fields(2) = 'new2'
+      fields(3) = 'new3'
+      DO 430 i = 1, n
+      l = flen
+      CALL GDFDNT(fn, l, d, GD_LCE, i)
+      CALL CHKOK2(ne, 43, i, d)
+      CALL CHKIN2(ne, 43, i, l, flen)
+      CALL CHKST2(ne, 43, i, fn, fields(i))
+  430 CONTINUE
+
+C     44: 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   '
+      fields(10) = 'new1   '
+      fields(11) = 'new10  '
+      fields(12) = 'new2   '
+      fields(13) = 'new3   '
+      fields(14) = 'new4   '
+      fields(15) = 'new5   '
+      fields(16) = 'new6   '
+      fields(17) = 'new7   '
+      fields(18) = 'new8   '
+      fields(19) = 'new9   '
+      fields(20) = 'phase  '
+      fields(21) = 'polynom'
+      fields(22) = 'recip  '
+      fields(23) = 'sbit   '
+      fields(24) = 'window '
+      DO 450 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
+
+C     46: GDMDLC check
+      CALL GDMDLC(d, 'data', 4, 'mnew1', 5, 2, 'in1', 3, 9.9d0, 8.8d0,
+     +'in2', 3, 7.7d0, 6.6d0, '', 0, 0d0, 0d0)
+      CALL CHKOK2(ne, 46, 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
+      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)
+      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)
+
+      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 GDMDPN(d, 'data', 4, 'mnew3', 5, 3, 'in1', 3, 3d3, 4d4, 5d5,
+     +6d6, 0d0, 0d0)
+      CALL CHKOK2(ne, 48, 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')
+
+      q(1) = 3d3
+      q(2) = 4d4
+      q(3) = 5d5
+      q(4) = 6d6
+      q(5) = 5.5d0
+      q(6) = 5.5d0
+      DO 480 i=1,4
+      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)
+      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)
+
+      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 GDMDLT(d, "data", 4, "mnew6", 5, "in", 2, "./more/table", 12)
+      CALL CHKOK2(ne, 50, 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')
+
+C     51: GDMDBT check
+      CALL GDMDBT(d, "data", 4, "mnew7", 5, "in", 2, 13, 12)
+      CALL CHKOK2(ne, 51, 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 GDMDSB(d, "data", 4, "mnew8", 5, "in", 2, 13, 12)
+      CALL CHKOK2(ne, 52, 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 GDMDMT(d, 'data', 4, 'mnew9', 5, 'in1', 3, 'in2', 3)
+      CALL CHKOK2(ne, 53, 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')
+
+C     54: GDMDPH check
+      CALL GDMDPH(d, 'data', 4, 'mnew10', 6, 'in1', 3, 22)
+      CALL CHKOK2(ne, 54, 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')
+
+C     55: GDMDCO check
+      CALL GDMDCO(d, 'data', 4, 'mnew11', 6, GD_F64, GD_F32, -8.1)
+      CALL CHKOK2(ne, 55, 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 GDGTCO(d, 'data/mnew11', 11, GD_F32, fl)
+      CALL CHKOK2(ne, 55, 3, d)
+      CALL CHKDBL(ne, 55, 1d0 * fl, -8.1d0)
+
+C     56: 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")
+
+C     57: GDADST check
+      CALL GDADST(d, 'new12', 5, "---string---", 12, 0)
+      CALL CHKOK2(ne, 57, 1, d)
+
+      CALL GDGTST(n, d, 'new12', 5, slen, str)
+      CALL CHKOK2(ne, 57, 2, d)
+      CALL CHKSTR(ne, 57, str, "---string---")
+
+C     58: GDMDST check
+      CALL GDMDST(d, "data", 4, 'mnew12', 6, "kai su, technon;", 16)
+      CALL CHKOK2(ne, 58, 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;")
+
+C     59: GDADSP check
+      CALL GDADSP(d, 'lorem STRING "Lorem ipsum"', 26, 0)
+      CALL CHKOK2(ne, 59, 1, d)
+
+      CALL GDGTST(n, d, 'lorem', 5, slen, str)
+      CALL CHKOK2(ne, 59, 2, d)
+      CALL CHKSTR(ne, 59, str, "Lorem ipsum")
+
+C     60: GDMDSP check
+      CALL GDMDSP(d, 'ipsum STRING "dolor sit amet."', 30, 'lorem', 5)
+      CALL CHKOK2(ne, 60, 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.")
+
+C     61: GDPTCO check
+      CALL GDPTCO(d, 'const', 5, GD_I32, 10)
+      CALL CHKOK2(ne, 61, 1, d)
+
+      CALL GDGTCO(d, 'const', 5, GD_F32, fl)
+      CALL CHKOK2(ne, 61, 2, d)
+      CALL CHKDBL(ne, 61, 1d0 * fl, 10.0d0)
+
+C     62: GDPTST check
+      CALL GDPTST(n, d, 'string', 6, 11, "Arthur Dent")
+      CALL CHKOK2(ne, 62, 1, d)
+      CALL CHKINT(ne, 62, n, 11)
+
+      CALL GDGTST(n, d, 'string', 6, slen, str)
+      CALL CHKOK2(ne, 62, 2, d)
+      CALL CHKSTR(ne, 62, str, "Arthur Dent")
+
+C     63: GDNMFT check
+      CALL GDNMFT(n, d, "data", 4, GD_LCE)
+      CALL CHKEOK(ne, 63, d)
+      CALL CHKINT(ne, 63, n, 2)
+
+C     64: GDMFDT check
+      fields(1) = 'mnew1'
+      fields(2) = 'mnew2'
+      DO 640 i = 1, n
+      l = flen
+      CALL GDMFDT(fn, l, d, "data", 4, GD_LCE, i)
+      CALL CHKOK2(ne, 64, i, d)
+      CALL CHKIN2(ne, 64, i, l, flen)
+      CALL CHKST2(ne, 64, i, fn, fields(i))
+  640 CONTINUE
+
+C     65: GDNMVE check
+      CALL GDNMVE(n, d, "data", 4)
+      CALL CHKEOK(ne, 65, d)
+      CALL CHKINT(ne, 65, n, 10)
+
+C     66: GDMVEN check
+      fields(1) = 'mlut  '
+      fields(2) = 'mnew1 '
+      fields(3) = 'mnew2 '
+      fields(4) = 'mnew3 '
+      fields(5) = 'mnew5 '
+      fields(6) = 'mnew6 '
+      fields(7) = 'mnew7 '
+      fields(8) = 'mnew8 '
+      fields(9) = 'mnew9 '
+      fields(10) = 'mnew10'
+      DO 660 i = 1, n
+      l = flen
+      CALL GDMVEN(fn, l, d, "data", 4, i)
+      CALL CHKOK2(ne, 66, i, d)
+      CALL CHKIN2(ne, 66, i, l, flen)
+      CALL CHKST2(ne, 66, i, fn, fields(i))
+  660 CONTINUE
+
+C     67: GDALRW check
+      CALL GDALRW(d, 'new1', 4, GD_I32, 4, 0)
+      CALL CHKOK2(ne, 67, 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)
+
+C     68: GDALLC check
+      CALL GDALLC(d, 'new2', 4, 3, 'in4', 3, 9.9d-1, 7.8d0, 'in5', 3,
+     +1.1d1, 2.2d-2, 'in6', 3, 1.96d0, 0d0)
+      CALL CHKOK2(ne, 68, 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')
+
+      q(1) = 9.9d-1
+      q(2) = 7.8d0
+      q(3) = 1.1d1
+      q(4) = 2.2d-2
+      q(5) = 1.96d0
+      q(6) = 0d0
+      DO 680 i=1,6
+      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)
+      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)
+
+      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 GDALPN(d, 'new4', 4, 4, 'in1', 3, 3d0, 4d0, 5d0, 6d0, 7d0,
+     +0d0)
+      CALL CHKOK2(ne, 70, 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 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)
+
+      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 GDALLT(d, "new6", 4, "in3", 3, "./other/table", 13, 0)
+      CALL CHKOK2(ne, 72, 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')
+
+C     73: GDALBT check
+      CALL GDALBT(d, "new7", 4, "in3", 3, 3, 2)
+      CALL CHKOK2(ne, 73, 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 GDALSB(d, "new8", 4, "out", 3, 1, 22)
+      CALL CHKOK2(ne, 74, 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 GDALMT(d, 'new9', 4, 'in6', 3, 'in4', 3)
+      CALL CHKOK2(ne, 75, 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')
+
+C     76: GDALPH check
+      CALL GDALPH(d, 'new10', 5, 'in2', 3, 8)
+      CALL CHKOK2(ne, 76, 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')
+
+C     77: GDALCO check
+      CALL GDALCO(d, 'new11', 5, GD_F32)
+      CALL CHKOK2(ne, 77, 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 GDGTCO(d, 'new11', 5, GD_F32, fl)
+      CALL CHKOK2(ne, 77, 3, d)
+      CALL CHKDBL(ne, 77, 1d0 * fl, -8.1d0)
+
+C     78: GDGENC check
+      CALL GDGENC(n, d, 0)
+      CALL CHKEOK(ne, 78, d)
+      CALL CHKINT(ne, 78, n, GDE_UN)
+
+C     79: GDGEND check
+      CALL GDGEND(n, d, 0)
+      CALL CHKEOK(ne, 79, d)
+      CALL CHKINT(ne, 79, n, GD_LE + GD_NA)
+
+C     80: 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)
+
+C     81: GDPFRG check
+      CALL GDPFRG(n, d, 1)
+      CALL CHKEOK(ne, 81, d)
+      CALL CHKINT(ne, 81, n, 0)
+
+C     82: GDAPRT check
+      CALL GDAPRT(d, GDPR_D, 1)
+      CALL CHKEOK(ne, 82, d)
+
+C     83: GDGPRT check
+      CALL GDGPRT(n, d, 1)
+      CALL CHKEOK(ne, 83, d)
+      CALL CHKINT(ne, 83, n, GDPR_D)
+
+C     84: 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')
+
+C     85: 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')
+
+C     87: GDAENC check
+      CALL GDAENC(d, GDE_TX, 1, 0)
+      CALL CHKOK2(ne, 87, 1, d)
+
+      CALL GDGENC(n, d, 1)
+      CALL CHKOK2(ne, 87, 2, d)
+      CALL CHKINT(ne, 87, n, GDE_TX)
+
+C     88: GDAEND check
+      CALL GDAEND(d, GD_BE, 1, 0)
+      CALL CHKOK2(ne, 88, 1, d)
+
+      CALL GDGEND(n, d, 1)
+      CALL CHKOK2(ne, 88, 2, d)
+      CALL CHKINT(ne, 88, n, GD_BE)
+
+C     89: GDALSP check
+      CALL GDALSP(d, 'new10 PHASE in1 3', 17, 0)
+      CALL CHKOK2(ne, 89, 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')
+
+C     90: GDDELE check
+      CALL GDDELE(d, 'new10', 5, 0)
+      CALL CHKOK2(ne, 90, 1, d)
+
+      l = flen
+      CALL GDGEPH(fn, l, i, n, d, 'new10', 5)
+      CALL CHKER2(ne, 90, 2, d, GD_EBC)
+
+C     91: GDMLSP check
+      CALL GDMLSP(d, 'mnew10 PHASE in4 11', 19, 'data', 4, 0)
+      CALL CHKOK2(ne, 91, 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')
+
+C     92: GDMOVE check
+      CALL GDMOVE(d, 'new9', 4, 1, 0)
+      CALL CHKOK2(ne, 92, 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')
+
+C     93: GDRENM check
+      CALL GDRENM(d, 'new9', 4, 'newer', 5, 0)
+      CALL CHKOK2(ne, 93, 1, d)
+
+      CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4)
+      CALL CHKER2(ne, 93, 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')
+
+C     94: GDUINC check
+      CALL GDUINC(d, 1, 0)
+      CALL CHKOK2(ne, 94, 1, d)
+
+      CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'newer', 5)
+      CALL CHKER2(ne, 94, 2, d, GD_EBC)
+
+C     95: GDGFOF check
+      CALL GDGFOF(n, d, 0)
+      CALL CHKEOK(ne, 95, d)
+      CALL CHKINT(ne, 95, n, 0)
+
+C     96: GDAFOF check
+      CALL GDAFOF(d, 33, 0, 0)
+      CALL CHKOK2(ne, 96, 1, d)
+
+      CALL GDGFOF(n, d, 0)
+      CALL CHKOK2(ne, 96, 2, d)
+      CALL CHKINT(ne, 96, n, 33)
+
+C     97: GDNTYP check
+      CALL GDNTYP(n, d, 'data', 4)
+      CALL CHKEOK(ne, 97, d)
+      CALL CHKINT(ne, 97, 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     99: GDVLDT check
+      CALL GDVLDT(n, d, 'new7', 4)
+      CALL CHKERR(ne, 99, d, GD_EBC)
+      CALL CHKINT(ne, 99, n, -1)
+
+C     100: 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)
+
+C     101: GDFNSS check
+      CALL GDFNSS(dp, d, 'data', 4, 33.3d0, 6, 0)
+      CALL CHKEOK(ne, 101, d)
+      CALL CHKDBL(ne, 101, dp, 37.0375D0)
+
+C     138: 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")
+
+C     139: GDASCA check
+      CALL GDASCA(d, 'lincom', 6, 6, 'new11', 5, -1, 0)
+      CALL CHKOK2(ne, 139, 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")
+
+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)
+      CALL CHKEOK(ne, 142, d)
+      CALL CHKINT(ne, 142, n, 264)
+
+C     143: GDGEDV check
+      l = flen
+      CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'div', 3)
+      CALL CHKEOK(ne, 143, d)
+      CALL CHKIN2(ne, 143, 1, l, flen)
+      CALL CHKIN2(ne, 143, 2, n, 0)
+      CALL CHKST2(ne, 143, 3, fields(1), 'mult')
+      CALL CHKST2(ne, 143, 4, fields(2), 'bit')
+
+C     144: GDGERC check
+      l = flen
+      CALL GDGERC(fields(1), l, dp, n, d, 'recip', 5)
+      CALL CHKEOK(ne, 144, d)
+      CALL CHKIN2(ne, 144, 1, l, flen)
+      CALL CHKIN2(ne, 144, 2, n, 0)
+      CALL CHKST2(ne, 144, 3, fields(1), 'div')
+      CALL CHKDB2(ne, 144, 4, dp, 6.5D0)
+
+C     145: GDGECR check
+      l = flen
+      CALL GDGECR(fields(1), l, dc, n, d, 'recip', 5)
+      CALL CHKEOK(ne, 145, d)
+      CALL CHKIN2(ne, 145, 1, l, flen)
+      CALL CHKIN2(ne, 145, 2, n, 0)
+      CALL CHKST2(ne, 145, 3, fields(1), 'div')
+      CALL CHKCP2(ne, 145, 4, dc, dcmplx(6.5, 4.3))
+
+C     146: GDADDV check
+      CALL GDADDV(d, 'new14', 5, 'in1', 3, 'in2', 3, 0)
+      CALL CHKOK2(ne, 146, 1, d)
+
+      l = flen
+      CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'new14', 5)
+      CALL CHKOK2(ne, 146, 2, d)
+      CALL CHKIN2(ne, 146, 1, l, flen)
+      CALL CHKIN2(ne, 146, 2, n, 0)
+      CALL CHKST2(ne, 146, 3, fields(1), 'in1')
+      CALL CHKST2(ne, 146, 4, fields(2), 'in2')
+
+C     147: GDADRC check
+      p(1) = 31.9
+      CALL GDADRC(d, 'new15', 5, 'in1', 3, p(1), 0)
+      CALL CHKOK2(ne, 147, 1, d)
+
+      l = flen
+      CALL GDGERC(fields(1), l, dp, n, d, 'new15', 5)
+      CALL CHKOK2(ne, 147, 2, d)
+      CALL CHKIN2(ne, 147, 1, l, flen)
+      CALL CHKIN2(ne, 147, 2, n, 0)
+      CALL CHKST2(ne, 147, 3, fields(1), 'in1')
+      CALL CHKDB2(ne, 147, 4, dp, p(1))
+
+C     148: GDADCR check
+      cp(1) = cmplx(31.9, 38.2)
+      CALL GDADCR(d, 'new16', 5, 'in1', 3, cp(1), 0)
+      CALL CHKOK2(ne, 148, 1, d)
+
+      l = flen
+      CALL GDGECR(fields(1), l, dc, n, d, 'new16', 5)
+      CALL CHKOK2(ne, 148, 2, d)
+      CALL CHKIN2(ne, 148, 1, l, flen)
+      CALL CHKIN2(ne, 148, 2, n, 0)
+      CALL CHKST2(ne, 148, 3, fields(1), 'in1')
+      CALL CHKCP2(ne, 148, 4, dc, cp(1))
+
+C     149: GDMDDV check
+      CALL GDMDDV(d, 'data', 4, 'new14', 5, 'in3', 3, 'in4', 3)
+      CALL CHKOK2(ne, 149, 1, d)
+
+      l = flen
+      CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'data/new14', 10)
+      CALL CHKOK2(ne, 149, 2, d)
+      CALL CHKIN2(ne, 149, 1, l, flen)
+      CALL CHKIN2(ne, 149, 2, n, 0)
+      CALL CHKST2(ne, 149, 3, fields(1), 'in3')
+      CALL CHKST2(ne, 149, 4, fields(2), 'in4')
+
+C     150: GDMDRC check
+      p(1) = 95.5
+      CALL GDMDRC(d, 'data', 4, 'new15', 5, 'in0', 3, p(1))
+      CALL CHKOK2(ne, 150, 1, d)
+
+      l = flen
+      CALL GDGERC(fields(1), l, dp, n, d, 'data/new15', 10)
+      CALL CHKOK2(ne, 150, 2, d)
+      CALL CHKIN2(ne, 150, 1, l, flen)
+      CALL CHKIN2(ne, 150, 2, n, 0)
+      CALL CHKST2(ne, 150, 3, fields(1), 'in0')
+      CALL CHKDB2(ne, 150, 4, dp, p(1))
+
+C     151: GDADCR check
+      cp(1) = cmplx(8.47, 6.22)
+      CALL GDMDCR(d,'data', 4,  'new16', 5, 'in3', 3, cp(1))
+      CALL CHKOK2(ne, 151, 1, d)
+
+      l = flen
+      CALL GDGECR(fields(1), l, dc, n, d, 'data/new16', 10)
+      CALL CHKOK2(ne, 151, 2, d)
+      CALL CHKIN2(ne, 151, 1, l, flen)
+      CALL CHKIN2(ne, 151, 2, n, 0)
+      CALL CHKST2(ne, 151, 3, fields(1), 'in3')
+      CALL CHKCP2(ne, 151, 4, dc, cp(1))
+
+C     152: GDALDV check
+      CALL GDALDV(d, 'new14', 5, 'in6', 3, 'in4', 3)
+      CALL CHKOK2(ne, 152, 1, d)
+
+      l = flen
+      CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'new14', 5)
+      CALL CHKOK2(ne, 152, 2, d)
+      CALL CHKIN2(ne, 152, 1, l, flen)
+      CALL CHKIN2(ne, 152, 2, n, 0)
+      CALL CHKST2(ne, 152, 3, fields(1), 'in6')
+      CALL CHKST2(ne, 152, 4, fields(2), 'in4')
+
+C     153: GDALRC check
+      p(1) = 0.187
+      CALL GDALRC(d, 'new15', 5, 'in5', 3, p(1))
+      CALL CHKOK2(ne, 153, 1, d)
+
+      l = flen
+      CALL GDGERC(fields(1), l, dp, n, d, 'new15', 5)
+      CALL CHKOK2(ne, 153, 2, d)
+      CALL CHKIN2(ne, 153, 1, l, flen)
+      CALL CHKIN2(ne, 153, 2, n, 0)
+      CALL CHKST2(ne, 153, 3, fields(1), 'in5')
+      CALL CHKDB2(ne, 153, 4, dp, p(1))
+
+C     154: GDALCR check
+      cp(1) = cmplx(4.3, 81.81)
+      CALL GDALCR(d, 'new16', 5, 'in6', 3, cp(1))
+      CALL CHKOK2(ne, 154, 1, d)
+
+      l = flen
+      CALL GDGECR(fields(1), l, dc, n, d, 'new16', 5)
+      CALL CHKOK2(ne, 154, 2, d)
+      CALL CHKIN2(ne, 154, 1, l, flen)
+      CALL CHKIN2(ne, 154, 2, n, 0)
+      CALL CHKST2(ne, 154, 3, fields(1), 'in6')
+      CALL CHKCP2(ne, 154, 4, dc, cp(1))
+
+C     155: GDRFRG check
+      CALL GDRFRG(d, 0)
+      CALL CHKEOK(ne, 155, d)
+
+C     156: GDINVD check
+      CALL GDINVD(m)
+      CALL CHKOK2(ne, 156, 1, m)
+
+      CALL GDNFRG(n, m)
+      CALL CHKER2(ne, 156, 2, m, GD_EBD)
+
+      CALL GDCLOS(m)
+
+C     157: GDSTDV check
+      n = GDSV_C
+      CALL GDSTDV(n, d)
+      CALL CHKOK2(ne, 157, 1, d)
+      CALL CHKINT(ne, 157, n, 9)
+
+      n = 0
+      CALL GDSTDV(n, d)
+      CALL CHKER2(ne, 157, 2, d, GD_EAR)
+
+C     158: GDGTCA check
+      CALL GDGTCA(d, 'carray', 6, GD_F64, p)
+      CALL CHKEOK(ne, 158, d)
+
+      DO 1580 i=1,6
+      CALL CHKDB2(ne, 158, i, p(i), 1.1d0 * i)
+ 1580 CONTINUE
+
+C     159: GDGCAS check
+      CALL GDGCAS(d, 'carray', 6, 3, 2, GD_F64, p)
+      CALL CHKEOK(ne, 159, d)
+
+      DO 1590 i=1,2
+      CALL CHKDB2(ne, 159, i, p(i), 2.2d0 + 1.1 * i)
+ 1590 CONTINUE
+
+C     168: GDPTCA check
+      p(1) = 9.6
+      p(2) = 8.5
+      p(3) = 7.4
+      p(4) = 6.3
+      p(5) = 5.2
+      p(6) = 4.1
+      CALL GDPTCA(d, 'carray', 6, GD_F64, p)
+      CALL CHKOK2(ne, 168, 1, d)
+
+      CALL GDGTCA(d, 'carray', 6, GD_F64, q)
+      CALL CHKOK2(ne, 168, 2, d)
+
+      DO 1680 i=1,6
+      CALL CHKDB2(ne, 168, i, q(i), 10.7d0 - 1.1d0 * i)
+ 1680 CONTINUE
+
+C     169: GDGCAS check
+      p(1) = 5.5
+      p(2) = 5.6
+      p(3) = 5.7
+      p(4) = 5.8
+      p(5) = 5.9
+      p(6) = 6.0
+      CALL GDPCAS(d, 'carray', 6, 3, 2, GD_F64, p)
+      CALL CHKOK2(ne, 169, 1, d)
+
+      CALL GDGTCA(d, 'carray', 6, GD_F64, q)
+      CALL CHKOK2(ne, 169, 2, d)
+
+      DO 1690 i=1,6
+      IF (i .eq. 3 .or. i .eq. 4) THEN
+        dp = 5.2 + 0.1 * i
+      ELSE
+        dp = 10.7 - 1.1 * i
+      ENDIF
+      CALL CHKDB2(ne, 169, i, q(i), dp)
+ 1690 CONTINUE
+
+C     177: GDCALN check
+      CALL GDCALN(n, d, 'carray', 6)
+      CALL CHKEOK(ne, 177, d)
+      CALL CHKINT(ne, 177, n, 6)
+
+C     178: GDGECA check
+      CALL GDGECA(i, l, n, d, 'carray', 6)
+      CALL CHKEOK(ne, 178, d)
+      CALL CHKIN2(ne, 178, 1, l, 6)
+      CALL CHKIN2(ne, 178, 2, n, 0)
+      CALL CHKIN2(ne, 178, 3, i, GD_F64)
+
+C     179: GDADCA check
+      p(1) = 1.2
+      p(2) = 3.4
+      p(3) = 5.6
+      p(4) = 7.8
+      CALL GDADCA(d, 'new17', 5, GD_F64, 4, GD_F64, p, 0)
+      CALL CHKOK2(ne, 179, 1, d)
+
+      CALL GDGECA(i, l, n, d, 'new17', 5)
+      CALL CHKOK2(ne, 179, 2, d)
+      CALL CHKIN2(ne, 179, 1, n, 0)
+      CALL CHKIN2(ne, 179, 2, i, GD_F64)
+      CALL CHKIN2(ne, 179, 3, l, 4)
+
+      CALL GDGTCA(d, 'new17', 5, GD_F64, q)
+      CALL CHKOK2(ne, 179, 3, d)
+
+      DO 1790 i=1,4
+      CALL CHKDB2(ne, 179, i, q(i), i * 2.2d0 - 1.0d0)
+ 1790 CONTINUE
+
+C     180: GDMDCA check
+      p(1) = 3.2
+      p(2) = 5.4
+      p(3) = 7.6
+      p(4) = 9.8
+      CALL GDMDCA(d, 'data', 4, 'new17', 5, GD_F64, 4, GD_F64, p)
+      CALL CHKOK2(ne, 180, 1, d)
+
+      CALL GDGECA(i, l, n, d, 'data/new17', 10)
+      CALL CHKOK2(ne, 180, 2, d)
+      CALL CHKIN2(ne, 180, 1, n, 0)
+      CALL CHKIN2(ne, 180, 2, i, GD_F64)
+      CALL CHKIN2(ne, 180, 3, l, 4)
+
+      CALL GDGTCA(d, 'data/new17', 10, GD_F64, q)
+      CALL CHKOK2(ne, 180, 3, d)
+
+      DO 1800 i=1,4
+      CALL CHKDB2(ne, 180, i, q(i), 1.0d0 + i * 2.2d0)
+ 1800 CONTINUE
+
+C     181: GDALCA check
+      CALL GDALCA(d, 'new17', 5, GD_F32, 3)
+      CALL CHKOK2(ne, 181, 1, d)
+
+      CALL GDGECA(i, l, n, d, 'new17', 5)
+      CALL CHKOK2(ne, 181, 2, d)
+      CALL CHKIN2(ne, 181, 1, n, 0)
+      CALL CHKIN2(ne, 181, 2, i, GD_F32)
+      CALL CHKIN2(ne, 181, 3, l, 3)
+
+C     183: GDCONS check
+      p(1) = 10.0
+      p(2) = -8.1
+      CALL GDNFDT(n, d, GD_COE)
+
+      DO 1830 i = 1, n
+      l = flen
+      CALL GDCONS(fl, d, GD_F32, i)
+      CALL CHKOK2(ne, 183, i, d)
+      CALL CHKDB2(ne, 183, i, 1d0 * fl, p(i))
+ 1830 CONTINUE
+
+C     191: GDMCOS check
+      p(1) = 3.3
+      p(2) = -8.1
+      CALL GDNMFT(n, d, "data", 4, GD_COE)
+
+      DO 1910 i = 1, n
+      l = flen
+      CALL GDMCOS(fl, d, "data", 4, GD_F32, i)
+      CALL CHKOK2(ne, 191, i, d)
+      CALL CHKDB2(ne, 191, i, 1d0 * fl, p(i))
+ 1910 CONTINUE
+
+C     199: GDSTRS check
+      strings(1) = "Lorem ipsum         "
+      strings(2) = "---string---        "
+      strings(3) = "Arthur Dent         "
+      CALL GDNFDT(n, d, GD_STE)
+
+      DO 1990 i = 1, n
+      l = slen
+
+      CALL GDSTRS(str, l, d, i)
+      CALL CHKOK2(ne, 199, i, d)
+      CALL CHKIN2(ne, 199, i, l, slen)
+      CALL CHKST2(ne, 199, i, str, strings(i))
+ 1990 CONTINUE
+
+C     200: GDMSTS check
+      strings(1) = 'This is a string constant.'
+      strings(2) = 'kai su, technon;          '
+      CALL GDNMFT(n, d, 'data', 4, GD_STE)
+
+      DO 2000 i = 1, n
+      l = slen
+      CALL GDMSTS(str, l, d, "data", 4, i)
+      CALL CHKOK2(ne, 200, i, d)
+      CALL CHKIN2(ne, 200, i, l, slen)
+      CALL CHKST2(ne, 200, i, str, strings(i))
+ 2000 CONTINUE
+
+C     201: GDSTRX check
+      CALL GDSTRX(i, d)
+      CALL CHKEOK(ne, 201, d)
+      CALL CHKINT(ne, 201, i, 12)
+
+C     202: GDMSTX check
+      CALL GDMSTX(i, d, 'data', 4)
+      CALL CHKEOK(ne, 202, d)
+      CALL CHKINT(ne, 202, i, slen)
+
+C     203: GDSEEK check
+      CALL GDSEEK(n, d, 'data', 4, 35, 0, GDSK_S)
+      CALL CHKOK2(ne, 203, 1, d)
+      CALL CHKIN2(ne, 203, 1, n, 280)
+
+      CALL GDGETD(m, d, 'data', 4, GD_HER, 0, 1, 0, GD_I8, c)
+      CALL CHKOK2(ne, 203, 2, d)
+      CALL CHKIN2(ne, 203, 2, m, 8)
+
+      DO 2030 i = 1, 8
+      CALL CHKIN2(ne, 203, i, INT(c(i)), 16 + i)
+ 2030 CONTINUE
+
+C     204: GDTELL check
+      CALL GDTELL(n, d, 'data', 4)
+      CALL CHKEOK(ne, 204, d)
+      CALL CHKINT(ne, 204, n, 288)
+
+C     205: GDHIDE check
+      CALL GDHIDE(d, 'data', 4)
+      CALL CHKEOK(ne, 205, d)
+
+C     206: GDHIDN check
+      CALL GDHIDN(n, d, 'data', 4)
+      CALL CHKOK2(ne, 206, 1, d)
+      CALL CHKIN2(ne, 206, 1, n, 1)
+
+      CALL GDHIDN(n,d, 'lincom', 6)
+      CALL CHKOK2(ne, 206, 2, d)
+      CALL CHKIN2(ne, 206, 2, n, 0)
+
+C     207: GDUHID check
+      CALL GDUHID(d, 'data', 4)
+      CALL CHKOK2(ne, 206, 1, d)
+      CALL GDHIDN(n, d, 'data', 4)
+      CALL CHKOK2(ne, 206, 2, d)
+      CALL CHKINT(ne, 206, n, 0)
+
+C     208: GDSYNC check
+      CALL GDSYNC(d, 'data', 4)
+      CALL CHKEOK(ne, 208, d)
+
+C     209: GDFLSH check
+      CALL GDFLSH(d, 'data', 4)
+      CALL CHKEOK(ne, 209, d)
+
+C     210: GDMFLS check
+      CALL GDMFLS(d)
+      CALL CHKEOK(ne, 210, d)
+
+C     211: GDGEWD check
+      l = flen
+      i = flen
+      CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'window',
+     +6)
+      CALL CHKEOK(ne, 211, d)
+      CALL CHKIN2(ne, 211, 1, i, flen)
+      CALL CHKIN2(ne, 211, 2, l, flen)
+      CALL CHKIN2(ne, 211, 3, n, 0)
+      CALL CHKIN2(ne, 211, 4, m, GDW_LT)
+      CALL CHKST2(ne, 211, 5, fields(1), 'linterp')
+      CALL CHKST2(ne, 211, 6, fields(2), 'mult')
+      CALL CHKDB2(ne, 211, 7, dp, 4.1D0)
+
+C     212: GDADWD check
+      CALL GDADWD(d, 'new18', 5, 'in1', 3, 'in2', 3, GDW_NE, 32, 0)
+      CALL CHKOK2(ne, 212, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'new18',
+     +5)
+      CALL CHKOK2(ne, 212, 2, d)
+      CALL CHKIN2(ne, 212, 1, i, flen)
+      CALL CHKIN2(ne, 212, 2, l, flen)
+      CALL CHKIN2(ne, 212, 3, n, 0)
+      CALL CHKIN2(ne, 212, 4, m, GDW_NE)
+      CALL CHKST2(ne, 212, 5, fields(1), 'in1')
+      CALL CHKST2(ne, 212, 6, fields(2), 'in2')
+      CALL CHKIN2(ne, 212, 7, j, 32)
+
+C     214: GDMDWD check
+      CALL GDMDWD(d, 'data', 4, 'mnew18', 6, 'in2', 3, 'in3', 3, GDW_ST,
+     +128, 0)
+      CALL CHKOK2(ne, 214, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d,
+     +'data/mnew18', 11)
+      CALL CHKOK2(ne, 214, 2, d)
+      CALL CHKIN2(ne, 214, 1, i, flen)
+      CALL CHKIN2(ne, 214, 2, l, flen)
+      CALL CHKIN2(ne, 214, 3, n, 0)
+      CALL CHKIN2(ne, 214, 4, m, GDW_ST)
+      CALL CHKST2(ne, 214, 5, fields(1), 'in2')
+      CALL CHKST2(ne, 214, 6, fields(2), 'in3')
+      CALL CHKIN2(ne, 214, 7, j, 128)
+
+C     217: GDALWD check
+      CALL GDALWD(d, 'new18', 5, 'in3', 3, 'in4', 3, GDW_GE, 32d3)
+      CALL CHKOK2(ne, 217, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'new18',
+     +5)
+      CALL CHKOK2(ne, 217, 2, d)
+      CALL CHKIN2(ne, 217, 1, i, flen)
+      CALL CHKIN2(ne, 217, 2, l, flen)
+      CALL CHKIN2(ne, 217, 3, n, 0)
+      CALL CHKIN2(ne, 217, 4, m, GDW_GE)
+      CALL CHKST2(ne, 217, 5, fields(1), 'in3')
+      CALL CHKST2(ne, 217, 6, fields(2), 'in4')
+      CALL CHKDB2(ne, 217, 7, dp, 32d3)
+
+C     218: GDATRG check
+      l = flen
+      CALL GDATRG(fields(1), l, d, 'alias', 5)
+      CALL CHKEOK(ne, 218, d)
+      CALL CHKIN2(ne, 218, 1, l, flen)
+      CALL CHKST2(ne, 218, 2, fields(1), 'data')
+
+C     219: GDADAL check
+      CALL GDADAL(d, 'new20', 5, 'data', 4, 0)
+      CALL CHKOK2(ne, 219, 1, d)
+
+      l = flen
+      CALL GDATRG(fields(1), l, d, 'new20', 5)
+      CALL CHKOK2(ne, 219, 2, d)
+      CALL CHKIN2(ne, 219, 1, l, flen)
+      CALL CHKST2(ne, 219, 2, fields(1), 'data')
+
+C     220: GDMDAL check
+      CALL GDMDAL(d, 'data', 4, 'mnew20', 6, 'data', 4)
+      CALL CHKOK2(ne, 220, 1, d)
+
+      l = flen
+      CALL GDATRG(fields(1), l, d, 'data/mnew20', 11)
+      CALL CHKOK2(ne, 220, 2, d)
+      CALL CHKIN2(ne, 220, 1, l, flen)
+      CALL CHKST2(ne, 220, 2, fields(1), 'data')
+
+C     221: GDNALS check
+      CALL GDNALS(n, d, 'data', 4)
+      CALL CHKEOK(ne, 221, d)
+      CALL CHKINT(ne, 221, n, 4)
+
+C     222: GDALSS check
+      fields(1) = 'data'
+      fields(2) = 'alias'
+      fields(3) = 'data/mnew20'
+      fields(4) = 'new20'
+      DO 2220 i = 1, n
+      l = flen
+      CALL GDALSS(fn, l, d, 'data', 4, i)
+      CALL CHKOK2(ne, 222, i, d)
+      CALL CHKIN2(ne, 222, i, l, flen)
+      CALL CHKST2(ne, 222, i, fn, fields(i))
+ 2220 CONTINUE
+
+C     223: GDINCA check
+      CALL GDINCA(d, 'format1', 7, 0, 'A', 1, 'Z', 1, GD_CR + GD_EX)
+      CALL CHKEOK(ne, 223, d)
+
+C     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
+      CALL GDFRAF(fields(1), l, fields(2), n, d, 1)
+      CALL CHKEOK(ne, 226, d)
+      CALL CHKIN2(ne, 226, 1, l, flen)
+      CALL CHKIN2(ne, 226, 2, n, flen)
+      CALL CHKST2(ne, 226, 3, fields(1), 'A')
+      CALL CHKST2(ne, 226, 4, fields(2), 'Z')
+
+C     227: GDAAFX check
+      CALL GDAAFX(d, 1, 'B', 1, '', 0)
+      CALL CHKOK2(ne, 227, 1, d)
+
+      l = flen
+      n = flen
+      CALL GDFRAF(fields(1), l, fields(2), n, d, 1)
+      CALL CHKOK2(ne, 227, 2, d)
+      CALL CHKIN2(ne, 227, 1, l, flen)
+      CALL CHKIN2(ne, 227, 2, n, flen)
+      CALL CHKST2(ne, 227, 3, fields(1), 'B')
+      CALL CHKST2(ne, 227, 3, fields(2), '')
+
+C     228: GDGEMX check
+      l = flen
+      i = flen
+      CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'mplex', 5)
+      CALL CHKEOK(ne, 228, d)
+      CALL CHKIN2(ne, 228, 1, i, flen)
+      CALL CHKIN2(ne, 228, 2, l, flen)
+      CALL CHKIN2(ne, 228, 3, n, 0)
+      CALL CHKIN2(ne, 228, 4, m, 1)
+      CALL CHKST2(ne, 228, 5, fields(1), 'data')
+      CALL CHKST2(ne, 228, 6, fields(2), 'sbit')
+      CALL CHKIN2(ne, 228, 7, j, 10)
+
+C     229: GDADMX check
+      CALL GDADMX(d, 'new21', 5, 'in1', 3, 'in2', 3, 5, 6, 0)
+      CALL CHKOK2(ne, 229, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'new21', 5)
+      CALL CHKOK2(ne, 229, 2, d)
+      CALL CHKIN2(ne, 229, 1, i, flen)
+      CALL CHKIN2(ne, 229, 2, l, flen)
+      CALL CHKIN2(ne, 229, 3, n, 0)
+      CALL CHKIN2(ne, 229, 4, m, 5)
+      CALL CHKST2(ne, 229, 5, fields(1), 'in1')
+      CALL CHKST2(ne, 229, 6, fields(2), 'in2')
+      CALL CHKIN2(ne, 229, 7, j, 6)
+
+C     230: GDMDMX check
+      CALL GDMDMX(d, 'data', 4, 'mnew21', 6, 'in2', 3, 'in3', 3, 0, 12)
+      CALL CHKOK2(ne, 230, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'data/mnew21',
+     +11)
+      CALL CHKOK2(ne, 230, 2, d)
+      CALL CHKIN2(ne, 230, 1, i, flen)
+      CALL CHKIN2(ne, 230, 2, l, flen)
+      CALL CHKIN2(ne, 230, 3, n, 0)
+      CALL CHKIN2(ne, 230, 4, m, 0)
+      CALL CHKST2(ne, 230, 5, fields(1), 'in2')
+      CALL CHKST2(ne, 230, 6, fields(2), 'in3')
+      CALL CHKIN2(ne, 230, 7, j, 12)
+
+C     231: GDALMX check
+      CALL GDALMX(d, 'new21', 5, 'in3', 3, 'in4', 3, 7, -1)
+      CALL CHKOK2(ne, 231, 1, d)
+
+      l = flen
+      i = flen
+      CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'new21', 5)
+      CALL CHKOK2(ne, 231, 2, d)
+      CALL CHKIN2(ne, 231, 1, i, flen)
+      CALL CHKIN2(ne, 231, 2, l, flen)
+      CALL CHKIN2(ne, 231, 3, n, 0)
+      CALL CHKIN2(ne, 231, 4, m, 7)
+      CALL CHKST2(ne, 231, 5, fields(1), 'in3')
+      CALL CHKST2(ne, 231, 6, fields(2), 'in4')
+      CALL CHKIN2(ne, 231, 7, j, 6)
+
+C     232: GDTOKE check
+      l = slen
+      CALL GDTOKE(str, l, d, '"test1 test2" test3\ test4 test5', 32)
+      CALL CHKOK2(ne, 232, 1, d)
+      CALL CHKIN2(ne, 232, 2, l, slen)
+      CALL CHKST2(ne, 232, 3, str, 'test1 test2')
+
+      l = slen
+      CALL GDTOKE(str, l, d, '', -1)
+      CALL CHKOK2(ne, 232, 4, d)
+      CALL CHKIN2(ne, 232, 5, l, slen)
+      CALL CHKST2(ne, 232, 6, str, 'test3 test4')
+
+C     233: GDRCLO check
+      CALL GDRCLO(d, 'data', 4)
+      CALL CHKEOK(ne, 233, d)
+
+C     234: GDDSYN check
+      CALL GDDSYN(n, d, 0)
+      CALL CHKEOK(ne, 234, d)
+      CALL CHKINT(ne, 234, n, 0)
+
+C     235: GDFLAG check
+      CALL GDFLAG(n, d, GD_PP, 0)
+      CALL CHKEOK(ne, 235, d)
+      CALL CHKINT(ne, 235, n, GD_PP)
+
+C     236: GDVBPX check
+      CALL GDVBPX(d, "big_test", 8)
+      CALL CHKEOK(ne, 236, d)
+
+C     237: GDNENT check
+      CALL GDNENT(n, d, "data", 4, GDEN_S, GDEN_H + GDEN_N)
+      CALL CHKOK2(ne, 237, 1, d)
+      CALL CHKIN2(ne, 237, 1, n, 5)
+      CALL GDNENT(n, d, "", -1, GDEN_V, GDEN_H + GDEN_N)
+      CALL CHKOK2(ne, 237, 2, d)
+      CALL CHKIN2(ne, 237, 2, n, 26)
+
+C     238: GDENTX check
+      CALL GDENTX(l, d, "", -1, GDEN_V, GDEN_H + GDEN_N)
+      CALL CHKEOK(ne, 238, d)
+      CALL CHKINT(ne, 238, l, 7)
+
+C     239: GDENTN check
+      fields(1)  = "INDEX"
+      fields(2)  = "bit"
+      fields(3)  = "data"
+      fields(4)  = "div"
+      fields(5)  = "lincom"
+      fields(6)  = "linterp"
+      fields(7)  = "mplex"
+      fields(8)  = "mult"
+      fields(9)  = "new1"
+      fields(10) = "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"
+      DO 2390 i = 1, n
+      l = flen
+      CALL GDENTN(fn, l, d, "", -1, GDEN_V, GDEN_H + GDEN_N, i)
+      CALL CHKOK2(ne, 239, i, d)
+      CALL CHKIN2(ne, 239, i, l, flen)
+      CALL CHKST2(ne, 239, i, fn, fields(i))
+ 2390 CONTINUE
+
+C     240: GDMXLB check
+      CALL GDMXLB(d, GDLB_A)
+      CALL CHKEOK(ne, 240, d)
+
+C     241: GDLTTN check
+      l = plen
+      CALL GDLTTN(path, l, d, "linterp", 7)
+      CALL CHKEOK(ne, 241, d)
+      CALL CHKINT(ne, 241, l, plen)
+      CALL CHKEOS(ne, 241, path, fildir//DIRSEP//'lut')
+
+C     243: 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 GDREFE(str, l, m, "", -1)
+      CALL CHKOK2(ne, 243, 2, m)
+      CALL CHKINT(ne, 243, l, 0);
+
+      CALL GDDSCD(m);
+
+
+
+
+
+
+
+
+
+C     ===============================================================
+C     Cleanup
+      CALL GDDSCD(d)
+
+      CALL SYSTEM ( 'rm -rf ' // fildir )
+
+      IF (ne .GT. 0) THEN
+        WRITE(*, 9000) ne
+        CALL EXIT(1)
+      ENDIF
+
+ 9000 FORMAT('ne = ', i8)
+
+      STOP
+      END
diff --git a/bindings/f77/test/big_test95.f90 b/bindings/f77/test/big_test95.f90
new file mode 100644
index 0000000..423a6c2
--- /dev/null
+++ b/bindings/f77/test/big_test95.f90
@@ -0,0 +1,2596 @@
+! Copyright (C) 2009-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
+!
+! -*- F95 -*-
+
+! General test
+!
+! This very large test checks almost every procedure defined by the F95
+! bindings.  Procedures not tested include: fgd_cbopen fgd_metaflush
+! fgd_flush fgd_close fgd_callback fgd_discard
+! (although this last one is used)
+
+! check functions
+subroutine check_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
+  integer, intent(in) :: t, i, d, v
+  integer :: e
+
+  e = fgd_error(d)
+
+  if (e .ne. v) then
+    ne = ne + 1
+    write(*, 9006), i, t, e, v
+  end if
+9006 format('e(', i0, ')[', i0, '] = ', i0, ', expected ', i0)
+end subroutine 
+
+subroutine check_int2(ne, t, i, n, v)
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t, i, n, v
+
+  if (n .ne. v) then
+    ne = ne + 1
+    write(*, 9007), i, t, n, v
+  end if
+9007 format('n(', i0, ')[', i0, '] = ', i0, ', expected ', i0)
+end subroutine 
+
+subroutine check_str2(ne, t, i, n, v)
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t, i
+  character (len=*), intent(in) :: n, v
+
+  if (n .ne. v) then
+    ne = ne + 1
+    write(*, 9008), i, t, n, v
+  end if
+9008 format('s(', i0, ')[', i0, '] = "', a, '", expected "', a, '"')
+end subroutine 
+
+subroutine check_str(ne, t, n, v)
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t
+  character (len=*), intent(in) :: n, v
+
+  if (n .ne. v) then
+    ne = ne + 1
+    write(*, 9009), t, n, v
+  end if
+9009 format('s[', i0, '] = "', a, '", expected "', a, '"')
+end subroutine 
+
+subroutine check_dbl2(ne, t, i, n, v)
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t, i
+  double precision, intent(in) :: n, v
+
+  if (abs(n - v) .gt. 1e-5) 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_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
+    ne = ne + 1
+    write(*, 9011), i, t, real(real(n)), real(aimag(n)), &
+    real(real(v)), real(aimag(v))
+  end if
+9011 format('x(', i0, ')[', i0, '] = ', d16.10, ';', d16.10, ', expected ', &
+d16.10, ';', d16.10)
+end subroutine 
+
+subroutine check_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)
+end subroutine 
+
+subroutine check_ok(ne, t, d)
+  use getdata
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t, d
+  call check_err(ne, t, d, GD_E_OK)
+end subroutine
+
+subroutine check_ok2(ne, t, i, d)
+  use getdata
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t, d
+  call check_err2(ne, t, i, d, GD_E_OK)
+end subroutine
+
+subroutine check_eos(ne, t, n, v)
+  integer, intent(inout) :: ne
+  integer, intent(in) :: t
+  character (len=*), intent(in) :: n, v
+  integer :: f
+
+  f = index(n, v)
+  if (f .eq. 0) then
+    f = 1
+  end if
+
+  call check_str(ne, t, n(f:), v)
+end subroutine
+  
+
+
+
+program big_test
+  use getdata
+  implicit none
+  include "test_getdata.f"
+  character (len=*), parameter :: fildir = 'test95_dirfile'
+  character (len=*), parameter :: frmat = 'test95_dirfile/format'
+  character (len=*), parameter :: frm2 = 'test95_dirfile/form2'
+  character (len=*), parameter :: dat = 'test95_dirfile/data'
+  integer, parameter :: flen = 11
+  integer, parameter :: nfields = 17
+  integer, parameter :: slen = 26
+
+  character (len=slen), dimension(3) :: strings
+  character (len=slen), dimension(3) :: st
+  character (len=flen), dimension(nfields + 11) :: fields
+  character (len=flen), dimension(nfields + 11) :: flist
+  character (len=GD_FIELD_LEN) :: str
+  character (len=4096) :: path
+  integer(1), dimension(80) :: datadata
+  integer :: i, d, n, l, ne
+  real :: fl
+  double precision :: dp
+  double complex :: dc
+  integer(8), dimension(6) :: iq
+  double precision, dimension(6) :: q
+  double complex, dimension(6) :: cq
+  type(gd_entry) :: ent
+
+  integer(1), dimension(8) :: ci1
+  integer(2), dimension(8) :: ci2
+  integer(4), dimension(8) :: ci4
+  integer(8), dimension(8) :: ci8
+  real, dimension(8) :: cr4
+  double precision, dimension(8) :: cr8
+  complex, dimension(8) :: cc8
+  double complex, dimension(8) :: cc16
+
+  do i=1,80
+    datadata(i) = int(i,1)
+  end do
+
+  call system ( 'rm -rf ' // fildir )
+  call system ( 'mkdir ' // fildir )
+
+  fields = (/    'INDEX      ', 'alias      ', 'bit        ', 'carray     ', &
+  'const      ', 'data       ', 'div        ', 'lincom     ', 'linterp    ', &
+  'mplex      ', 'mult       ', 'phase      ', 'polynom    ', 'recip      ', &
+  'sbit       ', 'string     ', 'window     ', '           ', '           ', &
+  '           ', '           ', '           ', '           ', '           ', &
+  '           ', '           ', '           ', '           ' /)
+
+  open(1, file=frmat, status='new')
+  write(1, *) '/ENDIAN little'
+  write(1, *) 'data RAW INT8 8'
+  write(1, *) 'lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const'
+  write(1, *) '/META data mstr STRING "This is a string constant."'
+  write(1, *) '/META data mconst CONST COMPLEX128 3.3;4.4'
+  write(1, *) '/META data mlut LINTERP DATA ./lut'
+  write(1, *) 'const CONST FLOAT64 5.5'
+  write(1, *) 'carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6'
+  write(1, *) 'linterp LINTERP data ./lut'
+  write(1, *) 'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const'
+  write(1, *) 'bit BIT data 3 4'
+  write(1, *) 'sbit SBIT data 5 6'
+  write(1, *) 'mplex MPLEX data sbit 1 10'
+  write(1, *) 'mult MULTIPLY data sbit'
+  write(1, *) 'phase PHASE data 11'
+  write(1, *) 'div DIVIDE mult bit'
+  write(1, *) 'recip RECIP div 6.5;4.3'
+  write(1, *) 'window WINDOW linterp mult LT 4.1'
+  write(1, *) '/ALIAS alias data'
+  write(1, *) 'string STRING "Zaphod Beeblebrox"'
+  close(1, status='keep')
+
+  open(1, file=frm2, status='new')
+  write(1, *) 'const2 CONST INT8 -19'
+  close(1, status='keep')
+
+  open(1, file=dat, form='unformatted', access='direct', recl=80, &
+  status='new')
+  write(1, rec=1) datadata
+  close(1, status='keep')
+
+  ne = 0
+
+! fgd_error check
+  d = fgd_open('x', GD_RDONLY)
+  call check_err(ne, 0, d, GD_E_OPEN)
+  call fgd_discard(d)
+
+! 1: fgd_open check
+  d = fgd_open(fildir, GD_RDWR)
+  call check_ok(ne, 1, d)
+
+! 2: 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)
+
+  do i=1,8
+  call check_int2(ne, 2, i, int(ci1(i)), 40 + i)
+  end do 
+
+! 102: 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)
+
+  do i=1,8
+  call check_int2(ne, 102, i, int(ci2(i)), 40 + i)
+  end do 
+
+! 103: 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)
+
+  do i=1,8
+  call check_int2(ne, 103, i, int(ci4(i)), 40 + i)
+  end do 
+
+! 104: 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)
+
+  do i=1,8
+  call check_int2(ne, 104, i, int(ci8(i)), 40 + i)
+  end do 
+
+! 105: 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)
+
+  do i=1,8
+  call check_dbl2(ne, 105, i, 1d0 * cr4(i), 40d0 + i)
+  end do 
+
+! 106: 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)
+
+  do i=1,8
+  call check_dbl2(ne, 106, i, cr8(i), 40d0 + i)
+  end do 
+
+! 107: 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)
+
+  do i=1,8
+  call check_cpx2(ne, 107, i, 1d0 * cc8(i), dcmplx(40 + i, 0))
+  end do 
+
+! 108: 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)
+
+  do i=1,8
+  call check_cpx2(ne, 108, i, cc16(i), dcmplx(40 + i, 0))
+  end do 
+
+! 109: 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)
+
+! 3: 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)
+
+! 110: 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)
+
+! 111: 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)
+
+! 112: 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)
+
+! 113: 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)
+
+! 114: 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)
+
+! 115: 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))
+
+! 116: 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))
+
+! 117: fgd_get_constant_n check
+  call fgd_get_constant_n(d, 'const')
+  call check_ok(ne, 117, d)
+
+! 4: fgd_field_name_max check
+  i = fgd_field_name_max(d)
+  call check_ok(ne, 4, d)
+  call check_int(ne, 4, i, 7)
+
+! 5: 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)
+
+! 6: fgd_nfields check
+  n = fgd_nfields(d)
+  call check_ok(ne, 6, d)
+  call check_int(ne, 6, n, nfields)
+
+! 8: 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)
+
+  do i = 1, n
+  call check_str2(ne, 8, i, flist(i), fields(i))
+  end do
+
+! 9: fgd_nmfields check
+  n = fgd_nmfields(d, 'data')
+  call check_ok(ne, 9, d)
+  call check_int(ne, 9, n, 3)
+
+! 10: 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)
+
+  DO i = 1, n
+  call check_str2(ne, 10, i, flist(i), fields(i))
+  end do
+
+! 11: fgd_nframes check
+  n = fgd_nframes(d)
+  call check_ok(ne, 11, d)
+  call check_int(ne, 11, n, 10)
+
+! 12: fgd_spf check
+  n = fgd_spf(d, 'data')
+  call check_ok(ne, 12, d)
+  call check_int(ne, 12, n, 8)
+
+! 13: 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)
+
+  n = fgd_getdata_i1(d, 'data', 5, 0, 1, 0, ci1)
+
+  DO i = 1, 8
+  if (i .eq. 1 .or. i .gt. 5) then
+    n = 40 + i
+  else
+    n = 11 + i
+  endif
+  call check_int2(ne, 13, i, int(ci1(i)), n)
+  end do
+
+! 118: fgd_putdata_i2 check
+  ci2 = (/ 23_2, 24_2, 25_2, 26_2, 27_2, 28_2, 29_2, 30_2 /)
+  n = fgd_putdata_i2(d, 'data', 5, 1, 0, 4, ci2)
+  call check_ok(ne, 118, d)
+  call check_int(ne, 118, n, 4)
+
+  n = fgd_getdata_i2(d, 'data', 5, 0, 1, 0, ci2)
+
+  DO i = 1, 8
+  if (i .eq. 1 .or. i .gt. 5) then
+    n = 40 + i
+  else
+    n = 21 + i
+  endif
+  call check_int2(ne, 118, i, int(ci2(i)), n)
+  end do
+
+! 119: fgd_putdata_i4 check
+  ci4 = (/ 33, 34, 35, 36, 37, 38, 39, 40 /)
+  n = fgd_putdata_i4(d, 'data', 5, 1, 0, 4, ci4)
+  call check_ok(ne, 119, d)
+  call check_int(ne, 119, n, 4)
+
+  n = fgd_getdata_i4(d, 'data', 5, 0, 1, 0, ci4)
+
+  DO i = 1, 8
+  if (i .eq. 1 .or. i .gt. 5) then
+    n = 40 + i
+  else
+    n = 31 + i
+  endif
+  call check_int2(ne, 119, i, int(ci4(i)), n)
+  end do
+
+! 120: fgd_putdata_i8 check
+  ci8 = (/ 43, 44, 45, 46, 47, 48, 49, 50 /)
+  n = fgd_putdata_i8(d, 'data', 5, 1, 0, 4, ci8)
+  call check_ok(ne, 120, d)
+  call check_int(ne, 120, n, 4)
+
+  n = fgd_getdata_i8(d, 'data', 5, 0, 1, 0, ci8)
+
+  DO i = 1, 8
+  if (i .eq. 1 .or. i .gt. 5) then
+    n = 40 + i
+  else
+    n = 41 + i
+  endif
+  call check_int2(ne, 120, i, int(ci8(i)), n)
+  end do
+
+! 121: fgd_putdata_r4 check
+  cr4 = (/ 33, 34, 35, 36, 37, 38, 39, 40 /)
+  n = fgd_putdata_r4(d, 'data', 5, 1, 0, 4, cr4)
+  call check_ok(ne, 121, d)
+  call check_int(ne, 121, n, 4)
+
+  n = fgd_getdata_r4(d, 'data', 5, 0, 1, 0, cr4)
+
+  DO i = 1, 8
+  if (i .eq. 1 .or. i .gt. 5) then
+    dp = 40. + i
+  else
+    dp = 31. + i
+  end if
+  call check_dbl2(ne, 121, i, 1d0 * cr4(i), dp)
+  end do
+
+! 122: fgd_putdata_r8 check
+  cr8 = (/ 43, 44, 45, 46, 47, 48, 49, 50 /)
+  n = fgd_putdata_r8(d, 'data', 5, 1, 0, 4, cr8)
+  call check_ok(ne, 122, d)
+  call check_int(ne, 122, n, 4)
+
+  n = fgd_getdata_r8(d, 'data', 5, 0, 1, 0, cr8)
+
+  DO i = 1, 8
+  if (i .eq. 1 .or. i .gt. 5) then
+    dp = 40. + i
+  else
+    dp = 41. + i
+  end if
+  call check_dbl2(ne, 122, i, cr8(i), dp)
+  end do
+
+! 123: fgd_putdata_c8 check
+  cc8 = (/ 53, 54, 55, 56, 57, 58, 59, 60 /)
+  n = fgd_putdata_c8(d, 'data', 5, 1, 0, 4, cc8)
+  call check_ok(ne, 123, d)
+  call check_int(ne, 123, n, 4)
+
+  n = fgd_getdata_c8(d, 'data', 5, 0, 1, 0, cc8)
+
+  DO i = 1, 8
+  if (i .eq. 1 .or. i .gt. 5) then
+    dc = dcmplx(40d0 + i, 0d0)
+  else
+    dc = dcmplx(51d0 + i, 0d0)
+  end if
+  call check_cpx2(ne, 123, i, 1d0 * cc8(i), dc)
+  end do
+
+! 124: fgd_putdata_c16 check
+  cc16 = (/ 63, 64, 65, 66, 67, 68, 69, 70 /)
+  n = fgd_putdata_c16(d, 'data', 5, 1, 0, 4, cc16)
+  call check_ok(ne, 124, d)
+  call check_int(ne, 124, n, 4)
+
+  n = fgd_getdata_c16(d, 'data', 5, 0, 1, 0, cc16)
+
+  DO i = 1, 8
+  if (i .eq. 1 .or. i .gt. 5) then
+    dc = dcmplx(40d0 + i, 0d0)
+  else
+    dc = dcmplx(61d0 + i, 0d0)
+  end if
+  call check_cpx2(ne, 124, i, cc16(i), dc)
+  end do
+
+! 14: fgd_error_string check
+  n = fgd_getdata_n(d, 'x', 5, 0, 1, 0)
+  call fgd_error_string(d, str, GD_FIELD_LEN)
+  call check_str(ne, 14, str, 'Field not found: x')
+
+! 15: 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)
+
+! 16: 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)
+
+! 18: 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)
+  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))
+  end do
+
+! 20: 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)
+  DO i=1,6
+  call check_cpx2(ne, 30, i, ent%ca(i), cq(i))
+  end do
+
+! 21: 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')
+
+! 22: 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
+  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')
+
+! 24: 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')
+
+! 25: 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')
+
+! 26: 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)
+
+! 27: fgd_fragment_index check
+  n = fgd_fragment_index(d, 'const')
+  call check_ok(ne, 27, d)
+  call check_int(ne, 27, n, 0)
+
+! 28: fgd_add_raw check
+  call fgd_add_raw(d, 'new1', GD_FLOAT64, 3, 0)
+  call check_ok2(ne, 28, 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)
+
+! 29: fgd_add_lincom check
+  call fgd_add_lincom(d, 'new2', 2, 'in1', 9.9d0, 8.8d0, &
+  'in2', 7.7d0, 6.6d0, '', 0d0, 0d0, 0)
+  call check_ok2(ne, 29, 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 /)
+  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))
+  end do
+
+! 30: fgd_add_clincom check
+  cq(1) = dcmplx(1.1, 1.2)
+  cq(2) = dcmplx(1.3, 1.4)
+  cq(3) = dcmplx(1.4, 1.5)
+  cq(4) = dcmplx(1.6, 1.7)
+  call fgd_add_clincom(d, 'new3', 2, 'in1', cq(1), cq(2), &
+  'in2', cq(3), cq(4), '', cq(5), cq(6), 0)
+  call check_ok2(ne, 30, 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)
+
+  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))
+  end do
+
+! 31: 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)
+
+  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)
+
+  q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /)
+  DO i=1,4
+  call check_dbl2(ne, 31, i, ent%a(i), q(i))
+  end do
+
+! 32: fgd_add_cpolynom check
+  cq(1) = dcmplx(3.1, 7.0)
+  cq(2) = dcmplx(4.2, 8.0)
+  cq(3) = dcmplx(5.2, 9.0)
+  cq(4) = dcmplx(6.3, 4.4)
+  call fgd_add_cpolynom(d, 'new5', 3, 'in1', cq(1), cq(2), cq(3), cq(4), &
+  dcmplx(0d0,0d0), dcmplx(0d0,0d0), 0)
+  call check_ok2(ne, 32, 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)
+
+  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))
+  end do
+
+! 33: fgd_add_linterp check
+  call fgd_add_linterp(d, "new6", "in", "./some/table", 0)
+  call check_ok2(ne, 33, 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')
+
+! 34: fgd_add_bit check
+  call fgd_add_bit(d, "new7", "in", 13, 12, 0)
+  call check_ok2(ne, 34, 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 fgd_add_sbit(d, "new8", "in", 13, 12, 0)
+  call check_ok2(ne, 35, 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 fgd_add_multiply(d, 'new9', 'in1', 'in2', 0)
+  call check_ok2(ne, 36, 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')
+
+! 37: fgd_add_phase check
+  call fgd_add_phase(d, 'new10', 'in1', 22, 0)
+  call check_ok2(ne, 37, 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')
+
+! 38: fgd_add_const check
+  call fgd_add_const(d, 'new11', GD_FLOAT64, 0)
+  call check_ok2(ne, 38, 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 fgd_get_constant_r4(d, 'new11', fl)
+  call check_ok2(ne, 38, 3, d)
+  call check_dbl(ne, 38, 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
+  str = fgd_fragmentname(d, 0)
+  call check_ok(ne, 39, d)
+  call check_eos(ne, 39, str, fildir//DIRSEP//'format')
+
+! 40: fgd_nfragments check
+  n = fgd_nfragments(d)
+  call check_ok(ne, 40, d)
+  call check_int(ne, 40, n, 1)
+
+! 41: fgd_include check
+  call fgd_include(d, 'form2', 0, 0)
+  call check_ok2(ne, 41, 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)
+
+! 42: 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)
+
+! 43: fgd_field_list_by_type check
+  fields(1) = 'lincom'
+  fields(2) = 'new2'
+  fields(3) = 'new3'
+  l = flen
+  call fgd_field_list_by_type(flist, d, GD_LINCOM_ENTRY, l)
+  call check_ok(ne, 43, d)
+  call check_int(ne, 43, l, flen)
+
+  do i = 1, n
+  call check_str2(ne, 43, i, flist(i), fields(i))
+  end do
+
+! 44: fgd_nvectors check
+  n = fgd_nvectors(d)
+  call check_ok(ne, 44, d)
+  call check_int(ne, 44, n, 25)
+
+! 45: 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     ', '           ', '           ', '           ' /)
+  l = flen
+  call fgd_vector_list(flist, d, l)
+  call check_ok(ne, 45, d)
+  call check_int(ne, 45, l, flen)
+ 
+  do i=1,n
+  call check_str2(ne, 45, i, flist(i), fields(i))
+  end do
+
+! 46: fgd_madd_lincom check
+  call fgd_madd_lincom(d, 'data', 'mnew1', 2, 'in1', 9.9d0, 8.8d0, &
+  'in2', 7.7d0, 6.6d0, '', 0d0, 0d0)
+  call check_ok2(ne, 46, 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 /)
+  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))
+  end do
+
+! 47: fgd_madd_clincom check
+  cq(1) = dcmplx(1.1, 1.2)
+  cq(2) = dcmplx(1.3, 1.4)
+  cq(3) = dcmplx(1.4, 1.5)
+  cq(4) = dcmplx(1.6, 1.7)
+  call fgd_madd_clincom(d, 'data', 'mnew2', 2, 'in1', cq(1), cq(2), &
+  'in2', cq(3), cq(4), '', cq(5), cq(6))
+  call check_ok2(ne, 47, 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)
+
+  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))
+  end do
+
+! 48: 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)
+
+  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')
+
+  q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /)
+  DO i=1,4
+  call check_dbl2(ne, 48, i, ent%a(i), q(i))
+  end do
+
+! 49: fgd_madd_cpolynom check
+  cq(1) = dcmplx(1.1, 0.0)
+  cq(2) = dcmplx(2.2, 0.0)
+  cq(3) = dcmplx(2.2, 0.0)
+  cq(4) = dcmplx(3.3, 4.4)
+  call fgd_madd_cpolynom(d, 'data', 'mnew5', 3, 'in1', cq(1), cq(2), &
+     cq(3), cq(4), dcmplx(0d0,0d0), dcmplx(0d0,0d0))
+  call check_ok2(ne, 49, 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')
+
+  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))
+  end do
+
+! 50: fgd_madd_linterp check
+  call fgd_madd_linterp(d, "data", "mnew6", "in", "./more/table")
+  call check_ok2(ne, 50, 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')
+
+! 51: fgd_madd_bit check
+  call fgd_madd_bit(d, "data", "mnew7", "in", 13, 12)
+  call check_ok2(ne, 51, 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 fgd_madd_sbit(d, "data", "mnew8", "in", 13, 12)
+  call check_ok2(ne, 52, 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 fgd_madd_multiply(d, 'data', 'mnew9', 'in1', 'in2')
+  call check_ok2(ne, 53, 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')
+
+! 54: fgd_madd_phase check
+  call fgd_madd_phase(d, 'data', 'mnew10', 'in1', 22)
+  call check_ok2(ne, 54, 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')
+
+! 55: fgd_madd_const check
+  call fgd_madd_const(d, 'data', 'mnew11', GD_FLOAT64)
+  call check_ok2(ne, 55, 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 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')
+
+! 56: 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")
+
+! 57: fgd_add_string check
+  call fgd_add_string(d, 'new12', 0)
+  call check_ok2(ne, 57, 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, "")
+
+! 58: fgd_madd_string check
+  call fgd_madd_string(d, "data", 'mnew12')
+  call check_ok2(ne, 58, 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, "")
+
+! 59: fgd_add_spec check
+  call fgd_add_spec(d, 'lorem STRING "Lorem ipsum"', 0)
+  call check_ok2(ne, 59, 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")
+
+! 60: fgd_madd_spec check
+  call fgd_madd_spec(d, 'ipsum STRING "dolor sit amet."', 'lorem')
+  call check_ok2(ne, 60, 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.")
+
+! 61: fgd_put_constant_i1 check
+  ci1(1) = 61
+  call fgd_put_constant_i1(d, 'const', ci1(1))
+  call check_ok2(ne, 61, 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)
+
+! 127: fgd_put_constant_i2 check
+  ci2(1) = 127
+  call fgd_put_constant_i2(d, 'const', ci2(1))
+  call check_ok2(ne, 127, 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)
+
+! 128: fgd_put_constant_i4 check
+  ci4(1) = 128
+  call fgd_put_constant_i4(d, 'const', ci4(1))
+  call check_ok2(ne, 128, 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)
+
+! 129: fgd_put_constant_i8 check
+  ci8(1) = 129
+  call fgd_put_constant_i8(d, 'const', ci8(1))
+  call check_ok2(ne, 129, 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)
+
+! 130: 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 fgd_get_constant_r4(d, 'new11', fl)
+  call check_ok2(ne, 130, 2, d)
+  call check_dbl(ne, 130, 1d0 * fl, -8.1d0)
+
+! 131: fgd_put_constant_r8 check
+  cr8(1) = 131
+  call fgd_put_constant_r8(d, 'const', cr8(1))
+  call check_ok2(ne, 131, 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)
+
+! 132: fgd_put_constant_c8 check
+  cc8(1) = 132
+  call fgd_put_constant_c8(d, 'const', cc8(1))
+  call check_ok2(ne, 132, 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)
+
+! 133: fgd_put_constant_c16 check
+  cc16(1) = 133
+  call fgd_put_constant_c16(d, 'const', cc16(1))
+  call check_ok2(ne, 133, 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)
+
+! 62: 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)
+
+  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")
+
+! 63: 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)
+
+! 64: fgd_mfield_list_by_type check
+  fields(1) = 'mnew1'
+  fields(2) = 'mnew2'
+  l = flen
+  call fgd_mfield_list_by_type(flist, d, "data", GD_LINCOM_ENTRY, l)
+  call check_ok2(ne, 64, i, d)
+  call check_int2(ne, 64, i, l, flen)
+
+  do i = 1, n
+  call check_str2(ne, 64, i, flist(i), fields(i))
+  end do
+
+! 65: fgd_nmvectors check
+  n = fgd_nmvectors(d, "data")
+  call check_ok(ne, 65, d)
+  call check_int(ne, 65, n, 11)
+
+! 66: fgd_mvector_list check
+  fields = (/    'mlut       ', 'mnew1      ', 'mnew2      ', 'mnew3      ', &
+  'mnew5      ', 'mnew6      ', 'mnew7      ', 'mnew8      ', 'mnew9      ', &
+  'mnew10     ', 'mnew4      ', '           ', '           ', '           ', &
+  '           ', '           ', '           ', '           ', '           ', &
+  '           ', '           ', '           ', '           ', '           ', &
+  '           ', '           ', '           ', '           ' /)
+  l = flen
+  call fgd_mvector_list(flist, d, "data", l)
+  call check_ok2(ne, 66, i, d)
+  call check_int2(ne, 66, i, l, flen)
+
+  do i=1,n
+  call check_str2(ne, 66, i, flist(i), fields(i))
+  end do
+
+! 67: fgd_alter_raw check
+  call fgd_alter_raw(d, 'new1', GD_INT32, 4, 0)
+  call check_ok2(ne, 67, 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)
+
+! 68: fgd_alter_lincom check
+  call fgd_alter_lincom(d, 'new2', 3, 'in4', 9.9d-1, 7.8d0, 'in5', &
+     1.1d1, 2.2d-2, 'in6', 1.96d0, 0d0)
+  call check_ok2(ne, 68, 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)
+
+  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))
+  end do
+
+! 69: fgd_alter_clincom check
+  cq(1) = dcmplx(0.1, 0.2)
+  cq(2) = dcmplx(0.3, 0.4)
+  cq(3) = dcmplx(0.4, 0.5)
+  cq(4) = dcmplx(0.6, 0.7)
+  call fgd_alter_clincom(d, 'new3', 2, 'in4', cq(1), cq(2), 'in3', &
+     cq(3), cq(4), '', cq(5), cq(6))
+  call check_ok2(ne, 69, 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)
+
+  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))
+  end do
+
+! 70: 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)
+
+  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')
+
+  q = (/ 3d0, 4d0, 5d0, 6d0, 7d0, 0d0 /)
+  DO i=1,5
+  call check_dbl2(ne, 70, i, ent%a(i), q(i))
+  end do
+
+! 71: fgd_alter_cpolynom check
+  cq(1) = dcmplx(1.1, 5.0)
+  cq(2) = dcmplx(1.2, 4.0)
+  cq(3) = dcmplx(1.2, 3.0)
+  cq(4) = dcmplx(1.3, 2.4)
+  call fgd_alter_cpolynom(d, 'new5', 3, 'in1', cq(1), cq(2), cq(3), &
+  cq(4), dcmplx(0d0,0d0), dcmplx(0d0,0d0))
+  call check_ok2(ne, 71, 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)
+
+  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
+
+! 72: fgd_alter_linterp check
+  call fgd_alter_linterp(d, "new6", "in3", "./other/table", 0)
+  call check_ok2(ne, 72, 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')
+
+! 73: fgd_alter_bit check
+  call fgd_alter_bit(d, "new7", "in3", 3, 2)
+  call check_ok2(ne, 73, 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 fgd_alter_sbit(d, "new8", "out", 1, 22)
+  call check_ok2(ne, 74, 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 fgd_alter_multiply(d, 'new9', 'in6', 'in4')
+  call check_ok2(ne, 75, 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')
+
+! 76: fgd_alter_phase check
+  call fgd_alter_phase(d, 'new10', 'in2', 8)
+  call check_ok2(ne, 76, 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')
+
+! 77: fgd_alter_const check
+  call fgd_alter_const(d, 'new11', GD_FLOAT32)
+  call check_ok2(ne, 77, 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 fgd_get_constant_r4(d, 'new11', fl)
+  call check_ok2(ne, 77, 3, d)
+  call check_dbl(ne, 77, 1d0 * fl, -8.1d0)
+
+! 78: fgd_encoding check
+  n = fgd_encoding(d, 0)
+  call check_ok(ne, 78, d)
+  call check_int(ne, 78, n, GD_UNENCODED)
+
+! 79: 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))
+
+! 80: 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)
+
+! 81: fgd_parent_fragment check
+  n = fgd_parent_fragment(d, 1)
+  call check_ok(ne, 81, d)
+  call check_int(ne, 81, n, 0)
+
+! 82: fgd_alter_protection check
+  call fgd_alter_protection(d, GD_PROTECT_DATA, 1)
+  call check_ok(ne, 82, d)
+
+! 83: fgd_protection check
+  n = fgd_protection(d, 1)
+  call check_ok(ne, 83, d)
+  call check_int(ne, 83, n, GD_PROTECT_DATA)
+
+! 84: 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')
+
+! 85: fgd_reference check
+  str = fgd_reference(d, "new1")
+  call check_ok(ne, 85, d)
+  call check_str(ne, 85, str, 'new1')
+
+! 87: fgd_alter_encoding check
+  call fgd_alter_encoding(d, GD_SLIM_ENCODED, 1, 0)
+  call check_ok2(ne, 87, 1, d)
+
+  n = fgd_encoding(d, 1)
+  call check_ok2(ne, 87, 2, d)
+  call check_int(ne, 87, n, GD_SLIM_ENCODED)
+
+! 88: fgd_alter_endianness check
+  call fgd_alter_endianness(d, GD_BIG_ENDIAN, 1, 0)
+  call check_ok2(ne, 88, 1, d)
+
+  n = fgd_endianness(d, 1)
+  call check_ok2(ne, 88, 2, d)
+  call check_int(ne, 88, n, GD_BIG_ENDIAN)
+
+! 89: fgd_alter_spec check
+  call fgd_alter_spec(d, 'new10 PHASE in1 3', 0)
+  call check_ok2(ne, 89, 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')
+
+! 90: fgd_delete check
+  call fgd_delete(d, 'new10', 0)
+  call check_ok2(ne, 90, 1, d)
+
+  n = fgd_entry(d, 'new10', ent)
+  call check_err2(ne, 90, 2, d, GD_E_BAD_CODE)
+
+! 91: fgd_malter_spec check
+  call fgd_malter_spec(d, 'mnew10 PHASE in4 11', 'data', 0)
+  call check_ok2(ne, 91, 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')
+
+! 92: fgd_move check
+  call fgd_move(d, 'new9', 1, 0)
+  call check_ok2(ne, 92, 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')
+
+! 93: fgd_rename check
+  call fgd_rename(d, 'new9', 'newer', 0)
+  call check_ok2(ne, 93, 1, d)
+
+  n = fgd_entry(d, 'new9', ent)
+  call check_err2(ne, 93, 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')
+
+! 94: fgd_uninclude check
+  call fgd_uninclude(d, 1, 0)
+  call check_ok2(ne, 94, 1, d)
+
+  n = fgd_entry(d, 'newer', ent)
+  call check_err2(ne, 94, 2, d, GD_E_BAD_CODE)
+
+! 95: fgd_frameoffset check
+  n = fgd_frameoffset(d, 0)
+  call check_ok(ne, 95, d)
+  call check_int(ne, 95, n, 0)
+
+! 96: fgd_alter_frameoffset check
+  call fgd_alter_frameoffset(d, 33, 0, 0)
+  call check_ok2(ne, 96, 1, d)
+
+  n = fgd_frameoffset(d, 0)
+  call check_ok2(ne, 96, 2, d)
+  call check_int(ne, 96, n, 33)
+
+! 97: fgd_native_type check
+  n = fgd_native_type(d, 'data')
+  call check_ok(ne, 97, d)
+  call check_int(ne, 97, n, GD_INT8)
+
+! 99: 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)
+
+! 100: 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)
+
+! 101: 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)
+
+! 86: fgd_eof check
+  n = fgd_eof(d, 'lincom')
+  call check_ok(ne, 86, d)
+  call check_int(ne, 86, n, 344)
+
+! 142: fgd_bof check
+  n = fgd_bof(d, 'lincom')
+  call check_ok(ne, 142, d)
+  call check_int(ne, 142, n, 264)
+
+! 143: fgd_entry (divide) check
+  n = fgd_entry(d, 'div', ent)
+  call check_ok(ne, 143, d)
+  call check_int2(ne, 143, 1, n, GD_DIVIDE_ENTRY)
+  call check_int2(ne, 143, 2, ent%fragment_index, 0)
+  call check_str2(ne, 143, 3, ent%field(1), 'mult')
+  call check_str2(ne, 143, 4, ent%field(2), 'bit')
+
+! 145: fgd_entry (recip) check
+  n = fgd_entry(d, 'recip', ent)
+  call check_ok(ne, 145, d)
+  call check_int2(ne, 145, 1, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 145, 2, ent%fragment_index, 0)
+  call check_int2(ne, 145, 3, ent%comp_scal, 1)
+  call check_str2(ne, 145, 4, ent%field(1), 'div')
+  call check_cpx2(ne, 145, 5, ent%cdividend, dcmplx(6.5, 4.3))
+
+! 146: fgd_add_divide check
+  call fgd_add_divide(d, 'new14', 'in1', 'in2', 0)
+  call check_ok2(ne, 146, 1, d)
+
+  n = fgd_entry(d, 'new14', ent)
+  call check_ok2(ne, 146, 2, d)
+  call check_int2(ne, 146, 1, n, GD_DIVIDE_ENTRY)
+  call check_int2(ne, 146, 2, ent%fragment_index, 0)
+  call check_str2(ne, 146, 3, ent%field(1), 'in1')
+  call check_str2(ne, 146, 4, ent%field(2), 'in2')
+
+! 147: fgd_add_recip check
+  call fgd_add_recip(d, 'new15', 'in1', 31.9d0, 0)
+  call check_ok2(ne, 147, 1, d)
+
+  n = fgd_entry(d, 'new15', ent)
+  call check_ok2(ne, 147, 2, d)
+  call check_int2(ne, 147, 1, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 147, 2, ent%fragment_index, 0)
+  call check_str2(ne, 147, 3, ent%field(1), 'in1')
+  call check_int2(ne, 147, 4, ent%comp_scal, 0)
+  call check_dbl2(ne, 147, 5, ent%dividend, 31.9d0)
+
+! 148: fgd_add_recip check
+  call fgd_add_crecip(d, 'new16', 'in1', dcmplx(31.9d0, 38.2d0), 0)
+  call check_ok2(ne, 148, 1, d)
+
+  n = fgd_entry(d, 'new16', ent)
+  call check_ok2(ne, 148, 2, d)
+  call check_int2(ne, 148, 1, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 148, 2, ent%fragment_index, 0)
+  call check_str2(ne, 148, 3, ent%field(1), 'in1')
+  call check_int2(ne, 148, 4, ent%comp_scal, 1)
+  call check_cpx2(ne, 148, 5, ent%cdividend, dcmplx(31.9, 38.2))
+
+! 149: fgd_madd_divide check
+  call fgd_madd_divide(d, 'data', 'new14', 'in3', 'in4')
+  call check_ok2(ne, 149, 1, d)
+
+  n = fgd_entry(d, 'data/new14', ent)
+  call check_ok2(ne, 149, 2, d)
+  call check_int2(ne, 149, 1, n, GD_DIVIDE_ENTRY)
+  call check_int2(ne, 149, 2, ent%fragment_index, 0)
+  call check_str2(ne, 149, 3, ent%field(1), 'in3')
+  call check_str2(ne, 149, 4, ent%field(2), 'in4')
+
+! 150: fgd_madd_recip check
+  call fgd_madd_recip(d, 'data', 'new15', 'in0', 95.5d0)
+  call check_ok2(ne, 150, 1, d)
+
+  n = fgd_entry(d, 'data/new15', ent)
+  call check_ok2(ne, 150, 2, d)
+  call check_int2(ne, 150, 1, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 150, 2, ent%fragment_index, 0)
+  call check_str2(ne, 150, 3, ent%field(1), 'in0')
+  call check_int2(ne, 150, 4, ent%comp_scal, 0)
+  call check_dbl2(ne, 150, 5, ent%dividend, 95.5d0)
+
+! 151: fgd_madd_recip check
+  call fgd_madd_crecip(d, 'data', 'new16', 'in3', dcmplx(8.47d0, 6.22d0))
+  call check_ok2(ne, 151, 1, d)
+
+  n = fgd_entry(d, 'data/new16', ent)
+  call check_ok2(ne, 151, 2, d)
+  call check_int2(ne, 151, 1, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 151, 2, ent%fragment_index, 0)
+  call check_str2(ne, 151, 3, ent%field(1), 'in3')
+  call check_int2(ne, 151, 4, ent%comp_scal, 1)
+  call check_cpx2(ne, 151, 5, ent%cdividend, dcmplx(8.47, 6.22))
+
+! 152: fgd_alter_divide check
+  call fgd_alter_divide(d, 'new14', 'in6', 'in4')
+  call check_ok2(ne, 152, 1, d)
+
+  n = fgd_entry(d, 'new14', ent)
+  call check_ok2(ne, 152, 2, d)
+  call check_int2(ne, 152, 1, n, GD_DIVIDE_ENTRY)
+  call check_int2(ne, 152, 2, ent%fragment_index, 0)
+  call check_str2(ne, 152, 3, ent%field(1), 'in6')
+  call check_str2(ne, 152, 4, ent%field(2), 'in4')
+
+! 153: fgd_alter_recip check
+  call fgd_alter_recip(d, 'new15', 'in5', 0.187d0)
+  call check_ok2(ne, 153, 1, d)
+
+  n = fgd_entry(d, 'new15', ent)
+  call check_ok2(ne, 153, 2, d)
+  call check_int2(ne, 153, 1, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 153, 2, ent%fragment_index, 0)
+  call check_str2(ne, 153, 3, ent%field(1), 'in5')
+  call check_dbl2(ne, 153, 4, ent%dividend, 0.187d0)
+
+! 154: fgd_alter_crecip check
+  call fgd_alter_crecip(d, 'new16', 'in2', dcmplx(4.3d0, 81.81d0))
+  call check_ok2(ne, 154, 1, d)
+
+  n = fgd_entry(d, 'new16', ent)
+  call check_ok2(ne, 154, 2, d)
+  call check_int2(ne, 154, 1, n, GD_RECIP_ENTRY)
+  call check_int2(ne, 154, 2, ent%fragment_index, 0)
+  call check_str2(ne, 154, 3, ent%field(1), 'in2')
+  call check_cpx2(ne, 154, 4, ent%cdividend, dcmplx(4.3d0, 81.81d0))
+
+! 155: fgd_rewrite_fragment check
+  call fgd_rewrite_fragment(d, 0)
+  call check_ok(ne, 155, d)
+
+! 156: fgd_invalid_dirfile check
+  l = fgd_invalid_dirfile()
+  call check_ok2(ne, 98, 1, l)
+
+  n = fgd_nfragments(l)
+  call check_err2(ne, 98, 2, l, GD_E_BAD_DIRFILE)
+
+  call fgd_close(l)
+
+! 157: fgd_dirfile_standards
+  n = fgd_dirfile_standards(d, GD_VERSION_CURRENT)
+  call check_ok2(ne, 157, 1, d)
+  call check_int(ne, 157, n, 9)
+
+  n = fgd_dirfile_standards(d, 0)
+  call check_err2(ne, 157, 2, d, GD_E_ARGUMENT)
+
+! 158: gd_get_carray_slice (INT8)
+  call fgd_get_carray_i1(d, "carray", 0, 0, ci1)
+  call check_ok(ne, 158, d)
+
+  do i=1,6
+    call check_int2(ne, 158, i, int(ci1(i)), i)
+  end do
+
+! 159: gd_get_carray_slice (INT8)
+  call fgd_get_carray_i1(d, "carray", 3, 2, ci1)
+  call check_ok(ne, 159, d)
+
+  do i=1,2
+    call check_int2(ne, 159, i, int(ci1(i)), i + 2)
+  end do
+
+! 160: gd_get_carray_slice (INT16)
+  call fgd_get_carray_i2(d, "carray", 3, 2, ci2)
+  call check_ok(ne, 160, d)
+
+  do i=1,2
+    call check_int2(ne, 160, i, int(ci2(i)), i + 2)
+  end do
+
+! 161: gd_get_carray_slice (INT32)
+  call fgd_get_carray_i4(d, "carray", 3, 2, ci4)
+  call check_ok(ne, 161, d)
+
+  do i=1,2
+    call check_int2(ne, 161, i, ci4(i), i + 2)
+  end do
+
+! 162: gd_get_carray_slice (INT64)
+  call fgd_get_carray_i8(d, "carray", 3, 2, ci8)
+  call check_ok(ne, 162, d)
+
+  do i=1,2
+    call check_int2(ne, 162, i, int(ci8(i)), i + 2)
+  end do
+
+! 163: gd_get_carray_slice (FLOAT32)
+  call fgd_get_carray_r4(d, "carray", 3, 2, cr4)
+  call check_ok(ne, 163, d)
+
+  do i=1,2
+  call check_dbl2(ne, 163, i, 1d0 * cr4(i), (2 + i) * 1.1d0)
+  end do
+
+! 164: gd_get_carray_slice (FLOAT64)
+  call fgd_get_carray_r8(d, "carray", 3, 2, cr8)
+  call check_ok(ne, 164, d)
+
+  do i=1,2
+  call check_dbl2(ne, 164, i, cr8(i), (2 + i) * 1.1d0)
+  end do
+
+! 165: gd_get_carray_slice (COMPLEX64)
+  call fgd_get_carray_c8(d, "carray", 3, 2, cc8)
+  call check_ok(ne, 165, d)
+
+  do i=1,2
+  call check_cpx2(ne, 165, i, 1d0 * cc8(i), dcmplx((2 + i) * 1.1, 0))
+  end do
+
+! 166: gd_get_carray_slice (COMPLEX128)
+  call fgd_get_carray_c16(d, "carray", 3, 2, cc16)
+  call check_ok(ne, 166, d)
+
+  do i=1,2
+  call check_cpx2(ne, 166, i, cc16(i), dcmplx((2 + i) * 1.1, 0))
+  end do
+
+! 168: gd_put_carray
+  ci1 = (/ 11_1, 12_1, 13_1, 14_1, 15_1, 16_1, 0_1, 0_1 /)
+  call fgd_put_carray_i1(d, "carray", 0, 0, ci1)
+  call check_ok2(ne, 168, 1, d)
+
+  call fgd_get_carray_i1(d, "carray", 0, 0, ci1)
+  call check_ok2(ne, 168, 2, d)
+
+  do i=1,6
+    call check_int2(ne, 168, i, int(ci1(i)), i + 10)
+  end do
+
+! 169: gd_put_carray_slice (INT8)
+  ci1 = (/ 72_1, 73_1, 0_1, 0_1, 0_1, 0_1, 0_1, 0_1 /)
+  call fgd_put_carray_i1(d, "carray", 3, 2, ci1)
+  call check_ok2(ne, 169, 1, d)
+
+  call fgd_get_carray_i1(d, "carray", 0, 0, ci1)
+  call check_ok2(ne, 169, 2, d)
+
+  do i=1,6
+    if (i .eq. 3 .or. i .eq. 4) then
+      n = 69 + i
+    else
+      n = 10 + i
+    end if
+    call check_int2(ne, 169, i, int(ci1(i)), n)
+  end do
+
+! 170: gd_put_carray_slice (INT16)
+  ci2 = (/ 173_2, 174_2, 0_2, 0_2, 0_2, 0_2, 0_2, 0_2 /)
+  call fgd_put_carray_i2(d, "carray", 3, 2, ci2)
+  call check_ok2(ne, 170, 1, d)
+
+  call fgd_get_carray_i2(d, "carray", 0, 0, ci2)
+  call check_ok2(ne, 170, 2, d)
+
+  do i=1,6
+    if (i .eq. 3 .or. i .eq. 4) then
+      n = 170 + i
+    else
+      n = 10 + i
+    end if
+    call check_int2(ne, 170, i, int(ci2(i)), n)
+  end do
+
+! 171: gd_put_carray_slice (INT32)
+  ci4 = (/ 174, 175, 0, 0, 0, 0, 0, 0 /)
+  call fgd_put_carray_i4(d, "carray", 3, 2, ci4)
+  call check_ok2(ne, 171, 1, d)
+
+  call fgd_get_carray_i4(d, "carray", 0, 0, ci4)
+  call check_ok2(ne, 171, 2, d)
+
+  do i=1,6
+    if (i .eq. 3 .or. i .eq. 4) then
+      n = 171 + i
+    else
+      n = 10 + i
+    end if
+    call check_int2(ne, 171, i, ci4(i), n)
+  end do
+
+! 172: gd_put_carray_slice (INT64)
+  ci8 = (/ 175, 176, 0, 0, 0, 0, 0, 0 /)
+  call fgd_put_carray_i8(d, "carray", 3, 2, ci8)
+  call check_ok2(ne, 172, 1, d)
+
+  call fgd_get_carray_i8(d, "carray", 0, 0, ci8)
+  call check_ok2(ne, 172, 2, d)
+
+  do i=1,6
+    if (i .eq. 3 .or. i .eq. 4) then
+      n = 172 + i
+    else
+      n = 10 + i
+    end if
+    call check_int2(ne, 172, i, int(ci8(i)), n)
+  end do
+
+! 173: gd_put_carray_slice (FLOAT32)
+  cr4 = (/ 176., 177., 0., 0., 0., 0., 0., 0. /)
+  call fgd_put_carray_r4(d, "carray", 3, 2, cr4)
+  call check_ok2(ne, 173, 1, d)
+
+  call fgd_get_carray_r4(d, "carray", 0, 0, cr4)
+  call check_ok2(ne, 173, 2, d)
+
+  do i=1,6
+    if (i .eq. 3 .or. i .eq. 4) then
+      dp = 173. + i
+    else
+      dp = 10 + i
+    end if
+    call check_dbl2(ne, 173, i, 1d0 * cr4(i), dp)
+  end do
+
+! 174: gd_put_carray_slice (FLOAT64)
+  cr8 = (/ 177., 178., 0., 0., 0., 0., 0., 0. /)
+  call fgd_put_carray_r8(d, "carray", 3, 2, cr8)
+  call check_ok2(ne, 174, 1, d)
+
+  call fgd_get_carray_r8(d, "carray", 0, 0, cr8)
+  call check_ok2(ne, 174, 2, d)
+
+  do i=1,6
+    if (i .eq. 3 .or. i .eq. 4) then
+      dp = 174. + i
+    else
+      dp = 10 + i
+    end if
+    call check_dbl2(ne, 174, i, cr8(i), dp)
+  end do
+
+! 175: gd_put_carray_slice (COMPLEX64)
+  cc8 = (/ 178., 179., 0., 0., 0., 0., 0., 0. /)
+  call fgd_put_carray_c8(d, "carray", 3, 2, cc8)
+  call check_ok2(ne, 175, 1, d)
+
+  call fgd_get_carray_c8(d, "carray", 0, 0, cc8)
+  call check_ok2(ne, 175, 2, d)
+
+  do i=1,6
+    if (i .eq. 3 .or. i .eq. 4) then
+      dc = dcmplx(175d0 + i, 0d0)
+    else
+      dc = dcmplx(10d0 + i, 0d0)
+    end if
+    call check_cpx2(ne, 175, i, 1d0 * cc8(i), dc)
+  end do
+
+! 176: gd_put_carray_slice (COMPLEX128)
+  cc16 = (/ 179., 180., 0., 0., 0., 0., 0., 0. /)
+  call fgd_put_carray_c16(d, "carray", 3, 2, cc16)
+  call check_ok2(ne, 176, 1, d)
+
+  call fgd_get_carray_c16(d, "carray", 0, 0, cc16)
+  call check_ok2(ne, 176, 2, d)
+
+  do i=1,6
+    if (i .eq. 3 .or. i .eq. 4) then
+      dc = dcmplx(176d0 + i, 0d0)
+    else
+      dc = dcmplx(10d0 + i, 0d0)
+    end if
+    call check_cpx2(ne, 175, i, cc16(i), dc)
+  end do
+
+! 177: gd_carray_len
+  n = fgd_carray_len(d, 'carray')
+  call check_ok(ne, 177, d)
+  call check_int(ne, 177, n, 6)
+
+! 178: gd_entry (CARRAY)
+  n = fgd_entry(d, 'carray', ent)
+  call check_ok(ne, 178, d)
+  call check_int2(ne, 178, 1, n, GD_CARRAY_ENTRY)
+  call check_int2(ne, 178, 2, ent%fragment_index, 0)
+  call check_int2(ne, 178, 2, ent%array_len, 6)
+  call check_int2(ne, 178, 3, ent%data_type, GD_FLOAT64)
+
+! 179: gd_add_carray
+  call fgd_add_carray(d, 'new17', GD_FLOAT64, 4, 0)
+  call check_ok2(ne, 179, 1, d)
+
+  n = fgd_entry(d, 'new17', ent)
+  call check_ok2(ne, 179, 2, d)
+  call check_int2(ne, 179, 1, n, GD_CARRAY_ENTRY)
+  call check_int2(ne, 179, 2, ent%fragment_index, 0)
+  call check_int2(ne, 179, 3, ent%array_len, 4)
+  call check_int2(ne, 179, 4, ent%data_type, GD_FLOAT64)
+
+  call fgd_get_carray_r4(d, 'new17', 0, 0, cr4)
+  call check_ok2(ne, 179, 3, d)
+
+  do i=1,4
+  call check_dbl2(ne, 179, i, 1d0 * cr4(i), 0d0)
+  end do
+
+! 180: gd_madd_carray
+  call fgd_madd_carray(d, 'data', 'new17', GD_FLOAT64, 4)
+  call check_ok2(ne, 180, 1, d)
+
+  n = fgd_entry(d, 'data/new17', ent)
+  call check_ok2(ne, 180, 2, d)
+  call check_int2(ne, 180, 1, n, GD_CARRAY_ENTRY)
+  call check_int2(ne, 180, 2, ent%fragment_index, 0)
+  call check_int2(ne, 180, 3, ent%array_len, 4)
+  call check_int2(ne, 180, 4, ent%data_type, GD_FLOAT64)
+
+  call fgd_get_carray_r4(d, 'data/new17', 0, 0, cr4)
+  call check_ok2(ne, 180, 3, d)
+
+  do i=1,4
+  call check_dbl2(ne, 180, i, 1d0 * cr4(i), 0d0)
+  end do
+
+! 181: gd_alter_carray
+  call fgd_alter_carray(d, 'new17', GD_FLOAT32, 3)
+  call check_ok2(ne, 181, 1, d)
+
+  n = fgd_entry(d, 'new17', ent)
+  call check_ok2(ne, 181, 2, d)
+  call check_int2(ne, 181, 1, n, GD_CARRAY_ENTRY)
+  call check_int2(ne, 181, 2, ent%fragment_index, 0)
+  call check_int2(ne, 181, 3, ent%data_type, GD_FLOAT32)
+  call check_int2(ne, 181, 4, ent%array_len, 3)
+
+  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(2) = -8
+  n = fgd_nfields_by_type(d, GD_CONST_ENTRY)
+  call fgd_constants_i1(ci1, d)
+  call check_ok(ne, 183, d)
+
+  do i = 1, n
+  call check_int2(ne, 183, i, int(ci1(i)), int(iq(i)))
+  end do
+
+! 184: fgd_constants_i2 check
+  iq(1) = 133
+  call fgd_constants_i2(ci2, d)
+  call check_ok(ne, 184, d)
+
+  do i = 1, n
+  call check_int2(ne, 184, i, int(ci2(i)), int(iq(i)))
+  end do
+
+! 185: fgd_constants_i4 check
+  call fgd_constants_i4(ci4, d)
+  call check_ok(ne, 185, d)
+
+  do i = 1, n
+  call check_int2(ne, 185, i, ci4(i), int(iq(i)))
+  end do
+
+! 186: fgd_constants_i8 check
+  call fgd_constants_i8(ci8, d)
+  call check_ok(ne, 186, d)
+
+  do i = 1, n
+  call check_int2(ne, 186, i, int(ci8(i)), int(iq(i)))
+  end do
+
+! 187: fgd_constants_r4 check
+  q(1) = 133.
+  q(2) = -8.1
+  call fgd_constants_r4(cr4, d)
+  call check_ok(ne, 187, d)
+
+  do i = 1, n
+  call check_dbl2(ne, 187, i, 1d0 * cr4(i), q(i))
+  end do
+
+! 188: fgd_constants_r8 check
+  call fgd_constants_r8(cr8, d)
+  call check_ok(ne, 188, d)
+
+  do i = 1, n
+  call check_dbl2(ne, 188, i, cr8(i), q(i))
+  end do
+
+
+! 189: fgd_constants_c8 check
+  cq(1) = 133.
+  cq(2) = -8.1
+  call fgd_constants_c8(cc8, d)
+  call check_ok(ne, 189, d)
+
+  do i = 1, n
+  call check_cpx2(ne, 189, i, 1d0 * cc8(i), cq(i))
+  end do
+
+! 190: fgd_constants_c16 check
+  call fgd_constants_c16(cc16, d)
+  call check_ok(ne, 190, d)
+
+  do i = 1, n
+  call check_cpx2(ne, 190, i, cc16(i), cq(i))
+  end do
+
+! 191: fgd_mconstants_i1 check
+  iq(1) = 3
+  iq(2) = 0
+  n = fgd_nmfields_by_type(d, 'data', GD_CONST_ENTRY)
+  call fgd_mconstants_i1(ci1, d, 'data')
+  call check_ok(ne, 191, d)
+
+  do i = 1, n
+  call check_int2(ne, 191, i, int(ci1(i)), int(iq(i)))
+  end do
+
+! 192: fgd_mconstants_i2 check
+  call fgd_mconstants_i2(ci2, d, 'data')
+  call check_ok(ne, 192, d)
+
+  do i = 1, n
+  call check_int2(ne, 192, i, int(ci2(i)), int(iq(i)))
+  end do
+
+! 193: fgd_mconstants_i4 check
+  call fgd_mconstants_i4(ci4, d, 'data')
+  call check_ok(ne, 193, d)
+
+  do i = 1, n
+  call check_int2(ne, 193, i, ci4(i), int(iq(i)))
+  end do
+
+! 194: fgd_mconstants_i8 check
+  call fgd_mconstants_i8(ci8, d, 'data')
+  call check_ok(ne, 194, d)
+
+  do i = 1, n
+  call check_int2(ne, 194, i, int(ci8(i)), int(iq(i)))
+  end do
+
+! 195: fgd_mconstants_r4 check
+  q(1) = 3.3
+  q(2) = 0.
+  call fgd_mconstants_r4(cr4, d, 'data')
+  call check_ok(ne, 195, d)
+
+  do i = 1, n
+  call check_dbl2(ne, 195, i, 1d0 * cr4(i), q(i))
+  end do
+
+! 196: fgd_mconstants_r8 check
+  call fgd_mconstants_r8(cr8, d, 'data')
+  call check_ok(ne, 196, d)
+
+  do i = 1, n
+  call check_dbl2(ne, 196, i, cr8(i), q(i))
+  end do
+
+
+! 197: fgd_mconstants_c8 check
+  cq(1) = dcmplx(3.3, 4.4)
+  cq(2) = 0.
+  call fgd_mconstants_c8(cc8, d, 'data')
+  call check_ok(ne, 197, d)
+
+  do i = 1, n
+  call check_cpx2(ne, 197, i, 1d0 * cc8(i), cq(i))
+  end do
+
+! 198: fgd_mconstants_c16 check
+  call fgd_mconstants_c16(cc16, d, 'data')
+  call check_ok(ne, 198, d)
+
+  do i = 1, n
+  call check_cpx2(ne, 198, i, cc16(i), cq(i))
+  end do
+
+! 199: fgd_strings check
+  strings(1) = "Lorem ipsum"
+  strings(2) = ""
+  strings(3) = "Arthur Dent"
+  n = fgd_nfields_by_type(d, GD_STRING_ENTRY)
+  l = slen
+  call fgd_strings(st, d, l)
+  call check_ok(ne, 199, d)
+  call check_int(ne, 199, l, slen)
+
+  do i = 1, n
+  call check_str2(ne, 199, i, st(i), strings(i))
+  end do
+
+! 200: fgd_strings check
+  strings(1) = "This is a string constant."
+  strings(2) = ""
+  n = fgd_nmfields_by_type(d, 'data', GD_STRING_ENTRY)
+  l = slen
+  call fgd_mstrings(st, d, 'data', l)
+  call check_ok(ne, 200, d)
+  call check_int(ne, 200, l, slen)
+
+  do i = 1, n
+  call check_str2(ne, 200, i, st(i), strings(i))
+  end do
+
+! 201: fgd_string_value_max
+  n = fgd_string_value_max(d)
+  call check_int(ne, 201, n, 11)
+
+! 202: fgd_mstring_value_max
+  n = fgd_mstring_value_max(d, 'data')
+  call check_int(ne, 202, n, 26)
+
+! 203: fgd_seek check
+  n = fgd_seek(d, 'data', 35, 0, GD_SEEK_SET)
+  call check_ok(ne, 203, d)
+  call check_int2(ne, 203, 1, n, 280)
+
+  n = fgd_getdata_r8(d, 'data', GD_HERE, 0, 1, 0, cr8)
+  call check_int2(ne, 203, 2, n, 8)
+
+  do i=1,8
+  call check_dbl2(ne, 203, i, cr8(i), 16d0 + i)
+  end do
+
+! 204: fgd_tell check
+  n = fgd_tell(d, 'data')
+  call check_ok(ne, 204, d)
+  call check_int(ne, 204, n, 288)
+
+! 205: fgd_hide check
+  call fgd_hide(d, 'data')
+  call check_ok(ne, 205, d)
+
+! 206: fgd_hidden check
+  n = fgd_hidden(d, 'data')
+  call check_ok2(ne, 206, 1, d)
+  call check_int2(ne, 206, 1, n, 1)
+
+  n = fgd_hidden(d, 'lincom')
+  call check_ok2(ne, 206, 2, d)
+  call check_int2(ne, 206, 2, n, 0)
+
+! 207: fgd_unhide check
+  call fgd_unhide(d, 'data')
+  call check_ok2(ne, 206, 1, d)
+  n = fgd_hidden(d, 'data')
+  call check_ok2(ne, 206, 2, d)
+  call check_int(ne, 206, n, 0)
+
+! 208: fgd_sync check
+  call fgd_sync(d, 'data')
+  call check_ok(ne, 208, d)
+
+! 209: fgd_flush check
+  call fgd_flush(d, 'data')
+  call check_ok(ne, 209, d)
+
+! 210: fgd_metaflush check
+  call fgd_metaflush(d)
+  call check_ok(ne, 210, d)
+
+! 211: fgd_entry (WINDOW) check
+  n = fgd_entry(d, 'window', ent)
+  call check_ok(ne, 211, d)
+  call check_int2(ne, 211, 1, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 211, 2, ent%fragment_index, 0)
+  call check_int2(ne, 211, 3, ent%windop, GD_WINDOP_LT)
+  call check_str2(ne, 211, 4, ent%field(1), 'linterp')
+  call check_str2(ne, 211, 5, ent%field(2), 'mult')
+  call check_dbl2(ne, 211, 6, ent%rthreshold, 4.1D0)
+
+! 212: fgd_add_window_i check
+  call fgd_add_window_i(d, 'new18', 'in1', 'in2', GD_WINDOP_NE, 32, 0)
+  call check_ok2(ne, 212, 1, d)
+
+  n = fgd_entry(d, 'new18', ent)
+  call check_ok2(ne, 212, 2, d)
+  call check_int2(ne, 212, 1, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 212, 2, ent%fragment_index, 0)
+  call check_int2(ne, 212, 3, ent%windop, GD_WINDOP_NE)
+  call check_str2(ne, 212, 4, ent%field(1), 'in1')
+  call check_str2(ne, 212, 5, ent%field(2), 'in2')
+  call check_int2(ne, 212, 6, ent%ithreshold, 32)
+
+! 213: fgd_add_window_r check
+  call fgd_add_window_r(d, 'new19', 'in5', 'in4', GD_WINDOP_LE, 1d-4, 0)
+  call check_ok2(ne, 213, 1, d)
+
+  n = fgd_entry(d, 'new19', ent)
+  call check_ok2(ne, 213, 2, d)
+  call check_int2(ne, 213, 1, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 213, 2, ent%fragment_index, 0)
+  call check_int2(ne, 213, 3, ent%windop, GD_WINDOP_LE)
+  call check_str2(ne, 213, 4, ent%field(1), 'in5')
+  call check_str2(ne, 213, 5, ent%field(2), 'in4')
+  call check_dbl2(ne, 213, 6, ent%rthreshold, 1d-4)
+
+! 214: fgd_madd_window_i check
+  call fgd_madd_window_i(d, 'data', 'mnew18', 'in2', 'in3', GD_WINDOP_SET, &
+  128)
+  call check_ok2(ne, 214, 1, d)
+
+  n = fgd_entry(d, 'data/mnew18', ent)
+  call check_ok2(ne, 214, 2, d)
+  call check_int2(ne, 214, 1, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 214, 2, ent%fragment_index, 0)
+  call check_int2(ne, 214, 3, ent%windop, GD_WINDOP_SET)
+  call check_str2(ne, 214, 4, ent%field(1), 'in2')
+  call check_str2(ne, 214, 5, ent%field(2), 'in3')
+  call check_int2(ne, 214, 6, ent%ithreshold, 128)
+
+! 215: fgd_madd_window_r check
+  call fgd_madd_window_r(d, 'data', 'mnew19', 'in4', 'in1', GD_WINDOP_GT, &
+  0d0)
+  call check_ok2(ne, 215, 1, d)
+
+  n = fgd_entry(d, 'data/mnew19', ent)
+  call check_ok2(ne, 215, 2, d)
+  call check_int2(ne, 215, 1, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 215, 2, ent%fragment_index, 0)
+  call check_int2(ne, 215, 3, ent%windop, GD_WINDOP_GT)
+  call check_str2(ne, 215, 4, ent%field(1), 'in4')
+  call check_str2(ne, 215, 5, ent%field(2), 'in1')
+  call check_dbl2(ne, 215, 6, ent%rthreshold, 0d0)
+
+! 216: fgd_alter_window_i check
+  call fgd_alter_window_i(d, 'new19', 'in3', 'in5', GD_WINDOP_CLR, 32)
+  call check_ok2(ne, 216, 1, d)
+
+  n = fgd_entry(d, 'new19', ent)
+  call check_ok2(ne, 216, 2, d)
+  call check_int2(ne, 216, 1, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 216, 2, ent%fragment_index, 0)
+  call check_int2(ne, 216, 3, ent%windop, GD_WINDOP_CLR)
+  call check_str2(ne, 216, 4, ent%field(1), 'in3')
+  call check_str2(ne, 216, 5, ent%field(2), 'in5')
+  call check_int2(ne, 216, 6, ent%ithreshold, 32)
+
+! 217: fgd_alter_window_r check
+  call fgd_alter_window_r(d, 'new18', 'in3', 'in4', GD_WINDOP_GE, 32d3)
+  call check_ok2(ne, 217, 1, d)
+
+  n = fgd_entry(d, 'new18', ent)
+  call check_ok2(ne, 217, 2, d)
+  call check_int2(ne, 217, 1, n, GD_WINDOW_ENTRY)
+  call check_int2(ne, 217, 2, ent%fragment_index, 0)
+  call check_int2(ne, 217, 3, ent%windop, GD_WINDOP_GE)
+  call check_str2(ne, 217, 4, ent%field(1), 'in3')
+  call check_str2(ne, 217, 5, ent%field(2), 'in4')
+  call check_dbl2(ne, 217, 6, ent%rthreshold, 32d3)
+
+! 218: fgd_alias_target check
+  str = fgd_alias_target(d, 'alias')
+  call check_ok(ne, 218, d)
+  call check_str(ne, 218, str, 'data')
+
+! 219: fgd_add_alias check
+  call fgd_add_alias(d, 'new20', 'data', 0)
+  call check_ok2(ne, 219, 1, d)
+
+  str = fgd_alias_target(d, 'new20')
+  call check_ok2(ne, 219, 2, d)
+  call check_str(ne, 219, str, 'data')
+
+! 220: fgd_madd_alias check
+  call fgd_madd_alias(d, 'data', 'mnew20', 'data')
+  call check_ok2(ne, 220, 1, d)
+
+  str = fgd_alias_target(d, 'data/mnew20')
+  call check_ok2(ne, 220, 2, d)
+  call check_str(ne, 220, str, 'data')
+
+! 221: fgd_naliases check
+  n = fgd_naliases(d, 'data')
+  call check_ok(ne, 221, d)
+  call check_int(ne, 221, n, 4)
+
+! 222: GDALSS check
+  fields(1) = 'data'
+  fields(2) = 'alias'
+  fields(3) = 'data/mnew20'
+  fields(4) = 'new20'
+  l = flen
+  call fgd_aliases(flist, d, 'data', l)
+  call check_ok(ne, 222, d)
+  call check_int(ne, 222, l, flen)
+
+  do i = 1, n
+  call check_str2(ne, 222, i, flist(i), fields(i))
+  end do
+
+! 223: fgd_include_affix check
+  call fgd_include_affix(d, 'format1', 0, 'A', 'Z', GD_CREAT + GD_EXCL)
+  call check_ok(ne, 223, d)
+
+! 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
+  call fgd_fragment_affixes(fields(1), l, fields(2), n, d, 1)
+  call check_ok(ne, 226, d)
+  call check_int2(ne, 226, 1, l, flen)
+  call check_str2(ne, 226, 2, fields(1), 'A')
+  call check_int2(ne, 226, 3, n, flen)
+  call check_str2(ne, 226, 4, fields(2), 'Z')
+
+! 227: fgd_alter_affixes check
+  call fgd_alter_affixes(d, 1, 'B', '')
+  call check_ok2(ne, 227, 1, d)
+
+  l = flen
+  n = flen
+  call fgd_fragment_affixes(fields(1), l, fields(2), n, d, 1)
+  call check_ok2(ne, 227, 2, d)
+  call check_int2(ne, 226, 3, l, flen)
+  call check_str2(ne, 227, 4, fields(1), 'B')
+  call check_int2(ne, 226, 5, n, flen)
+  call check_str2(ne, 227, 6, fields(2), '')
+
+! 228: fgd_entry (MPLEX) check
+  n = fgd_entry(d, 'mplex', ent)
+  call check_ok(ne, 228, d)
+  call check_int2(ne, 228, 1, n, GD_MPLEX_ENTRY)
+  call check_int2(ne, 228, 2, ent%fragment_index, 0)
+  call check_int2(ne, 228, 3, ent%count_val, 1)
+  call check_str2(ne, 228, 4, ent%field(1), 'data')
+  call check_str2(ne, 228, 5, ent%field(2), 'sbit')
+  call check_int2(ne, 228, 6, ent%period, 10)
+
+! 229: fgd_add_mplex check
+  call fgd_add_mplex(d, 'new21', 'in1', 'in2', 5, 6, 0)
+  call check_ok2(ne, 229, 1, d)
+
+  n = fgd_entry(d, 'new21', ent)
+  call check_ok2(ne, 229, 2, d)
+  call check_int2(ne, 229, 1, n, GD_MPLEX_ENTRY)
+  call check_int2(ne, 229, 2, ent%fragment_index, 0)
+  call check_int2(ne, 229, 3, ent%count_val, 5)
+  call check_str2(ne, 229, 4, ent%field(1), 'in1')
+  call check_str2(ne, 229, 5, ent%field(2), 'in2')
+  call check_int2(ne, 229, 6, ent%period, 6)
+
+! 230: fgd_madd_mplex check
+  call fgd_madd_mplex(d, 'data', 'mnew21', 'in2', 'in3', 0, 12)
+  call check_ok2(ne, 230, 1, d)
+
+  n = fgd_entry(d, 'data/mnew21', ent)
+  call check_ok2(ne, 230, 2, d)
+  call check_int2(ne, 230, 1, n, GD_MPLEX_ENTRY)
+  call check_int2(ne, 230, 2, ent%fragment_index, 0)
+  call check_int2(ne, 230, 3, ent%count_val, 0)
+  call check_str2(ne, 230, 4, ent%field(1), 'in2')
+  call check_str2(ne, 230, 5, ent%field(2), 'in3')
+  call check_int2(ne, 230, 6, ent%period, 12)
+
+! 231: fgd_alter_mplex check
+  call fgd_alter_mplex(d, 'new21', 'in3', 'in4', 7, -1)
+  call check_ok2(ne, 231, 1, d)
+
+  n = fgd_entry(d, 'new21', ent)
+  call check_ok2(ne, 231, 2, d)
+  call check_int2(ne, 231, 1, n, GD_MPLEX_ENTRY)
+  call check_int2(ne, 231, 2, ent%fragment_index, 0)
+  call check_int2(ne, 231, 3, ent%count_val, 7)
+  call check_str2(ne, 231, 4, ent%field(1), 'in3')
+  call check_str2(ne, 231, 5, ent%field(2), 'in4')
+  call check_int2(ne, 231, 6, ent%period, 6)
+
+! 232: fgd_strtok check
+  l = slen
+  call fgd_strtok(str, l, d, '"test1 test2" test3\ test4 test5')
+  call check_ok2(ne, 232, 1, d)
+  call check_int2(ne, 232, 2, l, slen)
+  call check_str2(ne, 232, 3, str, 'test1 test2')
+
+  l = slen
+  call fgd_strtok(str, l, d, '')
+  call check_ok2(ne, 232, 4, d)
+  call check_int2(ne, 232, 5, l, slen)
+  call check_str2(ne, 232, 6, str, 'test3 test4')
+
+! 233: fgd_raw_close check
+  call fgd_raw_close(d, 'data')
+  call check_ok(ne, 233, d)
+
+! 234: fgd_desync check
+  n = fgd_desync(d, 0)
+  call check_ok(ne, 234, d)
+  call check_int(ne, 234, n, 0)
+
+! 235: fgd_flags check
+  n = fgd_flags(d, GD_PRETTY_PRINT, 0)
+  call check_ok(ne, 235, d)
+  call check_int(ne, 235, n, GD_PRETTY_PRINT)
+
+! 236: fgd_verbose_prefix check
+  call fgd_verbose_prefix(d, "big_test95")
+  call check_ok(ne, 236, d)
+
+! 237: fgd_nentries check
+  n = fgd_nentries(d, "data", GD_SCALAR_ENTRIES, IOR(GD_ENTRIES_HIDDEN, &
+  GD_ENTRIES_NOALIAS))
+  call check_ok2(ne, 237, 1, d)
+  call check_int2(ne, 237, 1, n, 5)
+  n = fgd_nentries(d, "", GD_VECTOR_ENTRIES, IOR(GD_ENTRIES_HIDDEN, &
+  GD_ENTRIES_NOALIAS))
+  call check_ok2(ne, 237, 2, d)
+  call check_int2(ne, 237, 2, n, 28)
+
+! 238: fgd_field_name_max check
+  i = fgd_entry_name_max(d, "", GD_VECTOR_ENTRIES, IOR(GD_ENTRIES_HIDDEN, &
+    GD_ENTRIES_NOALIAS))
+  call check_ok(ne, 238, d)
+  call check_int(ne, 238, i, 7)
+
+! 239: fgd_field_list check
+  fields = (/    'INDEX      ', 'bit        ', 'data       ', 'div        ', &
+  'lincom     ', 'linterp    ', 'mplex      ', 'mult       ', 'new1       ', &
+  'new13      ', 'new14      ', 'new15      ', 'new16      ', 'new18      ', &
+  'new19      ', 'new2       ', 'new21      ', 'new3       ', 'new4       ', &
+  'new5       ', 'new6       ', 'new7       ', 'new8       ', 'phase      ', &
+  'polynom    ', 'recip      ', 'sbit       ', 'window     ' /)
+  l = flen
+  call fgd_entry_list(flist, d, "", GD_VECTOR_ENTRIES, IOR(GD_ENTRIES_HIDDEN, &
+      GD_ENTRIES_NOALIAS), l)
+  call check_ok(ne, 239, d)
+  call check_int(ne, 239, l, flen)
+
+  do i = 1, n
+  call check_str2(ne, 239, i, flist(i), fields(i))
+  end do
+
+! 240: fgd_mplex_lookback check
+  call fgd_mplex_lookback(d, GD_LOOKBACK_ALL)
+  call check_ok(ne, 240, d)
+
+! 241: fgd_raw_filename check
+  str = fgd_linterp_tablename(d, "linterp")
+  call check_ok(ne, 241, d)
+  call check_eos(ne, 241, str, fildir//DIRSEP//'lut')
+
+! 243: NULL return from gd_reference
+  l = fgd_open(fildir//DIRSEP//'empty', GD_RDWR + GD_CREAT + GD_EXCL)
+  call check_ok2(ne, 243, 1, l)
+
+  str = fgd_reference(l, "")
+  call check_ok2(ne, 243, 2, l)
+  call check_str(ne, 243, str, '')
+
+  call fgd_discard(l);
+
+
+ 
+
+
+  
+
+
+!================================================================
+  call fgd_discard(d)
+
+  call system ( 'rm -rf ' // fildir )
+
+  if (ne .GT. 0) then
+    write(*, 9000) ne
+    call exit(1)
+  end if
+
+9000 format('ne = ', i0)
+end program
diff --git a/bindings/f77/test/gdcopn.f b/bindings/f77/test/gdcopn.f
new file mode 100644
index 0000000..299a042
--- /dev/null
+++ b/bindings/f77/test/gdcopn.f
@@ -0,0 +1,111 @@
+C     Callback test
+
+      SUBROUTINE CALBCK(R, DUNIT, SUBERROR, LINE)
+      INCLUDE "getdata.f"
+
+      INTEGER R, DUNIT, SUBERROR
+      CHARACTER*(GD_MLL) LINE
+
+C     Tell the parser to ignore syntax errors
+      R = GDSX_I
+
+      END SUBROUTINE
+
+      SUBROUTINE CALBK2(R, DUNIT, SUBERROR, LINE)
+      INTEGER R
+
+C     An invalid response
+      R = 3333
+
+      END SUBROUTINE
+
+      PROGRAM GETTST
+      IMPLICIT NONE
+      EXTERNAL CALBCK
+      EXTERNAL CALBK2
+      INCLUDE "getdata.f"
+
+      CHARACTER*12 fildir
+      PARAMETER (fildir = 'test_dirfile')
+      CHARACTER*19 frmat
+      PARAMETER (frmat = 'test_dirfile/format')
+      CHARACTER*20 frmat2
+      PARAMETER (frmat2 = 'test_dirfile/format2')
+      CHARACTER*20 frmat3
+      PARAMETER (frmat3 = 'test_dirfile/format3')
+      CHARACTER*17 dat
+      PARAMETER (dat = 'test_dirfile/data')
+      INTEGER*1 datdat(80)
+      INTEGER*1 i
+      INTEGER d
+      INTEGER e1, e2, e3, e4
+      INTEGER r
+
+      r = 0
+
+      CALL SYSTEM ( 'rm -rf ' // fildir )
+      CALL SYSTEM ( 'mkdir ' // fildir )
+
+      DO 20 i = 1, 80
+      datdat(i) = i
+   20 CONTINUE
+
+      OPEN(1, FILE=frmat, STATUS='NEW')
+      WRITE(1, *) "data RAW INT 8"
+      WRITE(1, *) "bad line"
+      CLOSE(1, STATUS='KEEP')
+
+      OPEN(1, FILE=frmat2, STATUS='NEW')
+      WRITE(1, *) "bad line2"
+      CLOSE(1, STATUS='KEEP')
+
+      OPEN(1, FILE=frmat3, STATUS='NEW')
+      WRITE(1, *) "bad line3"
+      CLOSE(1, STATUS='KEEP')
+
+      OPEN(1, FILE=dat, FORM='UNFORMATTED', ACCESS='DIRECT', RECL=80,
+     +STATUS='NEW')
+      WRITE (1,REC=1) datdat
+      CLOSE(1, STATUS='KEEP')
+
+      CALL GDCOPN(d, fildir, 12, GD_RW, CALBCK)
+      CALL GDEROR(e1, d)
+      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
+      IF (e2 .NE. GD_EOK) THEN
+        r = 1
+        WRITE(*, 9001) 2, e2, GD_EOK
+      ENDIF
+      IF (e3 .NE. GD_ECB) THEN
+        r = 1
+        WRITE(*, 9001) 3, e3, GD_ECB
+      ENDIF
+      IF (e4 .NE. GD_EFO) THEN
+        r = 1
+        WRITE(*, 9001) 3, e4, GD_EFO
+      ENDIF
+
+      IF (r .GT. 0) CALL ExIT(1)
+
+ 9001 FORMAT('e[', i3, '] = ', i4, ', expected ', i4)
+
+      STOP
+      END
diff --git a/bindings/f77/test/test_getdata.f.in b/bindings/f77/test/test_getdata.f.in
new file mode 100644
index 0000000..d5a0e61
--- /dev/null
+++ b/bindings/f77/test/test_getdata.f.in
@@ -0,0 +1,2 @@
+      CHARACTER*1 DIRSEP
+      PARAMETER (DIRSEP="@GD_FDIRSEP@")
diff --git a/bindings/idl/Makefile.am b/bindings/idl/Makefile.am
new file mode 100644
index 0000000..f7182bc
--- /dev/null
+++ b/bindings/idl/Makefile.am
@@ -0,0 +1,95 @@
+# Copyright (C) 2009, 2011 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+
+if CC_WALL
+WALL=-Wall
+endif
+
+SUBDIRS=test
+
+if GD_EXTERNAL
+GDIDL_GETDATA_LIBS=$(GETDATA_LIBS)
+else
+GDIDL_GETDATA_LIBS=../../src/libgetdata.la
+endif
+
+idl_LTLIBRARIES = idl_getdata.la
+nodist_idl_HEADERS = idl_getdata.dlm
+
+# idl makes heavy use of type punning, ergo -fno-strict-aliasing
+AM_CFLAGS = ${WALL} $(IDL_CFLAGS) -fno-strict-aliasing $(GETDATA_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/src
+BUILT_SOURCES=sublist.c constants.c
+idl_getdata_la_LDFLAGS = -module -avoid-version -export-symbols-regex IDL_Load \
+												 -precious-files-regex 'idl_getdata\.dlm' $(IDL_LIBS)
+idl_getdata_la_LIBADD = $(GDIDL_GETDATA_LIBS)
+idl_getdata_la_SOURCES = getdata.c
+nodist_idl_getdata_la_SOURCES = constants.c sublist.c
+
+sublist.c.in: getdata.c makedlm.sh
+	${SHELL} ./makedlm.sh -c $< > $@
+
+sublist.c: sublist.stamp
+	@if test ! -f $@; then \
+		rm -f $<; \
+		$(MAKE) $<; \
+		fi
+
+if HAVE_DIFF
+
+sublist.stamp: sublist.c.in
+	@if $(DIFF) sublist.c sublist.c.in >/dev/null 2>&1; then \
+		echo "sublist.c is unchanged"; \
+		else \
+		rm -f sublist.c; \
+		cp sublist.c.in sublist.c; \
+		fi; \
+		touch sublist.stamp
+
+else
+
+sublist.stamp: sublist.c.in
+	@rm -f sublist.c; \
+		cp sublist.c.in sublist.c; \
+		touch sublist.stamp
+
+endif
+
+constants.c: ../make_parameters
+	../make_parameters i > $@
+
+../make_parameters: ../make_parameters.c
+	cd .. && ${MAKE} make_parameters
+
+idl_getdata.dlm: getdata.c makedlm.sh
+	${SHELL} ./makedlm.sh -d $< > $@
+
+all-local: .libs/idl_getdata.dlm
+
+# This is required to properly run the test suite
+.libs/idl_getdata.dlm: idl_getdata.dlm
+	if [ ! -e .libs ]; then mkdir -p .libs; fi
+	cp $< .libs
+
+clean-local:
+	rm -rf ${BUILT_SOURCES} *~ idl_getdata.dlm makedlm.sh sublist.c.in sublist.stamp
+
diff --git a/bindings/idl/Makefile.in b/bindings/idl/Makefile.in
new file mode 100644
index 0000000..28fd6b6
--- /dev/null
+++ b/bindings/idl/Makefile.in
@@ -0,0 +1,959 @@
+# 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/idl
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(srcdir)/makedlm.sh.in $(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES = makedlm.sh
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(idldir)" "$(DESTDIR)$(idldir)"
+LTLIBRARIES = $(idl_LTLIBRARIES)
+ at GD_EXTERNAL_FALSE@am__DEPENDENCIES_1 = ../../src/libgetdata.la
+idl_getdata_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_idl_getdata_la_OBJECTS = getdata.lo
+nodist_idl_getdata_la_OBJECTS = constants.lo sublist.lo
+idl_getdata_la_OBJECTS = $(am_idl_getdata_la_OBJECTS) \
+	$(nodist_idl_getdata_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+idl_getdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(idl_getdata_la_LDFLAGS) $(LDFLAGS) -o \
+	$@
+AM_V_P = $(am__v_P_ 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 = $(idl_getdata_la_SOURCES) $(nodist_idl_getdata_la_SOURCES)
+DIST_SOURCES = $(idl_getdata_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+HEADERS = $(nodist_idl_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2009, 2011 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+ at CC_WALL_TRUE@WALL = -Wall
+SUBDIRS = test
+ at GD_EXTERNAL_FALSE@GDIDL_GETDATA_LIBS = ../../src/libgetdata.la
+ at GD_EXTERNAL_TRUE@GDIDL_GETDATA_LIBS = $(GETDATA_LIBS)
+idl_LTLIBRARIES = idl_getdata.la
+nodist_idl_HEADERS = idl_getdata.dlm
+
+# idl makes heavy use of type punning, ergo -fno-strict-aliasing
+AM_CFLAGS = ${WALL} $(IDL_CFLAGS) -fno-strict-aliasing $(GETDATA_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/src
+BUILT_SOURCES = sublist.c constants.c
+idl_getdata_la_LDFLAGS = -module -avoid-version -export-symbols-regex IDL_Load \
+												 -precious-files-regex 'idl_getdata\.dlm' $(IDL_LIBS)
+
+idl_getdata_la_LIBADD = $(GDIDL_GETDATA_LIBS)
+idl_getdata_la_SOURCES = getdata.c
+nodist_idl_getdata_la_SOURCES = constants.c sublist.c
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/idl/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/idl/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+makedlm.sh: $(top_builddir)/config.status $(srcdir)/makedlm.sh.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+install-idlLTLIBRARIES: $(idl_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(idl_LTLIBRARIES)'; test -n "$(idldir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(idldir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(idldir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(idldir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(idldir)"; \
+	}
+
+uninstall-idlLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(idl_LTLIBRARIES)'; test -n "$(idldir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idldir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idldir)/$$f"; \
+	done
+
+clean-idlLTLIBRARIES:
+	-test -z "$(idl_LTLIBRARIES)" || rm -f $(idl_LTLIBRARIES)
+	@list='$(idl_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+idl_getdata.la: $(idl_getdata_la_OBJECTS) $(idl_getdata_la_DEPENDENCIES) $(EXTRA_idl_getdata_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(idl_getdata_la_LINK) -rpath $(idldir) $(idl_getdata_la_OBJECTS) $(idl_getdata_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ 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@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sublist.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
+install-nodist_idlHEADERS: $(nodist_idl_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_idl_HEADERS)'; test -n "$(idldir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(idldir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(idldir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(idldir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(idldir)" || exit $$?; \
+	done
+
+uninstall-nodist_idlHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_idl_HEADERS)'; test -n "$(idldir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(idldir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS) all-local
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(idldir)" "$(DESTDIR)$(idldir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-idlLTLIBRARIES clean-libtool clean-local \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-idlLTLIBRARIES install-nodist_idlHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-idlLTLIBRARIES uninstall-nodist_idlHEADERS
+
+.MAKE: $(am__recursive_targets) all check install install-am \
+	install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
+	check check-am clean clean-generic clean-idlLTLIBRARIES \
+	clean-libtool clean-local cscopelist-am ctags ctags-am \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am \
+	install-idlLTLIBRARIES install-info install-info-am \
+	install-man install-nodist_idlHEADERS install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-idlLTLIBRARIES uninstall-nodist_idlHEADERS
+
+
+sublist.c.in: getdata.c makedlm.sh
+	${SHELL} ./makedlm.sh -c $< > $@
+
+sublist.c: sublist.stamp
+	@if test ! -f $@; then \
+		rm -f $<; \
+		$(MAKE) $<; \
+		fi
+
+ at HAVE_DIFF_TRUE@sublist.stamp: sublist.c.in
+ at HAVE_DIFF_TRUE@	@if $(DIFF) sublist.c sublist.c.in >/dev/null 2>&1; then \
+ at HAVE_DIFF_TRUE@		echo "sublist.c is unchanged"; \
+ at HAVE_DIFF_TRUE@		else \
+ at HAVE_DIFF_TRUE@		rm -f sublist.c; \
+ at HAVE_DIFF_TRUE@		cp sublist.c.in sublist.c; \
+ at HAVE_DIFF_TRUE@		fi; \
+ at HAVE_DIFF_TRUE@		touch sublist.stamp
+
+ at HAVE_DIFF_FALSE@sublist.stamp: sublist.c.in
+ at HAVE_DIFF_FALSE@	@rm -f sublist.c; \
+ at HAVE_DIFF_FALSE@		cp sublist.c.in sublist.c; \
+ at HAVE_DIFF_FALSE@		touch sublist.stamp
+
+constants.c: ../make_parameters
+	../make_parameters i > $@
+
+../make_parameters: ../make_parameters.c
+	cd .. && ${MAKE} make_parameters
+
+idl_getdata.dlm: getdata.c makedlm.sh
+	${SHELL} ./makedlm.sh -d $< > $@
+
+all-local: .libs/idl_getdata.dlm
+
+# This is required to properly run the test suite
+.libs/idl_getdata.dlm: idl_getdata.dlm
+	if [ ! -e .libs ]; then mkdir -p .libs; fi
+	cp $< .libs
+
+clean-local:
+	rm -rf ${BUILT_SOURCES} *~ idl_getdata.dlm makedlm.sh sublist.c.in sublist.stamp
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/idl/getdata.c b/bindings/idl/getdata.c
new file mode 100644
index 0000000..f6f9024
--- /dev/null
+++ b/bindings/idl/getdata.c
@@ -0,0 +1,5903 @@
+/* Copyright (C) 2009-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 Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <idl_export.h>
+#include <stdlib.h>
+#define NO_GETDATA_LEGACY_API
+#undef _BSD_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#undef _SVID_SOURCE
+
+#ifdef HAVE_CONFIG_H
+# include "gd_config.h"
+#endif
+
+#ifdef GD_EXTERNAL
+# include <complex.h>
+# include <getdata.h>
+# define dtracevoid()
+# define dtrace(...)
+# define dprintf(...)
+# define dreturnvoid()
+# define dreturn(...)
+# define dwatch(...)
+#else
+# include "../../src/internal.h"
+#endif
+
+#define GDIDL_N_DIRFILES 1024
+static DIRFILE* idldirfiles[GDIDL_N_DIRFILES];
+static int idldirfiles_initialised = 0;
+
+static IDL_StructDefPtr gdidl_entry_def = NULL;
+IDL_StructDefPtr gdidl_const_def = NULL;
+
+/* Remember: there's a longjmp here -- in general this will play merry havoc
+ * with our debugging messagecruft */
+#define idl_abort(s) do { dreturnvoid(); \
+  IDL_Message(IDL_M_GENERIC, IDL_MSG_LONGJMP, s); } while(0)
+#define idl_kw_abort(s) do { IDL_KW_FREE; idl_abort(s); } while(0)
+#define dtraceidl() dtrace("%i, %p, %p", argc, argv, argk)
+
+/* Error reporting stuff */
+#define GDIDL_KW_PAR_ERROR { "ERROR", 0, 0xffff, IDL_KW_OUT, 0, \
+  IDL_KW_OFFSETOF(error) }
+#define GDIDL_KW_PAR_ESTRING { "ESTRING", 0, 0xffff, IDL_KW_OUT, 0, \
+  IDL_KW_OFFSETOF(estr) }
+#define GDIDL_KW_RESULT_ERROR IDL_VPTR error, estr
+#define GDIDL_KW_INIT_ERROR kw.error = kw.estr = NULL;
+#define GDIDL_SET_ERROR(D) \
+  do { \
+    if (kw.error != NULL) { \
+      IDL_ALLTYPES a; \
+      a.i = gd_error(D); \
+      IDL_StoreScalar(kw.error, IDL_TYP_INT, &a); \
+    } \
+    if (kw.estr != NULL) { \
+      IDL_StoreScalarZero(kw.estr, IDL_TYP_INT); \
+      char buffer[GD_MAX_LINE_LENGTH]; \
+      kw.estr->type = IDL_TYP_STRING; \
+      IDL_StrStore((IDL_STRING*)&kw.estr->value.s, gd_error_string(D, buffer, \
+            GD_MAX_LINE_LENGTH)); \
+    } \
+  } while(0)
+
+#define GDIDL_KW_ONLY_ERROR \
+  typedef struct { \
+    IDL_KW_RESULT_FIRST_FIELD; \
+    GDIDL_KW_RESULT_ERROR; \
+  } KW_RESULT; \
+KW_RESULT kw; \
+GDIDL_KW_INIT_ERROR; \
+static IDL_KW_PAR kw_pars[] = { \
+  GDIDL_KW_PAR_ERROR, \
+  GDIDL_KW_PAR_ESTRING, \
+  { NULL } }; \
+argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+/* initialise the idldirfiles array */
+static void gdidl_init_dirfile(void)
+{
+  dtracevoid();
+  int i;
+
+  for (i = 1; i < GDIDL_N_DIRFILES; ++i)
+    idldirfiles[i] = NULL;
+
+  /* we keep entry zero as a generic, invalid dirfile to return if
+   * dirfile lookup fails */
+  idldirfiles[0] = gd_invalid_dirfile();
+
+  idldirfiles_initialised = 1;
+  dreturnvoid();
+}
+
+/* convert a new DIRFILE* into an int */
+static long gdidl_set_dirfile(DIRFILE* D)
+{
+  long i;
+
+  dtrace("%p", D);
+
+  if (!idldirfiles_initialised)
+    gdidl_init_dirfile();
+
+  for (i = 1; i < GDIDL_N_DIRFILES; ++i)
+    if (idldirfiles[i] == NULL) {
+      idldirfiles[i] = D;
+      dreturn("%li", i);
+      return i;
+    }
+
+  /* out of idldirfiles space: complain and abort */
+  idl_abort("DIRFILE space exhausted.");
+  return 0; /* can't get here */
+}
+
+/* convert an int to a DIRFILE* */
+DIRFILE* gdidl_get_dirfile(IDL_LONG d)
+{
+  dtrace("%i", (int)d);
+
+  if (!idldirfiles_initialised)
+    gdidl_init_dirfile();
+
+  if (idldirfiles[d] == NULL) {
+    dreturn("%p [0]", idldirfiles[0]);
+    return idldirfiles[0];
+  }
+
+  dreturn("%p", idldirfiles[d]);
+  return idldirfiles[d];
+}
+
+/* delete the supplied dirfile */
+static void gdidl_clear_dirfile(IDL_LONG d)
+{
+  dtrace("%i", (int)d);
+
+  if (d != 0)
+    idldirfiles[d] = NULL;
+
+  dreturnvoid();
+}
+
+/* convert a GetData type code to an IDL type code */
+static inline UCHAR gdidl_idl_type(gd_type_t t) {
+  switch (t) {
+    case GD_UINT8:
+      return IDL_TYP_BYTE;
+    case GD_UINT16:
+      return IDL_TYP_UINT;
+    case GD_INT8: /* there is no signed 8-bit type in IDL
+                     - we type promote to INT */
+    case GD_INT16:
+      return IDL_TYP_INT;
+    case GD_UINT32:
+      return IDL_TYP_ULONG;
+    case GD_INT32:
+      return IDL_TYP_LONG;
+    case GD_UINT64:
+      return IDL_TYP_ULONG64;
+    case GD_INT64:
+      return IDL_TYP_LONG64;
+    case GD_FLOAT32:
+      return IDL_TYP_FLOAT;
+    case GD_FLOAT64:
+      return IDL_TYP_DOUBLE;
+    case GD_COMPLEX64:
+      return IDL_TYP_COMPLEX;
+    case GD_COMPLEX128:
+      return IDL_TYP_DCOMPLEX;
+    case GD_NULL:
+    case GD_UNKNOWN:
+      ;
+  }
+
+  return IDL_TYP_UNDEF;
+}
+
+/* convert an IDL type code to a GetData type code */
+static inline gd_type_t gdidl_gd_type(int t) {
+  switch (t) {
+    case IDL_TYP_BYTE:
+      return GD_UINT8;
+    case IDL_TYP_UINT:
+      return GD_UINT16;
+    case IDL_TYP_INT:
+      return GD_INT16;
+    case IDL_TYP_ULONG:
+      return GD_UINT32;
+    case IDL_TYP_LONG:
+      return GD_INT32;
+    case IDL_TYP_ULONG64:
+      return GD_UINT64;
+    case IDL_TYP_LONG64:
+      return GD_INT64;
+    case IDL_TYP_FLOAT:
+      return GD_FLOAT32;
+    case IDL_TYP_DOUBLE:
+      return GD_FLOAT64;
+    case IDL_TYP_COMPLEX:
+      return GD_COMPLEX64;
+    case IDL_TYP_DCOMPLEX:
+      return GD_COMPLEX128;
+  }
+
+  return GD_UNKNOWN;
+}
+
+/* convert a datum (from a void*) to an IDL_ALLTYPES union */
+static inline IDL_ALLTYPES gdidl_to_alltypes(gd_type_t t, void* d)
+{
+  dtrace("%x, %p", t, d);
+
+  float complex fc;
+  double complex dc;
+  IDL_ALLTYPES v;
+  v.c = 0;
+
+  switch (t) {
+    case GD_UINT8:
+      v.c = *(uint8_t*)d;
+      break;
+    case GD_INT8: /* there is no signed 8-bit type in IDL --
+                     we type promote to INT */
+      v.i = *(int8_t*)d;
+      break;
+    case GD_UINT16:
+      v.ui = *(uint16_t*)d;
+      break;
+    case GD_INT16:
+      v.i = *(int16_t*)d;
+      break;
+    case GD_UINT32:
+      v.ul = *(uint32_t*)d;
+      break;
+    case GD_INT32:
+      v.l = *(int32_t*)d;
+      break;
+    case GD_UINT64:
+      v.ul64 = *(uint64_t*)d;
+      break;
+    case GD_INT64:
+      v.l64 = *(int64_t*)d;
+      break;
+    case GD_FLOAT32:
+      v.f = *(float*)d;
+      break;
+    case GD_FLOAT64:
+      v.d = *(double*)d;
+      break;
+    case GD_COMPLEX64:
+      fc = *(float complex*)d;
+      v.cmp.r = crealf(fc);
+      v.cmp.i = cimagf(fc);
+      break;
+    case GD_COMPLEX128:
+      dc = *(double complex*)d;
+      v.cmp.r = creal(dc);
+      v.cmp.i = cimag(dc);
+      break;
+    case GD_NULL:
+    case GD_UNKNOWN:
+      ;
+  }
+
+  dreturnvoid();
+  return v;
+}
+
+/* convert an ALLTYPES to a value suitable for GetData -- all we do is 
+ * reference the appropriate member */
+static inline const void* gdidl_from_alltypes(UCHAR t, IDL_ALLTYPES* v)
+{
+  static float complex fc;
+  static double complex dc;
+
+  switch(t)
+  {
+    case IDL_TYP_BYTE:
+      return &(v->c);
+    case IDL_TYP_UINT:
+      return &(v->ui);
+    case IDL_TYP_INT:
+      return &(v->i);
+    case IDL_TYP_ULONG:
+      return &(v->ul);
+    case IDL_TYP_LONG:
+      return &(v->l);
+    case IDL_TYP_ULONG64:
+      return &(v->ul64);
+    case IDL_TYP_LONG64:
+      return &(v->l64);
+    case IDL_TYP_FLOAT:
+      return &(v->f);
+    case IDL_TYP_DOUBLE:
+      return &(v->d);
+    case IDL_TYP_COMPLEX:
+      fc = v->cmp.r + _Complex_I * v->cmp.i;
+      return &fc;
+    case IDL_TYP_DCOMPLEX:
+      dc = v->dcmp.r + _Complex_I * v->dcmp.i;
+      return &dc;
+  }
+
+  return NULL;
+}
+
+/* copy (and convert) an array of complex values */
+static inline void gdidl_cmp_to_c99(double complex* dest, IDL_COMPLEX* src,
+    size_t n)
+{
+  dtrace("%p, %p, %zi", dest, src, n);
+
+  size_t i;
+
+  for (i = 0; i < n; ++i)
+    dest[i] = src[i].r + _Complex_I * src[i].i;
+
+  dreturnvoid();
+}
+
+/* copy (and convert) an array of complex values */
+static inline void gdidl_dcmp_to_c99(double complex* dest, IDL_DCOMPLEX* src,
+    size_t n)
+{
+  dtrace("%p, %p, %zi", dest, src, n);
+
+  size_t i;
+
+  for (i = 0; i < n; ++i)
+    dest[i] = src[i].r + _Complex_I * src[i].i;
+
+  dreturnvoid();
+}
+
+/* copy (and convert) an array of complex values */
+static inline void gdidl_c99_to_dcmp(IDL_DCOMPLEX* dest,
+    const double complex* src, size_t n)
+{
+  dtrace("%p, %p, %zi", dest, src, n);
+  size_t i;
+
+  for (i = 0; i < n; ++i) {
+    dest[i].r = creal(src[i]);
+    dest[i].i = cimag(src[i]);
+  }
+
+  dreturnvoid();
+}
+
+static double complex gdidl_dcomplexScalar(IDL_VPTR obj)
+{
+  double r = 0, i = 0;
+
+  /* accept either a scalar or a single element array */
+  if (obj->flags & IDL_V_ARR) {
+    if (obj->value.arr->n_dim != 1 || obj->value.arr->dim[0] != 1)
+      idl_abort("Scalar or single element array expected where multiple "
+          "element array found");
+
+    if (obj->type == IDL_TYP_DCOMPLEX) {
+      r = ((IDL_DCOMPLEX *)obj->value.arr->data)[0].r;
+      i = ((IDL_DCOMPLEX *)obj->value.arr->data)[0].i;
+    } else if (obj->type == IDL_TYP_COMPLEX) {
+      r = ((IDL_COMPLEX *)obj->value.arr->data)[0].r;
+      i = ((IDL_COMPLEX *)obj->value.arr->data)[0].i;
+    } else
+      idl_abort("complex value expected");
+  } else {
+    IDL_ENSURE_SCALAR(obj);
+
+    if (obj->type == IDL_TYP_DCOMPLEX) {
+      r = obj->value.dcmp.r;
+      i = obj->value.dcmp.i;
+    } else if (obj->type == IDL_TYP_COMPLEX) {
+      r = obj->value.cmp.r;
+      i = obj->value.cmp.i;
+    } else
+      idl_abort("complex value expected");
+  }
+
+  return r + _Complex_I * i;
+}
+
+/* convert a gd_entry_t to an IDL GD_ENTRY struct in a temporary variable */
+IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E)
+{
+  dtrace("%p", E);
+
+  int i;
+  IDL_MEMINT dims[] = { 1 };
+  IDL_VPTR r;
+  void* data = IDL_MakeTempStruct(gdidl_entry_def, 1, dims, &r, IDL_TRUE);
+
+  /* Here we make labourious calls to StructTagInfoByName becuase we don't
+   * want to assume anything about the structure packing details of the IDL */
+
+  IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+          "FIELD", IDL_MSG_LONGJMP, NULL)), E->field);
+  *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "FIELD_TYPE",
+        IDL_MSG_LONGJMP, NULL)) = E->field_type;
+  *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "FRAGMENT",
+        IDL_MSG_LONGJMP, NULL)) = E->fragment_index;
+
+  /* the common IN_FIELDS case */
+  if (E->field_type == GD_BIT_ENTRY || E->field_type == GD_LINTERP_ENTRY
+      || E->field_type == GD_MULTIPLY_ENTRY || E->field_type == GD_PHASE_ENTRY
+      || E->field_type == GD_SBIT_ENTRY || E->field_type == GD_POLYNOM_ENTRY
+      || E->field_type == GD_DIVIDE_ENTRY || E->field_type == GD_RECIP_ENTRY
+      || E->field_type == GD_WINDOW_ENTRY || E->field_type == GD_MPLEX_ENTRY)
+  {
+    IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "IN_FIELDS", IDL_MSG_LONGJMP, NULL)), E->in_fields[0]);
+  }
+
+  switch (E->field_type)
+  {
+    case GD_RAW_ENTRY:
+      *(IDL_UINT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SPF",
+            IDL_MSG_LONGJMP, NULL)) = E->spf;
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE",
+            IDL_MSG_LONGJMP, NULL)) = E->data_type;
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
+      *(int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND",
+            IDL_MSG_LONGJMP, NULL)) = (int16_t)E->scalar_ind[0];
+      break;
+    case GD_LINCOM_ENTRY:
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "N_FIELDS", IDL_MSG_LONGJMP, NULL)) = E->n_fields;
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal;
+      for (i = 0; i < E->n_fields; ++i) {
+        IDL_StrStore((IDL_STRING*)(data +
+              IDL_StructTagInfoByName(gdidl_entry_def, "IN_FIELDS",
+                IDL_MSG_LONGJMP, NULL)) + i, E->in_fields[i]);
+        IDL_StrStore((IDL_STRING*)(data +
+              IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR",
+                IDL_MSG_LONGJMP, NULL)) + i, E->scalar[i]);
+        ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[i] =
+          (int16_t)E->scalar_ind[i];
+        IDL_StrStore((IDL_STRING*)(data +
+              IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR",
+                IDL_MSG_LONGJMP, NULL)) + i + GD_MAX_LINCOM,
+            E->scalar[i + GD_MAX_LINCOM]);
+        ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[i + GD_MAX_LINCOM] =
+          (int16_t)E->scalar_ind[i + GD_MAX_LINCOM];
+      }
+      if (E->comp_scal) {
+        gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
+            IDL_StructTagInfoByName(gdidl_entry_def, "CM", IDL_MSG_LONGJMP,
+              NULL)), E->cm, E->n_fields);
+        gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
+            IDL_StructTagInfoByName(gdidl_entry_def, "CB", IDL_MSG_LONGJMP,
+              NULL)), E->cb, E->n_fields);
+      } else {
+        memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "M",
+              IDL_MSG_LONGJMP, NULL), E->m, E->n_fields *
+            sizeof(double));
+        memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "B",
+              IDL_MSG_LONGJMP, NULL), E->b, E->n_fields *
+            sizeof(double));
+      }
+      break;
+    case GD_LINTERP_ENTRY:
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "TABLE", IDL_MSG_LONGJMP, NULL)), E->table);
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "BITNUM",
+            IDL_MSG_LONGJMP, NULL)) = E->bitnum;
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "NUMBITS",
+            IDL_MSG_LONGJMP, NULL)) = E->numbits;
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
+      ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+          "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0];
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "SCALAR", IDL_MSG_LONGJMP, NULL)) + 1, E->scalar[1]);
+      ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+          "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[1] = (int16_t)E->scalar_ind[1];
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "IN_FIELDS", IDL_MSG_LONGJMP, NULL)) + 1, E->in_fields[1]);
+      break;
+    case GD_RECIP_ENTRY:
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal;
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
+      ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+          "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0];
+
+      if (E->comp_scal)
+        gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
+              IDL_StructTagInfoByName(gdidl_entry_def, "CDIVIDEND",
+              IDL_MSG_LONGJMP, NULL)), &E->cdividend, 1);
+      else
+        *(double*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DIVIDEND",
+              IDL_MSG_LONGJMP, NULL)) = E->dividend;
+      break;
+    case GD_PHASE_ENTRY:
+      *(IDL_LONG*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SHIFT",
+            IDL_MSG_LONGJMP, NULL)) = E->shift;
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
+      ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+          "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0];
+      break;
+    case GD_POLYNOM_ENTRY:
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal;
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "POLY_ORD", IDL_MSG_LONGJMP, NULL)) = E->poly_ord;
+
+      for (i = 0; i <= E->poly_ord; ++i) {
+        IDL_StrStore((IDL_STRING*)(data +
+              IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR",
+                IDL_MSG_LONGJMP, NULL)) + i, E->scalar[i]);
+        ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[i] =
+          (int16_t)E->scalar_ind[i];
+      }
+
+      if (E->comp_scal)
+        gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
+            IDL_StructTagInfoByName(gdidl_entry_def, "CA", IDL_MSG_LONGJMP,
+              NULL)), E->ca, E->poly_ord + 1);
+      else
+        memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "A",
+              IDL_MSG_LONGJMP, NULL), E->a,
+            (E->poly_ord + 1) * sizeof(double));
+      break;
+    case GD_WINDOW_ENTRY:
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "WINDOP", IDL_MSG_LONGJMP, NULL)) = E->windop;
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "IN_FIELDS", IDL_MSG_LONGJMP, NULL)) + 1, E->in_fields[1]);
+
+      switch (E->windop) {
+        case GD_WINDOP_EQ:
+        case GD_WINDOP_NE:
+          *(IDL_LONG64*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+                "ITHRESHOLD", IDL_MSG_LONGJMP, NULL)) = E->threshold.i;
+          break;
+        case GD_WINDOP_SET:
+        case GD_WINDOP_CLR:
+          *(IDL_ULONG*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+                "UTHRESHOLD", IDL_MSG_LONGJMP, NULL)) = E->threshold.u;
+          break;
+        default:
+          *(double*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+                "RTHRESHOLD", IDL_MSG_LONGJMP, NULL)) = E->threshold.r;
+          break;
+      }
+
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
+      ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+          "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0];
+
+      break;
+    case GD_MPLEX_ENTRY:
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "IN_FIELDS", IDL_MSG_LONGJMP, NULL)) + 1, E->in_fields[1]);
+
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "COUNT_VAL", IDL_MSG_LONGJMP, NULL)) = E->count_val;
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+            "PERIOD", IDL_MSG_LONGJMP, NULL)) = E->period;
+
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
+      ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+          "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0];
+      IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+              "SCALAR", IDL_MSG_LONGJMP, NULL)) + 1, E->scalar[1]);
+      ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
+          "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[1] = (int16_t)E->scalar_ind[1];
+      break;
+    case GD_CARRAY_ENTRY:
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "ARRAY_LEN",
+            IDL_MSG_LONGJMP, NULL)) = E->array_len;
+      /* fallthrough */
+    case GD_CONST_ENTRY:
+      *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE",
+            IDL_MSG_LONGJMP, NULL)) = E->const_type;
+      break;
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_STRING_ENTRY:
+      break;
+  }
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* convert an IDL structure into an gd_entry_t */
+void gdidl_read_idl_entry(gd_entry_t *E, IDL_VPTR v, int alter)
+{
+  /* this function is fairly agnostic about the structure it's given: so
+   * long as it gets a structure with the fields it wants (of the right type)
+   * it's happy */
+
+  dtrace("%p, %p, %i", E, v, alter);
+
+  IDL_VPTR d;
+  IDL_MEMINT o;
+  int i, n = 0;
+  int copy_scalar[GD_MAX_POLYORD + 1];
+  int action = (alter) ? IDL_MSG_RET | IDL_MSG_ATTR_NOPRINT : IDL_MSG_LONGJMP;
+
+  memset(copy_scalar, 0, sizeof(int) * (GD_MAX_POLYORD + 1));
+  memset(E, 0, sizeof(gd_entry_t));
+
+  unsigned char* data = v->value.s.arr->data;
+
+  if (!alter) {
+    /* field */
+    o = IDL_StructTagInfoByName(v->value.s.sdef, "FIELD", IDL_MSG_LONGJMP, &d);
+    IDL_ENSURE_STRING(d);
+    E->field = IDL_STRING_STR((IDL_STRING*)(data + o));
+
+    /* fragment_index */
+    o = IDL_StructTagInfoByName(v->value.s.sdef, "FRAGMENT", IDL_MSG_LONGJMP,
+        &d);
+    if (d->type != IDL_TYP_INT)
+      idl_abort("GD_ENTRY element FRAGMENT must be of type INT");
+    E->fragment_index = *(int16_t*)(data + o);
+  }
+
+  /* field_type */
+  o = IDL_StructTagInfoByName(v->value.s.sdef, "FIELD_TYPE", IDL_MSG_LONGJMP,
+      &d);
+  if (d->type != IDL_TYP_INT)
+    idl_abort("GD_ENTRY element FIELD_TYPE must be of type INT");
+  E->field_type = *(int16_t*)(data + o);
+
+  /* the common case in_fields */
+  if (E->field_type == GD_BIT_ENTRY || E->field_type == GD_LINTERP_ENTRY
+      || E->field_type == GD_MULTIPLY_ENTRY || E->field_type == GD_PHASE_ENTRY
+      || E->field_type == GD_SBIT_ENTRY || E->field_type == GD_POLYNOM_ENTRY
+      || E->field_type == GD_DIVIDE_ENTRY || E->field_type == GD_RECIP_ENTRY
+      || 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));
+    }
+  }
+
+  switch (E->field_type)
+  {
+    case GD_RAW_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "SPF", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_UINT)
+          idl_abort("GD_ENTRY element INDEX must be of type UINT");
+        E->spf = *(uint16_t*)(data + o);
+      }
+
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "DATA_TYPE", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element DATA_TYPE must be of type INT");
+        E->data_type = *(int16_t*)(data + o);
+      } else
+        E->data_type = GD_NULL;
+
+      copy_scalar[0] = 1;
+
+      break;
+    case GD_LINCOM_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "N_FIELDS", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element N_FIELDS must be of type INT");
+        n = E->n_fields = *(int16_t*)(data + o);
+      }
+
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "COMP_SCAL", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element COMP_SCAL must be of type INT");
+        E->comp_scal = *(int16_t*)(data + o);
+      }
+
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "IN_FIELDS", action, &d);
+      if (o != -1) {
+        IDL_ENSURE_STRING(d);
+        IDL_ENSURE_ARRAY(d);
+        if (n == 0) {
+          n = d->value.arr->dim[0];
+          if (n > GD_MAX_LINCOM)
+            n = GD_MAX_LINCOM;
+        }
+        for (i = 0; i < n; ++i)
+          E->in_fields[i] = IDL_STRING_STR((IDL_STRING*)(data + o) + i);
+      }
+
+      for (i = 0 ; i < n; ++i) {
+        copy_scalar[i] = 1;
+        copy_scalar[i + GD_MAX_LINCOM] = 1;
+      }
+
+      if (E->comp_scal) {
+        o = IDL_StructTagInfoByName(v->value.s.sdef, "CM", action, &d);
+        if (o != -1) {
+          IDL_ENSURE_ARRAY(d);
+          if (n == 0) {
+            n = d->value.arr->dim[0];
+            if (n > GD_MAX_LINCOM)
+              n = GD_MAX_LINCOM;
+          }
+          if (d->type == IDL_TYP_DCOMPLEX)
+            gdidl_dcmp_to_c99(E->cm, (IDL_DCOMPLEX*)data + o, n);
+          else
+            idl_abort("GD_ENTRY element CM must be of type DCOMPLEX");
+        }
+      } else {
+        o = IDL_StructTagInfoByName(v->value.s.sdef, "M", action, &d);
+        if (o != -1) {
+          IDL_ENSURE_ARRAY(d);
+          if (n == 0) {
+            n = d->value.arr->dim[0];
+            if (n > GD_MAX_LINCOM)
+              n = GD_MAX_LINCOM;
+          }
+          if (d->type == IDL_TYP_DOUBLE) {
+            memcpy(E->m, data + o, n * sizeof(double));
+            for (i = 0; i < n; ++i)
+              E->cm[i] = E->m[i];
+          } else
+            idl_abort("GD_ENTRY element M must be of type DOUBLE");
+        }
+      }
+
+      if (E->comp_scal) {
+        o = IDL_StructTagInfoByName(v->value.s.sdef, "CB", action, &d);
+        if (o != -1) {
+          IDL_ENSURE_ARRAY(d);
+          if (n == 0) {
+            n = d->value.arr->dim[0];
+            if (n > GD_MAX_LINCOM)
+              n = GD_MAX_LINCOM;
+          }
+          if (d->type == IDL_TYP_DCOMPLEX)
+            gdidl_dcmp_to_c99(E->cb, (IDL_DCOMPLEX*)data + o,
+                E->n_fields);
+          else
+            idl_abort("GD_ENTRY element CB must be of type DCOMPLEX");
+        }
+      } else {
+        o = IDL_StructTagInfoByName(v->value.s.sdef, "B", action, &d);
+        if (o != -1) {
+          IDL_ENSURE_ARRAY(d);
+          if (n == 0) {
+            n = d->value.arr->dim[0];
+            if (n > GD_MAX_LINCOM)
+              n = GD_MAX_LINCOM;
+          }
+          if (d->type == IDL_TYP_DOUBLE) {
+            memcpy(E->b, data + o, E->n_fields *
+                sizeof(double));
+            for (i = 0; i < E->n_fields; ++i)
+              E->cb[i] = E->b[i];
+          } else
+            idl_abort("GD_ENTRY element B must be of type DOUBLE");
+        }
+      }
+      break;
+    case GD_LINTERP_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "TABLE", action, &d);
+      if (o != -1) {
+        IDL_ENSURE_STRING(d);
+        E->table = IDL_STRING_STR((IDL_STRING*)(data + o));
+      }
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "BITNUM", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element BITNUM must be of type INT");
+        E->bitnum = *(int16_t*)(data + o);
+      } else
+        E->bitnum = -1;
+
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "NUMBITS", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element NUMBITS must be of type INT");
+        E->numbits = *(int16_t*)(data + o);
+      }
+
+      copy_scalar[0] = copy_scalar[1] = 1;
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "IN_FIELDS", action, &d);
+      if (o != -1) {
+        IDL_ENSURE_STRING(d);
+        E->in_fields[1] = IDL_STRING_STR((IDL_STRING*)(data + o) + 1);
+      }
+      break;
+    case GD_RECIP_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "COMP_SCAL", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element COMP_SCAL must be of type INT");
+        E->comp_scal = *(int16_t*)(data + o);
+      }
+
+      if (E->comp_scal) {
+        o = IDL_StructTagInfoByName(v->value.s.sdef, "CDIVIDEND", action, &d);
+        if (o != -1) {
+          if (d->type == IDL_TYP_DCOMPLEX)
+            gdidl_dcmp_to_c99(&E->cdividend, (IDL_DCOMPLEX*)data + o,
+                1);
+          else
+            idl_abort("GD_ENTRY element CDIVIDEND must be of type DCOMPLEX");
+        }
+      } else {
+        o = IDL_StructTagInfoByName(v->value.s.sdef, "DIVIDEND", action, &d);
+        if (o != -1) {
+          if (d->type == IDL_TYP_DOUBLE)
+            E->dividend = *(double*)(data + o);
+          else
+            idl_abort("GD_ENTRY element DIVIDEND must be of type DOUBLE");
+        }
+      }
+      copy_scalar[0] = 1;
+      break;
+    case GD_PHASE_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "SHIFT", IDL_MSG_LONGJMP,
+          &d);
+      if (d->type != IDL_TYP_LONG)
+        idl_abort("GD_ENTRY element SHIFT must be of type LONG");
+      E->shift = *(int16_t*)(data + o);
+      copy_scalar[0] = 1;
+      break;
+    case GD_POLYNOM_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "POLY_ORD", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element POLY_ORD must be of type INT");
+        E->poly_ord = *(int16_t*)(data + o);
+        n = E->poly_ord + 1;
+      }
+
+      for (i = 0 ; i < n; ++i)
+        copy_scalar[i] = 1;
+
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "COMP_SCAL", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element COMP_SCAL must be of type INT");
+        E->comp_scal = *(int16_t*)(data + o);
+      }
+
+      if (E->comp_scal) {
+        o = IDL_StructTagInfoByName(v->value.s.sdef, "CA", action, &d);
+        if (o != -1) {
+          IDL_ENSURE_ARRAY(d);
+          if (n == 0) {
+            n = d->value.arr->dim[0];
+            if (n > GD_MAX_POLYORD + 1)
+              n = GD_MAX_POLYORD;
+          }
+          if (d->type == IDL_TYP_DCOMPLEX)
+            gdidl_dcmp_to_c99(E->ca, (IDL_DCOMPLEX*)data + o, n);
+          else
+            idl_abort("GD_ENTRY element CA must be of type DCOMPLEX");
+        }
+      } else {
+        o = IDL_StructTagInfoByName(v->value.s.sdef, "A", action, &d);
+        if (o != -1) {
+          IDL_ENSURE_ARRAY(d);
+          if (n == 0) {
+            n = d->value.arr->dim[0];
+            if (n > GD_MAX_POLYORD + 1)
+              n = GD_MAX_POLYORD;
+          }
+          if (d->type == IDL_TYP_DOUBLE)
+            memcpy(E->a, data + o, n * sizeof(double));
+          else
+            idl_abort("GD_ENTRY element A must be of type DOUBLE");
+        }
+      }
+      break;
+    case GD_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;
+      }
+      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);
+      }
+
+      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);
+      }
+
+      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;
+
+      copy_scalar[0] = copy_scalar[1] = 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 */
+    case GD_CONST_ENTRY:
+      o = IDL_StructTagInfoByName(v->value.s.sdef, "DATA_TYPE", action, &d);
+      if (o != -1) {
+        if (d->type != IDL_TYP_INT)
+          idl_abort("GD_ENTRY element DATA_TYPE must be of type INT");
+        E->const_type = *(int16_t*)(data + o);
+      } else
+        E->const_type = GD_NULL;
+      break;
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_STRING_ENTRY:
+      break;
+  }
+
+  /* scalars */
+  o = IDL_StructTagInfoByName(v->value.s.sdef, "SCALAR", action, &d);
+  if (o != -1) {
+    for (i = 0; i < GD_MAX_POLYORD + 1; ++i)
+      if (copy_scalar[i]) {
+        E->scalar[i] = IDL_STRING_STR((IDL_STRING*)(data + o) + i);
+        if (E->scalar[i][0] == '\0')
+          E->scalar[i] = NULL;
+      }
+  } else 
+    for (i = 0; i < GD_MAX_POLYORD + 1; ++i)
+      E->scalar[i] = NULL;
+
+  /* scalar indices */
+  o = IDL_StructTagInfoByName(v->value.s.sdef, "SCALAR_IND", action, &d);
+  if (o != -1)
+    for (i = 0; i < GD_MAX_POLYORD + 1; ++i)
+      if (copy_scalar[i])
+        E->scalar_ind[i] = *((int16_t*)(data + o) + i);
+
+  dreturnvoid();
+}
+
+/* convert an IDL string or numerical encoding key to a GetData flag */
+unsigned long gdidl_convert_encoding(IDL_VPTR idl_enc)
+{
+  dtrace("%p", idl_enc);
+
+  unsigned long encoding = 0;
+
+  IDL_ENSURE_SIMPLE(idl_enc);
+  if (idl_enc->type == IDL_TYP_STRING) {
+    const char* enc = IDL_VarGetString(idl_enc);
+    if (strcasecmp(enc, "BZIP2"))
+      encoding = GD_BZIP2_ENCODED;
+    else if (strcasecmp(enc, "GZIP"))
+      encoding = GD_GZIP_ENCODED;
+    else if (strcasecmp(enc, "LZMA"))
+      encoding = GD_LZMA_ENCODED;
+    else if (strcasecmp(enc, "SLIM"))
+      encoding = GD_SLIM_ENCODED;
+    else if (strcasecmp(enc, "SIE"))
+      encoding = GD_SIE_ENCODED;
+    else if (strcasecmp(enc, "TEXT"))
+      encoding = GD_TEXT_ENCODED;
+    else if (strcasecmp(enc, "ZZIP"))
+      encoding = GD_ZZIP_ENCODED;
+    else if (strcasecmp(enc, "ZZSLIM"))
+      encoding = GD_ZZSLIM_ENCODED;
+    else if (strcasecmp(enc, "NONE"))
+      encoding = GD_UNENCODED;
+    else if (strcasecmp(enc, "RAW"))
+      encoding = GD_UNENCODED;
+    else if (strcasecmp(enc, "UNENCODED"))
+      encoding = GD_UNENCODED;
+    else if (strcasecmp(enc, "AUTO"))
+      encoding = GD_AUTO_ENCODED;
+    else
+      idl_abort("Unknown encoding type.");
+  } else
+    encoding = IDL_LongScalar(idl_enc);
+
+  dreturn("%lx", encoding);
+  return encoding;
+}
+
+
+/* The public subroutines begin here.  The `DLM' lines are magical. */
+
+/* @@DLM: F gdidl_dirfilename GD_DIRFILENAME 1 1 KEYWORDS */
+IDL_VPTR gdidl_dirfilename(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  const char* name = gd_dirfilename(D);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_StrToSTRING((char*)name);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: P gdidl_add GD_ADD 2 2 KEYWORDS */
+void gdidl_add(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  gd_entry_t E;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  IDL_ENSURE_STRUCTURE(argv[1]);
+  gdidl_read_idl_entry(&E, argv[1], 0);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd(D, &E, parent);
+  } else
+    gd_add(D, &E);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_bit GD_ADD_BIT 3 3 KEYWORDS */
+void gdidl_add_bit(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int bitnum;
+    int numbits;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.bitnum = kw.fragment_index = 0;
+  kw.parent_x = 0;
+  kw.numbits = 1;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "BITNUM", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(bitnum) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "NUMBITS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(numbits) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field = IDL_VarGetString(argv[2]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_bit(D, parent, field_code, in_field, kw.bitnum, kw.numbits);
+  } else
+    gd_add_bit(D, field_code, in_field, kw.bitnum, kw.numbits,
+        kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_const GD_ADD_CONST 2 2 KEYWORDS */
+void gdidl_add_const(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  double zero = 0;
+  gd_type_t data_type = GD_FLOAT64;
+  const void *data = &zero;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int const_type;
+    IDL_VPTR value;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.value = NULL;
+  kw.fragment_index = 0;
+  kw.parent_x = 0;
+  kw.const_type = GD_FLOAT64;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) },
+    { "VALUE", 0, 1, IDL_KW_VIN, 0, IDL_KW_OFFSETOF(value) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  if (kw.value) {
+    data = gdidl_from_alltypes(kw.value->type, &kw.value->value);
+    data_type = gdidl_gd_type(kw.value->type);
+  }
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_const(D, parent, field_code, kw.const_type, data_type, data);
+  } else
+    gd_add_const(D, field_code, kw.const_type, data_type, data,
+        kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_carray GD_ADD_CARRAY 2 2 KEYWORDS */
+void gdidl_add_carray(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  gd_type_t data_type = GD_INT8;
+  void *data = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int const_type;
+    int n;
+    IDL_VPTR value;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.value = NULL;
+  kw.fragment_index = kw.n = 0;
+  kw.parent_x = 0;
+  kw.const_type = GD_FLOAT64;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "LENGTH", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(n) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) },
+    { "VALUE", 0, 1, IDL_KW_VIN, 0, IDL_KW_OFFSETOF(value) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  if (kw.value) {
+    IDL_ENSURE_ARRAY(kw.value);
+    if (kw.value->value.arr->n_dim != 1)
+      idl_kw_abort("VALUE must be a vector, not a multidimensional array");
+    data = (void *)kw.value->value.arr->data;
+    data_type = gdidl_gd_type(kw.value->type);
+    kw.n = kw.value->value.arr->n_elts;
+  } else if (kw.n) {
+    data = malloc(kw.n);
+    memset(data, 0, kw.n);
+  } else
+    idl_kw_abort("either LENGTH or VALUE must be specified");
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_carray(D, parent, field_code, kw.const_type, kw.n, data_type, data);
+  } else
+    gd_add_carray(D, field_code, kw.const_type, kw.n, data_type, data,
+        kw.fragment_index);
+
+  if (!kw.value)
+    free(data);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_lincom GD_ADD_LINCOM 5 11 KEYWORDS */
+void gdidl_add_lincom(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  int i, comp_scal = 0;
+  const char* in_field[3];
+  double m[3];
+  double b[3];
+  double complex cm[3];
+  double complex cb[3];
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]); 
+  int n_fields = (argc - 2) / 3; /* IDL's runtime check on # of args should
+                                    ensure this is 1, 2, or 3. */
+
+  for (i = 0; i < n_fields; ++i) {
+    in_field[i] = IDL_VarGetString(argv[2 + i * 3]);
+    if (argv[3 + i * 3]->type == IDL_TYP_DCOMPLEX ||
+        argv[3 + i * 3]->type == IDL_TYP_COMPLEX)
+    {
+      comp_scal = 1;
+      m[i] = cm[i] = gdidl_dcomplexScalar(argv[3 + i * 3]);
+    } else
+      cm[i] = m[i] = IDL_DoubleScalar(argv[3 + i * 3]);
+
+    if (argv[4 + i * 3]->type == IDL_TYP_DCOMPLEX ||
+        argv[4 + i * 3]->type == IDL_TYP_COMPLEX)
+    {
+      comp_scal = 1;
+      b[i] = cb[i] = gdidl_dcomplexScalar(argv[4 + i * 3]);
+    } else
+      cb[i] = b[i] = IDL_DoubleScalar(argv[4 + i * 3]);
+  }
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    if (comp_scal) 
+      gd_madd_clincom(D, parent, field_code, n_fields, in_field, cm, cb);
+    else
+      gd_madd_lincom(D, parent, field_code, n_fields, in_field, m, b);
+  } else if (comp_scal) 
+    gd_add_clincom(D, field_code, n_fields, in_field, cm, cb,
+        kw.fragment_index);
+  else
+    gd_add_lincom(D, field_code, n_fields, in_field, m, b,
+        kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_linterp GD_ADD_LINTERP 4 4 KEYWORDS */
+void gdidl_add_linterp(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field = IDL_VarGetString(argv[2]);
+  const char* table = IDL_VarGetString(argv[3]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_linterp(D, parent, field_code, in_field, table);
+  } else
+    gd_add_linterp(D, field_code, in_field, table, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@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;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field1 = IDL_VarGetString(argv[2]);
+  const char* in_field2 = IDL_VarGetString(argv[3]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_multiply(D, parent, field_code, in_field1, in_field2);
+  } else
+    gd_add_multiply(D, field_code, in_field1, in_field2, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_divide GD_ADD_DIVIDE 4 4 KEYWORDS */
+void gdidl_add_divide(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field1 = IDL_VarGetString(argv[2]);
+  const char* in_field2 = IDL_VarGetString(argv[3]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_divide(D, parent, field_code, in_field1, in_field2);
+  } else
+    gd_add_divide(D, field_code, in_field1, in_field2, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_recip GD_ADD_RECIP 3 3 KEYWORDS */
+void gdidl_add_recip(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int comp_scal = 0;
+  double complex cdividend = 0;
+  double dividend = 1;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_VPTR dividend;
+    int dividend_x;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.parent_x = kw.dividend_x = 0;
+  kw.dividend = NULL;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "DIVIDEND", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(dividend_x),
+      IDL_KW_OFFSETOF(dividend) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field1 = IDL_VarGetString(argv[2]);
+
+  if (kw.dividend_x) {
+    if (kw.dividend->type == IDL_TYP_DCOMPLEX ||
+        kw.dividend->type == IDL_TYP_COMPLEX)
+    {
+      comp_scal = 1;
+      cdividend = gdidl_dcomplexScalar(kw.dividend);
+    } else
+      dividend = IDL_DoubleScalar(kw.dividend);
+  }
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    if (comp_scal)
+      gd_madd_crecip(D, parent, field_code, in_field1, cdividend);
+    else
+      gd_madd_recip(D, parent, field_code, in_field1, dividend);
+  } else if (comp_scal)
+    gd_add_crecip(D, field_code, in_field1, cdividend, kw.fragment_index);
+  else
+    gd_add_recip(D, field_code, in_field1, dividend, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_phase GD_ADD_PHASE 4 4 KEYWORDS */
+void gdidl_add_phase(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.fragment_index = 0;
+  kw.parent_x = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field = IDL_VarGetString(argv[2]);
+  long shift = IDL_LongScalar(argv[3]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_phase(D, parent, field_code, in_field, shift);
+  } else
+    gd_add_phase(D, field_code, in_field, shift, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_polynom GD_ADD_POLYNOM 4 9 KEYWORDS */
+void gdidl_add_polynom(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  int i, comp_scal = 0;
+  double a[GD_MAX_POLYORD + 1];
+  double complex ca[GD_MAX_POLYORD + 1];
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field = IDL_VarGetString(argv[2]);
+
+  int poly_ord;
+  if (argv[3]->flags & IDL_V_ARR) {
+    if (argv[3]->value.arr->n_dim != 1)
+      idl_kw_abort("The array of coeffecients may only have a single "
+          "dimension");
+
+    poly_ord = argv[3]->value.arr->dim[0] - 1;
+    if (poly_ord < 1)
+      idl_kw_abort("The array of coeffecients must have at least two elements");
+    if (poly_ord > GD_MAX_POLYORD)
+      poly_ord = GD_MAX_POLYORD;
+
+    for (i = 0; i <= poly_ord; ++i) {
+      switch(argv[3]->type)
+      {
+        case IDL_TYP_BYTE:
+          ca[i] = a[i] = ((UCHAR*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_INT:
+          ca[i] = a[i] = ((IDL_INT*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_LONG:
+          ca[i] = a[i] = ((IDL_LONG*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_FLOAT:
+          ca[i] = a[i] = ((float*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_DOUBLE:
+          ca[i] = a[i] = ((double*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_UINT:
+          ca[i] = a[i] = ((IDL_UINT*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_ULONG:
+          ca[i] = a[i] = ((IDL_ULONG*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_LONG64:
+          ca[i] = a[i] = ((IDL_LONG64*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_ULONG64:
+          ca[i] = a[i] = ((IDL_ULONG64*)(argv[3]->value.arr->data))[i];
+          break;
+        case IDL_TYP_COMPLEX:
+          comp_scal = 1;
+          ca[i] = ((IDL_COMPLEX*)(argv[3]->value.arr->data))[i].r
+            + _Complex_I * ((IDL_COMPLEX*)(argv[3]->value.arr->data))[i].i;
+          break;
+        case IDL_TYP_DCOMPLEX:
+          comp_scal = 1;
+          ca[i] = ((IDL_DCOMPLEX*)(argv[3]->value.arr->data))[i].r
+            + _Complex_I * ((IDL_DCOMPLEX*)(argv[3]->value.arr->data))[i].i;
+          break;
+        default:
+          idl_kw_abort("The coeffecients must be of scalar type");
+      }
+    }
+  } else {
+    poly_ord = argc - 4;
+
+    for (i = 0; i <= poly_ord; ++i)
+      if (argv[i + 3]->type == IDL_TYP_COMPLEX) {
+        comp_scal = 1;
+        ca[i] = argv[i + 3]->value.cmp.r +
+          _Complex_I * argv[i + 3]->value.cmp.i;
+      } else if (argv[i + 3]->type == IDL_TYP_DCOMPLEX) {
+        comp_scal = 1;
+        ca[i] = argv[i + 3]->value.dcmp.r +
+          _Complex_I * argv[i + 3]->value.dcmp.i;
+      } else
+        ca[i] = a[i] = IDL_DoubleScalar(argv[i + 3]);
+  }
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    if (comp_scal)
+      gd_madd_cpolynom(D, parent, field_code, poly_ord, in_field, ca);
+    else
+      gd_madd_polynom(D, parent, field_code, poly_ord, in_field, a);
+  } else if (comp_scal)
+    gd_add_cpolynom(D, field_code, poly_ord, in_field, ca,
+        kw.fragment_index);
+  else
+    gd_add_polynom(D, field_code, poly_ord, in_field, a,
+        kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_raw GD_ADD_RAW 3 3 KEYWORDS */
+void gdidl_add_raw(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    unsigned int spf;
+    int fragment_index;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.spf = 1;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "SPF", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(spf) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_add_raw(D, field_code, IDL_LongScalar(argv[2]), kw.spf,
+      kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+/* @@DLM: P gdidl_add_sbit GD_ADD_SBIT 3 3 KEYWORDS */
+void gdidl_add_sbit(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int bitnum;
+    int numbits;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.bitnum = kw.fragment_index = 0;
+  kw.parent_x = 0;
+  kw.numbits = 1;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "BITNUM", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(bitnum) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "NUMBITS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(numbits) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field = IDL_VarGetString(argv[2]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_sbit(D, parent, field_code, in_field, kw.bitnum, kw.numbits);
+  } else
+    gd_add_sbit(D, field_code, in_field, kw.bitnum, kw.numbits,
+        kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_spec GD_ADD_SPEC 2 2 KEYWORDS */
+void gdidl_add_spec(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* line = IDL_VarGetString(argv[1]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_spec(D, line, parent);
+  } else
+    gd_add_spec(D, line, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_string GD_ADD_STRING 2 2 KEYWORDS */
+void gdidl_add_string(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* str = "";
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING value;
+    int value_x;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.value_x = 0;
+  kw.parent_x = 0;
+  kw.fragment_index = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { "VALUE", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(value_x),
+      IDL_KW_OFFSETOF(value) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.value_x) 
+    str = IDL_STRING_STR(&kw.value);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_string(D, parent, field_code, str);
+  } else
+    gd_add_string(D, field_code, str, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_bit GD_ALTER_BIT 2 2 KEYWORDS */
+void gdidl_alter_bit(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* in_field = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int bitnum;
+    int bitnum_x;
+    int numbits;
+    IDL_STRING in_field;
+    int in_field_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.bitnum = 0;
+  kw.bitnum_x = 0;
+  kw.numbits = 0;
+  kw.in_field_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "BITNUM", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(bitnum_x),
+      IDL_KW_OFFSETOF(bitnum) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
+      IDL_KW_OFFSETOF(in_field) },
+    { "NUMBITS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(numbits) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  if (!kw.bitnum_x)
+    kw.bitnum = -1;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.in_field_x)
+    in_field = IDL_STRING_STR(&kw.in_field);
+
+  gd_alter_bit(D, field_code, in_field, kw.bitnum, kw.numbits);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_const GD_ALTER_CONST 2 2 KEYWORDS */
+void gdidl_alter_const(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int const_type;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.const_type = GD_NULL;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_alter_const(D, field_code, kw.const_type);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_carray GD_ALTER_CARRAY 2 2 KEYWORDS */
+void gdidl_alter_carray(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int len;
+    int const_type;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.const_type = GD_NULL;
+  kw.len = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "LENGTH", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(len) },
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_alter_carray(D, field_code, kw.const_type, (size_t)kw.len);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_encoding GD_ALTER_ENCODING 2 2 KEYWORDS */
+void gdidl_alter_encoding(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    int fragment_index_x;
+    int recode;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.recode = 0;
+  kw.fragment_index = 0;
+  kw.fragment_index_x = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x),
+      IDL_KW_OFFSETOF(fragment_index) },
+    { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  if (!kw.fragment_index_x)
+    kw.fragment_index = GD_ALL_FRAGMENTS;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_alter_encoding(D, gdidl_convert_encoding(argv[1]), kw.fragment_index,
+      kw.recode);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_endianness GD_ALTER_ENDIANNESS 1 1 KEYWORDS */
+void gdidl_alter_endianness(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int arm_end;
+    int big_end;
+    int fragment_index;
+    int fragment_index_x;
+    int little_end;
+    int not_arm_end;
+    int recode;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.recode = 0;
+  kw.fragment_index = 0;
+  kw.fragment_index_x = 0;
+  kw.arm_end = kw.big_end = kw.little_end = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(arm_end) },
+    { "BIG_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(big_end) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x),
+      IDL_KW_OFFSETOF(fragment_index) },
+    { "LITTLE_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(little_end) },
+    { "NOT_ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(not_arm_end) },
+    { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  if (!kw.fragment_index_x)
+    kw.fragment_index = GD_ALL_FRAGMENTS;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_alter_endianness(D, (kw.big_end ? GD_BIG_ENDIAN : 0) | 
+      (kw.little_end ? GD_LITTLE_ENDIAN : 0) | (kw.arm_end ? GD_ARM_ENDIAN : 0)
+      | (kw.not_arm_end ? GD_NOT_ARM_ENDIAN : 0), kw.fragment_index, kw.recode);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_entry GD_ALTER_ENTRY 3 3 KEYWORDS */
+void gdidl_alter_entry(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int recode;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  gd_entry_t E;
+
+  kw.recode = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  IDL_ENSURE_STRUCTURE(argv[2]);
+  gdidl_read_idl_entry(&E, argv[2], 1);
+
+  gd_alter_entry(D, field_code, &E, kw.recode);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_frameoffset GD_ALTER_FRAMEOFFSET 2 2 KEYWORDS */
+void gdidl_alter_frameoffset(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    int fragment_index_x;
+    int recode;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.recode = 0;
+  kw.fragment_index = 0;
+  kw.fragment_index_x = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x),
+      IDL_KW_OFFSETOF(fragment_index) },
+    { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  if (!kw.fragment_index_x)
+    kw.fragment_index = GD_ALL_FRAGMENTS;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_alter_frameoffset64(D, IDL_Long64Scalar(argv[1]), kw.fragment_index,
+      kw.recode);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_lincom GD_ALTER_LINCOM 2 2 KEYWORDS */
+void gdidl_alter_lincom(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_VPTR in_field;
+    int in_field_x;
+    IDL_VPTR m;
+    int m_x;
+    IDL_VPTR b;
+    int b_x;
+    int n_fields;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  int i;
+  const char* local_in_field[3];
+  double* m = NULL;
+  double* b = NULL;
+  double complex* cm = NULL;
+  double complex* cb = NULL;
+  const char** in_field = NULL;
+  IDL_VPTR tmp_m = NULL;
+  IDL_VPTR tmp_b = NULL;
+  int comp_scal = 1;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.in_field = kw.m = kw.b = NULL;
+  kw.in_field_x = kw.m_x = kw.b_x = kw.n_fields = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "B", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(b_x), IDL_KW_OFFSETOF(b) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELDS", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(in_field_x),
+      IDL_KW_OFFSETOF(in_field) },
+    { "M", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(m_x), IDL_KW_OFFSETOF(m) },
+    { "N_FIELDS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(n_fields) },
+    { NULL }
+  };
+
+  argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  /* check keywords */
+  if (kw.in_field_x) {
+    IDL_ENSURE_ARRAY(kw.in_field);
+    IDL_ENSURE_STRING(kw.in_field);
+    if (kw.in_field->value.arr->n_dim != 1)
+      idl_kw_abort("IN_FIELDS must be a vector");
+
+    if (kw.n_fields == 0) {
+      kw.n_fields = kw.in_field->value.arr->dim[0];
+      if (kw.n_fields > GD_MAX_LINCOM)
+        kw.n_fields = GD_MAX_LINCOM;
+    } else if (kw.in_field->value.arr->dim[0] < kw.n_fields) 
+      idl_kw_abort("Insufficient number of elements in IN_FIELDS");
+
+    for (i = 0; i < kw.n_fields; ++i)
+      local_in_field[i] =
+        IDL_STRING_STR((IDL_STRING*)(kw.in_field->value.arr->data) + i);
+    in_field = local_in_field;
+  }
+
+  if (kw.m_x) {
+    IDL_ENSURE_ARRAY(kw.m);
+    if (kw.n_fields == 0) {
+      kw.n_fields = kw.in_field->value.arr->dim[0];
+      if (kw.n_fields > GD_MAX_LINCOM)
+        kw.n_fields = GD_MAX_LINCOM;
+    } else if (kw.m->value.arr->dim[0] < kw.n_fields) 
+      idl_kw_abort("Insufficient number of elements in M");
+
+    if (kw.m->type == IDL_TYP_COMPLEX || kw.m->type == IDL_TYP_DCOMPLEX) {
+      comp_scal = 1;
+      cm = malloc(sizeof(double complex) * kw.n_fields);
+      if (kw.m->type == IDL_TYP_DCOMPLEX)
+        gdidl_dcmp_to_c99(cm, (IDL_DCOMPLEX*)kw.m->value.arr->data,
+            kw.n_fields);
+      else
+        gdidl_cmp_to_c99(cm, (IDL_COMPLEX*)kw.m->value.arr->data, kw.n_fields);
+    } else {
+      tmp_m = IDL_CvtDbl(1, &kw.m);
+      m = (double*)tmp_m->value.arr->data;
+    }
+  }
+
+  if (kw.b_x) {
+    IDL_ENSURE_ARRAY(kw.b);
+    if (kw.n_fields == 0) {
+      kw.n_fields = kw.in_field->value.arr->dim[0];
+      if (kw.n_fields > GD_MAX_LINCOM)
+        kw.n_fields = GD_MAX_LINCOM;
+    } else if (kw.b->value.arr->dim[0] < kw.n_fields) 
+      idl_kw_abort("Insufficient number of elements in B");
+
+    if (kw.b->type == IDL_TYP_COMPLEX || kw.b->type == IDL_TYP_DCOMPLEX) {
+      comp_scal = 1;
+      cb = malloc(sizeof(double complex) * kw.n_fields);
+      if (kw.b->type == IDL_TYP_DCOMPLEX)
+        gdidl_dcmp_to_c99(cb, (IDL_DCOMPLEX*)kw.b->value.arr->data,
+            kw.n_fields);
+      else
+        gdidl_cmp_to_c99(cb, (IDL_COMPLEX*)kw.b->value.arr->data, kw.n_fields);
+    } else {
+      tmp_b = IDL_CvtDbl(1, &kw.b);
+      b = (double*)tmp_b->value.arr->data;
+    }
+  }
+
+  if (comp_scal)
+    gd_alter_clincom(D, field_code, kw.n_fields, in_field, cm, cb);
+  else
+    gd_alter_lincom(D, field_code, kw.n_fields, in_field, m, b);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  if (tmp_m != NULL && kw.m->type != IDL_TYP_DOUBLE)
+    IDL_Deltmp(tmp_m);
+  if (tmp_b != NULL && kw.b->type != IDL_TYP_DOUBLE)
+    IDL_Deltmp(tmp_b);
+
+  free(cm);
+  free(cb);
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_linterp GD_ALTER_LINTERP 2 2 KEYWORDS */
+void gdidl_alter_linterp(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* in_field = NULL;
+  const char* table = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING table;
+    int table_x;
+    IDL_STRING in_field;
+    int in_field_x;
+    int rename;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.table_x = 0;
+  kw.rename = 0;
+  kw.in_field_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
+      IDL_KW_OFFSETOF(in_field) },
+    { "RENAME_TABLE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(rename) },
+    { "TABLE", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(table_x),
+      IDL_KW_OFFSETOF(table) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.in_field_x)
+    in_field = IDL_STRING_STR(&kw.in_field);
+  if (kw.table_x)
+    table = IDL_STRING_STR(&kw.table);
+
+  gd_alter_linterp(D, field_code, in_field, table, kw.rename);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_multiply GD_ALTER_MULTIPLY 2 2 KEYWORDS */
+void gdidl_alter_multiply(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* in_field1 = NULL;
+  const char* in_field2 = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING in_field1;
+    int in_field1_x;
+    IDL_STRING in_field2;
+    int in_field2_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.in_field1_x = 0;
+  kw.in_field2_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD1", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field1_x),
+      IDL_KW_OFFSETOF(in_field1) },
+    { "IN_FIELD2", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field2_x),
+      IDL_KW_OFFSETOF(in_field2) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.in_field1_x)
+    in_field1 = IDL_STRING_STR(&kw.in_field1);
+  if (kw.in_field2_x)
+    in_field2 = IDL_STRING_STR(&kw.in_field2);
+
+  gd_alter_multiply(D, field_code, in_field1, in_field2);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_divide GD_ALTER_DIVIDE 2 2 KEYWORDS */
+void gdidl_alter_divide(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* in_field1 = NULL;
+  const char* in_field2 = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING in_field1;
+    int in_field1_x;
+    IDL_STRING in_field2;
+    int in_field2_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.in_field1_x = 0;
+  kw.in_field2_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD1", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field1_x),
+      IDL_KW_OFFSETOF(in_field1) },
+    { "IN_FIELD2", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field2_x),
+      IDL_KW_OFFSETOF(in_field2) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.in_field1_x)
+    in_field1 = IDL_STRING_STR(&kw.in_field1);
+  if (kw.in_field2_x)
+    in_field2 = IDL_STRING_STR(&kw.in_field2);
+
+  gd_alter_divide(D, field_code, in_field1, in_field2);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_recip GD_ALTER_RECIP 2 2 KEYWORDS */
+void gdidl_alter_recip(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* in_field = NULL;
+  int comp_scal = 0;
+  double dividend = 0;
+  complex double cdividend = 0;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_VPTR dividend;
+    int dividend_x;
+    IDL_STRING in_field;
+    int in_field_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.dividend_x = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "DIVIDEND", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(dividend_x),
+      IDL_KW_OFFSETOF(dividend) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
+      IDL_KW_OFFSETOF(in_field) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.in_field_x)
+    in_field = IDL_STRING_STR(&kw.in_field);
+
+  if (kw.dividend_x) {
+    if (kw.dividend->type == IDL_TYP_DCOMPLEX ||
+        kw.dividend->type == IDL_TYP_COMPLEX)
+    {
+      comp_scal = 1;
+      cdividend = gdidl_dcomplexScalar(kw.dividend);
+    } else
+      dividend = IDL_DoubleScalar(kw.dividend);
+  }
+
+  if (comp_scal)
+    gd_alter_crecip(D, field_code, in_field, cdividend);
+  else
+    gd_alter_recip(D, field_code, in_field, dividend);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_phase GD_ALTER_PHASE 2 2 KEYWORDS */
+void gdidl_alter_phase(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* in_field = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int shift;
+    IDL_STRING in_field;
+    int in_field_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.shift = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
+      IDL_KW_OFFSETOF(in_field) },
+    { "SHIFT", IDL_TYP_LONG, 1, 0, 0, IDL_KW_OFFSETOF(shift) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.in_field_x)
+    in_field = IDL_STRING_STR(&kw.in_field);
+
+  gd_alter_phase(D, field_code, in_field, kw.shift);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_polynom GD_ALTER_POLYNOM 2 2 KEYWORDS */
+void gdidl_alter_polynom(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_VPTR in_field;
+    int in_field_x;
+    IDL_VPTR a;
+    int a_x;
+    int poly_ord;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  int comp_scal = 1;
+  double* a = NULL;
+  double complex* ca = NULL;
+  const char* in_field = NULL;
+  IDL_VPTR tmp_a = NULL;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.in_field_x = kw.a_x = kw.poly_ord = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "A", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(a_x), IDL_KW_OFFSETOF(a) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
+      IDL_KW_OFFSETOF(in_field) },
+    { "POLY_ORD", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(poly_ord) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.a_x) {
+    IDL_ENSURE_ARRAY(kw.a);
+    if (kw.poly_ord == 0) {
+      kw.poly_ord = kw.in_field->value.arr->dim[0] - 1;
+      if (kw.poly_ord > GD_MAX_POLYORD)
+        kw.poly_ord = GD_MAX_POLYORD;
+    } else if (kw.a->value.arr->dim[0] < kw.poly_ord + 1) 
+      idl_kw_abort("Insufficient number of elements in A");
+
+    if (kw.a->type == IDL_TYP_COMPLEX || kw.a->type == IDL_TYP_DCOMPLEX) {
+      comp_scal = 1;
+      ca = malloc(sizeof(double complex) * (kw.poly_ord + 1));
+      if (kw.a->type == IDL_TYP_DCOMPLEX)
+        gdidl_dcmp_to_c99(ca, (IDL_DCOMPLEX*)kw.a->value.arr->data,
+            kw.poly_ord + 1);
+      else
+        gdidl_cmp_to_c99(ca, (IDL_COMPLEX*)kw.a->value.arr->data,
+            kw.poly_ord + 1);
+    } else {
+      tmp_a = IDL_CvtDbl(1, &kw.a);
+      a = (double*)tmp_a->value.arr->data;
+    }
+  }
+
+  if (comp_scal)
+    gd_alter_cpolynom(D, field_code, kw.poly_ord, in_field, ca);
+  else
+    gd_alter_polynom(D, field_code, kw.poly_ord, in_field, a);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  /* If no type conversion is needed IDL_CvtDbl returns its input,
+   * so we must check the input type to determine whether we need to delete
+   * the temporary variable */
+  if (tmp_a != NULL && kw.a->type != IDL_TYP_DOUBLE)
+    IDL_Deltmp(tmp_a);
+
+  free(ca);
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_raw GD_ALTER_RAW 2 2 KEYWORDS */
+void gdidl_alter_raw(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    unsigned int spf;
+    gd_type_t type;
+    int recode;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.recode = 0;
+  kw.spf = 0;
+  kw.type = GD_NULL;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) },
+    { "SPF", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(spf) },
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(type) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_alter_raw(D, field_code, IDL_LongScalar(argv[2]), kw.spf,
+      kw.recode);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_sbit GD_ALTER_SBIT 2 2 KEYWORDS */
+void gdidl_alter_sbit(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* in_field = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int bitnum;
+    int bitnum_x;
+    int numbits;
+    IDL_STRING in_field;
+    int in_field_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.bitnum = kw.bitnum_x = 0;
+  kw.numbits = 0;
+  kw.in_field_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "BITNUM", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(bitnum_x),
+      IDL_KW_OFFSETOF(bitnum) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
+      IDL_KW_OFFSETOF(in_field) },
+    { "NUMBITS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(numbits) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (!kw.bitnum_x)
+    kw.bitnum = -1;
+
+  if (kw.in_field_x)
+    in_field = IDL_STRING_STR(&kw.in_field);
+
+  gd_alter_sbit(D, field_code, in_field, kw.bitnum, kw.numbits);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_spec GD_ALTER_SPEC 2 2 KEYWORDS */
+void gdidl_alter_spec(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int recode;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.parent_x = 0;
+  kw.recode = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* line = IDL_VarGetString(argv[1]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_malter_spec(D, line, parent, kw.recode);
+  } else
+    gd_alter_spec(D, line, kw.recode);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_close GD_CLOSE 1 1 KEYWORDS */
+void gdidl_close(int argc, IDL_VPTR argv[], char *argk)
+{
+  int ret = 0;
+  DIRFILE* D = NULL;
+
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int discard;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.discard = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "DISCARD", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(discard) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  IDL_LONG d = IDL_LongScalar(argv[0]);
+
+  if (d != 0) {
+    D = gdidl_get_dirfile(d);
+
+    if (kw.discard)
+      ret = gd_discard(D);
+    else
+      ret = gd_close(D);
+  }
+
+  if (ret)
+    GDIDL_SET_ERROR(D);
+  else {
+    if (kw.error != NULL)
+      IDL_StoreScalarZero(kw.error, IDL_TYP_INT);
+    if (kw.estr != NULL) {
+      IDL_StoreScalarZero(kw.estr, IDL_TYP_INT); /* free dynamic memory */
+      kw.estr->type = IDL_TYP_STRING;
+      IDL_StrStore((IDL_STRING*)&kw.estr->value.s, "Success");
+    }
+
+    if (d != 0)
+      gdidl_clear_dirfile(d);
+  }
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_delete GD_DELETE 2 2 KEYWORDS */
+void gdidl_delete(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int alias;
+    int data;
+    int deref;
+    int force;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.alias = kw.data = kw.deref = kw.force = 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) },
+    { 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.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);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_flush GD_FLUSH 1 1 KEYWORDS */
+void gdidl_flush(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING field_code;
+    int field_code_x;
+    int noclose;
+    int nosync;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  const char* field_code = NULL;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.field_code_x = 0;
+  kw.noclose = kw.nosync = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FIELD_CODE", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(field_code_x),
+      IDL_KW_OFFSETOF(field_code) },
+    { "NOCLOSE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(noclose) },
+    { "NOSYNC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(nosync) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.field_code_x)
+    field_code = IDL_STRING_STR(&kw.field_code);
+
+  if (kw.noclose && kw.nosync)
+    idl_kw_abort("nothing to do");
+  else if (kw.noclose)
+    gd_sync(D, field_code);
+  else if (kw.nosync)
+    gd_raw_close(D, field_code);
+  else
+    gd_flush(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_include GD_INCLUDE 2 2 KEYWORDS */
+void gdidl_include(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  char *prefix = NULL;
+  char *suffix = NULL;
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int arm_end;
+    int big_end;
+    int creat;
+    int excl;
+    int force_enc;
+    int force_end;
+    int ignore_dups;
+    int ignore_refs;
+    int little_end;
+    int not_arm_end;
+    int pedantic;
+    int permissive;
+    int trunc;
+    int enc_x;
+    IDL_VPTR enc;
+    IDL_VPTR index;
+    int fragment_index;
+    int index_x;
+    IDL_STRING prefix;
+    int prefix_x;
+    IDL_STRING suffix;
+    int suffix_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+  kw.big_end = kw.creat = kw.excl = kw.force_enc = kw.force_end =
+    kw.ignore_dups = kw.ignore_refs = kw.little_end = kw.pedantic = kw.trunc =
+    kw.enc_x = kw.index_x = kw.fragment_index = kw.arm_end = kw.not_arm_end =
+    kw.prefix_x = kw.suffix_x = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    IDL_KW_FAST_SCAN,
+    { "ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(arm_end) },
+    { "BIG_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(big_end) },
+    { "CREAT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(creat) },
+    { "ENCODING", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(enc_x),
+      IDL_KW_OFFSETOF(enc) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "EXCL", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(excl) },
+    { "FORCE_ENCODING", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force_enc) },
+    { "FORCE_ENDIANNESS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force_end) },
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "INDEX", 0, 1, IDL_KW_OUT, IDL_KW_OFFSETOF(index_x),
+      IDL_KW_OFFSETOF(index) },
+    { "IGNORE_DUPS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ignore_dups) },
+    { "IGNORE_REFS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ignore_dups) },
+    { "LITTLE_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(little_end) },
+    { "NOT_ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(not_arm_end) },
+    { "PEDANTIC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pedantic) },
+    { "PERMISSIVE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(permissive) },
+    { "PREFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(prefix_x),
+      IDL_KW_OFFSETOF(prefix) },
+    { "SUFFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(suffix_x),
+      IDL_KW_OFFSETOF(suffix) },
+    { "TRUNC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(trunc) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  /* check writability before doing anything */
+  if (kw.index_x)
+    IDL_StoreScalarZero(kw.index, IDL_TYP_INT);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char *file = IDL_VarGetString(argv[1]);
+
+  unsigned long flags = (kw.arm_end ? GD_ARM_ENDIAN : 0)
+    | (kw.big_end ? GD_BIG_ENDIAN : 0) | (kw.creat ? GD_CREAT : 0)
+    | (kw.excl ? GD_EXCL : 0) | (kw.force_enc ? GD_FORCE_ENCODING : 0)
+    | (kw.force_end ? GD_FORCE_ENDIAN : 0)
+    | (kw.ignore_dups ? GD_IGNORE_DUPS : 0)
+    | (kw.ignore_refs ? GD_IGNORE_REFS : 0)
+    | (kw.little_end ? GD_LITTLE_ENDIAN : 0)
+    | (kw.not_arm_end ? GD_NOT_ARM_ENDIAN : 0)
+    | (kw.pedantic ? GD_PEDANTIC : 0) | (kw.permissive ? GD_PERMISSIVE : 0)
+    | (kw.trunc ? GD_TRUNC : 0);
+
+  if (kw.enc_x)
+    flags |= gdidl_convert_encoding(kw.enc);
+
+  if (kw.prefix_x)
+    prefix = IDL_STRING_STR(&kw.prefix);
+
+  if (kw.suffix_x)
+    suffix = IDL_STRING_STR(&kw.suffix);
+
+  int index = (int16_t)gd_include_affix(D, file, kw.fragment_index, prefix,
+      suffix, flags);
+
+  if (kw.index_x) {
+    IDL_ALLTYPES v;
+    v.i = index;
+    IDL_StoreScalar(kw.index, IDL_TYP_INT, &v);
+  }
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_metaflush GD_METAFLUSH 1 1 KEYWORDS */
+void gdidl_metaflush(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_metaflush(D);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_rewrite_fragment GD_REWRITE_FRAGMENT 1 1 KEYWORDS */
+void gdidl_rewrite_fragment(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    int fragment_index_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.fragment_index = 0;
+  kw.fragment_index_x = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x),
+      IDL_KW_OFFSETOF(fragment_index) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  if (!kw.fragment_index_x)
+    kw.fragment_index = GD_ALL_FRAGMENTS;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_rewrite_fragment(D, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_move GD_MOVE 3 3 KEYWORDS */
+void gdidl_move(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int move_data;
+    int alias;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.move_data = kw.alias = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "ALIAS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(alias) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  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);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: F gdidl_open GD_OPEN 1 1 KEYWORDS */
+IDL_VPTR gdidl_open(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  char* name = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int rdwr;
+    int arm_end;
+    int big_end;
+    int creat;
+    int excl;
+    int force_enc;
+    int force_end;
+    int ignore_dups;
+    int ignore_refs;
+    int little_end;
+    int not_arm_end;
+    int pedantic;
+    int permissive;
+    int pretty_print;
+    int trunc;
+    int truncsub;
+    int verbose;
+    int enc_x;
+    IDL_VPTR enc;
+  } KW_RESULT;
+  KW_RESULT kw;
+  kw.rdwr = kw.big_end = kw.creat = kw.excl = kw.force_enc = kw.force_end =
+    kw.ignore_dups = kw.little_end = kw.pedantic = kw.trunc = kw.verbose =
+    kw.enc_x = kw.arm_end = kw.not_arm_end = kw.pretty_print = kw.truncsub =
+    kw.ignore_refs = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    IDL_KW_FAST_SCAN,
+    { "ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(arm_end) },
+    { "BIG_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(big_end) },
+    { "CREAT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(creat) },
+    { "ENCODING", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(enc_x),
+      IDL_KW_OFFSETOF(enc) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "EXCL", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(excl) },
+    { "FORCE_ENCODING", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force_enc) },
+    { "FORCE_ENDIANNESS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force_end) },
+    { "IGNORE_DUPS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ignore_dups) },
+    { "IGNORE_REFS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ignore_refs) },
+    { "LITTLE_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(little_end) },
+    { "NOT_ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(not_arm_end) },
+    { "PEDANTIC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pedantic) },
+    { "PERMISSIVE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(permissive) },
+    { "PRETTY_PRINT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pretty_print) },
+    { "RDWR", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(rdwr) },
+    { "TRUNC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(trunc) },
+    { "TRUNCSUB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(truncsub) },
+    { "VERBOSE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(verbose) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  name = IDL_VarGetString(argv[0]);
+
+  unsigned long flags = (kw.rdwr ? GD_RDWR : GD_RDONLY)
+    | (kw.arm_end ? GD_ARM_ENDIAN : 0) | (kw.big_end ? GD_BIG_ENDIAN : 0)
+    | (kw.creat ? GD_CREAT : 0) | (kw.excl ? GD_EXCL : 0)
+    | (kw.force_enc ? GD_FORCE_ENCODING : 0)
+    | (kw.force_end ? GD_FORCE_ENDIAN : 0)
+    | (kw.ignore_dups ? GD_IGNORE_DUPS : 0)
+    | (kw.ignore_refs ? GD_IGNORE_REFS : 0)
+    | (kw.little_end ? GD_LITTLE_ENDIAN : 0)
+    | (kw.not_arm_end ? GD_NOT_ARM_ENDIAN : 0)
+    | (kw.pedantic ? GD_PEDANTIC : 0) | (kw.permissive ? GD_PERMISSIVE : 0)
+    | (kw.pretty_print ? GD_PRETTY_PRINT : 0) | (kw.trunc ? GD_TRUNC : 0)
+    | (kw.truncsub ? GD_TRUNCSUB : 0) | (kw.verbose ? GD_VERBOSE : 0);
+
+  if (kw.enc_x)
+    flags |= gdidl_convert_encoding(kw.enc);
+
+  DIRFILE* D = gd_open(name, flags);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(gdidl_set_dirfile(D));
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: P gdidl_alter_protection GD_ALTER_PROTECTION 2 2 KEYWORDS */
+void gdidl_alter_protection(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    int fragment_index_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.fragment_index_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x),
+      IDL_KW_OFFSETOF(fragment_index) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  if (!kw.fragment_index_x)
+    kw.fragment_index = GD_ALL_FRAGMENTS;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_alter_protection(D, IDL_LongScalar(argv[1]), kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_reference GD_REFERENCE 2 2 KEYWORDS */
+void gdidl_reference(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_reference(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_rename GD_RENAME 3 3 KEYWORDS */
+void gdidl_rename(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int updatedb;
+    int move_data;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.move_data = kw.updatedb = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) },
+    { "UPDATEDB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(updatedb) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* new_code = IDL_VarGetString(argv[2]);
+
+  gd_rename(D, field_code, new_code, (kw.move_data ? GD_REN_DATA : 0) |
+      (kw.updatedb ? GD_REN_UPDB : 0));
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_uninclude GD_UNINCLUDE 2 2 KEYWORDS */
+void gdidl_uninclude(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int del;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.del = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "DELETE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(del) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_uninclude(D, IDL_LongScalar(argv[1]), kw.del);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: F gdidl_validate GD_VALIDATE 2 2 KEYWORDS */
+IDL_VPTR gdidl_validate(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  int v = gd_validate(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(v);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_getdata GD_GETDATA 2 2 KEYWORDS */
+IDL_VPTR gdidl_getdata(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_LONG64 first_frame;
+    IDL_LONG64 first_sample;
+    IDL_LONG n_frames;
+    IDL_LONG n_samples;
+    int first_frame_x, first_sample_x;
+    gd_type_t return_type;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  IDL_VPTR r;
+
+  kw.first_frame = kw.first_sample = kw.n_frames = kw.n_samples = 0;
+  kw.first_frame_x = kw.first_sample_x = 0;
+  kw.return_type = GD_FLOAT64;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FIRST_FRAME", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_frame_x),
+      IDL_KW_OFFSETOF(first_frame) },
+    { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x),
+      IDL_KW_OFFSETOF(first_sample) },
+    { "NUM_FRAMES", IDL_TYP_LONG, 1, 0, 0, IDL_KW_OFFSETOF(n_frames) },
+    { "NUM_SAMPLES", IDL_TYP_LONG, 1, 0, 0, IDL_KW_OFFSETOF(n_samples) },
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(return_type) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  /* 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);
+
+  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));
+
+    gd_getdata64(D, field_code, kw.first_frame, kw.first_sample, kw.n_frames,
+        kw.n_samples, kw.return_type, data);
+
+    if (gd_error(D)) {
+      free(data);
+      r = IDL_GettmpInt(0);
+    } else {
+      IDL_MEMINT dim[] = { kw.n_frames * spf + kw.n_samples };
+      r = IDL_ImportArray(1, dim, gdidl_idl_type(kw.return_type), data,
+          (IDL_ARRAY_FREE_CB)free, NULL);
+    }
+  }
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_bof GD_BOF 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_bof(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char *field_code = IDL_VarGetString(argv[1]);
+
+  off64_t bof = gd_bof64(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_Gettmp();
+  r->type = IDL_TYP_LONG64;
+  r->value.l64 = (IDL_LONG64)bof;
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_constant GD_GET_CONSTANT 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_constant(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int const_type;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.const_type = GD_FLOAT64;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  void* data = malloc(16);
+
+  int ret = gd_get_constant(D, field_code, kw.const_type, data);
+
+  IDL_VPTR r;
+  if (!ret) {
+    r = IDL_Gettmp();
+    r->value = gdidl_to_alltypes(kw.const_type, data);
+    r->type = gdidl_idl_type(kw.const_type);
+  } else {
+    GDIDL_SET_ERROR(D);
+    r = IDL_GettmpInt(0);
+  }
+  free(data);
+
+  IDL_KW_FREE;
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_carray GD_GET_CARRAY 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_carray(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+  int ret = 1;
+  void *data = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    unsigned int start;
+    unsigned int n;
+    int const_type;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.const_type = GD_FLOAT64;
+  kw.start = kw.n = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "LENGTH", IDL_TYP_UINT, 1, 0, 0, IDL_KW_OFFSETOF(n) },
+    { "START", IDL_TYP_UINT, 1, 0, 0, IDL_KW_OFFSETOF(start) },
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  if (kw.n == 0) {
+    kw.n = gd_carray_len(D, field_code);
+    if (kw.n > kw.start)
+      kw.n -= kw.start;
+    else
+      kw.n = 0;
+  }
+
+  data = malloc(16 * kw.n);
+  ret = gd_get_carray_slice(D, field_code, kw.start, kw.n, kw.const_type,
+      data);
+
+  IDL_VPTR r;
+  if (!ret) {
+    IDL_MEMINT dim[] = { kw.n };
+    r = IDL_ImportArray(1, dim, gdidl_idl_type(kw.const_type), data,
+        (IDL_ARRAY_FREE_CB)free, NULL);
+  } else {
+    free(data);
+    GDIDL_SET_ERROR(D);
+    r = IDL_GettmpInt(0);
+  }
+
+  IDL_KW_FREE;
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_constants GD_CONSTANTS 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_constants(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int const_type;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  unsigned int nconst;
+  const void* consts;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.parent_x = 0;
+  kw.const_type = GD_FLOAT64;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  /* no signed 8-bit type in IDL */
+  if (kw.const_type == GD_INT8)
+    idl_kw_abort("Cannot return data as a signed 8-bit integer.");
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    nconst = gd_nmfields_by_type(D, parent, GD_CONST_ENTRY);
+    consts = gd_mconstants(D, parent, kw.const_type);
+  } else {
+    nconst = gd_nfields_by_type(D, GD_CONST_ENTRY);
+    consts = gd_constants(D, kw.const_type);
+  }
+
+  IDL_VPTR r;
+  if (consts != NULL) {
+    void* data = malloc(GD_SIZE(kw.const_type) * nconst);
+    memcpy(data, consts, GD_SIZE(kw.const_type) * nconst);
+    IDL_MEMINT dim[IDL_MAX_ARRAY_DIM] = { nconst };
+
+    r = IDL_ImportArray(1, dim, gdidl_idl_type(kw.const_type), data,
+        (IDL_ARRAY_FREE_CB)free, NULL);
+  } else
+    IDL_MakeTempVector(IDL_TYP_INT, 0, IDL_ARR_INI_ZERO, &r);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_encoding GD_ENCODING 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_encoding(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  unsigned long enc = gd_encoding(D, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpLong(enc);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_endianness GD_ENDIANNESS 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_endianness(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  unsigned long end = gd_endianness(D, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpLong(end);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_entry GD_ENTRY 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_entry(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_entry_t E;
+  int ret = gd_entry(D, field_code, &E);
+
+  IDL_VPTR r = NULL;
+  if (ret) {
+    GDIDL_SET_ERROR(D);
+    r = IDL_GettmpInt(0);
+  } else {
+    r = gdidl_make_idl_entry(&E);
+    gd_free_entry_strings(&E);
+  }
+
+  IDL_KW_FREE;
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_entry_type GD_ENTRY_TYPE 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_entry_type(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_entype_t type = gd_entry_type(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(type);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_error GD_ERROR 1 1 */
+IDL_VPTR gdidl_error(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int err = gd_error(gdidl_get_dirfile(IDL_LongScalar(argv[0])));
+
+  IDL_VPTR r = IDL_GettmpInt(err);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_error_count GD_ERROR_COUNT 1 1 */
+IDL_VPTR gdidl_error_count(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int err = gd_error_count(gdidl_get_dirfile(IDL_LongScalar(argv[0])));
+
+  IDL_VPTR r = IDL_GettmpInt(err);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_error_string GD_ERROR_STRING 1 1 */
+IDL_VPTR gdidl_error_string(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  char buffer[GD_MAX_LINE_LENGTH];
+  gd_error_string(gdidl_get_dirfile(IDL_LongScalar(argv[0])), buffer,
+      GD_MAX_LINE_LENGTH);
+
+  IDL_VPTR r = IDL_StrToSTRING(buffer);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_eof GD_EOF 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_eof(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char *field_code = IDL_VarGetString(argv[1]);
+
+  off64_t eof = gd_eof64(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_Gettmp();
+  r->type = IDL_TYP_LONG64;
+  r->value.l64 = (IDL_LONG64)eof;
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_field_list GD_ENTRY_LIST 1 1 KEYWORDS */
+/* the following alias is needed for backwards compatibility */
+/* @@DLM: F gdidl_get_field_list GD_FIELD_LIST 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_field_list(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  unsigned int i, nentries, flags = 0;
+  const char **list;
+  const char *parent = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int type;
+    IDL_STRING parent;
+    int parent_x;
+    int hidden, noalias, scalars, vectors, aliases;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.type = 0;
+  kw.hidden = kw.noalias = kw.scalars = kw.vectors = kw.aliases = 0;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "ALIASES", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(aliases) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "HIDDEN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(hidden) },
+    { "NOALIAS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(noalias) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { "SCALARS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(scalars) },
+    { "TYPE", IDL_TYP_UINT, 1, 0, 0, IDL_KW_OFFSETOF(type) },
+    { "VECTORS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(vectors) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.parent_x)
+    parent = IDL_STRING_STR(&kw.parent);
+
+  if (kw.hidden)
+    flags |= GD_ENTRIES_HIDDEN;
+  if (kw.noalias)
+    flags |= GD_ENTRIES_NOALIAS;
+
+  if (kw.type == 0) {
+    if (kw.vectors)
+      kw.type = GD_VECTOR_ENTRIES;
+    else if (kw.scalars)
+      kw.type = GD_SCALAR_ENTRIES;
+    else if (kw.aliases)
+      kw.type = GD_ALIAS_ENTRIES;
+  }
+
+  nentries = gd_nentries(D, parent, kw.type, flags);
+  list = gd_entry_list(D, parent, kw.type, flags);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r;
+
+  IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, nentries,
+      IDL_ARR_INI_ZERO, &r);
+  for (i = 0; i < nentries; ++i)
+    IDL_StrStore(data + i, (char*)list[i]);
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_fragment_index GD_FRAGMENT_INDEX 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_fragment_index(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  char* field_code = IDL_VarGetString(argv[1]);
+
+  int index = gd_fragment_index(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpLong(index);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_fragmentname GD_FRAGMENTNAME 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_fragmentname(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  int index = (int)IDL_LongScalar(argv[1]);
+
+  const char* name = gd_fragmentname(D, index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_StrToSTRING((char*)name);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_framenum GD_FRAMENUM 3 3 KEYWORDS */
+IDL_VPTR gdidl_get_framenum(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_LONG64 frame_start;
+    IDL_LONG64 frame_end;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.frame_start = 0;
+  kw.frame_end = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FIELD_START", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(frame_start) },
+    { "FIELD_END", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(frame_end) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  double value = IDL_DoubleScalar(argv[2]);
+
+  double frame = gd_framenum_subset64(D, field_code, value, kw.frame_start,
+      kw.frame_end);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_Gettmp();
+  r->type = IDL_TYP_DOUBLE;
+  r->value.d = frame;
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_frameoffset GD_FRAMEOFFSET 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_frameoffset(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  off64_t foffs = gd_frameoffset64(D, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_Gettmp();
+  r->type = IDL_TYP_LONG64;
+  r->value.l64 = (long long)foffs;
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_native_type GD_NATIVE_TYPE 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_native_type(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_type_t t = gd_native_type(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(t);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_nfields GD_NENTRIES 1 1 KEYWORDS */
+/* the following alias is needed for backwards compatibility */
+/* @@DLM: F gdidl_get_nfields GD_NFIELDS 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_nfields(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  unsigned int nentries, flags = 0;
+  const char *parent = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int type;
+    IDL_STRING parent;
+    int parent_x;
+    int aliases, hidden, noalias, scalars, vectors;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.type = 0;
+  kw.hidden = kw.noalias = kw.scalars = kw.vectors = kw.aliases = 0;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "ALIASES", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(aliases) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "HIDDEN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(hidden) },
+    { "NOALIAS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(noalias) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { "SCALARS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(scalars) },
+    { "TYPE", IDL_TYP_UINT, 1, 0, 0, IDL_KW_OFFSETOF(type) },
+    { "VECTORS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(vectors) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.parent_x)
+    parent = IDL_STRING_STR(&kw.parent);
+
+  if (kw.hidden)
+    flags |= GD_ENTRIES_HIDDEN;
+  if (kw.noalias)
+    flags |= GD_ENTRIES_NOALIAS;
+
+  if (kw.type == 0) {
+    if (kw.vectors)
+      kw.type = GD_VECTOR_ENTRIES;
+    else if (kw.scalars)
+      kw.type = GD_SCALAR_ENTRIES;
+    else if (kw.aliases)
+      kw.type = GD_ALIAS_ENTRIES;
+  }
+
+  nentries = gd_nentries(D, parent, kw.type, flags);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpLong(nentries);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_nfragments GD_NFRAGMENTS 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_nfragments(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  unsigned int nfrags;
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  nfrags = gd_nfragments(D);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpLong(nfrags);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_nframes GD_NFRAMES 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_nframes(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  off64_t nframes = gd_nframes64(D);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_Gettmp();
+  r->type = IDL_TYP_LONG64;
+  r->value.l64 = (IDL_LONG64)nframes;
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_nvectors GD_NVECTORS 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_nvectors(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  unsigned int nfields;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    nfields = gd_nmvectors(D, parent);
+  } else 
+    nfields = gd_nvectors(D);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpLong(nfields);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_parent_fragment GD_PARENT_FRAGMENT 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_parent_fragment(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  int parent = gd_parent_fragment(D, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(parent);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_protection GD_PROTECTION 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_protection(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  int prot = gd_protection(D, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(prot);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_raw_filename GD_RAW_FILENAME 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_raw_filename(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  const char* name = gd_raw_filename(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_StrToSTRING((char*)name);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_spf GD_SPF 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_spf(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  unsigned int spf = gd_spf(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpUInt(spf);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_carray_len GD_CARRAY_LEN 2 2 KEYWORDS */
+IDL_VPTR gdidl_carray_len(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  size_t len = gd_carray_len(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpUInt(len);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_string GD_GET_STRING 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_string(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  char buffer[GD_MAX_LINE_LENGTH];
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_get_string(D, field_code, GD_MAX_LINE_LENGTH, buffer);
+
+  IDL_VPTR r;
+  if (gd_error(D)) {
+    GDIDL_SET_ERROR(D);
+    r = IDL_StrToSTRING("");
+  } else 
+    r = IDL_StrToSTRING(buffer);
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_strings GD_STRINGS 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_strings(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  unsigned int nstring;
+  const char** strings;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    nstring = gd_nmfields_by_type(D, parent, GD_STRING_ENTRY);
+    strings = gd_mstrings(D, parent);
+  } else {
+    nstring = gd_nfields_by_type(D, GD_STRING_ENTRY);
+    strings = gd_strings(D);
+  }
+
+  IDL_VPTR r;
+  if (nstring > 0) {
+    int i;
+    IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, nstring,
+        IDL_ARR_INI_ZERO, &r);
+    for (i = 0; i < nstring; ++i)
+      IDL_StrStore(data + i, (char*)strings[i]);
+  } else
+    IDL_MakeTempVector(IDL_TYP_STRING, 0, IDL_ARR_INI_ZERO, &r);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_get_vector_list GD_VECTOR_LIST 1 1 KEYWORDS */
+IDL_VPTR gdidl_get_vector_list(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int i;
+  unsigned int nfields;
+  const char** list;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    gd_type_t type;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    nfields = gd_nmvectors(D, parent);
+    list = gd_mvector_list(D, parent);
+  } else {
+    nfields = gd_nvectors(D);
+    list = gd_vector_list(D);
+  }
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r;
+
+  IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, nfields,
+      IDL_ARR_INI_ZERO, &r);
+  for (i = 0; i < nfields; ++i)
+    IDL_StrStore(data + i, (char*)list[i]);
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: P gdidl_putdata GD_PUTDATA 3 3 KEYWORDS */
+void gdidl_putdata(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_LONG64 first_frame;
+    IDL_LONG64 first_sample;
+    int first_frame_x, first_sample_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.first_frame = kw.first_sample = kw.first_frame_x = kw.first_sample_x = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FIRST_FRAME", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x),
+      IDL_KW_OFFSETOF(first_frame) },
+    { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x),
+      IDL_KW_OFFSETOF(first_sample) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  if (kw.first_frame_x == 0 && kw.first_sample_x == 0) {
+    kw.first_frame = GD_HERE;
+    kw.first_sample = 0;
+  }
+
+  IDL_ENSURE_ARRAY(argv[2]);
+  if (argv[2]->value.arr->n_dim != 1)
+    idl_kw_abort("data must be a vector, not a multidimensional array");
+
+  off64_t n_samples = argv[2]->value.arr->n_elts;
+
+  gd_putdata64(D, field_code, kw.first_frame, kw.first_sample, 0, n_samples,
+      gdidl_gd_type(argv[2]->type), argv[2]->value.arr->data);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_put_constant GD_PUT_CONSTANT 3 3 KEYWORDS */
+void gdidl_put_constant(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  const void* data = gdidl_from_alltypes(argv[2]->type, &argv[2]->value);
+  gd_put_constant(D, field_code, gdidl_gd_type(argv[2]->type), data);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_put_carray GD_PUT_CARRAY 3 3 KEYWORDS */
+void gdidl_put_carray(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int start;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.start = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "START", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(start) },
+    { NULL }
+  };
+
+  argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  IDL_ENSURE_ARRAY(argv[2]);
+  if (argv[2]->value.arr->n_dim != 1)
+    idl_kw_abort("data must be a vector, not a multidimensional array");
+
+  int length = argv[2]->value.arr->n_elts;
+
+  gd_put_carray_slice(D, field_code, kw.start, length,
+      gdidl_gd_type(argv[2]->type), argv[2]->value.arr->data);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_put_string GD_PUT_STRING 3 3 KEYWORDS */
+void gdidl_put_string(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* data = IDL_VarGetString(argv[2]);
+
+  gd_put_string(D, field_code, data);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: F gdidl_invalid_dirfile GD_INVALID_DIRFILE 0 0 */
+IDL_VPTR gdidl_invalid_dirfile(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  IDL_VPTR r = IDL_GettmpInt(gdidl_set_dirfile(gd_invalid_dirfile()));
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_dirfile_standards GD_DIRFILE_STANDARDS 1 2 KEYWORDS */
+IDL_VPTR gdidl_dirfile_standards(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int earliest;
+    int current;
+    int latest;
+  } KW_RESULT;
+  KW_RESULT kw;
+  int vers = 16384;
+
+  kw.earliest = kw.current = kw.latest = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "CURRENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(current) },
+    { "EARLIEST", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(earliest) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "LATEST", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(latest) },
+    { NULL }
+  };
+
+  argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (argc > 1)
+    vers = IDL_LongScalar(argv[1]);
+
+  vers = gd_dirfile_standards(D, (vers != 16384) ? vers :
+      kw.current ? GD_VERSION_CURRENT : kw.latest ? GD_VERSION_LATEST :
+      kw.earliest ? GD_VERSION_EARLIEST : 16384);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(vers);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_seek GD_SEEK 2 2 KEYWORDS */
+IDL_VPTR gdidl_seek(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    off64_t frame_num;
+    off64_t sample_num;
+    int whence;
+    int write;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.whence = GD_SEEK_SET;
+  kw.frame_num = kw.sample_num = 0;
+  kw.write = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAME_NUM", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(frame_num) },
+    { "SAMPLE_NUM", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(sample_num) },
+    { "WHENCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(whence) },
+    { "WRITE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(write) },
+    { NULL }
+  };
+
+  argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  off64_t pos = gd_seek64(D, field_code, kw.frame_num, kw.sample_num,
+      (kw.whence & (GD_SEEK_SET | GD_SEEK_CUR | GD_SEEK_END)) |
+      (kw.write ? GD_SEEK_WRITE : 0));
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_Gettmp();
+  r->type = IDL_TYP_LONG64;
+  r->value.l64 = (IDL_LONG64)pos;
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_tell GD_TELL 2 2 KEYWORDS */
+IDL_VPTR gdidl_tell(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  off64_t pos = gd_tell64(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_Gettmp();
+  r->type = IDL_TYP_LONG64;
+  r->value.l64 = (IDL_LONG64)pos;
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_hidden GD_HIDDEN 2 2 KEYWORDS */
+IDL_VPTR gdidl_hidden(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  int hidden = gd_hidden(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(hidden);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: P gdidl_hide GD_HIDE 2 2 KEYWORDS */
+void gdidl_hide(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_hide(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_unhide GD_UNHIDE 2 2 KEYWORDS */
+void gdidl_unhide(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  gd_unhide(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_window GD_ADD_WINDOW 5 5 KEYWORDS */
+void gdidl_add_window(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  gd_windop_t windop;
+  gd_triplet_t threshold;
+  int nop = 0;
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING parent;
+    int eq, ne, le, lt, gt, ge, set, clr;
+    int parent_x;
+    int fragment_index;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.eq = kw.ne = kw.le = kw.lt = kw.gt = kw.ge = kw.set = kw.clr = 0;
+  kw.fragment_index = kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "CLR", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(clr) },
+    { "EQ", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(eq) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "GE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ge) },
+    { "GT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(gt) },
+    { "LE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(le) },
+    { "LT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(lt) },
+    { "NE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ne) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { "SET", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(set) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field = IDL_VarGetString(argv[2]);
+  const char* check = IDL_VarGetString(argv[3]);
+
+  /* check operator */
+  if (kw.eq) {
+    windop = GD_WINDOP_EQ;
+    nop++;
+  }
+  if (kw.ne) {
+    windop = GD_WINDOP_NE;
+    nop++;
+  }
+  if (kw.le) {
+    windop = GD_WINDOP_LE;
+    nop++;
+  }
+  if (kw.lt) {
+    windop = GD_WINDOP_LT;
+    nop++;
+  }
+  if (kw.ge) {
+    windop = GD_WINDOP_GE;
+    nop++;
+  }
+  if (kw.gt) {
+    windop = GD_WINDOP_GT;
+    nop++;
+  }
+  if (kw.set) {
+    windop = GD_WINDOP_SET;
+    nop++;
+  }
+  if (kw.clr) {
+    windop = GD_WINDOP_CLR;
+    nop++;
+  }
+
+  if (nop > 1)
+    idl_kw_abort("Multiple operations specified");
+  else if (nop == 0)
+    idl_kw_abort("No operation specified");
+
+  switch (windop) {
+    case GD_WINDOP_EQ:
+    case GD_WINDOP_NE:
+      threshold.i = IDL_Long64Scalar(argv[4]);
+      break;
+    case GD_WINDOP_SET:
+    case GD_WINDOP_CLR:
+      threshold.u = IDL_ULong64Scalar(argv[4]);
+      break;
+    default:
+      threshold.r = IDL_DoubleScalar(argv[4]);
+      break;
+  }
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_window(D, parent, field_code, in_field, check, windop, threshold);
+  } else
+    gd_add_window(D, field_code, in_field, check, windop, threshold,
+        kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_add_mplex GD_ADD_MPLEX 5 5 KEYWORDS */
+void gdidl_add_mplex(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING parent;
+    int parent_x;
+    int fragment_index;
+    int max;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = kw.parent_x = kw.max = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "MAX", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(max) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* in_field = IDL_VarGetString(argv[2]);
+  const char* count = IDL_VarGetString(argv[3]);
+  int val = IDL_LongScalar(argv[4]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_mplex(D, parent, field_code, in_field, count, val, kw.max);
+  } else
+    gd_add_mplex(D, field_code, in_field, count, val, kw.max,
+        kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_window GD_ALTER_WINDOW 2 2 KEYWORDS */
+void gdidl_alter_window(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int nop = 0;
+  const char* in_field = NULL;
+  const char* check = NULL;
+  gd_triplet_t threshold;
+  gd_windop_t windop = GD_WINDOP_UNK;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_VPTR threshold;
+    int eq, ne, le, lt, gt, ge, set, clr;
+    int threshold_x;
+    IDL_STRING in_field;
+    int in_field_x;
+    IDL_STRING check;
+    int check_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  threshold.r = 0;
+  kw.check_x = kw.in_field_x = kw.threshold_x = 0;
+  kw.eq = kw.ne = kw.le = kw.lt = kw.gt = kw.ge = kw.set = kw.clr = 0;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "CHECK_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(check_x),
+      IDL_KW_OFFSETOF(check) },
+    { "CLR", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(clr) },
+    { "EQ", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(eq) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "GE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ge) },
+    { "GT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(gt) },
+    { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
+      IDL_KW_OFFSETOF(in_field) },
+    { "LE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(le) },
+    { "LT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(lt) },
+    { "NE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ne) },
+    { "SET", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(set) },
+    { "THRESHOLD", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(threshold_x),
+      IDL_KW_OFFSETOF(threshold) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  /* count operators */
+  if (kw.eq) {
+    windop = GD_WINDOP_EQ;
+    nop++;
+  }
+  if (kw.ne) {
+    windop = GD_WINDOP_NE;
+    nop++;
+  }
+  if (kw.le) {
+    windop = GD_WINDOP_LE;
+    nop++;
+  }
+  if (kw.lt) {
+    windop = GD_WINDOP_LT;
+    nop++;
+  }
+  if (kw.ge) {
+    windop = GD_WINDOP_GE;
+    nop++;
+  }
+  if (kw.gt) {
+    windop = GD_WINDOP_GT;
+    nop++;
+  }
+  if (kw.set) {
+    windop = GD_WINDOP_SET;
+    nop++;
+  }
+  if (kw.clr) {
+    windop = GD_WINDOP_CLR;
+    nop++;
+  }
+
+  if (nop > 1)
+    idl_kw_abort("Multiple operations specified");
+
+  /* Need the current windop and/or threshold */
+  if (nop == 0 || !kw.threshold_x) {
+    gd_entry_t E;
+    gd_entry(D, field_code, &E);
+    gd_free_entry_strings(&E);
+    if (gd_error(D)) {
+      GDIDL_SET_ERROR(D);
+
+      IDL_KW_FREE;
+
+      dreturnvoid();
+      return;
+    }
+    if (nop == 0)
+      windop = E.windop;
+    if (!kw.threshold_x)
+      threshold = E.threshold;
+  }
+
+  if (kw.in_field_x)
+    in_field = IDL_STRING_STR(&kw.in_field);
+
+  if (kw.check_x)
+    check = IDL_STRING_STR(&kw.check);
+
+  if (kw.threshold_x) {
+    switch (windop) {
+      case GD_WINDOP_EQ:
+      case GD_WINDOP_NE:
+        threshold.i = IDL_Long64Scalar(kw.threshold);
+        break;
+      case GD_WINDOP_SET:
+      case GD_WINDOP_CLR:
+        threshold.u = IDL_ULong64Scalar(kw.threshold);
+        break;
+      default:
+        threshold.r = IDL_DoubleScalar(kw.threshold);
+        break;
+    }
+  }
+
+  gd_alter_window(D, field_code, in_field, check, windop, threshold);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_mplex GD_ALTER_MPLEX 2 2 KEYWORDS */
+void gdidl_alter_mplex(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char* in_field1 = NULL;
+  const char* in_field2 = NULL;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int val, val_x, period;
+    IDL_STRING in_field1;
+    int in_field1_x;
+    IDL_STRING in_field2;
+    int in_field2_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  kw.in_field1_x = kw.in_field2_x = kw.val_x = 0;
+  kw.period = -1;
+  GDIDL_KW_INIT_ERROR;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "COUNT_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field2_x),
+      IDL_KW_OFFSETOF(in_field2) },
+    { "COUNT_VAL", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(val_x),
+      IDL_KW_OFFSETOF(val) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field1_x),
+      IDL_KW_OFFSETOF(in_field1) },
+    { "PERIOD", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(period) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  /* no value specified, figure out the previous value */
+  if (!kw.val_x) {
+    gd_entry_t E;
+    gd_entry(D, field_code, &E);
+    kw.val = E.count_val;
+  }
+
+  if (!gd_error(D)) {
+    if (kw.in_field1_x)
+      in_field1 = IDL_STRING_STR(&kw.in_field1);
+
+    if (kw.in_field2_x)
+      in_field2 = IDL_STRING_STR(&kw.in_field2);
+
+    gd_alter_mplex(D, field_code, in_field1, in_field2, kw.val, kw.period);
+  }
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: F gdidl_naliases GD_NALIASES 2 2 KEYWORDS */
+IDL_VPTR gdidl_naliases(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int nalias;
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  nalias = gd_naliases(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpLong(nalias);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_alias_target GD_ALIAS_TARGET 2 2 KEYWORDS */
+IDL_VPTR gdidl_alias_target(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  const char* name = gd_alias_target(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_StrToSTRING((char*)name);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_aliases GD_ALIASES 2 2 KEYWORDS */
+IDL_VPTR gdidl_aliases(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int i;
+  unsigned int nalias;
+  const char** list;
+
+  GDIDL_KW_ONLY_ERROR;
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+
+  nalias = gd_naliases(D, field_code);
+  list = gd_aliases(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r;
+
+  IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, nalias,
+      IDL_ARR_INI_ZERO, &r);
+  for (i = 0; i < nalias; ++i)
+    IDL_StrStore(data + i, (char*)list[i]);
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: P gdidl_add_alias GD_ADD_ALIAS 3 3 KEYWORDS */
+void gdidl_add_alias(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    IDL_STRING parent;
+    int parent_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+  kw.parent_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
+      IDL_KW_OFFSETOF(parent) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char* field_code = IDL_VarGetString(argv[1]);
+  const char* target = IDL_VarGetString(argv[2]);
+
+  if (kw.parent_x) {
+    const char* parent = IDL_STRING_STR(&kw.parent);
+    gd_madd_alias(D, parent, field_code, target);
+  } else
+    gd_add_alias(D, field_code, target, kw.fragment_index);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_alter_affixes GD_ALTER_AFFIXES 1 1 KEYWORDS */
+void gdidl_alter_affixes(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  char *prefix = NULL;
+  char *suffix = NULL;
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+    IDL_STRING prefix;
+    int prefix_x;
+    IDL_STRING suffix;
+    int suffix_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = kw.prefix_x = kw.suffix_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { "PREFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(prefix_x),
+      IDL_KW_OFFSETOF(prefix) },
+    { "SUFFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(suffix_x),
+      IDL_KW_OFFSETOF(suffix) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.prefix_x)
+    prefix = IDL_STRING_STR(&kw.prefix);
+
+  if (kw.suffix_x)
+    suffix = IDL_STRING_STR(&kw.suffix);
+
+  gd_alter_affixes(D, kw.fragment_index, prefix, suffix);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: F gdidl_fragment_affixes GD_FRAGMENT_AFFIXES 1 1 KEYWORDS */
+IDL_VPTR gdidl_fragment_affixes(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  char *prefix;
+  char *suffix;
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int fragment_index;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.fragment_index = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_fragment_affixes(D, kw.fragment_index, &prefix, &suffix);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r;
+
+  IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, 2,
+      IDL_ARR_INI_ZERO, &r);
+  IDL_StrStore(data, prefix);
+  IDL_StrStore(data + 1, suffix);
+
+  free(prefix);
+  free(suffix);
+
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_strtok GD_STRTOK 1 1 KEYWORDS */
+IDL_VPTR gdidl_strtok(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  const char *string = NULL;
+  char *token;
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING string;
+    int string_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.string_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "STRING", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(string_x),
+      IDL_KW_OFFSETOF(string) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.string_x)
+    string = IDL_STRING_STR(&kw.string);
+
+  token = gd_strtok(D, string);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_StrToSTRING(token);
+  free(token);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_desync GD_DESYNC 1 1 KEYWORDS */
+IDL_VPTR gdidl_desync(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int ret;
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int pathcheck;
+    int reopen;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.pathcheck = kw.reopen = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PATHCHECK", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pathcheck) },
+    { "REOPEN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(reopen) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  ret = gd_desync(D, (kw.pathcheck ? GD_DESYNC_PATHCHECK : 0) |
+      (kw.reopen ? GD_DESYNC_REOPEN : 0));
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpInt(ret);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: F gdidl_flags GD_FLAGS 1 1 KEYWORDS */
+IDL_VPTR gdidl_flags(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  unsigned long flags, set = 0, reset = 0;
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    short int pretty, verbose;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.pretty = kw.verbose = -1;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PRETTY_PRINT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pretty) },
+    { "VERBOSE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(verbose) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  if (kw.pretty == 1)
+    set |= GD_PRETTY_PRINT;
+  else if (kw.pretty == 0)
+    reset |= GD_PRETTY_PRINT;
+
+  if (kw.verbose == 1)
+    set |= GD_VERBOSE;
+  else if (kw.verbose == 0)
+    reset |= GD_VERBOSE;
+
+  DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  flags = gd_flags(D, set, reset);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_GettmpLong(flags);
+  dreturn("%p", r);
+  return r;
+}
+
+/* @@DLM: P gdidl_verbose_prefix GD_VERBOSE_PREFIX 1 1 KEYWORDS */
+void gdidl_verbose_prefix(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  char *prefix = NULL;
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    IDL_STRING prefix;
+    int prefix_x;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.prefix_x = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { "PREFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(prefix_x),
+      IDL_KW_OFFSETOF(prefix) },
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  if (kw.prefix_x)
+    prefix = IDL_STRING_STR(&kw.prefix);
+
+  gd_verbose_prefix(D, prefix);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: P gdidl_mplex_lookback GD_MPLEX_LOOKBACK 1 2 KEYWORDS */
+void gdidl_mplex_lookback(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  int lookback = GD_DEFAULT_LOOKBACK;
+
+  typedef struct {
+    IDL_KW_RESULT_FIRST_FIELD;
+    GDIDL_KW_RESULT_ERROR;
+    int all;
+  } KW_RESULT;
+  KW_RESULT kw;
+
+  GDIDL_KW_INIT_ERROR;
+  kw.all = 0;
+
+  static IDL_KW_PAR kw_pars[] = {
+    { "ALL", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(all) },
+    GDIDL_KW_PAR_ERROR,
+    GDIDL_KW_PAR_ESTRING,
+    { NULL }
+  };
+
+  IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+  if (kw.all)
+    lookback = GD_LOOKBACK_ALL;
+  else if (argc > 1)
+    lookback = IDL_LongScalar(argv[1]);
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+  gd_mplex_lookback(D, lookback);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  dreturnvoid();
+}
+
+/* @@DLM: F gdidl_get_linterp_tablename GD_LINTERP_TABLENAME 2 2 KEYWORDS */
+IDL_VPTR gdidl_get_linterp_tablename(int argc, IDL_VPTR argv[], char *argk)
+{
+  dtraceidl();
+
+  GDIDL_KW_ONLY_ERROR;
+
+  DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+  const char *field_code = IDL_VarGetString(argv[1]);
+
+  char *name = gd_linterp_tablename(D, field_code);
+
+  GDIDL_SET_ERROR(D);
+
+  IDL_KW_FREE;
+
+  IDL_VPTR r = IDL_StrToSTRING(name);
+  free(name);
+  dreturn("%p", r);
+  return r;
+}
+
+
+/**** Module initialisation ****/
+
+/* These are defined in the automatically generated sublist.c */
+extern IDL_SYSFUN_DEF2 gdidl_procs[];
+extern int gdidl_n_procs;
+extern IDL_SYSFUN_DEF2 gdidl_funcs[];
+extern int gdidl_n_funcs;
+
+/* These are defined in the automatically generated constants.c */
+extern IDL_STRUCT_TAG_DEF gdidl_constants[];
+/* @@DLM: F gdidl_generate_constants GETDATA_CONSTANTS 0 0 */
+extern IDL_VPTR gdidl_generate_constants(int argc, IDL_VPTR argv[], char *argk);
+
+/* GD_ENTRY structure form */
+static IDL_MEMINT lincom_dims[] = { 1, GD_MAX_LINCOM };
+static IDL_MEMINT polynom_dims[] = { 1, GD_MAX_POLYORD + 1 };
+static IDL_STRUCT_TAG_DEF gdidl_entry[] = {
+  { "FIELD",      0, (void*)IDL_TYP_STRING },
+  { "FIELD_TYPE", 0, (void*)IDL_TYP_INT },
+  { "FRAGMENT",   0, (void*)IDL_TYP_INT },
+
+  { "IN_FIELDS",  lincom_dims, (void*)IDL_TYP_STRING },
+  { "A",          polynom_dims, (void*)IDL_TYP_DOUBLE }, /* POLYNOM */
+  { "CA",         polynom_dims, (void*)IDL_TYP_DCOMPLEX }, /* POLYNOM */
+  { "ARRAY_LEN",  0, (void*)IDL_TYP_INT }, /* CARRAY */
+  { "B",          lincom_dims, (void*)IDL_TYP_DOUBLE }, /* LINCOM */
+  { "CB",         lincom_dims, (void*)IDL_TYP_DCOMPLEX }, /* LINCOM */
+  { "BITNUM",     0, (void*)IDL_TYP_INT }, /* (S)BIT */
+  { "COMP_SCAL",  0, (void*)IDL_TYP_INT }, /* LINCOM / POLYNOM */
+  { "COUNT_VAL",  0, (void*)IDL_TYP_INT }, /* MPLEX */
+  { "DATA_TYPE",  0, (void*)IDL_TYP_INT }, /* RAW / CONST / CARRAY */
+  { "DIVIDEND",   0, (void*)IDL_TYP_DOUBLE }, /* RECIP */
+  { "CDIVIDEND",  0, (void*)IDL_TYP_DCOMPLEX }, /* RECIP */
+  { "M",          lincom_dims, (void*)IDL_TYP_DOUBLE }, /* LINCOM */
+  { "CM",         lincom_dims, (void*)IDL_TYP_DCOMPLEX }, /* LINCOM */
+  { "N_FIELDS",   0, (void*)IDL_TYP_INT },  /* LINCOM */
+  { "NUMBITS",    0, (void*)IDL_TYP_INT }, /* (S)BIT */
+  { "PERIOD",     0, (void*)IDL_TYP_INT }, /* MPLEX */
+  { "POLY_ORD",   0, (void*)IDL_TYP_INT }, /* POLYNOM */
+  { "SCALAR",     polynom_dims, (void*)IDL_TYP_STRING },
+  { "SCALAR_IND", polynom_dims, (void*)IDL_TYP_INT },
+  { "SHIFT",      0, (void*)IDL_TYP_LONG }, /* PHASE */
+  { "SPF",        0, (void*)IDL_TYP_UINT }, /* RAW */
+  { "TABLE",      0, (void*)IDL_TYP_STRING }, /* LINTERP */
+  { "UTHRESHOLD", 0, (void*)IDL_TYP_ULONG }, /* WINDOW */
+  { "ITHRESHOLD", 0, (void*)IDL_TYP_LONG }, /* WINDOW */
+  { "RTHRESHOLD", 0, (void*)IDL_TYP_DOUBLE }, /* WINDOW */
+  { "WINDOP",     0, (void*)IDL_TYP_INT }, /* WINDOW */
+  { NULL }
+};
+
+int IDL_Load(void)
+{
+  dtracevoid();
+
+  IDL_SysRtnAdd(gdidl_procs, IDL_FALSE, gdidl_n_procs);
+  IDL_SysRtnAdd(gdidl_funcs, IDL_TRUE, gdidl_n_funcs);
+
+  /* entry struct */
+  gdidl_entry_def = IDL_MakeStruct("GD_ENTRY", gdidl_entry);
+  gdidl_const_def = IDL_MakeStruct("GD_CONSTANTS", gdidl_constants);
+
+  dreturn("%i", 1);
+  return 1;
+}
diff --git a/bindings/idl/makedlm.sh.in b/bindings/idl/makedlm.sh.in
new file mode 100644
index 0000000..3e75fc1
--- /dev/null
+++ b/bindings/idl/makedlm.sh.in
@@ -0,0 +1,79 @@
+#!/bin/sh
+# Copyright (C) 2009, 2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# 
+# @configure_input@
+
+GREP=@GREP@
+DATE=@DATE@
+opt=$1
+in=$2
+
+if test "x$DATE" == "xnot found"; then
+  BUILD_DATE="unspecified"
+else
+  BUILD_DATE=`date`
+fi
+
+if test "$opt" = "-c"; then
+cat <<EOF
+/* This code is automatically generated.  Changes made here will be lost. */
+#define _LARGEFILE64_SOURCE 1
+#include <stdio.h>
+#include <idl_export.h>
+EOF
+else
+cat <<EOF
+MODULE GETDATA
+DESCRIPTION IDL GetData bindings
+VERSION @VERSION@
+BUILD_DATE $BUILD_DATE
+SOURCE The GetData Project <@PACKAGE_BUGREPORT@>
+
+STRUCTURE GD_ENTRY
+EOF
+fi
+$GREP @@DLM $in | sort -k 5 | {
+nfunc=0
+nproc=0
+while read sc magic type func idl min max key extra; do if test "$opt" = "-c"; then
+  if test "x$key" == "xKEYWORDS"; then key=IDL_SYSFUN_DEF_F_KEYWORDS; else key=0; fi
+  if test $type == "F"; then
+    echo "extern IDL_VPTR $func(int argc, IDL_VPTR argv[], char *argk);"
+    if test -n "$funcstruct"; then funcstruct="$funcstruct, "; fi
+    funcstruct="$funcstruct
+    { { (IDL_SYSRTN_GENERIC)$func }, \"$idl\", $min, $max, $key, 0 }"
+    (( nfunc=nfunc+1 ))
+  else
+    echo "extern void $func(int argc, IDL_VPTR argv[], char *argk);"
+    if test -n "$procstruct"; then procstruct="$procstruct, "; fi
+    procstruct="$procstruct
+    { { (IDL_SYSRTN_GENERIC)$func }, \"$idl\", $min, $max, $key, 0 }"
+    (( nproc=nproc+1 ))
+  fi
+else
+  if test "x$key" == "xKEYWORDS"; then key=" KEYWORDS"; else key=; fi
+  if test $type == "F"; then type="FUNCTION "; else type="PROCEDURE"; fi
+  echo "$type $idl $min $max$key"
+fi; done
+if test "$opt" = "-c"; then
+  echo "int gdidl_n_procs=$nproc; IDL_SYSFUN_DEF2 gdidl_procs[] = { $procstruct };"
+  echo "int gdidl_n_funcs=$nfunc; IDL_SYSFUN_DEF2 gdidl_funcs[] = { $funcstruct };"
+fi; }
diff --git a/bindings/idl/test/Makefile.am b/bindings/idl/test/Makefile.am
new file mode 100644
index 0000000..7592109
--- /dev/null
+++ b/bindings/idl/test/Makefile.am
@@ -0,0 +1,40 @@
+# Copyright (C) 2009-2010, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign serial-tests
+
+if TEST_IDL
+TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} IDL_PATH="${srcdir}" IDL_DLM_PATH=../.libs ${IDL}
+idlTESTS=big_test.pro
+TESTS=$(addprefix ${srcdir}/,$(idlTESTS))
+endif
+
+EXTRA_DIST=getdata_idl_test_routines.pro ${idlTESTS}
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~ 
diff --git a/bindings/idl/test/Makefile.in b/bindings/idl/test/Makefile.in
new file mode 100644
index 0000000..789bf80
--- /dev/null
+++ b/bindings/idl/test/Makefile.in
@@ -0,0 +1,673 @@
+# 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/idl/test
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/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_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2009-2010, 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_IDL_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} IDL_PATH="${srcdir}" IDL_DLM_PATH=../.libs ${IDL}
+ at TEST_IDL_TRUE@idlTESTS = big_test.pro
+ at TEST_IDL_TRUE@TESTS = $(addprefix ${srcdir}/,$(idlTESTS))
+EXTRA_DIST = getdata_idl_test_routines.pro ${idlTESTS}
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/idl/test/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/idl/test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am check-local clean \
+	clean-generic clean-libtool clean-local cscopelist-am ctags-am \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am
+
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~ 
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/idl/test/big_test.pro b/bindings/idl/test/big_test.pro
new file mode 100644
index 0000000..2937e29
--- /dev/null
+++ b/bindings/idl/test/big_test.pro
@@ -0,0 +1,1402 @@
+; vim: ft=idlang
+;
+; Copyright (C) 2009-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
+
+; Load the helper routines
+.r getdata_idl_test_routines
+
+; If this IDL is running in timed demo mode, we can't perform this test,
+; having neither DLM nor file functionality.
+if (LMGR(/DEMO)) then timed_demo_mode
+
+; General test
+
+filedir = "test_dirfile"
+format  = "test_dirfile/format"
+form2   = "test_dirfile/form2"
+data    = "test_dirfile/data"
+
+flen    = 11
+nfields = 17
+nume    = 0
+
+spawn, "rm -rf " + filedir
+file_mkdir, filedir
+
+datadata = bindgen(80) + 1
+
+fields = [ 'INDEX', 'alias', 'bit', 'carray', 'const', 'data', 'div', 'lincom',$
+  'linterp', 'mplex', 'mult', 'phase', 'polynom', 'recip', 'sbit', 'string',$
+  'window' ]
+
+; Write the test dirfile
+openw,1,format
+printf,1,'/ENDIAN little'
+printf,1,'data RAW INT8 8'
+printf,1,'lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const'
+printf,1,'/META data mstr STRING "This is a string constant."'
+printf,1,'/META data mconst CONST COMPLEX128 3.3;4.4'
+printf,1,'/META data mlut LINTERP DATA ./lut'
+printf,1,'const CONST FLOAT64 5.5'
+printf,1,'carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6'
+printf,1,'linterp LINTERP data ./lut'
+printf,1,'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const'
+printf,1,'bit BIT data 3 4'
+printf,1,'sbit SBIT data 5 6'
+printf,1,'mplex MPLEX data sbit 1 10'
+printf,1,'mult MULTIPLY data sbit'
+printf,1,'div DIVIDE mult bit'
+printf,1,'recip RECIP div 6.5;4.3'
+printf,1,'phase PHASE data 11'
+printf,1,'window WINDOW linterp mult LT 4.1'
+printf,1,'/ALIAS alias data'
+printf,1,'string STRING "Zaphod Beeblebrox"'
+close,1
+
+openw,1,form2
+printf,1,'const2 CONST INT8 -19'
+close,1
+
+openw,1,data
+writeu,1,byte(datadata)
+close,1
+
+;  140: getdata_constants check
+defsysv, "!GD", getdata_constants()
+nume += check_simple(140, !GD.E_OPEN, 1)
+
+;  0: gd_error check
+d = gd_open("x",error=error)
+nume += check_error(0, d, !GD.E_OPEN)
+nume += check_simple(0, error, !GD.E_OPEN)
+gd_close, d, /DISCARD
+
+;  1: gd_open check
+d = gd_open(filedir, /RDWR)
+nume += check_ok(1, d)
+nume += check_simple(1, d, 1)
+
+;  2: gd_getdata check
+n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1)
+nume += check_ok(2, d)
+nume += check_simple(2, n, INDGEN(8) + 41)
+
+;  3: gd_get_constant check
+n = gd_get_constant(d, "const", type=!GD.FLOAT64)
+nume += check_ok(3, d)
+nume += check_simple(3, n, 5.5)
+
+;  6: gd_nfields check
+n = gd_nfields(d)
+nume += check_ok(6, d)
+nume += check_simple(6, n, nfields)
+
+;  8: gd_field_list check
+n = gd_field_list(d)
+nume += check_ok(8, d)
+nume += check_simple(8, n, fields)
+
+;  9: gd_nmfields_check
+n = gd_nfields(d, parent="data")
+nume += check_ok(9, d)
+nume += check_simple(9, n, 3)
+
+;  10: gd_mfield_list check
+n = gd_field_list(d, parent="data")
+nume += check_ok(10, d)
+nume += check_simple(10, n, [ "mstr", "mconst", "mlut" ])
+
+;  11: gd_nframes check
+n = gd_nframes(d)
+nume += check_ok(11, d)
+nume += check_simple(11, n, 10)
+
+;  12: gd_spf check
+n = gd_spf(d, "data")
+nume += check_ok(12, d)
+nume += check_simple(12, n, 8)
+
+;  13: gd_putdata check
+gd_putdata, d, "data", [13, 14, 15, 16], first_frame=5, first_sample=1
+nume += check_ok2(13, 1, d)
+
+n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1)
+nume += check_ok2(13, 2, d)
+nume += check_simple(13, n, [ 41, 13, 14, 15, 16, 46, 47, 48])
+
+;  122: gd_putdata (float) check
+gd_putdata, d, "data", [23., 24., 25., 26.], first_frame=5, first_sample=1
+nume += check_ok2(122, 1, d)
+
+n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1)
+nume += check_ok2(122, 2, d)
+nume += check_simple(122, n, [ 41, 23, 24, 25, 26, 46, 47, 48])
+
+;  124: gd_putdata (complex) check
+gd_putdata, d, "data", [COMPLEX(33,0), COMPLEX(34,0), COMPLEX(35,0), $
+  COMPLEX(36,0)], first_frame=5, first_sample=1
+nume += check_ok2(124, 1, d)
+
+n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1)
+nume += check_ok2(124, 2, d)
+nume += check_simple(124, n, [ 41, 33, 34, 35, 36, 46, 47, 48])
+
+;  14: gd_error_string check
+n = gd_getdata(d, "x", num_frames=1, estring=estring)
+nume += check_error(14, d, !GD.E_BAD_CODE)
+nume += check_simple2(14, 1, gd_error_string(d), "Field not found: x")
+nume += check_simple2(14, 2, estring, "Field not found: x")
+
+;  15: gd_entry_type check
+n = gd_entry_type(d, "data")
+nume += check_ok(15, d)
+nume += check_simple(15, n, !GD.RAW_ENTRY)
+
+;  16: gd_entry (raw)
+n = gd_entry(d, "data")
+nume += check_ok(16, d)
+nume += check_simple2(16, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(16, 2, n.field, "data")
+nume += check_simple2(16, 3, n.fragment, 0)
+nume += check_simple2(16, 4, n.data_type, !GD.INT8)
+nume += check_simple2(16, 5, n.spf, 8)
+
+;  18: gd_entry (lincom)
+n = gd_entry(d, "lincom")
+nume += check_ok(18, d)
+nume += check_simple2(18, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(18, 2, n.field, "lincom")
+nume += check_simple2(18, 3, n.fragment, 0)
+nume += check_simple2(18, 4, n.n_fields, 3)
+nume += check_simple2(18, 5, n.in_fields, [ "data", "INDEX", "linterp" ])
+nume += check_simple2(18, 6, n.comp_scal, 1)
+nume += check_simple2(18, 7, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $
+  DCOMPLEX(5.5D,0) ])
+nume += check_simple2(18, 8, n.cb, [ DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), $
+  DCOMPLEX(5.5D,0) ])
+nume += check_simple2(18, 9, n.scalar, [ "", "", "const", "", "", "const" ])
+
+;  20: gd_entry (polynom)
+n = gd_entry(d, "polynom")
+nume += check_ok(20, d)
+nume += check_simple2(20, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(20, 2, n.field, "polynom")
+nume += check_simple2(20, 3, n.fragment, 0)
+nume += check_simple2(20, 4, n.poly_ord, 5)
+nume += check_simple2(20, 5, n.in_fields, [ "data" ])
+nume += check_simple2(20, 6, n.comp_scal, 1)
+nume += check_simple2(20, 7, n.ca, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $
+  DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), DCOMPLEX(5.5D,0), DCOMPLEX(5.5D,0) ])
+nume += check_simple2(20, 8, n.scalar, [ "", "", "", "", "const", "const" ])
+
+;  21: gd_entry (linterp)
+n = gd_entry(d, "linterp")
+nume += check_ok(21, d)
+nume += check_simple2(21, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(21, 2, n.field, "linterp")
+nume += check_simple2(21, 3, n.fragment, 0)
+nume += check_simple2(21, 4, n.in_fields, [ "data" ])
+nume += check_simple2(21, 5, n.table, "./lut")
+
+;  22: gd_entry (bit)
+n = gd_entry(d, "bit")
+nume += check_ok(22, d)
+nume += check_simple2(22, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(22, 2, n.field, "bit")
+nume += check_simple2(22, 3, n.fragment, 0)
+nume += check_simple2(22, 4, n.in_fields, [ "data" ])
+nume += check_simple2(22, 5, n.numbits, 4)
+nume += check_simple2(22, 6, n.bitnum, 3)
+
+;  23: gd_entry (sbit)
+n = gd_entry(d, "sbit")
+nume += check_ok(23, d)
+nume += check_simple2(23, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(23, 2, n.field, "sbit")
+nume += check_simple2(23, 3, n.fragment, 0)
+nume += check_simple2(23, 4, n.in_fields, [ "data" ])
+nume += check_simple2(23, 5, n.numbits, 6)
+nume += check_simple2(23, 6, n.bitnum, 5)
+
+;  24: gd_entry (multiply)
+n = gd_entry(d, "mult")
+nume += check_ok(24, d)
+nume += check_simple2(24, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(24, 2, n.field, "mult")
+nume += check_simple2(24, 3, n.fragment, 0)
+nume += check_simple2(24, 4, n.in_fields, [ "data", "sbit" ])
+
+;  25: gd_entry (phase)
+n = gd_entry(d, "phase")
+nume += check_ok(25, d)
+nume += check_simple2(25, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(25, 2, n.field, "phase")
+nume += check_simple2(25, 3, n.fragment, 0)
+nume += check_simple2(25, 4, n.in_fields, [ "data" ])
+nume += check_simple2(25, 5, n.shift, 11)
+
+;  26: gd_entry (const)
+n = gd_entry(d, "const")
+nume += check_ok(26, d)
+nume += check_simple2(26, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(26, 2, n.field, "const")
+nume += check_simple2(26, 3, n.fragment, 0)
+nume += check_simple2(26, 4, n.data_type, !GD.FLOAT64)
+
+;  134: gd_entry (string)
+n = gd_entry(d, "string")
+nume += check_ok(134, d)
+nume += check_simple2(134, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(134, 2, n.field, "string")
+nume += check_simple2(134, 3, n.fragment, 0)
+
+;  27: gd_fragment_index check
+n = gd_fragment_index(d, "data")
+nume += check_ok(27, d)
+nume += check_simple(27, n, 0)
+
+;  28: gd_add_raw check
+gd_add_raw, d, "new1", !GD.FLOAT64, spf=3
+nume += check_ok2(28, 1, d)
+
+n = gd_entry(d, "new1")
+nume += check_ok2(28, 2, d)
+nume += check_simple2(28, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(28, 2, n.field, "new1")
+nume += check_simple2(28, 3, n.fragment, 0)
+nume += check_simple2(28, 4, n.data_type, !GD.FLOAT64)
+nume += check_simple2(28, 5, n.spf, 3)
+
+;  30: gd_add_lincom
+gd_add_lincom, d, "new2", "in1", COMPLEX(1.1, 1.2), COMPLEX(1.3, 1.4), $
+  "in2", COMPLEX(1.4, 1.5), COMPLEX(1.6, 1.7)
+nume += check_ok2(30, 1, d)
+
+n = gd_entry(d, "new2")
+nume += check_ok2(30, 2, d)
+nume += check_simple2(30, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(30, 2, n.field, "new2")
+nume += check_simple2(30, 3, n.fragment, 0)
+nume += check_simple2(30, 4, n.n_fields, 2)
+nume += check_simple2(30, 5, n.in_fields, [ "in1", "in2" ])
+nume += check_simple2(30, 6, n.comp_scal, 1)
+nume += check_simple2(30, 7, n.cm, [ DCOMPLEX(1.1,1.2), DCOMPLEX(1.4,1.5) ])
+nume += check_simple2(30, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ])
+
+;  32: gd_add_polynom
+gd_add_polynom, d, "new4", "in1", DCOMPLEX(3.1,7.0D), DCOMPLEX(4.2,8.0), $
+  DCOMPLEX(5.2,9.0), DCOMPLEX(6.3,4.4)
+nume += check_ok2(32, 1, d)
+
+n = gd_entry(d, "new4")
+nume += check_ok2(32, 2, d)
+nume += check_simple2(32, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(32, 2, n.field, "new4")
+nume += check_simple2(32, 3, n.fragment, 0)
+nume += check_simple2(32, 4, n.poly_ord, 3)
+nume += check_simple2(32, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(32, 6, n.comp_scal, 1)
+nume += check_simple2(32, 7, n.ca, [ DCOMPLEX(3.1,7.0D), DCOMPLEX(4.2,8.0), $
+  DCOMPLEX(5.2,9.0), DCOMPLEX(6.3,4.4) ])
+
+;  33: gd_add_linterp
+gd_add_linterp, d, "new6", "in", "./some/table"
+nume += check_ok2(33, 1, d)
+
+n = gd_entry(d, "new6")
+nume += check_ok2(33, 2, d)
+nume += check_simple2(33, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(33, 2, n.field, "new6")
+nume += check_simple2(33, 3, n.fragment, 0)
+nume += check_simple2(33, 4, n.in_fields, [ "in" ])
+nume += check_simple2(33, 5, n.table, "./some/table")
+
+;  34: gd_add_bit
+gd_add_bit, d, "new7", "in1", bitnum=11, numbits=22
+nume += check_ok2(34, 1, d)
+
+n = gd_entry(d, "new7")
+nume += check_ok2(34, 2, d)
+nume += check_simple2(34, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(34, 2, n.field, "new7")
+nume += check_simple2(34, 3, n.fragment, 0)
+nume += check_simple2(34, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(34, 5, n.numbits, 22)
+nume += check_simple2(34, 6, n.bitnum, 11)
+
+;  35: gd_add_sbit
+gd_add_sbit, d, "new8", "in2", bitnum=5, numbits=10
+nume += check_ok2(35, 1, d)
+
+n = gd_entry(d, "new8")
+nume += check_ok2(35, 2, d)
+nume += check_simple2(35, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(35, 2, n.field, "new8")
+nume += check_simple2(35, 3, n.fragment, 0)
+nume += check_simple2(35, 4, n.in_fields, [ "in2" ])
+nume += check_simple2(35, 5, n.numbits, 10)
+nume += check_simple2(35, 6, n.bitnum, 5)
+
+;  36: gd_add_multiply
+gd_add_multiply, d, "new9", "in2", "in3"
+nume += check_ok2(36, 1, d)
+
+n = gd_entry(d, "new9")
+nume += check_ok(36, d)
+nume += check_simple2(36, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(36, 2, n.field, "new9")
+nume += check_simple2(36, 3, n.fragment, 0)
+nume += check_simple2(36, 4, n.in_fields, [ "in2", "in3" ])
+
+;  37: gd_add_phase
+gd_add_phase, d, "new10", "in6", 42
+nume += check_ok2(37, 1, d)
+
+n = gd_entry(d, "new10")
+nume += check_ok2(37, 2, d)
+nume += check_simple2(37, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(37, 2, n.field, "new10")
+nume += check_simple2(37, 3, n.fragment, 0)
+nume += check_simple2(37, 4, n.in_fields, [ "in6" ])
+nume += check_simple2(37, 5, n.shift, 42)
+
+;  38: gd_add_const
+gd_add_const, d, "new11", type=!GD.FLOAT64, value=4.3D
+nume += check_ok2(38, 1, d)
+
+n = gd_entry(d, "new11")
+nume += check_ok2(38, 2, d)
+nume += check_simple2(38, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(38, 2, n.field, "new11")
+nume += check_simple2(38, 3, n.fragment, 0)
+nume += check_simple2(38, 4, n.data_type, !GD.FLOAT64)
+
+n = gd_get_constant(d, "new11")
+nume += check_ok2(38, 3, d)
+nume += check_simple2(38, 5, n, 4.3D)
+
+;  125: gd_add
+n = {field: "new13", field_type: !GD.PHASE_ENTRY, fragment: 0, $
+  shift: -88L, in_fields: [ "new9" ], scalar: [ "" ], scalar_ind: [ 0 ]}
+gd_add, d, n
+nume += check_ok2(125, 1, d)
+
+n = gd_entry(d, "new13")
+nume += check_ok2(125, 2, d)
+nume += check_simple2(125, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(125, 2, n.field, "new13")
+nume += check_simple2(125, 3, n.fragment, 0)
+nume += check_simple2(125, 4, n.in_fields, [ "new9" ])
+nume += check_simple2(125, 5, n.shift, -88)
+
+;  39: gd_fragmentname
+n = gd_fragmentname(d, 0)
+nume += check_ok(39, d)
+nume += check_eostring(39, n, "test_dirfile/format")
+
+;  40: gd_nfragments
+n = gd_nfragments(d)
+nume += check_ok(40, d)
+nume += check_simple(40, n, 1)
+
+;  41: gd_include
+gd_include, d, "form2"
+nume += check_ok2(41, 1, d)
+
+n = gd_get_constant(d, "const2", type=!GD.INT16)
+nume += check_ok2(41, 2, d)
+nume += check_simple(41, n, -19)
+
+;  42: gd_nfields_by_type check
+n = gd_nfields(d,type=!GD.LINCOM_ENTRY)
+nume += check_ok(42, d)
+nume += check_simple(42, n, 2)
+
+;  43: gd_field_list_by_type check
+n = gd_field_list(d, type=!GD.LINCOM_ENTRY)
+nume += check_ok(43, d)
+nume += check_simple(43, n, [ "lincom", "new2"  ])
+
+;  44: gd_nvectors check
+n = gd_nvectors(d)
+nume += check_ok(44, d)
+nume += check_simple(44, n, 23)
+
+;  45: 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' ])
+
+;  46: gd_madd_lincom
+gd_add_lincom, d, "mnew2", "in1", 9.9D, 8.8D, "in2", 7.7D, 6.6D, $
+  parent="data"
+nume += check_ok2(46, 1, d)
+
+n = gd_entry(d, "data/mnew2")
+nume += check_ok2(46, 2, d)
+nume += check_simple2(46, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(46, 2, n.field, "data/mnew2")
+nume += check_simple2(46, 3, n.fragment, 0)
+nume += check_simple2(46, 4, n.n_fields, 2)
+nume += check_simple2(46, 5, n.in_fields, [ "in1", "in2" ])
+nume += check_simple2(46, 6, n.comp_scal, 0)
+nume += check_simple2(46, 7, n.m, [ 9.9D, 7.7D ])
+nume += check_simple2(46, 8, n.b, [ 8.8D, 6.6D ])
+
+;  48: gd_madd_polynom
+gd_add_polynom, d, "mnew4", "in1", [ 3.3D, 4.4D, 5.5D, 6.6D ], $
+  parent="data"
+nume += check_ok2(48, 1, d)
+
+n = gd_entry(d, "data/mnew4")
+nume += check_ok2(48, 2, d)
+nume += check_simple2(48, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(48, 2, n.field, "data/mnew4")
+nume += check_simple2(48, 3, n.fragment, 0)
+nume += check_simple2(48, 4, n.poly_ord, 3)
+nume += check_simple2(48, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(48, 6, n.comp_scal, 0)
+nume += check_simple2(48, 7, n.a, [ 3.3D, 4.4D, 5.5D, 6.6D ])
+
+;  50: gd_madd_linterp
+gd_add_linterp, d, "mnew6", "in", "./more/table", parent="data"
+nume += check_ok2(50, 1, d)
+
+n = gd_entry(d, "data/mnew6")
+nume += check_ok2(50, 2, d)
+nume += check_simple2(50, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(50, 2, n.field, "data/mnew6")
+nume += check_simple2(50, 3, n.fragment, 0)
+nume += check_simple2(50, 4, n.in_fields, [ "in" ])
+nume += check_simple2(50, 5, n.table, "./more/table")
+
+;  51: gd_madd_bit
+gd_add_bit, d, "mnew7", "in1", bitnum=21, numbits=12, parent="data"
+nume += check_ok2(51, 1, d)
+
+n = gd_entry(d, "data/mnew7")
+nume += check_ok2(51, 2, d)
+nume += check_simple2(51, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(51, 2, n.field, "data/mnew7")
+nume += check_simple2(51, 3, n.fragment, 0)
+nume += check_simple2(51, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(51, 5, n.numbits, 12)
+nume += check_simple2(51, 6, n.bitnum, 21)
+
+;  52: gd_madd_sbit
+gd_add_sbit, d, "mnew8", "in3", bitnum=2, numbits=14, parent="data"
+nume += check_ok2(52, 1, d)
+
+n = gd_entry(d, "data/mnew8")
+nume += check_ok2(52, 2, d)
+nume += check_simple2(52, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(52, 2, n.field, "data/mnew8")
+nume += check_simple2(52, 3, n.fragment, 0)
+nume += check_simple2(52, 4, n.in_fields, [ "in3" ])
+nume += check_simple2(52, 5, n.numbits, 14)
+nume += check_simple2(52, 6, n.bitnum, 2)
+
+;  53: gd_madd_multiply
+gd_add_multiply, d, "mnew9", "in4", "in1", parent="data"
+nume += check_ok2(53, 1, d)
+
+n = gd_entry(d, "data/mnew9")
+nume += check_ok2(53, 2, d)
+nume += check_simple2(53, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(53, 2, n.field, "data/mnew9")
+nume += check_simple2(53, 3, n.fragment, 0)
+nume += check_simple2(53, 4, n.in_fields, [ "in4", "in1" ])
+
+;  54: gd_madd_phase
+gd_add_phase, d, "mnew10", "in1", -4, parent="data"
+nume += check_ok2(54, 1, d)
+
+n = gd_entry(d, "data/mnew10")
+nume += check_ok2(54, 2, d)
+nume += check_simple2(54, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(54, 2, n.field, "data/mnew10")
+nume += check_simple2(54, 3, n.fragment, 0)
+nume += check_simple2(54, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(54, 5, n.shift, -4)
+
+;  55: gd_madd_const
+gd_add_const, d, "mnew11", type=!GD.UINT64, parent="data"
+nume += check_ok2(55, 1, d)
+
+n = gd_entry(d, "data/mnew11")
+nume += check_ok2(55, 2, d)
+nume += check_simple2(55, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(55, 2, n.field, "data/mnew11")
+nume += check_simple2(55, 3, n.fragment, 0)
+nume += check_simple2(55, 4, n.data_type, !GD.UINT64)
+
+;  126: gd_madd
+n = {field: "mnew13", field_type: !GD.PHASE_ENTRY, fragment: 0, $
+  shift: 2L, in_fields: [ "in1" ], scalar: [ "" ], scalar_ind: [ 0 ]}
+gd_add, d, n, parent="data"
+nume += check_ok2(126, 1, d)
+
+n = gd_entry(d, "data/mnew13")
+nume += check_ok2(126, 2, d)
+nume += check_simple2(126, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(126, 2, n.field, "data/mnew13")
+nume += check_simple2(126, 3, n.fragment, 0)
+nume += check_simple2(126, 4, n.in_fields, [ "in1" ])
+nume += check_simple2(126, 5, n.shift, 2)
+
+;  56: gd_get_string
+n = gd_get_string(d, "string")
+nume += check_ok(56, d)
+nume += check_simple(56, n, "Zaphod Beeblebrox")
+
+;  57: gd_add_string
+gd_add_string, d, "new12", value="a string"
+nume += check_ok2(57, 1, d)
+
+n = gd_entry(d, "new12")
+nume += check_ok2(57, 2, d)
+nume += check_simple2(57, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(57, 2, n.field, "new12")
+nume += check_simple2(57, 3, n.fragment, 0)
+
+n = gd_get_string(d, "new12")
+nume += check_ok2(57, 3, d)
+nume += check_simple2(57, 4, n, "a string")
+
+;  58: gd_madd_string
+gd_add_string, d, "mnew12", value="another string", parent="data"
+nume += check_ok2(58, 1, d)
+
+n = gd_entry(d, "data/mnew12")
+nume += check_ok2(58, 2, d)
+nume += check_simple2(58, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(58, 2, n.field, "data/mnew12")
+nume += check_simple2(58, 3, n.fragment, 0)
+
+n = gd_get_string(d, "data/mnew12")
+nume += check_ok2(58, 3, d)
+nume += check_simple2(58, 4, n, "another string")
+
+;  59: gd_add_spec
+gd_add_spec, d, 'lorem STRING "Lorem ipsum"'
+nume += check_ok2(59, 1, d)
+
+n = gd_entry(d, "lorem")
+nume += check_ok2(59, 2, d)
+nume += check_simple2(59, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(59, 2, n.field, "lorem")
+nume += check_simple2(59, 3, n.fragment, 0)
+
+n = gd_get_string(d, "lorem")
+nume += check_ok2(59, 3, d)
+nume += check_simple2(59, 4, n, "Lorem ipsum")
+
+;  60: gd_madd_string
+gd_add_spec, d, 'ipsum STRING "dolor sit amet."', parent="lorem"
+nume += check_ok2(60, 1, d)
+
+n = gd_entry(d, "lorem/ipsum")
+nume += check_ok2(60, 2, d)
+nume += check_simple2(60, 1, n.field_type, !GD.STRING_ENTRY)
+nume += check_simple2(60, 2, n.field, "lorem/ipsum")
+nume += check_simple2(60, 3, n.fragment, 0)
+
+n = gd_get_string(d, "lorem/ipsum")
+nume += check_ok2(60, 3, d)
+nume += check_simple2(60, 4, n, "dolor sit amet.")
+
+;  61: gd_put_constant
+gd_put_constant, d, "const", 61
+nume += check_ok2(61, 1, d)
+
+n = gd_get_constant(d, "const", type=!GD.INT32)
+nume += check_ok2(61, 2, d)
+nume += check_simple(61, n, 61)
+
+;  62: gd_put_string
+gd_put_string, d, "string", "Arthur Dent"
+nume += check_ok2(62, 1, d)
+
+n = gd_get_string(d, "string")
+nume += check_ok2(62, 2, d)
+nume += check_simple(62, n, "Arthur Dent")
+
+;  63: gd_nmfields_by_type
+n = gd_nfields(d, parent="data", type=!GD.LINCOM_ENTRY)
+nume += check_ok(63, d)
+nume += check_simple(63, n, 1)
+
+;  64: gd_mfield_list_by_type
+n = gd_field_list(d, parent="data", type=!GD.LINCOM_ENTRY)
+nume += check_ok(64, d)
+nume += check_simple(64, n, [ "mnew2" ])
+
+;  65: gd_nmvectors
+n = gd_nvectors(d, parent="data")
+nume += check_ok(65, d)
+nume += check_simple(65, n, 9)
+
+;  66: gd_mvector_list check
+n = gd_vector_list(d, parent="data")
+nume += check_ok(66, d)
+nume += check_simple(66, n, [ 'mlut', 'mnew2', 'mnew4', 'mnew6', $
+  'mnew7', 'mnew8', 'mnew9', 'mnew10', 'mnew13' ])
+
+;  67: gd_alter_raw check
+gd_alter_raw, d, "new1", type=!GD.INT32
+nume += check_ok2(67, 1, d)
+
+n = gd_entry(d, "new1")
+nume += check_ok2(67, 2, d)
+nume += check_simple2(67, 1, n.field_type, !GD.RAW_ENTRY)
+nume += check_simple2(67, 2, n.field, "new1")
+nume += check_simple2(67, 3, n.fragment, 0)
+nume += check_simple2(67, 4, n.data_type, !GD.INT32)
+nume += check_simple2(67, 5, n.spf, 3)
+
+;  69: gd_alter_lincom
+gd_alter_lincom, d, "new2", in_fields=[ "in3", "in4" ], $
+  m=[ COMPLEX(2.3, 4.5), COMPLEX(6.7, 8.9) ]
+nume += check_ok2(69, 1, d)
+
+n = gd_entry(d, "new2")
+nume += check_ok2(69, 2, d)
+nume += check_simple2(69, 1, n.field_type, !GD.LINCOM_ENTRY)
+nume += check_simple2(69, 2, n.field, "new2")
+nume += check_simple2(69, 3, n.fragment, 0)
+nume += check_simple2(69, 4, n.n_fields, 2)
+nume += check_simple2(69, 5, n.in_fields, [ "in3", "in4" ])
+nume += check_simple2(69, 6, n.comp_scal, 1)
+nume += check_simple2(69, 7, n.cm, [ DCOMPLEX(2.3,4.5), DCOMPLEX(6.7,8.9) ])
+nume += check_simple2(69, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ])
+
+;  71: gd_alter_polynom
+gd_alter_polynom, d, "new4", poly_ord=4, a=[ DCOMPLEX(1.2,3.4), $
+  DCOMPLEX(5.6,7.8), DCOMPLEX(9.0,1.2), DCOMPLEX(3.4,5.6), DCOMPLEX(7.8,9.0) ]
+nume += check_ok2(71, 1, d)
+
+n = gd_entry(d, "new4")
+nume += check_ok2(71, 2, d)
+nume += check_simple2(71, 1, n.field_type, !GD.POLYNOM_ENTRY)
+nume += check_simple2(71, 2, n.field, "new4")
+nume += check_simple2(71, 3, n.fragment, 0)
+nume += check_simple2(71, 4, n.poly_ord, 4)
+nume += check_simple2(71, 5, n.in_fields, [ "in1" ])
+nume += check_simple2(71, 6, n.comp_scal, 1)
+nume += check_simple2(71, 7, n.ca, [ DCOMPLEX(1.2,3.4), DCOMPLEX(5.6,7.8), $
+  DCOMPLEX(9.0,1.2), DCOMPLEX(3.4,5.6), DCOMPLEX(7.8,9.0) ])
+
+;  72: gd_alter_linterp
+gd_alter_linterp, d, "new6", table="./other/table"
+nume += check_ok2(72, 1, d)
+
+n = gd_entry(d, "new6")
+nume += check_ok2(72, 2, d)
+nume += check_simple2(72, 1, n.field_type, !GD.LINTERP_ENTRY)
+nume += check_simple2(72, 2, n.field, "new6")
+nume += check_simple2(72, 3, n.fragment, 0)
+nume += check_simple2(72, 4, n.in_fields, [ "in" ])
+nume += check_simple2(72, 5, n.table, "./other/table")
+
+;  73: gd_alter_bit
+gd_alter_bit, d, "new7", in_field="in3",  numbits=8
+nume += check_ok2(73, 1, d)
+
+n = gd_entry(d, "new7")
+nume += check_ok2(73, 2, d)
+nume += check_simple2(73, 1, n.field_type, !GD.BIT_ENTRY)
+nume += check_simple2(73, 2, n.field, "new7")
+nume += check_simple2(73, 3, n.fragment, 0)
+nume += check_simple2(73, 4, n.in_fields, [ "in3" ])
+nume += check_simple2(73, 5, n.numbits, 8)
+nume += check_simple2(73, 6, n.bitnum, 11)
+
+;  74: gd_alter_sbit
+gd_alter_sbit, d, "new8", bitnum=15, numbits=1
+nume += check_ok2(74, 1, d)
+
+n = gd_entry(d, "new8")
+nume += check_ok2(74, 2, d)
+nume += check_simple2(74, 1, n.field_type, !GD.SBIT_ENTRY)
+nume += check_simple2(74, 2, n.field, "new8")
+nume += check_simple2(74, 3, n.fragment, 0)
+nume += check_simple2(74, 4, n.in_fields, [ "in2" ])
+nume += check_simple2(74, 5, n.numbits, 1)
+nume += check_simple2(74, 6, n.bitnum, 15)
+
+;  75: gd_alter_multiply
+gd_alter_multiply, d, "new9", in_field1="in6"
+nume += check_ok2(75, 1, d)
+
+n = gd_entry(d, "new9")
+nume += check_ok(75, d)
+nume += check_simple2(75, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(75, 2, n.field, "new9")
+nume += check_simple2(75, 3, n.fragment, 0)
+nume += check_simple2(75, 4, n.in_fields, [ "in6", "in3" ])
+
+;  76: gd_alter_phase
+gd_alter_phase, d, "new10", shift=76
+nume += check_ok2(76, 1, d)
+
+n = gd_entry(d, "new10")
+nume += check_ok2(76, 2, d)
+nume += check_simple2(76, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(76, 2, n.field, "new10")
+nume += check_simple2(76, 3, n.fragment, 0)
+nume += check_simple2(76, 4, n.in_fields, [ "in6" ])
+nume += check_simple2(76, 5, n.shift, 76)
+
+;  77: gd_alter_const
+gd_alter_const, d, "new11", type=!GD.FLOAT32
+nume += check_ok2(77, 1, d)
+
+n = gd_entry(d, "new11")
+nume += check_ok2(77, 2, d)
+nume += check_simple2(77, 1, n.field_type, !GD.CONST_ENTRY)
+nume += check_simple2(77, 2, n.field, "new11")
+nume += check_simple2(77, 3, n.fragment, 0)
+nume += check_simple2(77, 4, n.data_type, !GD.FLOAT32)
+
+;  141: gd_alter
+n = {field_type: !GD.PHASE_ENTRY, shift: -8L}
+gd_alter_entry, d, "new13", n
+nume += check_ok2(141, 1, d)
+
+n = gd_entry(d, "new13")
+nume += check_ok2(141, 2, d)
+nume += check_simple2(141, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(141, 2, n.field, "new13")
+nume += check_simple2(141, 3, n.fragment, 0)
+nume += check_simple2(141, 4, n.in_fields, [ "new9" ])
+nume += check_simple2(141, 5, n.shift, -8)
+
+;  78: gd_encoding
+n = gd_encoding(d, fragment=0)
+nume += check_ok(78, d)
+nume += check_simple(78, n, !GD.UNENCODED)
+
+;  79: gd_endianness
+n = gd_endianness(d, fragment=0)
+nume += check_ok(79, d)
+nume += check_simple(79, n, (!GD.LITTLE_ENDIAN + !GD.NOT_ARM_ENDIAN))
+
+;  80: dirfilename
+n = gd_dirfilename(d)
+nume += check_ok(80, d)
+nume += check_eostring(80, n, "test_dirfile")
+
+;  81: gd_parent_fragment
+n = gd_parent_fragment(d, fragment=1)
+nume += check_ok(81, d)
+nume += check_simple(80, n, 0)
+
+;  82: gd_alter_protection
+gd_alter_protection, d, !GD.PROTECT_DATA, fragment=1
+nume += check_ok(82, d)
+
+;  83: gd_protection
+n = gd_protection(d, fragment=1)
+nume += check_ok(83, d)
+nume += check_simple(83, n, !GD.PROTECT_DATA)
+
+;  84: gd_raw_filename
+n = gd_raw_filename(d, 'data')
+nume += check_ok(84, d)
+nume += check_eostring(84, n, "test_dirfile/data")
+
+;  85: gd_reference
+gd_reference, d, "new1"
+nume += check_ok(85, d)
+
+;  87: gd_alter_encoding
+gd_alter_encoding, d, !GD.SLIM_ENCODED, fragment=1
+nume += check_ok2(87, 1, d)
+
+n = gd_encoding(d, fragment=1)
+nume += check_ok2(87, 2, d)
+nume += check_simple(87, n, !GD.SLIM_ENCODED)
+
+;  88: gd_alter_endianness
+gd_alter_endianness, d, /big_endian, fragment=1
+nume += check_ok2(88, 1, d)
+
+n = gd_endianness(d, fragment=1)
+nume += check_ok2(88, 2, d)
+nume += check_simple(88, n, !GD.BIG_ENDIAN)
+
+;  89: gd_alter_spec
+gd_alter_spec, d, "new10 PHASE in 3"
+nume += check_ok2(89, 1, d)
+
+n = gd_entry(d, "new10")
+nume += check_ok2(89, 2, d)
+nume += check_simple2(89, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(89, 2, n.field, "new10")
+nume += check_simple2(89, 3, n.fragment, 0)
+nume += check_simple2(89, 4, n.in_fields, [ "in" ])
+nume += check_simple2(89, 5, n.shift, 3)
+
+;  90: gd_delete
+gd_delete, d, "new10"
+nume += check_ok2(90, 1, d)
+
+n = gd_entry(d, "new10")
+nume += check_error2(90, 2, d, !GD.E_BAD_CODE)
+
+;  91: gd_malter_spec
+gd_alter_spec, d, "mnew10 PHASE in4 11", parent="data"
+nume += check_ok2(91, 1, d)
+
+n = gd_entry(d, "data/mnew10")
+nume += check_ok2(91, 2, d)
+nume += check_simple2(91, 1, n.field_type, !GD.PHASE_ENTRY)
+nume += check_simple2(91, 2, n.field, "data/mnew10")
+nume += check_simple2(91, 3, n.fragment, 0)
+nume += check_simple2(91, 4, n.in_fields, [ "in4" ])
+nume += check_simple2(91, 5, n.shift, 11)
+
+;  92: gd_move
+gd_move, d, "new9", 1
+nume += check_ok2(92, 1, d)
+
+n = gd_entry(d, "new9")
+nume += check_ok2(92, 2, d)
+nume += check_simple2(92, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(92, 2, n.field, "new9")
+nume += check_simple2(92, 3, n.fragment, 1)
+
+;  93: gd_rename
+gd_rename, d, "new9", "newer"
+nume += check_ok2(93, 1, d)
+
+n = gd_entry(d, "new9")
+nume += check_error2(93, 2, d, !GD.E_BAD_CODE)
+
+n = gd_entry(d, "newer")
+nume += check_ok2(93, 3, d)
+nume += check_simple2(93, 1, n.field_type, !GD.MULTIPLY_ENTRY)
+nume += check_simple2(93, 2, n.field, "newer")
+nume += check_simple2(93, 3, n.fragment, 1)
+
+;  94: gd_uninclude
+gd_uninclude, d, 1
+nume += check_ok2(94, 1, d)
+
+n = gd_entry(d, "newer")
+nume += check_error2(94, 2, d, !GD.E_BAD_CODE)
+
+;  95: gd_frameoffset
+n = gd_frameoffset(d,fragment=0)
+nume += check_ok(95,d)
+nume += check_simple(95,n,0)
+
+;  96: gd_alter_frameoffset
+gd_alter_frameoffset, d, 33, fragment=0
+nume += check_ok2(96,1,d)
+
+n = gd_frameoffset(d,fragment=0)
+nume += check_ok(96,d)
+nume += check_simple(96,n,33)
+
+;  97: gd_native_type
+n = gd_native_type(d, "data")
+nume += check_ok(97, d)
+nume += check_simple(97,n,!GD.INT8)
+
+;  99: gd_validate
+n =  gd_validate(d, "new7")
+nume += check_error(99,d,!GD.E_BAD_CODE)
+nume += check_simple(99,n,-1)
+
+;  101: gd_framenum
+n = gd_framenum(d, "data", 33.3, field_start=6)
+nume += check_ok(101,d)
+nume += check_float(101, n, 37.037500D)
+
+;  86: gd_eof
+n = gd_eof(d, "lincom")
+nume += check_ok(86,d)
+nume += check_simple(86,n,344)
+
+;  142: gd_bof
+n = gd_bof(d, "lincom")
+nume += check_ok(142,d)
+nume += check_simple(142,n,264)
+
+;  143: gd_entry (divide)
+n = gd_entry(d, "div")
+nume += check_ok(143, d)
+nume += check_simple2(143, 1, n.field_type, !GD.DIVIDE_ENTRY)
+nume += check_simple2(143, 2, n.field, "div")
+nume += check_simple2(143, 3, n.fragment, 0)
+nume += check_simple2(143, 4, n.in_fields, [ "mult", "bit" ])
+
+;  145: gd_entry (recip)
+n = gd_entry(d, "recip")
+nume += check_ok(145, d)
+nume += check_simple2(145, 1, n.field_type, !GD.RECIP_ENTRY)
+nume += check_simple2(145, 2, n.field, "recip")
+nume += check_simple2(145, 3, n.fragment, 0)
+nume += check_simple2(145, 4, n.in_fields, [ "div" ])
+nume += check_simple2(145, 5, n.comp_scal, 1)
+nume += check_simple2(145, 6, n.cdividend, DCOMPLEX(6.5D,4.3D))
+
+;  146: gd_add_divide
+gd_add_divide, d, "new14", "in2", "in3"
+nume += check_ok2(146, 1, d)
+
+n = gd_entry(d, "new14")
+nume += check_ok(146, d)
+nume += check_simple2(146, 1, n.field_type, !GD.DIVIDE_ENTRY)
+nume += check_simple2(146, 2, n.field, "new14")
+nume += check_simple2(146, 3, n.fragment, 0)
+nume += check_simple2(146, 4, n.in_fields, [ "in2", "in3" ])
+
+;  148: gd_add_recip
+gd_add_recip, d, "new16", "in2", dividend=COMPLEX(33.3, 44.4)
+nume += check_ok2(148, 1, d)
+
+n = gd_entry(d, "new16")
+nume += check_ok(148, d)
+nume += check_simple2(148, 1, n.field_type, !GD.RECIP_ENTRY)
+nume += check_simple2(148, 2, n.field, "new16")
+nume += check_simple2(148, 3, n.fragment, 0)
+nume += check_simple2(148, 4, n.in_fields, [ "in2" ])
+nume += check_simple2(148, 5, n.comp_scal, 1)
+nume += check_simple2(148, 6, n.cdividend, DCOMPLEX(33.3, 44.4))
+
+;  152: gd_alter_divide
+gd_alter_divide, d, "new14", in_field1="in6"
+nume += check_ok2(152, 1, d)
+
+n = gd_entry(d, "new14")
+nume += check_ok(152, d)
+nume += check_simple2(152, 1, n.field_type, !GD.DIVIDE_ENTRY)
+nume += check_simple2(152, 2, n.field, "new14")
+nume += check_simple2(152, 3, n.fragment, 0)
+nume += check_simple2(152, 4, n.in_fields, [ "in6", "in3" ])
+
+;  153: gd_alter_recip
+gd_alter_recip, d, "new16", dividend=1.01
+nume += check_ok2(153, 1, d)
+
+n = gd_entry(d, "new16")
+nume += check_ok(153, d)
+nume += check_simple2(153, 1, n.field_type, !GD.RECIP_ENTRY)
+nume += check_simple2(153, 2, n.field, "new16")
+nume += check_simple2(153, 3, n.fragment, 0)
+nume += check_simple2(153, 5, n.comp_scal, 0)
+nume += check_simple2(153, 4, n.in_fields, [ "in2" ])
+nume += check_simple2(153, 6, n.dividend, 1.01)
+
+;  155: gd_rewrite_fragment
+gd_rewrite_fragment, d, fragment=0
+nume += check_ok(155, d)
+
+;  156: gd_invalid_dirfile
+m = gd_invalid_dirfile()
+nume += check_ok2(156, 1, m)
+n = gd_nfragments(m)
+nume += check_error2(156, 2, m, !GD.E_BAD_DIRFILE)
+gd_close, m
+
+;  157: gd_dirfile_standards
+n = gd_dirfile_standards(d, /CURRENT)
+nume += check_ok2(157, 1, d)
+nume += check_simple(157, n, 9)
+n = gd_dirfile_standards(d, 0)
+nume += check_error2(157, 2, d, !GD.E_ARGUMENT)
+
+;  158: gd_get_carray
+n = gd_get_carray(d, "carray", type=!GD.FLOAT32)
+nume += check_ok(158, d)
+nume += check_simple(158, n, [ 1.1, 2.2, 3.3, 4.4, 5.5, 6.6 ])
+
+;  159: gd_get_carray_slice
+n = gd_get_carray(d, "carray", type=!GD.FLOAT32, len=2, start=2)
+nume += check_ok(159, d)
+nume += check_simple(159, n, [ 3.3, 4.4 ])
+
+;  167: gd_carrays
+;  168: gd_put_carray
+m = [ 9.8, 8.7, 7.6, 6.5, 5.4, 4.3 ]
+gd_put_carray, d, "carray", m
+nume += check_ok(168, d)
+
+n = gd_get_carray(d, "carray", type=!GD.FLOAT32)
+nume += check_ok(168, d)
+nume += check_simple(168, n, m)
+
+;  169: gd_put_carray_slice
+gd_put_carray, d, "carray", [ 33, 34 ], start=2
+nume += check_ok(169, d)
+
+n = gd_get_carray(d, "carray", type=!GD.FLOAT32)
+nume += check_ok(169, d)
+nume += check_simple(169, n, [ 9.8, 8.7, 33., 34., 5.4, 4.3 ])
+
+;  177: gd_carray_len
+n = gd_carray_len(d, "carray")
+nume += check_ok(170, d)
+nume += check_simple(170, n, 6)
+
+;  178: gd_entry (CARRAY)
+n = gd_entry(d, "carray")
+nume += check_ok(178, d)
+nume += check_simple2(178, 1, n.field_type, !GD.CARRAY_ENTRY)
+nume += check_simple2(178, 2, n.field, "carray")
+nume += check_simple2(178, 3, n.fragment, 0)
+nume += check_simple2(178, 4, n.data_type, !GD.FLOAT64)
+nume += check_simple2(178, 5, n.array_len, 6)
+
+;  179: gd_add_carray
+gd_add_carray, d, "new17", type=!GD.FLOAT64, value=[3.3D, 4.3D]
+nume += check_ok2(179, 1, d)
+
+n = gd_entry(d, "new17")
+nume += check_ok2(179, 2, d)
+nume += check_simple2(179, 1, n.field_type, !GD.CARRAY_ENTRY)
+nume += check_simple2(179, 2, n.field, "new17")
+nume += check_simple2(179, 3, n.fragment, 0)
+nume += check_simple2(179, 4, n.data_type, !GD.FLOAT64)
+nume += check_simple2(179, 5, n.array_len, 2)
+
+n = gd_get_carray(d, "new17")
+nume += check_ok2(179, 3, d)
+nume += check_simple2(179, 5, n, [3.3D, 4.3D])
+
+;  180: gd_madd_carray
+gd_add_carray, d, "mnew17", type=!GD.INT16, parent="data", value=[33, 43]
+nume += check_ok2(180, 1, d)
+
+n = gd_entry(d, "data/mnew17")
+nume += check_ok2(180, 2, d)
+nume += check_simple2(180, 1, n.field_type, !GD.CARRAY_ENTRY)
+nume += check_simple2(180, 2, n.field, "data/mnew17")
+nume += check_simple2(180, 3, n.fragment, 0)
+nume += check_simple2(180, 4, n.data_type, !GD.INT16)
+nume += check_simple2(180, 5, n.array_len, 2)
+
+n = gd_get_carray(d, "data/mnew17", type=!GD.INT16)
+nume += check_ok2(180, 3, d)
+nume += check_simple2(180, 6, n, [33, 43])
+
+;  181: gd_alter_carray
+gd_alter_carray, d, "new17", type=!GD.FLOAT32, len=3
+nume += check_ok2(181, 1, d)
+
+n = gd_entry(d, "new17")
+nume += check_ok2(181, 2, d)
+nume += check_simple2(181, 1, n.field_type, !GD.CARRAY_ENTRY)
+nume += check_simple2(181, 2, n.field, "new17")
+nume += check_simple2(181, 3, n.fragment, 0)
+nume += check_simple2(181, 4, n.data_type, !GD.FLOAT32)
+nume += check_simple2(181, 5, n.array_len, 3)
+
+;  183: gd_constants
+n = gd_constants(d, type=!GD.FLOAT32)
+nume += check_ok(183, d)
+
+;  191: gd_mconstants
+n = gd_constants(d, parent="data", type=!GD.FLOAT32)
+nume += check_ok(191, d)
+nume += check_simple(191, n, [ 3.3, 0. ])
+
+; 199: gd_strings
+n = gd_strings(d)
+nume += check_ok(199, d)
+nume += check_simple(199, n, [ "Lorem ipsum", "a string", "Arthur Dent" ])
+
+; 200: gd_strings
+n = gd_strings(d, parent="data")
+nume += check_ok(200, d)
+nume += check_simple(200, n, [ "This is a string constant.", "another string" ])
+
+; 203: gd_seek
+n = gd_seek(d, "data", frame_num=35)
+nume += check_ok2(203, 0, d)
+m = gd_getdata(d, "data", type=!GD.INT16, num_frames=1)
+nume += check_ok2(203, 1, d)
+nume += check_simple2(203, 0, n, 280)
+nume += check_simple2(203, 1, m, INDGEN(8) + 17)
+
+; 204: gd_tell
+n = gd_tell(d, "data")
+nume += check_ok(204, d)
+nume += check_simple(204, n, 288)
+
+; 205: gd_hide check
+gd_hide, d, 'data'
+nume += check_ok(205, d)
+
+; 206: gd_hidden check
+n = gd_hidden(d, 'data')
+nume += check_ok2(206, 1, d)
+nume += check_simple2(206, 1, n, 1)
+
+n = gd_hidden(d, 'lincom')
+nume += check_ok2(206, 2, d)
+nume += check_simple2(206, 2, n, 0)
+
+; 207: gd_unhide check
+gd_unhide, d, 'data'
+nume += check_ok2(206, 1, d)
+n = gd_hidden(d, 'data')
+nume += check_ok2(206, 2, d)
+nume += check_simple(206, n, 0)
+
+; 208: gd_sync check
+gd_flush, d, field_code='data', /noclose
+nume += check_ok(208, d)
+
+; 209: gd_flush check
+gd_flush, d, field_code='data'
+nume += check_ok(209, d)
+
+; 210: gd_metaflush check
+gd_metaflush, d
+nume += check_ok(210, d)
+
+; 211: gd_entry (WINDOW) check
+n = gd_entry(d, 'window')
+nume += check_ok(211, d)
+nume += check_simple2(211, 1, n.field_type, !GD.WINDOW_ENTRY)
+nume += check_simple2(211, 2, n.fragment, 0)
+nume += check_simple2(211, 3, n.windop, !GD.WINDOP_LT)
+nume += check_simple2(211, 4, n.in_fields, [ 'linterp', 'mult' ])
+nume += check_simple2(211, 6, n.rthreshold, 4.1D0)
+
+; 212: gd_add_window check
+gd_add_window, d, 'new18', 'in1', 'in2', /NE, 32, fragment=0
+nume += check_ok2(212, 1, d)
+
+n = gd_entry(d, 'new18')
+nume += check_ok2(212, 2, d)
+nume += check_simple2(212, 1, n.field_type, !GD.WINDOW_ENTRY)
+nume += check_simple2(212, 2, n.fragment, 0)
+nume += check_simple2(212, 3, n.windop, !GD.WINDOP_NE)
+nume += check_simple2(212, 4, n.in_fields, [ 'in1', 'in2' ])
+nume += check_simple2(212, 6, n.ithreshold, 32)
+
+; 214: gd_madd_window check
+gd_add_window, d, parent='data', 'mnew18', 'in2', 'in3', /SET, 128
+nume += check_ok2(214, 1, d)
+
+n = gd_entry(d, 'data/mnew18')
+nume += check_ok2(214, 2, d)
+nume += check_simple2(214, 1, n.field_type, !GD.WINDOW_ENTRY)
+nume += check_simple2(214, 2, n.fragment, 0)
+nume += check_simple2(214, 3, n.windop, !GD.WINDOP_SET)
+nume += check_simple2(214, 4, n.in_fields, [ 'in2', 'in3' ])
+nume += check_simple2(214, 6, n.uthreshold, 128)
+
+; 217: gd_alter_window check
+gd_alter_window, d, 'new18', in_field='in3', check_field='in4', /GE, $
+  threshold=32e3
+nume += check_ok2(217, 1, d)
+
+n = gd_entry(d, 'new18')
+nume += check_ok2(217, 2, d)
+nume += check_simple2(217, 1, n.field_type, !GD.WINDOW_ENTRY)
+nume += check_simple2(217, 2, n.fragment, 0)
+nume += check_simple2(217, 3, n.windop, !GD.WINDOP_GE)
+nume += check_simple2(217, 4, n.in_fields, [ 'in3', 'in4' ])
+nume += check_simple2(217, 6, n.rthreshold, 32d3)
+
+; 218: gd_alias_target check
+str = gd_alias_target(d, 'alias')
+nume += check_ok(218, d)
+nume += check_simple(218, str, 'data')
+
+; 219: gd_add_alias check
+gd_add_alias, d, 'new20', 'data', fragment=0
+nume += check_ok2(219, 1, d)
+
+str = gd_alias_target(d, 'new20')
+nume += check_ok2(219, 2, d)
+nume += check_simple(219, str, 'data')
+
+; 220: gd_madd_alias check
+gd_add_alias, d, parent='data', 'mnew20', 'data'
+nume += check_ok2(220, 1, d)
+
+str = gd_alias_target(d, 'data/mnew20')
+nume += check_ok2(220, 2, d)
+nume += check_simple(220, str, 'data')
+
+; 221: gd_naliases check
+n = gd_naliases(d, 'data')
+nume += check_ok(221, d)
+nume += check_simple(221, n, 4)
+
+; 222: gd_alias check
+n = gd_aliases(d, 'data')
+nume += check_ok(222, d)
+nume += check_simple(222, n, [ 'data', 'alias', 'data/mnew20', 'new20' ])
+
+; 223: gd_include_affix check
+gd_include, d, 'format1', prefix='A', suffix='Z', /CREAT, /EXCL
+nume += check_ok(223, d)
+
+; 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)
+nume += check_simple(226, n, [ "A", "Z" ])
+
+; 227: gd_alter_affixes check
+gd_alter_affixes, d, fragment=1, prefix='B', suffix=''
+nume += check_ok2(227, 1, d)
+
+n = gd_fragment_affixes(d, fragment=1)
+nume += check_ok2(227, 2, d)
+nume += check_simple(227, n, [ "B", "" ])
+
+; 228: gd_entry (MPLEX) check
+n = gd_entry(d, 'mplex')
+nume += check_ok(228, d)
+nume += check_simple2(228, 1, n.field_type, !GD.MPLEX_ENTRY)
+nume += check_simple2(228, 2, n.fragment, 0)
+nume += check_simple2(228, 3, n.count_val, 1)
+nume += check_simple2(228, 4, n.in_fields, [ 'data', 'sbit' ])
+nume += check_simple2(228, 5, n.period, 10)
+
+; 229: gd_add_mplex check
+gd_add_mplex, d, 'new21', 'in1', 'in2', 5, max=6
+nume += check_ok2(229, 1, d)
+
+n = gd_entry(d, 'new21')
+nume += check_ok2(229, 2, d)
+nume += check_simple2(229, 1, n.field_type, !GD.MPLEX_ENTRY)
+nume += check_simple2(229, 2, n.fragment, 0)
+nume += check_simple2(229, 3, n.count_val, 5)
+nume += check_simple2(229, 4, n.in_fields, [ 'in1', 'in2' ])
+nume += check_simple2(229, 5, n.period, 6)
+
+; 230: gd_madd_mplex check
+gd_add_mplex, d, parent='data', 'mnew21', 'in2', 'in3', 0, max=12
+nume += check_ok2(230, 1, d)
+
+n = gd_entry(d, 'data/mnew21')
+nume += check_ok2(230, 2, d)
+nume += check_simple2(230, 1, n.field_type, !GD.MPLEX_ENTRY)
+nume += check_simple2(230, 2, n.fragment, 0)
+nume += check_simple2(230, 3, n.count_val, 0)
+nume += check_simple2(230, 4, n.in_fields, [ 'in2', 'in3' ])
+nume += check_simple2(230, 5, n.period, 12)
+
+; 231: gd_alter_mplex check
+gd_alter_mplex, d, 'new21', in_field='in3', count_field='in4', count_val=2, $
+  period=7
+nume += check_ok2(231, 1, d)
+
+n = gd_entry(d, 'new21')
+nume += check_ok2(231, 2, d)
+nume += check_simple2(231, 1, n.field_type, !GD.MPLEX_ENTRY)
+nume += check_simple2(231, 2, n.fragment, 0)
+nume += check_simple2(231, 3, n.count_val, 2)
+nume += check_simple2(231, 4, n.in_fields, [ 'in3', 'in4' ])
+nume += check_simple2(231, 5, n.period, 7)
+
+; 232: gd_strtok check
+str = gd_strtok(d, STRING='"test1 test2" test3\ test4')
+nume += check_ok2(232, 1 ,d)
+nume += check_simple2(232, 2, str, "test1 test2")
+
+str = gd_strtok(d)
+nume += check_ok2(232, 3 ,d)
+nume += check_simple2(232, 4, str, "test3 test4")
+
+; 233: gd_raw_close check
+gd_flush, d, field_code='data', /nosync
+nume += check_ok(233, d)
+
+; 234: gd_desync check
+n = gd_desync(d)
+nume += check_ok(234, d)
+nume += check_simple(234, n, 0)
+
+; 235: gd_flags check
+n = gd_flags(d, /PRETTY_PRINT)
+nume += check_ok(235, d)
+nume += check_simple(235, n, !GD.PRETTY_PRINT)
+
+; 236: gd_verbose_prefix
+gd_verbose_prefix, d, prefix="big_test"
+nume += check_ok(236, d)
+
+; 237: gd_nentries check
+n = gd_nentries(d, parent="data", /SCALARS, /HIDDEN, /NOALIAS)
+nume += check_ok2(237, 1, d)
+nume += check_simple2(237, 1, n, 5)
+n = gd_nentries(d, /VECTORS, /HIDDEN, /NOALIAS)
+nume += check_ok2(237, 2, d)
+nume += check_simple2(237, 2, n, 24)
+ 
+; 239: gd_entry_list check
+n = gd_entry_list(d, /VECTORS, /HIDDEN, /NOALIAS)
+nume += check_ok(239, d)
+nume += check_simple(239, n, ["INDEX", "bit", "data", "div", "lincom", $
+  "linterp", "mplex", "mult", "new1", "new13", "new14", "new16", "new18", $
+  "new2", "new21", "new4", "new6", "new7", "new8", "phase", "polynom", $
+  "recip", "sbit", "window"])
+
+; 240: gd_mplex_lookback check
+gd_mplex_lookback, d, /ALL
+nume += check_ok(240, d)
+
+; 241: gd_linterp_tablename
+n = gd_linterp_tablename(d, 'linterp')
+nume += check_ok(241, d)
+nume += check_eostring(241, n, "test_dirfile/lut")
+
+
+
+
+
+; ===============================================================
+; Cleanup
+gd_close, d, /DISCARD
+
+spawn, "rm -rf " + filedir
+
+if (nume gt 0) then print, "nume=", nume
+if (nume gt 0) then exit, /status
+
+exit,status=0
diff --git a/bindings/idl/test/getdata_idl_test_routines.pro b/bindings/idl/test/getdata_idl_test_routines.pro
new file mode 100644
index 0000000..ba7a844
--- /dev/null
+++ b/bindings/idl/test/getdata_idl_test_routines.pro
@@ -0,0 +1,70 @@
+pro timed_demo_mode
+  print,""
+  print,"**********************************************"
+  print,"* The GetData IDL bindings cannot be tested in"
+  print,"* timed demo mode.  All tests will be skipped."
+  print,"**********************************************"
+  print,""
+  exit,status=77
+end
+
+function check_float, t, v, g
+  if (abs(v - g) gt 1e-6) then begin
+    print,"n[", t, "]=", v, ", expected ", g
+    return,1
+  endif
+
+  return,0
+end
+
+function check_simple2, t, m, v, g
+  if (total(v ne g)) then begin
+    print,"n[", t, ",", m, "]=", v, ", expected ", g
+    return,1
+  endif
+
+  return,0
+end
+
+function check_simple, t, v, g
+  if (total(v ne g)) then begin
+    print,"n[", t, "]=", v, ", expected ", g
+    return,1
+  endif
+
+  return,0
+end
+
+function check_error, t, d, ce
+  e = gd_error(d)
+  if (e ne ce) then begin
+    print,"e[", t, "]=", e, ", expected ", ce
+    return,1
+  endif
+
+  return,0
+end
+
+function check_ok, t, d
+  return, check_error(t,d,!GD.E_OK)
+end
+
+function check_error2, t, m, d, ce
+  e = gd_error(d)
+  if (e ne ce) then begin
+    print,"e[", t, ",", m, "]=", e, ", expected ", ce
+    return,1
+  endif
+
+  return,0
+end
+
+function check_ok2, t, m, d
+  return, check_error2(t,m,d,!GD.E_OK)
+end
+
+function check_eostring, t, v, g
+  f = strpos(v, g, /reverse_search)
+  if (f EQ -1) THEN f = 0
+  return, check_simple(t, strmid(v, f), g)
+end
diff --git a/bindings/make_parameters.c b/bindings/make_parameters.c
new file mode 100644
index 0000000..ad92d24
--- /dev/null
+++ b/bindings/make_parameters.c
@@ -0,0 +1,556 @@
+/* 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
+ */
+#ifdef HAVE_CONFIG_H
+#include "gd_config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#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
+ */
+#define CONSTANT(s,f,t) { "GD_" #s, #s, f, GD_ ## s, t }
+static struct {
+  const char* lname; /* Long name */
+  const char* sname; /* Short name */
+  const char* fname; /* F77 name */
+  long int value;
+  int type;
+} constant_list[] = {
+  CONSTANT(E_OK,             "GD_EOK", 0),
+  CONSTANT(E_OPEN,           "GD_EOP", 0),
+  CONSTANT(E_FORMAT,         "GD_EFO", 0),
+  CONSTANT(E_TRUNC,          "GD_ETR", 0),
+  CONSTANT(E_CREAT,          "GD_ECR", 0),
+  CONSTANT(E_BAD_CODE,       "GD_EBC", 0),
+  CONSTANT(E_BAD_TYPE,       "GD_EBT", 0),
+  CONSTANT(E_RAW_IO,         "GD_ERW", 0),
+  CONSTANT(E_OPEN_FRAGMENT,  "GD_EOF", 0),
+  CONSTANT(E_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),
+  { NULL }
+};
+
+static void parameter(const char* cname, const char* name, int value,
+    int free_form)
+{
+  if (free_form)
+    printf("integer, parameter :: %s=%i\\\n", cname, value);
+  else
+    printf(
+        "C     Corresponding to %s\\\n"
+        "      INTEGER %s\\\n"
+        "      PARAMETER (%s=%i)\\\n", cname, name, name, value);
+}
+
+void Fortran(void)
+{
+  int i, j;
+  char c;
+
+  for (i = 0; i < 2; ++i) {
+    c = (i == 0) ? 'C' : '!';
+    if (i == 0)
+      printf("s/@PARAMETERS@/\\\nC     Error codes\\\n");
+    else
+      printf("s/@PARAMETERS95@/\\\n! Error codes\\\n");
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 0)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Open flags\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 1 || constant_list[j].type == 2)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Field types\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 3)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf(
+        "\\\n%c Data types -- the unsigned types won't work when passed as\\\n"
+        "%c               a return type, but we keep them anyways, since\\\n"
+        "%c               they might appear as a result of calling %s\\\n",
+        c, c, c, (i == 0) ? "GDGERW" : "fget_entry");
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 4)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Delete flags\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 5)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Protection levels\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 6)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Callback actions\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 7)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Syntax suberrors\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 8)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("\\\n%c Special version codes\\\n", c);
+
+    for (j = 0; constant_list[j].lname != NULL; ++j)
+      if (constant_list[j].type == 9)
+        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)
+        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)
+        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)
+        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)
+        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)
+        parameter(constant_list[j].lname, constant_list[j].fname,
+            constant_list[j].value, i);
+
+    printf("/\n");
+  }
+  printf("s/@GD_MAX_LINE_LENGTH@/%i/\n", GD_MAX_LINE_LENGTH);
+}
+
+void Python(void)
+{
+  int i;
+
+  printf(
+      "/* This code is automatically generated.  "
+      "Changes made here will be lost. */\n#define NO_IMPORT_ARRAY\n"
+      "#include \"pygetdata.h\"\n"
+      "const struct gdpy_constant_t gdpy_constant_list[] = {\n");
+  
+  for (i = 0; constant_list[i].lname != NULL; ++i)
+    printf("{\"%s\", %s}, ", constant_list[i].sname, constant_list[i].lname);
+
+  /* Python numerical type aliases */
+  printf(
+      "{\"INT\", GD_INT32}, "
+      "{\"LONG\", GD_INT64}, "
+      "{\"ULONG\", GD_UINT64}, "
+      "{\"FLOAT\", GD_FLOAT64}, "
+      "{\"COMPLEX\", GD_COMPLEX128}, "
+      "{NULL, 0}};\n"
+      );
+}
+
+void IDL(void)
+{
+  int i, n;
+
+  /* The structure */
+  printf(
+      "/* This code is automatically generated.  "
+      "Changes made here will be lost. */\n#define _LARGEFILE64_SOURCE 1\n"
+      "#include <stdio.h>\n#include <idl_export.h>\n"
+      "IDL_STRUCT_TAG_DEF gdidl_constants[] = {\n"
+      );
+
+  for (i = 0; constant_list[i].lname != NULL; ++i)
+    if ((constant_list[i].type != 1) && (constant_list[i].type != 5) &&
+        (constant_list[i].type != 7) && (constant_list[i].type != 8) &&
+        (constant_list[i].type != 11) && (constant_list[i].type != 13) &&
+        (constant_list[i].type != 14) && (constant_list[i].type != 98))
+    {
+      printf("{ \"%s\", 0, (void*)IDL_TYP_%s }, ", constant_list[i].sname,
+          (constant_list[i].type == 2) ? "LONG" : "INT"); 
+    }
+
+  printf("{ NULL }};\n");
+
+  /* The initialisation function */
+  printf(
+      "extern IDL_StructDefPtr gdidl_const_def;"
+      "IDL_VPTR gdidl_generate_constants(int argc, IDL_VPTR argv[], char *argk)"
+      "{"
+      "IDL_VPTR r;"
+      "IDL_MEMINT dims[] = { 1 };"
+      "void* data = IDL_MakeTempStruct(gdidl_const_def, 1,dims, &r, IDL_TRUE);"
+      "\n");
+
+  for (n = i = 0; constant_list[i].lname != NULL; ++i)
+    if ((constant_list[i].type != 1) && (constant_list[i].type != 5) &&
+        (constant_list[i].type != 7) && (constant_list[i].type != 8) &&
+        (constant_list[i].type != 11) && (constant_list[i].type != 13) &&
+        (constant_list[i].type != 14) && (constant_list[i].type != 98))
+    {
+      printf("*(IDL_%s*)(data + IDL_StructTagInfoByIndex(gdidl_const_def, %i, "
+          "IDL_MSG_LONGJMP, NULL)) = %li;\n", (constant_list[i].type == 2) ?
+          "LONG" : "INT", n++, constant_list[i].value);
+    }
+
+  printf("return r; }\n");
+}
+
+void Perl(void)
+{
+  int i;
+
+  printf("s/@PARAMETERS@/");
+
+  printf("our $VERSION = %i.%04i;\\\n", GETDATA_MAJOR, GETDATA_MINOR * 100 +
+      GETDATA_REVISION);
+  for (i = 0; constant_list[i].lname != NULL; ++i)
+    printf("our $%s = %li;\\\n", constant_list[i].sname,
+        constant_list[i].value);
+
+  printf("/\n");
+  printf("s/@PARAMLIST@/");
+
+  for (i = 0; constant_list[i].lname != NULL; ++i)
+    printf("%s ", constant_list[i].sname);
+  printf("/\n");
+}
+
+/* Since this file gets installed, we're a little more chatty here than usual */
+void MatLab(void)
+{
+  int i;
+
+  fputs("function GD = getdata_constants()\n", stdout);
+
+  fputs("% GETDATA_CONSTANTS  Define GetData symbolic constants\n"
+      "%\n"
+      "%   GETDATA_CONSTANTS  produces a structure containing the symbolic "
+      "constants\n"
+      "%   used by the GetData bindings.  Member names of the structure "
+      "correspond to\n"
+      "%   names of symbolic constants used in the GetData C API.\n"
+      "%\n"
+      "%   Although it can be used in immediate context by doing something "
+      "like\n"
+      "%\n"
+      "%     >> GETDATA_CONSTANTS.FLOAT64\n"
+      "%\n"
+      "%     ans =\n"
+      "%\n"
+      "%              136\n"
+      "%\n"
+      "%   it is usually assigned to a variable, which prevents having to "
+      "evaluate this\n"
+      "%   function more than once.  We recommend calling this variable GD:\n"
+      "%\n"
+      "%     >> GD = GETDATA_CONSTANTS;\n"
+      "%     >> GD.FLOAT64\n"
+      "%\n"
+      "%     ans =\n"
+      "%\n"
+      "%              136\n"
+      "%\n"
+      "%   providing more succinct symbol names which closely resemble the "
+      "cor-\n"
+      "%   respondng C API symbol names (e.g. GD_FLOAT64).  In the "
+      "documentation for\n"
+      "%   these bindings, we assume such a GD variable has been defined, and "
+      "refer to\n"
+      "%   symbolic constants as GD.<...> when necessary.\n"
+      "%\n"
+      "%   See also GETDATA\n\n", stdout);
+
+  fputs("  GD = struct(...\n"
+      "    'VERSION', '" VERSION "'", stdout);
+
+  for (i = 0; constant_list[i].lname != NULL; ++i)
+    printf(", ...\n    '%s', int32(%li)", constant_list[i].sname,
+        constant_list[i].value);
+
+  printf(" ...\n  );\nend\n");
+
+  fputs("\n% Copyright (C) 2013 D. V. Wiebe\n%\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+      "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%\n"
+      "% This file is part of the GetData project.\n%\n"
+      "% GetData is free software; you can redistribute it and/or modify it "
+      "under\n"
+      "% the terms of the GNU Lesser General Public License as published by "
+      "the\n"
+      "% Free Software Foundation; either version 2.1 of the License, or (at "
+      "your\n"
+      "% option) any later version.\n%\n"
+      "% GetData is distributed in the hope that it will be useful, but "
+      "WITHOUT\n"
+      "% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY "
+      "or\n"
+      "% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public\n"
+      "% License for more details.\n%\n"
+      "% You should have received a copy of the GNU Lesser General Public "
+      "License\n"
+      "% along with GetData; if not, write to the Free Software Foundation, "
+      "Inc.,\n"
+      "% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n", stdout);
+}
+
+int main(int argc, char* argv[])
+{
+  if (argv[1][0] == 'f')
+    Fortran();
+  else if (argv[1][0] == 'p')
+    Python();
+  else if (argv[1][0] == 'i')
+    IDL();
+  else if (argv[1][0] == 'P')
+    Perl();
+  else if (argv[1][0] == 'm')
+    MatLab();
+  else
+    return 1;
+
+  return 0;
+}
diff --git a/bindings/matlab/Contents.m.head b/bindings/matlab/Contents.m.head
new file mode 100644
index 0000000..7960b0a
--- /dev/null
+++ b/bindings/matlab/Contents.m.head
@@ -0,0 +1,95 @@
+% These bindings provide light-weight bindings to the GetData C library for
+% use withing MATLAB.  In general, there is a one-to-one mapping between C API
+% functions and matlab functions.  Differences in behaviour, where notable, are
+% provided in the corresponing function help.
+%
+% The Dirifle object:
+%   Dirfile objects returned from GD_OPEN and similar should be treated as
+%   opaque objects.  They should not be used other than when passing to a
+%   function in these bindings.
+%
+% GetData symbolic constants:
+%   Like the underlying C API, the GetData bindings make use of a large number
+%   of special numbers.  For convenience, a struct containing all these numbers
+%   is provided by the GETDATA_CONSTANTS function, which is typically used by
+%   doing something like:
+%
+%     >> GD = GETDATA_CONSTANTS;
+%
+%   This then allows the use of these constants as GD.UINT8, GD.RAW_ENTRY, &c.,
+%   which is both shorter than using the function directly, i.e.,
+%   GETDATA_CONSTANTS.UINT8, and also only requires evaluating the
+%   GETDATA_CONSTANTS function once.
+%
+%   In this documentation, when a reference is made to a GetData symbolic
+%   constant, it is done so as if the GD variable had been created as above.
+%   The reader should understand, e.g., GD.UINT8 as referring to the same
+%   special number as the similarly-named C API's symbolic constant, e.g.,
+%   GD_UINT8.
+%
+% Input and Output:
+%   Functions in these GetData bindings produce either one or zero scalar or
+%   vector outputs, as explained in the corresponding function documentation.
+%
+%   In general, where the C API would allow a NULL string pointer, these
+%   bindings accept a numeric zero (0) instead of a string input in place of a
+%   NULL.
+%
+%   Unlike the C Library, real and complex data may be used interchangeably in
+%   function calls.
+%
+% Error reporting:
+%   GetData C Library errors are represented in MATLAB as standard exceptions
+%   (see MEXCEPTION).  In general, GetData functions should be evaluated in a
+%   TRY ... CATCH ... END block.  GetData-specific exceptions can be identified
+%   through their MEXCEPTION.identifier.  The component part of a GetData
+%   MEXCPETION.identifier will always start with 'GetData:'.
+%
+%   Exceptions representing a GetData C Library error will have the component
+%   identifier 'GetData:Lib'.  Exceptions generated by the bindings themselves
+%   (almost all of which are failures in data conversion between MATLAB and C
+%   API data types) will have the component identifier 'GetData:GDMX'.  For C
+%   Library errors, the mnemonic part of the MEXCEPTION.identifier corresponds
+%   to the C library error code (e.g. 'GetData:Lib:BadCode').  For C Library
+%   errors, numeric error codes can be obtained using the GD_ERROR function, as
+%   in the C Library.  The return value of GD_ERROR is unspecified after an
+%   exception in the MATLAB bindings (i.e. a 'GetData:GDMX' exception).
+%
+% The Entry structure:
+%   Functions which deal with generic field metadata (GD_ADD, GD_ALTER_ENTRY,
+%   GD_ENTRY, &c.) use structures mirroring the C API's gd_entry_t object with
+%   the following exceptions:
+%
+%   * In entries with multiple input fields, .IN_FIELDS is a cell array of
+%     strings of the appropriate length.  For entries with a single input field,
+%     .IN_FIELDS may be either a simple string or else a cell array of length
+%     one.
+%
+%   * A distinction is not made between real and complex data.  As a result,
+%     the entry struct for, say, a POLYNOM, stores co-efficients in the .A
+%     member, regardless of whether they are complex or purely real.  As a side
+%     effect, the structure does not contain a .COMP_SCAL member.
+%
+%   * LINCOM entries don't provide a .N_FIELDS member, nor do POLYNOM entries
+%     provide a .POLY_ORD member; these values should be determined by
+%     determining the length of .IN_FIELDS, .M, or .B for LINCOMs or of .A for
+%     POLYNOMs.
+%
+%   * The .SCALAR and .SCALAR_IND members are provided for field types which
+%     allow non-literal parameters.  Where the C API would have NULL pointers
+%     in .SCALAR to indicate a literal, the bindings will have a numeric 0 in
+%     the corresponding .SCALAR cell array element.  As with .IN_FIELDS, a
+%     length-one .SCALAR cell array may be replaced by a scalar.
+%
+%   See gd_entry(3) in section 3 of the UNIX manual for details on the C API's
+%   gd_entry_t object.
+%
+% Function list:
+%   NOTE: accompanying documentation for the functions below in general only
+%         point out differences in behaviour between these MATLAB bindings and
+%         the underlying C API function which the MATLAB function wraps.  Users
+%         should also consult the C API documentation, which can be found in
+%         section 3 of the UNIX manual, e.g.
+%
+%           $ man 3 gd_open
+%
diff --git a/bindings/matlab/Makefile.am b/bindings/matlab/Makefile.am
new file mode 100644
index 0000000..eb5c14f
--- /dev/null
+++ b/bindings/matlab/Makefile.am
@@ -0,0 +1,115 @@
+# Copyright (C) 2013 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS=test
+
+matlabdir=$(matlabbasedir)/getdata
+
+matlabfiles=gd_add_bit.m gd_add_divide.m gd_add_lincom.m gd_add_linterp.m \
+						gd_add_mplex.m gd_add_multiply.m gd_add_phase.m gd_add_polynom.m \
+						gd_add_raw.m gd_add_recip.m gd_add_sbit.m gd_add_window.m \
+						gd_alter_bit.m gd_alter_carray.m gd_alter_const.m \
+						gd_alter_divide.m gd_alter_lincom.m gd_alter_linterp.m \
+						gd_alter_mplex.m gd_alter_multiply.m gd_alter_phase.m \
+						gd_alter_polynom.m gd_alter_raw.m gd_alter_recip.m gd_alter_sbit.m \
+						gd_alter_window.m gd_field_list_by_type.m gd_field_list.m \
+						gd_get_constant.m gd_madd_bit.m gd_madd_divide.m \
+						gd_madd_lincom.m gd_madd_linterp.m gd_madd_mplex.m \
+						gd_madd_multiply.m gd_madd_phase.m gd_madd_polynom.m \
+						gd_madd_recip.m gd_madd_sbit.m gd_madd_window.m \
+						gd_mfield_list_by_type.m gd_mfield_list.m gd_mvector_list.m \
+						gd_nfields_by_type.m gd_nfields.m gd_nmfields_by_type.m \
+						gd_nmfields.m gd_nmvectors.m gd_nvectors.m gd_put_carray.m \
+						gd_put_constant.m gd_vector_list.m getdata_constants.m
+mexfiles=gd_add gd_add_alias \
+				 gd_add_carray gd_add_const gd_add_spec gd_add_string gd_aliases \
+				 gd_alias_target gd_alter_affixes \
+				 gd_alter_encoding gd_alter_endianness gd_alter_entry \
+				 gd_alter_frameoffset \
+				 gd_alter_protection gd_alter_spec gd_bof gd_carray_len gd_carrays \
+				 gd_close gd_constants gd_delete gd_delete_alias gd_desync \
+				 gd_dirfilename gd_dirfile_standards \
+				 gd_discard gd_encoding gd_endianness \
+				 gd_entry gd_entry_list gd_entry_type gd_eof \
+				 gd_error gd_error_string gd_flags gd_flush gd_fragment_affixes \
+				 gd_fragment_index gd_fragmentname \
+				 gd_framenum gd_frameoffset gd_get_carray gd_get_carray_slice \
+				 gd_getdata gd_get_string \
+				 gd_hidden gd_hide gd_include gd_invalid_dirfile \
+				 gd_linterp_tablename gd_madd gd_madd_alias \
+				 gd_madd_carray gd_madd_const gd_madd_spec gd_madd_string \
+				 gd_malter_spec gd_mcarrays \
+				 gd_mconstants gd_metaflush gd_move gd_move_alias gd_mplex_lookback \
+				 gd_mstrings gd_naliases gd_native_type gd_nentries gd_nfragments \
+				 gd_nframes gd_open gd_parent_fragment gd_protection \
+				 gd_put_carray_slice \
+				 gd_putdata gd_put_string gd_raw_close gd_raw_filename \
+				 gd_reference gd_rename gd_rewrite_fragment \
+				 gd_seek gd_spf gd_strings gd_strtok \
+				 gd_sync gd_tell gd_unhide gd_uninclude gd_validate gd_verbose_prefix
+
+matlabcfiles=$(addsuffix .c,${mexfiles})
+matlabmexfiles=$(addsuffix . at mexext@,${mexfiles})
+matlabdocfiles=$(addsuffix .m,${mexfiles})
+
+EXTRA_DIST=$(matlabcfiles) doc.tail Contents.m.head
+
+dist_matlab_SCRIPTS=$(matlabfiles)
+nodist_matlab_SCRIPTS=Contents.m getdata_constants.m $(matlabmexfiles) \
+											$(matlabdocfiles)
+
+lib_LTLIBRARIES=libgetdata-matlab.la
+
+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)
+GDMX_LIBS=$(GETDATA_LIBS)
+else
+libgetdata_matlab_la_LIBADD=../../src/libgetdata.la
+AM_CPPFLAGS=-I${top_srcdir}/src -I../../src
+GDMX_LIBS=-L../../src/.libs -lgetdata
+endif
+
+%.m: %.c ${srcdir}/doc.tail
+	${GREP} '^ %' $< | ${SED} -e 's/^ //' > $@
+	cat ${srcdir}/doc.tail >> $@
+
+%. at mexext@: %.c libgetdata-matlab.la
+	${MEX} ${AM_CPPFLAGS} -L.libs -lgetdata-matlab $(GDMX_LIBS) $<
+
+Contents.m: ${srcdir}/Contents.m.head make_contents.sh $(matlabfiles) \
+						$(matlabdocfiles) ${srcdir}/doc.tail
+	${SHELL} ./make_contents.sh ${srcdir} > $@
+	cat ${srcdir}/doc.tail >> $@
+
+getdata_constants.m: ../make_parameters
+	../make_parameters m > $@
+
+../make_parameters: ../make_parameters.c
+	cd .. && ${MAKE} make_parameters
+
+clean-local:
+	rm -rf $(nodist_matlab_SCRIPTS)
diff --git a/bindings/matlab/Makefile.in b/bindings/matlab/Makefile.in
new file mode 100644
index 0000000..d324034
--- /dev/null
+++ b/bindings/matlab/Makefile.in
@@ -0,0 +1,1038 @@
+# 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/matlab
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(srcdir)/make_contents.sh.in $(dist_matlab_SCRIPTS) \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES = make_contents.sh
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(matlabdir)" \
+	"$(DESTDIR)$(matlabdir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+ at GD_EXTERNAL_FALSE@libgetdata_matlab_la_DEPENDENCIES =  \
+ at GD_EXTERNAL_FALSE@	../../src/libgetdata.la
+am_libgetdata_matlab_la_OBJECTS = libgetdata_matlab_la-matlab.lo
+libgetdata_matlab_la_OBJECTS = $(am_libgetdata_matlab_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libgetdata_matlab_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libgetdata_matlab_la_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SCRIPTS = $(dist_matlab_SCRIPTS) $(nodist_matlab_SCRIPTS)
+AM_V_P = $(am__v_P_ 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 = $(libgetdata_matlab_la_SOURCES)
+DIST_SOURCES = $(libgetdata_matlab_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+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 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+SUBDIRS = test
+matlabdir = $(matlabbasedir)/getdata
+matlabfiles = gd_add_bit.m gd_add_divide.m gd_add_lincom.m gd_add_linterp.m \
+						gd_add_mplex.m gd_add_multiply.m gd_add_phase.m gd_add_polynom.m \
+						gd_add_raw.m gd_add_recip.m gd_add_sbit.m gd_add_window.m \
+						gd_alter_bit.m gd_alter_carray.m gd_alter_const.m \
+						gd_alter_divide.m gd_alter_lincom.m gd_alter_linterp.m \
+						gd_alter_mplex.m gd_alter_multiply.m gd_alter_phase.m \
+						gd_alter_polynom.m gd_alter_raw.m gd_alter_recip.m gd_alter_sbit.m \
+						gd_alter_window.m gd_field_list_by_type.m gd_field_list.m \
+						gd_get_constant.m gd_madd_bit.m gd_madd_divide.m \
+						gd_madd_lincom.m gd_madd_linterp.m gd_madd_mplex.m \
+						gd_madd_multiply.m gd_madd_phase.m gd_madd_polynom.m \
+						gd_madd_recip.m gd_madd_sbit.m gd_madd_window.m \
+						gd_mfield_list_by_type.m gd_mfield_list.m gd_mvector_list.m \
+						gd_nfields_by_type.m gd_nfields.m gd_nmfields_by_type.m \
+						gd_nmfields.m gd_nmvectors.m gd_nvectors.m gd_put_carray.m \
+						gd_put_constant.m gd_vector_list.m getdata_constants.m
+
+mexfiles = gd_add gd_add_alias \
+				 gd_add_carray gd_add_const gd_add_spec gd_add_string gd_aliases \
+				 gd_alias_target gd_alter_affixes \
+				 gd_alter_encoding gd_alter_endianness gd_alter_entry \
+				 gd_alter_frameoffset \
+				 gd_alter_protection gd_alter_spec gd_bof gd_carray_len gd_carrays \
+				 gd_close gd_constants gd_delete gd_delete_alias gd_desync \
+				 gd_dirfilename gd_dirfile_standards \
+				 gd_discard gd_encoding gd_endianness \
+				 gd_entry gd_entry_list gd_entry_type gd_eof \
+				 gd_error gd_error_string gd_flags gd_flush gd_fragment_affixes \
+				 gd_fragment_index gd_fragmentname \
+				 gd_framenum gd_frameoffset gd_get_carray gd_get_carray_slice \
+				 gd_getdata gd_get_string \
+				 gd_hidden gd_hide gd_include gd_invalid_dirfile \
+				 gd_linterp_tablename gd_madd gd_madd_alias \
+				 gd_madd_carray gd_madd_const gd_madd_spec gd_madd_string \
+				 gd_malter_spec gd_mcarrays \
+				 gd_mconstants gd_metaflush gd_move gd_move_alias gd_mplex_lookback \
+				 gd_mstrings gd_naliases gd_native_type gd_nentries gd_nfragments \
+				 gd_nframes gd_open gd_parent_fragment gd_protection \
+				 gd_put_carray_slice \
+				 gd_putdata gd_put_string gd_raw_close gd_raw_filename \
+				 gd_reference gd_rename gd_rewrite_fragment \
+				 gd_seek gd_spf gd_strings gd_strtok \
+				 gd_sync gd_tell gd_unhide gd_uninclude gd_validate gd_verbose_prefix
+
+matlabcfiles = $(addsuffix .c,${mexfiles})
+matlabmexfiles = $(addsuffix . at mexext@,${mexfiles})
+matlabdocfiles = $(addsuffix .m,${mexfiles})
+EXTRA_DIST = $(matlabcfiles) doc.tail Contents.m.head
+dist_matlab_SCRIPTS = $(matlabfiles)
+nodist_matlab_SCRIPTS = Contents.m getdata_constants.m $(matlabmexfiles) \
+											$(matlabdocfiles)
+
+lib_LTLIBRARIES = libgetdata-matlab.la
+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@
+ at GD_EXTERNAL_FALSE@libgetdata_matlab_la_LIBADD = ../../src/libgetdata.la
+ at GD_EXTERNAL_TRUE@libgetdata_matlab_la_LIBADD = $(GETDATA_LIBS)
+ at GD_EXTERNAL_FALSE@AM_CPPFLAGS = -I${top_srcdir}/src -I../../src
+ at GD_EXTERNAL_TRUE@AM_CPPFLAGS = $(GETDATA_CFLAGS)
+ at GD_EXTERNAL_FALSE@GDMX_LIBS = -L../../src/.libs -lgetdata
+ at GD_EXTERNAL_TRUE@GDMX_LIBS = $(GETDATA_LIBS)
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/matlab/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/matlab/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+make_contents.sh: $(top_builddir)/config.status $(srcdir)/make_contents.sh.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libgetdata-matlab.la: $(libgetdata_matlab_la_OBJECTS) $(libgetdata_matlab_la_DEPENDENCIES) $(EXTRA_libgetdata_matlab_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdata_matlab_la_LINK) -rpath $(libdir) $(libgetdata_matlab_la_OBJECTS) $(libgetdata_matlab_la_LIBADD) $(LIBS)
+install-dist_matlabSCRIPTS: $(dist_matlab_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	@list='$(dist_matlab_SCRIPTS)'; test -n "$(matlabdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(matlabdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(matlabdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(matlabdir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(matlabdir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-dist_matlabSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_matlab_SCRIPTS)'; test -n "$(matlabdir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	dir='$(DESTDIR)$(matlabdir)'; $(am__uninstall_files_from_dir)
+install-nodist_matlabSCRIPTS: $(nodist_matlab_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_matlab_SCRIPTS)'; test -n "$(matlabdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(matlabdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(matlabdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(matlabdir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(matlabdir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-nodist_matlabSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_matlab_SCRIPTS)'; test -n "$(matlabdir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	dir='$(DESTDIR)$(matlabdir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdata_matlab_la-matlab.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 $@ $<
+
+libgetdata_matlab_la-matlab.lo: matlab.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdata_matlab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdata_matlab_la-matlab.lo -MD -MP -MF $(DEPDIR)/libgetdata_matlab_la-matlab.Tpo -c -o libgetdata_matlab_la-matlab.lo `test -f 'matlab.c' || echo '$(srcdir)/'`matlab.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdata_matlab_la-matlab.Tpo $(DEPDIR)/libgetdata_matlab_la-matlab.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='matlab.c' object='libgetdata_matlab_la-matlab.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) $(libgetdata_matlab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdata_matlab_la-matlab.lo `test -f 'matlab.c' || echo '$(srcdir)/'`matlab.c
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(SCRIPTS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(matlabdir)" "$(DESTDIR)$(matlabdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-dist_matlabSCRIPTS \
+	install-nodist_matlabSCRIPTS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-dist_matlabSCRIPTS uninstall-libLTLIBRARIES \
+	uninstall-nodist_matlabSCRIPTS
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libLTLIBRARIES \
+	clean-libtool clean-local cscopelist-am ctags ctags-am \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dist_matlabSCRIPTS install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am \
+	install-libLTLIBRARIES install-man \
+	install-nodist_matlabSCRIPTS install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am \
+	uninstall-dist_matlabSCRIPTS uninstall-libLTLIBRARIES \
+	uninstall-nodist_matlabSCRIPTS
+
+
+%.m: %.c ${srcdir}/doc.tail
+	${GREP} '^ %' $< | ${SED} -e 's/^ //' > $@
+	cat ${srcdir}/doc.tail >> $@
+
+%. at mexext@: %.c libgetdata-matlab.la
+	${MEX} ${AM_CPPFLAGS} -L.libs -lgetdata-matlab $(GDMX_LIBS) $<
+
+Contents.m: ${srcdir}/Contents.m.head make_contents.sh $(matlabfiles) \
+						$(matlabdocfiles) ${srcdir}/doc.tail
+	${SHELL} ./make_contents.sh ${srcdir} > $@
+	cat ${srcdir}/doc.tail >> $@
+
+getdata_constants.m: ../make_parameters
+	../make_parameters m > $@
+
+../make_parameters: ../make_parameters.c
+	cd .. && ${MAKE} make_parameters
+
+clean-local:
+	rm -rf $(nodist_matlab_SCRIPTS)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/matlab/doc.tail b/bindings/matlab/doc.tail
new file mode 100644
index 0000000..d02ffa7
--- /dev/null
+++ b/bindings/matlab/doc.tail
@@ -0,0 +1,20 @@
+
+% Copyright (C) 2013 D. V. Wiebe
+% 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% 
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add.c b/bindings/matlab/gd_add.c
new file mode 100644
index 0000000..d0f49b4
--- /dev/null
+++ b/bindings/matlab/gd_add.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ADD  Add a field
+ %
+ %   GD_ADD(DIRFILE,ENTRY)
+ %             adds a field described by ENTRY to the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   The ENTRY object should be an entry struct; see GETDATA and gd_entry(3) in
+ %   the UNIX manual for details.
+ %
+ %   See the documentation on the C API function gd_add(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MADD, GD_OPEN, GETDATA
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  gd_entry_t *E;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  E = gdmx_to_entry(prhs, 1, 0);
+
+  gd_add(D, E);
+
+  gdmx_free_entry(E);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_add_alias.c b/bindings/matlab/gd_add_alias.c
new file mode 100644
index 0000000..f25262f
--- /dev/null
+++ b/bindings/matlab/gd_add_alias.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 "gd_matlab.h"
+
+/*
+ % GD_ADD_ALIAS  Add a field alias
+ %
+ %   GD_ADD_ALIAS(DIRFILE,NAME,TARGET,FRAGMENT)
+ %             adds a field alias called NAME pointing to TARGET in the metadata
+ %             fragment indexed by FRAGMENT of the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_add_alias(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MADD_ALIAS, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code, *target;
+  int fragment_index;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  target = gdmx_to_string(prhs, 2, 0);
+  fragment_index = gdmx_to_int(prhs, 3);
+
+  gd_add_alias(D, field_code, target, fragment_index);
+
+  mxFree(target);
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_add_bit.m b/bindings/matlab/gd_add_bit.m
new file mode 100644
index 0000000..79a568f
--- /dev/null
+++ b/bindings/matlab/gd_add_bit.m
@@ -0,0 +1,41 @@
+function gd_add_bit(D, field_code, in_fields, bitnum, numbits, fragment_index)
+% GD_ADD_BIT  Add a BIT field
+%
+%   GD_ADD_BIT(DIRFILE,NAME,INPUT,BITNUM,NUMBITS,FRAGMENT)
+%             adds a BIT field called NAME to the dirfile specified by DIRFILE.
+%             The input field is INPUT, the first bit is BITNUM and the length
+%             is NUMBITS.  The field is added to the fragment indexed by
+%             FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_bit(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_BIT, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.BIT_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {in_fields}, ...
+  'bitnum', bitnum, 'numbits', numbits));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_carray.c b/bindings/matlab/gd_add_carray.c
new file mode 100644
index 0000000..8f4a4c4
--- /dev/null
+++ b/bindings/matlab/gd_add_carray.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ADD_CARRAY  Add a CARRAY field
+ %
+ %   GD_ADD_CARRAY(DIRFILE,NAME,TYPE,VALUES,FRAGMENT)
+ %             adds a CARRAY field called NAME to the dirfile specified by
+ %             DIRFILE.  The storage type is TYPE, and the values of the field
+ %             are in VALUES.  The field is added to the fragment indexed by
+ %             FRAGMENT.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_add_carray(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ADD, GD_MADD_CARRAY, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_name;
+  size_t n;
+  int fragment_index;
+  gd_type_t const_type, data_type;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(5);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_name = gdmx_to_string(prhs, 1, 0);
+  const_type = gdmx_to_gd_type(prhs, 2);
+  gdmx_to_data(&data, &data_type, &n, prhs, 3);
+  fragment_index = gdmx_to_int(prhs, 4);
+
+  gd_add_carray(D, field_name, const_type, n, data_type, data, fragment_index);
+
+  gdmx_free_data(data, data_type);
+  mxFree(field_name);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_add_const.c b/bindings/matlab/gd_add_const.c
new file mode 100644
index 0000000..60e7943
--- /dev/null
+++ b/bindings/matlab/gd_add_const.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ADD_CONST  Add a CONST field
+ %
+ %   GD_ADD_CONST(DIRFILE,NAME,TYPE,VALUE,FRAGMENT)
+ %             adds a CONST field called NAME to the dirfile specified by
+ %             DIRFILE.  The storage type is TYPE, and the value of the field
+ %             is VALUE.  The field is added to the fragment indexed by
+ %             FRAGMENT.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_add_const(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ADD, GD_MADD_CONST, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_name;
+  size_t n;
+  int fragment_index;
+  gd_type_t const_type, data_type;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(5);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_name = gdmx_to_string(prhs, 1, 0);
+  const_type = gdmx_to_gd_type(prhs, 2);
+  gdmx_to_data(&data, &data_type, &n, prhs, 3);
+  fragment_index = gdmx_to_int(prhs, 4);
+
+  gd_add_const(D, field_name, const_type, data_type, data, fragment_index);
+
+  gdmx_free_data(data, data_type);
+  mxFree(field_name);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_add_divide.m b/bindings/matlab/gd_add_divide.m
new file mode 100644
index 0000000..25278e9
--- /dev/null
+++ b/bindings/matlab/gd_add_divide.m
@@ -0,0 +1,39 @@
+function gd_add_divide(D, field_code, in1, in2, fragment_index)
+% GD_ADD_DIVIDE  Add a DIVIDE field
+%
+%   GD_ADD_DIVIDE(DIRFILE,NAME,INPUT1,INPUT2,FRAGMENT) 
+%             adds a DIVIDE field called NAME to the dirfile specified by
+%             DIRFILE.  The input fields are INPUT1 and INPUT2 and the field
+%             is added to the fragment indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_divide(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_DIVIDE, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.DIVIDE_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {{in1; in2}}));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_lincom.m b/bindings/matlab/gd_add_lincom.m
new file mode 100644
index 0000000..99ce527
--- /dev/null
+++ b/bindings/matlab/gd_add_lincom.m
@@ -0,0 +1,41 @@
+function gd_add_lincom(D, field_code, in_fields, m, b, fragment_index);
+% GD_ADD_LINCOM  Add a LINCOM field
+%
+%   GD_ADD_LINCOM(DIRFILE,NAME,INPUTS,M,B,FRAGMENT)
+%             adds a LINCOM field called NAME to the dirfile specified by
+%             DIRFILE.  The input fields are provided in the cell array INPUTS
+%             and the slopes and offsets given by the numeric arrays M and B,
+%             which may be complex valued.  The field is added to the fragment
+%             indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_lincom(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_LINCOM, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.LINCOM_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {in_fields}, 'm', m, 'b', b));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_linterp.m b/bindings/matlab/gd_add_linterp.m
new file mode 100644
index 0000000..7cd56d7
--- /dev/null
+++ b/bindings/matlab/gd_add_linterp.m
@@ -0,0 +1,40 @@
+function gd_add_linterp(D, field_code, in_field, table, fragment_index);
+% GD_ADD_LINTERP  Add a LINTERP field
+%
+%   GD_ADD_LINTERP(DIRFILE,NAME,INPUT,TABLE,FRAGMENT)
+%             adds a LINTERP field called NAME to the dirfile specified by
+%             DIRFILE.  The input field is INPUT and the associated look-up
+%             table is given by the path TABLE.  The field is added to the
+%             fragment indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_linterp(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_LINTERP, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.LINTERP_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', in_field, 'table', table));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_mplex.m b/bindings/matlab/gd_add_mplex.m
new file mode 100644
index 0000000..edc5f4c
--- /dev/null
+++ b/bindings/matlab/gd_add_mplex.m
@@ -0,0 +1,43 @@
+function gd_add_mplex(D, field_code, in_field1, in_field2, count_val, ...
+period, fragment_index)
+% GD_ADD_MPLEX  Add a MPLEX field
+%
+%   GD_ADD_MPLEX(DIRFILE,NAME,INPUT1,INPUT2,COUNT_VAL,COUNT_MAX,FRAGMENT)
+%             adds a MPLEX field called NAME to the dirfile specified by
+%             DIRFILE.  The input data field is INPUT1, the index field is
+%             INPUT2.  The target value is COUNT_VAL and the maximum value of
+%             INPUT2 is COUNT_MAX.  The field is added to the fragment
+%             indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_mplex(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_MPLEX, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.MPLEX_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {{in_field1; in_field2}}, ...
+  'count_val', count_val, 'period', period));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_multiply.m b/bindings/matlab/gd_add_multiply.m
new file mode 100644
index 0000000..de0fe5a
--- /dev/null
+++ b/bindings/matlab/gd_add_multiply.m
@@ -0,0 +1,39 @@
+function gd_add_multiply(D, field_code, in1, in2, fragment_index)
+% GD_ADD_MULTIPLY  Add a MULTIPLY field
+%
+%   GD_ADD_MULTIPLY(DIRFILE,NAME,INPUT1,INPUT2,FRAGMENT) 
+%             adds a MULTIPLY field called NAME to the dirfile specified by
+%             DIRFILE.  The input fields are INPUT1 and INPUT2 and the field
+%             is added to the fragment indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_multiply(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_MULTIPLY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.MULTIPLY_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {{in1; in2}}));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_phase.m b/bindings/matlab/gd_add_phase.m
new file mode 100644
index 0000000..a560983
--- /dev/null
+++ b/bindings/matlab/gd_add_phase.m
@@ -0,0 +1,39 @@
+function gd_add_phase(D, field_code, in_fields, shift, fragment_index)
+% GD_ADD_PHASE  Add a PHASE field
+%
+%   GD_ADD_PHASE(DIRFILE,NAME,INPUT,SHIFT,FRAGMENT)
+%             adds a PHASE field called NAME to the dirfile specified by
+%             DIRFILE.  The input field is INPUT and the phase shift is SHIFT.
+%             The field is added to the fragment indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_phase(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_PHASE, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.PHASE_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {in_fields}, 'shift', shift));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_polynom.m b/bindings/matlab/gd_add_polynom.m
new file mode 100644
index 0000000..9f9621d
--- /dev/null
+++ b/bindings/matlab/gd_add_polynom.m
@@ -0,0 +1,40 @@
+function gd_add_polynom(D, field_code, in_field, a, fragment_index);
+% GD_ADD_POLYNOM  Add a POLYNOM field
+%
+%   GD_ADD_POLYNOM(DIRFILE,NAME,INPUT,A,FRAGMENT)
+%             adds a POLYNOM field called NAME to the dirfile specified by
+%             DIRFILE.  The input field is INPUT and the co-efficients are
+%             given in the numerical array A, which may be complex valued.
+%             The field is added to the fragment indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_polynom(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_POLYNOM, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.POLYNOM_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {in_field}, 'a', a));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_raw.m b/bindings/matlab/gd_add_raw.m
new file mode 100644
index 0000000..825edb5
--- /dev/null
+++ b/bindings/matlab/gd_add_raw.m
@@ -0,0 +1,41 @@
+function gd_add_raw(D, field_code, data_type, spf, fragment_index)
+% GD_ADD_RAW  Add a RAW field
+%
+%   GD_ADD_RAW(DIRFILE,NAME,TYPE,SPF,FRAGMENT)
+%             adds a RAW field called NAME to the dirfile specified by
+%             DIRFILE.  The type of the raw data is given by TYPE, which should
+%             be one of the data types provided by GETDATA_CONSTANTS().  The
+%             samples-per-frame of the field is given by SPF.  The field is
+%             added to the fragment indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_raw(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.RAW_ENTRY, ...
+  'fragment_index', fragment_index, 'data_type', data_type, 'spf', spf));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_recip.m b/bindings/matlab/gd_add_recip.m
new file mode 100644
index 0000000..8f182d4
--- /dev/null
+++ b/bindings/matlab/gd_add_recip.m
@@ -0,0 +1,40 @@
+function gd_add_recip(D, field_code, in_field, dividend, fragment_index)
+% GD_ADD_RECIP  Add a RECIP field
+%
+%   GD_ADD_RECIP(DIRFILE,NAME,INPUT,DIVIDEND,FRAGMENT)
+%             adds a RECIP field called NAME to the dirfile specified by
+%             DIRFILE.  The scalar dividend is DIVIDEND, which may be complex
+%             valued.  The field is added to the fragment indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_recip(3) in section 3 of
+%   the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_RECIP, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.RECIP_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {in_field}, ...
+  'dividend', dividend));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_sbit.m b/bindings/matlab/gd_add_sbit.m
new file mode 100644
index 0000000..ac81aba
--- /dev/null
+++ b/bindings/matlab/gd_add_sbit.m
@@ -0,0 +1,41 @@
+function gd_add_sbit(D, field_code, in_fields, bitnum, numbits, fragment_index)
+% GD_ADD_SBIT  Add a SBIT field
+%
+%   GD_ADD_SBIT(DIRFILE,NAME,INPUT,BITNUM,NUMBITS,FRAGMENT)
+%             adds a SBIT field called NAME to the dirfile specified by DIRFILE.
+%             The input field is INPUT, the first bit is BITNUM and the length
+%             is NUMBITS.  The field is added to the fragment indexed by
+%             FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_sbit(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_SBIT, GD_OPEN
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.SBIT_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {in_fields}, ...
+  'bitnum', bitnum, 'numbits', numbits));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_add_spec.c b/bindings/matlab/gd_add_spec.c
new file mode 100644
index 0000000..33f798f
--- /dev/null
+++ b/bindings/matlab/gd_add_spec.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ADD_SPEC  Add a field
+ %
+ %   GD_ADD_SPEC(DIRFILE,SPEC,FRAGMENT)
+ %             adds a field described by the field specification line SPEC to
+ %             the dirfile DIRFILE.  The field is added to the fragment indexed 
+ %             by FRAGMENT.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_add_spec(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ADD, GD_MADD_SPEC, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *spec;
+  int fragment_index;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  spec = gdmx_to_string(prhs, 1, 0);
+  fragment_index = gdmx_to_int(prhs, 2);
+
+  gd_add_spec(D, spec, fragment_index);
+
+  mxFree(spec);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_add_string.c b/bindings/matlab/gd_add_string.c
new file mode 100644
index 0000000..18ca4f0
--- /dev/null
+++ b/bindings/matlab/gd_add_string.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 "gd_matlab.h"
+
+/*
+ % GD_ADD_STRING  Add a STRING field
+ %
+ %   GD_ADD_STRING(DIRFILE,NAME,VALUE,FRAGMENT)
+ %             adds a STRING field called NAME to the dirfile specified by
+ %             DIRFILE.  The value of the field is set to VALUE.  The field is
+ %             added to the fragment indexed by FRAGMENT.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_add_string(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ADD, GD_MADD_STRING, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_name, *value;
+  int fragment_index;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_name = gdmx_to_string(prhs, 1, 0);
+  value = gdmx_to_string(prhs, 2, 0);
+  fragment_index = gdmx_to_int(prhs, 3);
+
+  gd_add_string(D, field_name, value, fragment_index);
+
+  mxFree(field_name);
+  mxFree(value);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_add_window.m b/bindings/matlab/gd_add_window.m
new file mode 100644
index 0000000..9cb9dd1
--- /dev/null
+++ b/bindings/matlab/gd_add_window.m
@@ -0,0 +1,44 @@
+function gd_add_window(D, field_code, in_field1, in_field2, windop, ...
+threshold, fragment_index);
+% GD_ADD_WINDOW  Add a WINDOW field
+%
+%   GD_ADD_WINDOW(DIRFILE,NAME,INPUT1,INPUT2,WINDOP,THRESHOLD,FRAGMENT)
+%             adds a WINDOW field called NAME to the dirfile specified by
+%             DIRFILE.  The data input field is INPUT1, and the mask field is
+%             INPUT2. The operator is specified by WINDOP, which should be one
+%             of the GD.WINDOP_... members provided by GETDATA_CONSTANTS, and
+%             the threshold is THRESHOLD.  The field is added to the fragment
+%             indexed by FRAGMENT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_add_window(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD, GD_MADD_WINDOW, GD_OPEN, GETDATA_CONSTANTS
+
+  GD = getdata_constants();
+  gd_add(D, struct('field', field_code, 'field_type', GD.WINDOW_ENTRY, ...
+  'fragment_index', fragment_index, 'in_fields', {{in_field1; in_field2}}, ...
+  'windop', windop, 'threshold', threshold));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alias_target.c b/bindings/matlab/gd_alias_target.c
new file mode 100644
index 0000000..e3679f3
--- /dev/null
+++ b/bindings/matlab/gd_alias_target.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 "gd_matlab.h"
+
+/*
+ % GD_ALIAS_TARGET  Report the target of an /ALIAS
+ %
+ %   T = GD_ALIAS_TARGET(DIRFILE,NAME)
+ %             returns the target, T, of the alias named NAME.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_alias_target(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ALIASES, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const char *s;
+  char *field_code;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  s = gd_alias_target(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = mxCreateString(s);
+}
diff --git a/bindings/matlab/gd_aliases.c b/bindings/matlab/gd_aliases.c
new file mode 100644
index 0000000..7c5277e
--- /dev/null
+++ b/bindings/matlab/gd_aliases.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 "gd_matlab.h"
+
+/*
+ % GD_ALIASES  Retrieve a list of aliases for a field
+ %
+ %   A = GD_ALIASES(DIRFILE,NAME)
+ %             returns a cell array of strings, A, comprising all the aliases of
+ %             the field called NAME.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_aliases(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_NALIASES, GD_ENTRY_LIST, GD_ALIAS_TARGET, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code;
+  const char **al;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  al = gd_aliases(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_string_list(al);
+}
diff --git a/bindings/matlab/gd_alter_affixes.c b/bindings/matlab/gd_alter_affixes.c
new file mode 100644
index 0000000..457e407
--- /dev/null
+++ b/bindings/matlab/gd_alter_affixes.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 "gd_matlab.h"
+
+/*
+ % GD_ALTER_AFFIXES  Modify the affixes of an included fragment
+ %
+ %   GD_ALTER_ENDIANNESS(DIRFILE,FRAGMENT,PREFIX,SUFFIX)
+ %             modifies the prefix and suffix associated with the fragment
+ %             indexed by FRAGMENT in the dirfile DIRFILE.  If PREFIX or SUFFIX
+ %             is numeric zero, no change is made to the associated affix.
+ %             Otherwise, the affix is set to the value of the parameter.  To
+ %             remove an affix, set it to the empty string: ''.
+ %             Otherwise, the binary files are not modified.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_alter_affixes(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_FRAGMENT_AFFIXES, GD_INCLUDE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  int i;
+  char *p = NULL, *s = NULL;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+  p = gdmx_to_string(prhs, 2, 1);
+  s = gdmx_to_string(prhs, 3, 1);
+
+  gd_alter_affixes(D, i, p, s);
+
+  mxFree(p);
+  mxFree(s);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_alter_bit.m b/bindings/matlab/gd_alter_bit.m
new file mode 100644
index 0000000..f4ab292
--- /dev/null
+++ b/bindings/matlab/gd_alter_bit.m
@@ -0,0 +1,39 @@
+function gd_alter_bit(D, field_code, in_fields, bitnum, numbits)
+% GD_ALTER_BIT  Modify the metadata of a BIT field
+%
+%   GD_ALTER_BIT(DIRFILE,NAME,INPUT,BITNUM,NUMBITS)
+%             modifies the metadata of the BIT field called NAME in the
+%             dirfile specified by DIRFILE.  The input field is set to INPUT,
+%             the first bit to BITNUM, and the number of bits to NUMBITS.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_bit(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.BIT_ENTRY, ...
+  'in_fields', {in_fields}, 'bitnum', bitnum, 'numbits', numbits), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_carray.m b/bindings/matlab/gd_alter_carray.m
new file mode 100644
index 0000000..461559f
--- /dev/null
+++ b/bindings/matlab/gd_alter_carray.m
@@ -0,0 +1,40 @@
+function gd_alter_carray(D, field_code, const_type, array_len)
+% GD_ALTER_CARRAY  Modify the metadata of a CARRAY field
+%
+%   GD_ALTER_CARRAY(DIRFILE,NAME,TYPE,LEN)
+%             modifies the metadata of the CARRAY field called NAME in the
+%             dirfile specified by DIRFILE.  The storage type is set to TYPE,
+%             which should be one of the data type symbols provided by
+%             GETDATA_CONSTANTS, and the length of the CARRAY is set to LEN.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_carray(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN, GETDATA_CONSTANTS
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.CARRAY_ENTRY, ...
+  'const_type', const_type, 'array_len', array_len), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_const.m b/bindings/matlab/gd_alter_const.m
new file mode 100644
index 0000000..46b2d29
--- /dev/null
+++ b/bindings/matlab/gd_alter_const.m
@@ -0,0 +1,40 @@
+function gd_alter_const(D, field_code, const_type)
+% GD_ALTER_CONST  Modify the metadata of a CONST field
+%
+%   GD_ALTER_CONST(DIRFILE,NAME,TYPE)
+%             modifies the metadata of the CONST field called NAME in the
+%             dirfile specified by DIRFILE, setting the storage type of the
+%             field to TYPE, which should be one of the data type symbols
+%             provided by GETDATA_CONSTANTS.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_const(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN, GETDATA_CONSTANTS
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.CONST_ENTRY, ...
+  'const_type', const_type), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_divide.m b/bindings/matlab/gd_alter_divide.m
new file mode 100644
index 0000000..f1e3b8f
--- /dev/null
+++ b/bindings/matlab/gd_alter_divide.m
@@ -0,0 +1,39 @@
+function gd_alter_divide(D, field_code, in1, in2)
+% GD_ALTER_DIVIDE  Modify the metadata of a DIVIDE field
+%
+%   GD_ALTER_DIVIDE(DIRFILE,NAME,INPUT1,INPUT2)
+%             modifies the metadata of the DIVIDE field called NAME in the
+%             dirfile specified by DIRFILE.  The input fields are set to INPUT1,
+%             and INPUT2, if non-zero.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_divide(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.DIVIDE_ENTRY, ...
+  'in_fields', {{in1; in2}}), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_encoding.c b/bindings/matlab/gd_alter_encoding.c
new file mode 100644
index 0000000..e534c6d
--- /dev/null
+++ b/bindings/matlab/gd_alter_encoding.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 "gd_matlab.h"
+
+/*
+ % GD_ALTER_ENCODING  Modify the encoding of a fragment
+ %
+ %   GD_ALTER_ENCODING(DIRFILE,ENCODING,FRAGMENT[,RECODE])
+ %             sets the encoding of the metadata fragment indexed by FRAGMENT
+ %             in the dirfile DIRFILE to ENCODING, which should be one of the
+ %             GD.xxx_ENCODED constants provided by GETDATA_CONSTANTS.
+ %             If RECODE is given and non-zero, binary files affected by the
+ %             encoding change will be converted.  Otherwise, the binary files
+ %             are not modified.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_alter_endianness(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ENCODING, GD_OPEN, GETDATA_CONSTANTS
+ */
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  int i, r = 0;
+  unsigned int e;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(3,4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  e = gdmx_to_uint(prhs, 1);
+  i = gdmx_to_int(prhs, 2);
+  if (nrhs > 3)
+    r = gdmx_to_int(prhs, 3);
+
+  gd_alter_encoding(D, e, i, r);
+
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_alter_endianness.c b/bindings/matlab/gd_alter_endianness.c
new file mode 100644
index 0000000..af3d629
--- /dev/null
+++ b/bindings/matlab/gd_alter_endianness.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ALTER_ENDIANNESS  Modify the byte sex of a fragment
+ %
+ %   GD_ALTER_ENDIANNESS(DIRFILE,ENDIANNESS,FRAGMENT[,RECODE])
+ %             sets the byte sex of the metadata fragment indexed by FRAGMENT
+ %             in the dirfile DIRFILE to ENDIANNESS, which should be one of:
+ %             numeric zero, indicating the native type of the platform;
+ %             GD.BIG_ENDIAN, or GD.LITTLE_ENDIAN, optionally bitwise or'd with
+ %             either GD.ARM_ENDIAN or GD.NOT_ARM_ENDIAN.  See GETDATA_CONSTANTS
+ %             for these constants.  If RECODE is given and non-zero, binary
+ %             files affected by the byte sex change will be converted.
+ %             Otherwise, the binary files are not modified.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_alter_endianness(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ENDIANNESS, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  int i, r = 0;
+  unsigned long e;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(3,4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  e = gdmx_to_ulong(prhs, 1);
+  i = gdmx_to_int(prhs, 2);
+  if (nrhs > 3)
+    r = gdmx_to_int(prhs, 3);
+
+  gd_alter_endianness(D, e, i, r);
+
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_alter_entry.c b/bindings/matlab/gd_alter_entry.c
new file mode 100644
index 0000000..10b8cd2
--- /dev/null
+++ b/bindings/matlab/gd_alter_entry.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ALTER_ENTRY  Modify field metadata
+ %
+ %   GD_ALTER_ENTRY(DIRFILE,FIELD_CODE,ENTRY[,RECODE])
+ %             modifies the metadata of the field FIELD_CODE in the dirfile
+ %             DIRFILE according to the contents of the ENTRY struct.  If
+ %             RECODE is given and non-zero, other data will be updated to
+ %             reflect metadata changes.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   This function ignores both the .FIELD member and the .FRAGMENT_INDEX
+ %   member of the supplied ENTRY structure.  They may be omitted.  For a
+ %   discussion of the ENTRY structure, see GETDATA.
+ %
+ %   See the documentation on the C API function gd_alter_endianness(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ADD, GD_OPEN, GETDATA
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  gd_entry_t *E;
+  int recode = 0;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(3,4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  E = gdmx_to_entry(prhs, 2, GDMX_ENO_FRAG | GDMX_ENO_FIELD);
+  if (nrhs > 3)
+    recode = gdmx_to_int(prhs, 3);
+
+  gd_alter_entry(D, field_code, E, recode);
+
+  mxFree(field_code);
+  gdmx_free_entry(E);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_alter_frameoffset.c b/bindings/matlab/gd_alter_frameoffset.c
new file mode 100644
index 0000000..8922424
--- /dev/null
+++ b/bindings/matlab/gd_alter_frameoffset.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 "gd_matlab.h"
+
+/*
+ % GD_ALTER_FRAMEOFFSET  Modify the frameoffset of a fragment
+ %
+ %   GD_ALTER_FRAMEOFFSET(DIRFILE,OFFSET,FRAGMENT[,RECODE])
+ %             sets the byte sex of the metadata fragment indexed by FRAGMENT
+ %             in the dirfile DIRFILE to OFFSET.  If RECODE is given and
+ %             non-zero, binary files affected by the offset change will be
+ %             converted.  Otherwise, the binary files are not modified.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_alter_frameoffset(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_FRAMEOFFSET, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  int i, r;
+  unsigned long long o;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  o = gdmx_to_ullong(prhs, 1);
+  i = gdmx_to_int(prhs, 2);
+  r = gdmx_to_int(prhs, 3);
+
+  gd_alter_frameoffset64(D, o, i, r);
+
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_alter_lincom.m b/bindings/matlab/gd_alter_lincom.m
new file mode 100644
index 0000000..4ff624d
--- /dev/null
+++ b/bindings/matlab/gd_alter_lincom.m
@@ -0,0 +1,41 @@
+function gd_alter_lincom(D, field_code, in_fields, m, b)
+% GD_ALTER_LINCOM  Modify the metadata of a LINCOM field
+%
+%   GD_ALTER_LINCOM(DIRFILE,NAME,INPUTS,M,B)
+%             modifies the metadata of the LINCOM field called NAME in the
+%             dirfile specified by DIRFILE.  The input fields are set according
+%             to INPUT; changing the length of this cell array changes the
+%             number of input fields in the dirfile.  The slope and offsets are
+%             set to M and B.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_lincom(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.LINCOM_ENTRY, ...
+  'in_fields', {in_fields}, 'm', m, 'b', b), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_linterp.m b/bindings/matlab/gd_alter_linterp.m
new file mode 100644
index 0000000..a24ff27
--- /dev/null
+++ b/bindings/matlab/gd_alter_linterp.m
@@ -0,0 +1,41 @@
+function gd_alter_linterp(D, field_code, in_fields, table, recode);
+% GD_ALTER_LINTERP  Modify the metadata of a LINTERP field
+%
+%   GD_ALTER_LINTERP(DIRFILE,NAME,INPUT,TABLE,RECODE)
+%             modifies the metadata of the LINTERP field called NAME in the
+%             dirfile specified by DIRFILE.  The input field is set to INPUT,
+%             and the associated look-up table path to TABLE, except when these
+%             inputs are numeric zero, indicating no change.  If RECODE is
+%             non-zero, an existing look-up table will be renamed to TABLE.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_linterp(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.LINTERP_ENTRY, ...
+  'in_fields', in_fields, 'table', table), recode);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_mplex.m b/bindings/matlab/gd_alter_mplex.m
new file mode 100644
index 0000000..aa81377
--- /dev/null
+++ b/bindings/matlab/gd_alter_mplex.m
@@ -0,0 +1,41 @@
+function gd_alter_mplex(D, field_code, in1, in2, count_val, period)
+% GD_ALTER_MPLEX  Modify the metadata of a MPLEX field
+%
+%   GD_ALTER_MPLEX(DIRFILE,NAME,INPUT1,INPUT2,COUNT_VAL,COUNT_MAX)
+%             modifies the metadata of the MPLEX field called NAME in the
+%             dirfile specified by DIRFILE.  The input fields are set to INPUT1,
+%             and INPUT2, if non-zero, and the count value and maximum are set
+%             to COUNT_VAL and COUNT_MAX, respectively.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_mplex(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.MPLEX_ENTRY, ...
+  'in_fields', {{in1; in2}}, 'count_val', count_val, ...
+  'period', period), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_multiply.m b/bindings/matlab/gd_alter_multiply.m
new file mode 100644
index 0000000..550f831
--- /dev/null
+++ b/bindings/matlab/gd_alter_multiply.m
@@ -0,0 +1,39 @@
+function gd_alter_multiply(D, field_code, in1, in2)
+% GD_ALTER_MULTIPLY  Modify the metadata of a MULTIPLY field
+%
+%   GD_ALTER_MULTIPLY(DIRFILE,NAME,INPUT1,INPUT2)
+%             modifies the metadata of the MULTIPLY field called NAME in the
+%             dirfile specified by DIRFILE.  The input fields are set to INPUT1,
+%             and INPUT2, if non-zero.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_multiply(3) in section
+%   3 of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.MULTIPLY_ENTRY, ...
+  'in_fields', {{in1; in2}}), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_phase.m b/bindings/matlab/gd_alter_phase.m
new file mode 100644
index 0000000..ccdd0bc
--- /dev/null
+++ b/bindings/matlab/gd_alter_phase.m
@@ -0,0 +1,39 @@
+function gd_alter_phase(D, field_code, in_fields, shift)
+% GD_ALTER_PHASE  Modify the metadata of a PHASE field
+%
+%   GD_ALTER_PHASE(DIRFILE,NAME,INPUT,SHIFT)
+%             modifies the metadata of the PHASE field called NAME in the
+%             dirfile specified by DIRFILE.  The input field is set to INPUT,
+%             if non-zero, and the phase shift to SHIFT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_phase(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.PHASE_ENTRY, ...
+  'in_fields', {in_fields}, 'shift', shift), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_polynom.m b/bindings/matlab/gd_alter_polynom.m
new file mode 100644
index 0000000..ae255e4
--- /dev/null
+++ b/bindings/matlab/gd_alter_polynom.m
@@ -0,0 +1,39 @@
+function gd_alter_polynom(D, field_code, in_fields, a)
+% GD_ALTER_POLYNOM  Modify the metadata of a POLYNOM field
+%
+%   GD_ALTER_POLYNOM(DIRFILE,NAME,INPUT,A)
+%             modifies the metadata of the POLYNOM field called NAME in the
+%             dirfile specified by DIRFILE.  The input field is set to INPUT1,
+%             if non-zero, and the co-efficient vector to A.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_polynom(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.POLYNOM_ENTRY, ...
+  'in_fields', {in_fields}, 'a', a), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_protection.c b/bindings/matlab/gd_alter_protection.c
new file mode 100644
index 0000000..01f5c7c
--- /dev/null
+++ b/bindings/matlab/gd_alter_protection.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 "gd_matlab.h"
+
+/*
+ % GD_ALTER_PROTECTION  Modify the byte sex of a fragment
+ %
+ %   GD_ALTER_PROTECTION(DIRFILE,LEVEL,FRAGMENT)
+ %             sets the protection level of the metadata fragment indexed by
+ %             FRAGMENT in the dirfile DIRFILE to LEVEL, which should be one of
+ %             the GD.PROTECT_[...] symbols provided by GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_alter_protection(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_PROTECTION, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  int i, n;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+  n = gdmx_to_int(prhs, 2);
+
+  gd_alter_protection(D, n, i);
+
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_alter_raw.m b/bindings/matlab/gd_alter_raw.m
new file mode 100644
index 0000000..9d97a03
--- /dev/null
+++ b/bindings/matlab/gd_alter_raw.m
@@ -0,0 +1,42 @@
+function gd_alter_raw(D, field_code, data_type, spf, recode)
+% GD_ALTER_RAW  Modify the metadata of a RAW field
+%
+%   GD_ALTER_RAW(DIRFILE,NAME,TYPE,SPF,RECODE)
+%             modifies the metadata of the RAW field called NAME in the
+%             dirfile specified by DIRFILE.  The data type is set to TYPE, if
+%             not GD.NULL, and the samples-per-frame to SPF, if not zero.  If
+%             RECODE is non-zero, the binary file associated with the field will
+%             be rewritten to reflect the changes; otherwise the binary file is
+%             not modified.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_raw(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.RAW_ENTRY, ...
+  'data_type', data_type, 'spf', spf), recode);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_recip.m b/bindings/matlab/gd_alter_recip.m
new file mode 100644
index 0000000..af312e6
--- /dev/null
+++ b/bindings/matlab/gd_alter_recip.m
@@ -0,0 +1,39 @@
+function gd_alter_recip(D, field_code, in_fields, dividend)
+% GD_ALTER_RECIP  Modify the metadata of a RECIP field
+%
+%   GD_ALTER_RECIP(DIRFILE,NAME,INPUT,DIVIDEND)
+%             modifies the metadata of the RECIP field called NAME in the
+%             dirfile specified by DIRFILE.  The input field is set to INPUT1,
+%             if non-zero, and the dividend to DIVIDEND.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_recip(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.RECIP_ENTRY, ...
+  'in_fields', {in_fields}, 'dividend', dividend), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_sbit.m b/bindings/matlab/gd_alter_sbit.m
new file mode 100644
index 0000000..beb257d
--- /dev/null
+++ b/bindings/matlab/gd_alter_sbit.m
@@ -0,0 +1,39 @@
+function gd_alter_sbit(D, field_code, in_fields, bitnum, numbits)
+% GD_ALTER_SBIT  Modify the metadata of a SBIT field
+%
+%   GD_ALTER_SBIT(DIRFILE,NAME,INPUT,BITNUM,NUMBITS)
+%             modifies the metadata of the SBIT field called NAME in the
+%             dirfile specified by DIRFILE.  The input field is set to INPUT,
+%             the first bit to BITNUM, and the number of bits to NUMBITS.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_sbit(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.SBIT_ENTRY, ...
+  'in_fields', {in_fields}, 'bitnum', bitnum, 'numbits', numbits), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_alter_spec.c b/bindings/matlab/gd_alter_spec.c
new file mode 100644
index 0000000..8d93377
--- /dev/null
+++ b/bindings/matlab/gd_alter_spec.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 "gd_matlab.h"
+
+/*
+ % GD_ALTER_SPEC  Modify field metadata
+ %
+ %   GD_ALTER_SPEC(DIRFILE,SPEC[,RECODE])
+ %             modifies the metadata of a field in the dirfile DIRFILE
+ %             according to the field specification line SPEC.  If
+ %             RECODE is given and non-zero, other data will be updated to
+ %             reflect metadata changes.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_alter_spec(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_MALTER_SPEC, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *spec;
+  int recode = 0;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(2,3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  spec = gdmx_to_string(prhs, 1, 0);
+  if (nrhs > 2)
+    recode = gdmx_to_int(prhs, 2);
+
+  gd_alter_spec(D, spec, recode);
+
+  mxFree(spec);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_alter_window.m b/bindings/matlab/gd_alter_window.m
new file mode 100644
index 0000000..804746a
--- /dev/null
+++ b/bindings/matlab/gd_alter_window.m
@@ -0,0 +1,40 @@
+function gd_alter_window(D, field_code, in1, in2, windop, threshold)
+% GD_ALTER_WINDOW  Modify the metadata of a WINDOW field
+%
+%   GD_ALTER_WINDOW(DIRFILE,NAME,INPUT1,INPUT2,WINDOP,THRESHOLD)
+%             modifies the metadata of the WINDOW field called NAME in the
+%             dirfile specified by DIRFILE.  The input fields are set to INPUT1,
+%             and INPUT2, if non-zero, the operator to WINDOP and the threshold
+%             to THRESHOLD.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_alter_window(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ALTER_ENTRY, GD_OPEN
+
+  GD = getdata_constants();
+  gd_alter_entry(D, field_code, struct('field_type', GD.WINDOW_ENTRY, ...
+  'in_fields', {{in1; in2}}, 'windop', windop, 'threshold', threshold), 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_bof.c b/bindings/matlab/gd_bof.c
new file mode 100644
index 0000000..597076c
--- /dev/null
+++ b/bindings/matlab/gd_bof.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_BOF  Report the start of data in a field
+ %
+ %   S = GD_BOF(DIRFILE,FIELD_CODE)
+ %             reports the sample number, S,  where the data of the field
+ %             specified by FIELD_CODE starts.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_bof(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_EOF, GD_OPEN, GD_NFRAMES
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  unsigned long long n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_bof64(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ullong(n);
+}
diff --git a/bindings/matlab/gd_carray_len.c b/bindings/matlab/gd_carray_len.c
new file mode 100644
index 0000000..275ccb1
--- /dev/null
+++ b/bindings/matlab/gd_carray_len.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
+ */
+#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_carrays.c b/bindings/matlab/gd_carrays.c
new file mode 100644
index 0000000..5aa34a5
--- /dev/null
+++ b/bindings/matlab/gd_carrays.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 "gd_matlab.h"
+#include <string.h>
+
+/*
+ % GD_CARRAYS  Fetch all CARRAY values
+ %
+ %   A = GD_CARRAYS(DIRFILE[,TYPE])
+ %             returns a cell array of numeric arrays, A, containing all the
+ %             CARRAY data in the dirfile DIRFILE.  A corresponding array of
+ %             field names can be produced with GD_FIELD_LIST_BY_TYPE.  The
+ %             type of the returned data is given by TYPE, one of the data
+ %             type symbols provided by GETDATA_CONSTANTS.  If omitted, the
+ %             default type, GD.FLOAT64, is used.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_carrays(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MCARRAYS, GD_FIELD_LIST_BY_TYPE, GD_GET_CARRAY_SLICE
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  gd_type_t type = GD_FLOAT64;
+  const gd_carray_t *c;
+
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    type = gdmx_to_gd_type(prhs, 1);
+
+  c = gd_carrays(D, type);
+
+  gdmx_err(D, 0);
+
+  /* convert to array of arrays */
+  plhs[0] = gdmx_from_carrays(c, type);
+}
diff --git a/bindings/matlab/gd_close.c b/bindings/matlab/gd_close.c
new file mode 100644
index 0000000..fff7a0d
--- /dev/null
+++ b/bindings/matlab/gd_close.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 "gd_matlab.h"
+
+/*
+ % GD_CLOSE  Save and close a dirfile
+ %
+ %   GD_CLOSE(DIRFILE)
+ %             flushes all changes and closes the dirfile DIRFILE.  The DIRFILE
+ %             object supplied will no longer be valid if this function
+ %             succeeds.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_close(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_DISCARD, GD_OPEN, GD_FLUSH
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  int n;
+
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  n = gd_close(D);
+
+  if (n)
+    gdmx_err(D, 1);
+}
diff --git a/bindings/matlab/gd_constants.c b/bindings/matlab/gd_constants.c
new file mode 100644
index 0000000..be42920
--- /dev/null
+++ b/bindings/matlab/gd_constants.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_CONSTANTS  Fetch all CONST values
+ %
+ %   A = GD_CONSTANTS(DIRFILE[,TYPE])
+ %             returns a numeric array, A, containing all the CONST data in the
+ %             dirfile DIRFILE.  A corresponding array of field names can be
+ %             produced with GD_FIELD_LIST_BY_TYPE.  The type of the returned
+ %             data is given by TYPE, one of the data type symbols provided by
+ %             GETDATA_CONSTANTS.  If omitted, the default type, GD.FLOAT64, is
+ %             used.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_constants(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MCONSTANTS, GD_FIELD_LIST_BY_TYPE, GD_GET_CONSTANT,
+ %            GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const void *data;
+  unsigned int n;
+  gd_type_t type = GD_FLOAT64;
+
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    type = gdmx_to_gd_type(prhs, 1);
+
+  data = gd_constants(D, type);
+
+  gdmx_err(D, 0);
+  
+  /* length */
+  n = gd_nfields_by_type(D, GD_CONST_ENTRY);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_data(data, type, n);
+}
diff --git a/bindings/matlab/gd_delete.c b/bindings/matlab/gd_delete.c
new file mode 100644
index 0000000..3c7838b
--- /dev/null
+++ b/bindings/matlab/gd_delete.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 "gd_matlab.h"
+
+/*
+ % GD_DELETE  Delete a field from a dirfile
+ %
+ %   GD_DELETE(DIRFILE,NAME[,FLAGS])
+ %             deletes the field called NAME from the dirfile DIRFILE.  If
+ %             given, FLAGS should be a bitwise or'd collection of zero or more
+ %             of the GD.DEL_... flags provided by GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_delete_alias(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_DELETE_ALIAS, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code;
+  unsigned int flags = 0;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(2, 3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  if (nrhs > 2)
+    flags = gdmx_to_uint(prhs, 2);
+
+  gd_delete(D, field_code, flags);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_delete_alias.c b/bindings/matlab/gd_delete_alias.c
new file mode 100644
index 0000000..4c1ec1d
--- /dev/null
+++ b/bindings/matlab/gd_delete_alias.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 "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_desync.c b/bindings/matlab/gd_desync.c
new file mode 100644
index 0000000..0cf4bc9
--- /dev/null
+++ b/bindings/matlab/gd_desync.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 "gd_matlab.h"
+
+/*
+ % GD_DESYNC  Modify the byte sex of a fragment
+ %
+ %   B = GD_DESYNC(DIRFILE[,FLAGS])
+ %             returns a boolean, B, indicating whether the dirfile DIRFILE on
+ %             disk has been changed by a third-party since having been opened
+ %             by GetData.  If given, FLAGS should be a bitwise-or'd collection
+ %             of zero or more of the GD.DESYNC_... symbols provided by
+ %             GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_desync(3) in section 3
+ %   the UNIX manual for more details.
+ %
+ %   See also GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  unsigned int flags = 0;
+  int n;
+
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    flags = gdmx_to_uint(prhs, 1);
+
+  n = gd_desync(D, 0);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_bool(n);
+}
diff --git a/bindings/matlab/gd_dirfile_standards.c b/bindings/matlab/gd_dirfile_standards.c
new file mode 100644
index 0000000..f40717e
--- /dev/null
+++ b/bindings/matlab/gd_dirfile_standards.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_DIRFILE_STANDARDS  Change or report the Dirfile Standards Version
+ %
+ %   V = GD_DIRFILE_STANDARDS(DIRFILE[,VERSION])
+ %             if given, sets the standards version of DIRFILE to VERSION, which
+ %             may be a literal number or else one of the GD.VERSION_... symbols
+ %             provided by GETDATA_CONSTANTS.  Returns the current version
+ %             number, V, after possibly changing it.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_dirfile_standards(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  int n, v = GD_VERSION_CURRENT;
+
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    v = gdmx_to_int(prhs, 1);
+
+  n = gd_dirfile_standards(D, v);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_int(n);
+}
diff --git a/bindings/matlab/gd_dirfilename.c b/bindings/matlab/gd_dirfilename.c
new file mode 100644
index 0000000..1a52f32
--- /dev/null
+++ b/bindings/matlab/gd_dirfilename.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_DIRFILENAME  Report the path to a dirfile
+ %
+ %   P = GD_DIRFILENAME(DIRFILE)
+ %             reports the path, P, to the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_dirfilename(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const char *s;
+
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  s = gd_dirfilename(D);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = mxCreateString(s);
+}
diff --git a/bindings/matlab/gd_discard.c b/bindings/matlab/gd_discard.c
new file mode 100644
index 0000000..399e763
--- /dev/null
+++ b/bindings/matlab/gd_discard.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 "gd_matlab.h"
+
+/*
+ % GD_DISCARD  Close a dirfile
+ %
+ %   GD_DISCARD(DIRFILE)
+ %             discards all changes and closes the dirfile DIRFILE.  The DIRFILE
+ %             object supplied will no longer be valid if this function
+ %             succeeds.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_discard(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_CLOSE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  int n;
+
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  n = gd_discard(D);
+
+  if (n)
+    gdmx_err(D, 1);
+}
diff --git a/bindings/matlab/gd_encoding.c b/bindings/matlab/gd_encoding.c
new file mode 100644
index 0000000..e3ff779
--- /dev/null
+++ b/bindings/matlab/gd_encoding.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 "gd_matlab.h"
+
+/*
+ % GD_ENCODING  Report the data encoding of a fragment
+ %
+ %   E = GD_ENCODING(DIRFILE,FRAGMENT)
+ %             reports the encoding, E, of the fragment indexed by FRAGMENT
+ %             in the dirfile DIRFILE.  The returned value will be one of the
+ %             GD.xxx_ENCODED symbols provided by GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_encoding(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ALTER_ENCODING, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  unsigned long n;
+  int i;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+
+  n = gd_encoding(D, i);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ulong(n);
+}
diff --git a/bindings/matlab/gd_endianness.c b/bindings/matlab/gd_endianness.c
new file mode 100644
index 0000000..5f90fb0
--- /dev/null
+++ b/bindings/matlab/gd_endianness.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_ENDIANNESS  Report the data byte sex of a fragment
+ %
+ %   E = GD_ENDIANNESS(DIRFILE,FRAGMENT)
+ %             reports the byte sex, E, of the fragment indexed by FRAGMENT
+ %             in the dirfile DIRFILE.  The returned value will (almost always)
+ %             be either GD.BIG_ENDIAN or GD.LITTLE_ENDIAN, which are provided
+ %             by GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_endiannes(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ALTER_ENDIANNESS, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  unsigned long n;
+  int i;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+
+  n = gd_endianness(D, i);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ulong(n);
+}
diff --git a/bindings/matlab/gd_entry.c b/bindings/matlab/gd_entry.c
new file mode 100644
index 0000000..69aaa05
--- /dev/null
+++ b/bindings/matlab/gd_entry.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 "gd_matlab.h"
+
+/*
+ % GD_ENTRY  Retrieve field metadata
+ %
+ %   E = GD_ENTRY(DIRFILE,FIELD_CODE)
+ %             returns an structure, E, containing the metadata of the field
+ %             specified by FIELD_CODE in the dirfile DIRFILE.  See GETDATA 
+ %             and the corresponding C API documentation for information on
+ %             this structure.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_entry(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ADD, GD_ENTRY_TYPE, GD_ALTER_ENTRY, GD_OPEN, GETDATA
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  gd_entry_t E;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  gd_entry(D, field_code, &E);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_entry(&E);
+  gd_free_entry_strings(&E);
+}
diff --git a/bindings/matlab/gd_entry_list.c b/bindings/matlab/gd_entry_list.c
new file mode 100644
index 0000000..d365921
--- /dev/null
+++ b/bindings/matlab/gd_entry_list.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 "gd_matlab.h"
+
+/*
+ % GD_ENTRY_LIST  Retrieve a list of field names
+ %
+ %   L = GD_ENTRY_LIST(DIRFILE[,PARENT[,TYPE[,FLAGS]]])
+ %             returns a cell array of strings, L, listing all fields in the
+ %             dirfile DIRFILE which satisfy the supplied PARENT, TYPE, and/or
+ %             FLAGS.
+ %
+ %   If PARENT is given, and not numeric zero, metafields of the specified
+ %   parent field will be searched.  Otherwise, only top level fields are
+ %   considered.  If non-zero (matching all types), TYPE should be either one
+ %   of the GD.xxx_ENTRY symbols or else one of the special GD.xxx_ENTRIES
+ %   symbols provided by GETDATA_CONSTANTS.  FLAGS, if given, should be zero
+ %   or more of the GD.ENTRIES_... flags, bitwise or'd together.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_entry_list(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_NENTRIES, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *parent = NULL;
+  unsigned int type = 0, flags = 0;
+  const char **fl;
+
+  GDMX_CHECK_RHS2(1,4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    parent = gdmx_to_string(prhs, 1, 1);
+  if (nrhs > 2)
+    type = gdmx_to_uint(prhs, 2);
+  if (nrhs > 3)
+    flags = gdmx_to_uint(prhs, 3);
+
+  fl = gd_entry_list(D, parent, type, flags);
+
+  mxFree(parent);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_string_list(fl);
+}
diff --git a/bindings/matlab/gd_entry_type.c b/bindings/matlab/gd_entry_type.c
new file mode 100644
index 0000000..f70ac83
--- /dev/null
+++ b/bindings/matlab/gd_entry_type.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 "gd_matlab.h"
+
+/*
+ % GD_ENTRY_TYPE  Retrieve the field type of a field
+ %
+ %   T = GD_ENTRY_TYPE(DIRFILE,FIELD_CODE)
+ %             returns the entry type, T, of the field specified by FIELD_CODE
+ %             in the dirfile DIRFILE.  The returned value will be one of the
+ %             GD.xxx_ENTRY symbols provided by GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_entry_type(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ENTRY, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  gd_entype_t t;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  t = gd_entry_type(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_entype(t);
+}
diff --git a/bindings/matlab/gd_eof.c b/bindings/matlab/gd_eof.c
new file mode 100644
index 0000000..6e85037
--- /dev/null
+++ b/bindings/matlab/gd_eof.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_EOF  Report the end of data in a field
+ %
+ %   S = GD_EOF(DIRFILE,FIELD_CODE)
+ %             reports the sample number, S,  where the data of the field
+ %             specified by FIELD_CODE ends.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_bof(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_BOF, GD_OPEN, GD_NFRAMES
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  unsigned long long n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_eof64(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ullong(n);
+}
diff --git a/bindings/matlab/gd_error.c b/bindings/matlab/gd_error.c
new file mode 100644
index 0000000..55067d5
--- /dev/null
+++ b/bindings/matlab/gd_error.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 "gd_matlab.h"
+
+/*
+ % GD_ERROR  Report the C library error code
+ %
+ %   E = GD_ERROR(DIRFILE)
+ %             returns the error code, E, associated with the last call to the
+ %             C GetData library.  This will be one of the GD.E_... symbols
+ %             provided by GETDATA_CONSTANTS.  Since the MATLAB bindings throw
+ %             exceptions on library error, it is only ever useful to use this
+ %             inside a CATCH block after a GetData Library error has been
+ %             thrown.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_error(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ERROR_STRING, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  int e;
+
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  e = gd_error(D);
+
+  plhs[0] = gdmx_from_int(e);
+}
diff --git a/bindings/matlab/gd_error_string.c b/bindings/matlab/gd_error_string.c
new file mode 100644
index 0000000..c6969eb
--- /dev/null
+++ b/bindings/matlab/gd_error_string.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 "gd_matlab.h"
+
+/*
+ % GD_ERROR_STRING  retrieve the library error string
+ %
+ %   S = GD_ERROR_STRING(DIRFILE)
+ %             returns the error string, S, associated with the last call to the
+ %             C GetData library.  Since the MATLAB bindings throw exceptions
+ %             on library error, it is only ever useful to use this inside a
+ %             CATCH block after a GetData Library error has been thrown.  In
+ %             this case, the .message member of thrown MEXCEPTION object also
+ %             contains this string.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_error_string(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ERROR, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *s;
+
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  s = gd_error_string(D, NULL, 0);
+
+  plhs[0] = gdmx_from_string(s);
+  free(s);
+}
diff --git a/bindings/matlab/gd_field_list.m b/bindings/matlab/gd_field_list.m
new file mode 100644
index 0000000..780b279
--- /dev/null
+++ b/bindings/matlab/gd_field_list.m
@@ -0,0 +1,30 @@
+function field_list = gd_field_list(D)
+% GD_FIELD_LIST  Retrieve a list of field names
+%
+%   GD_FIELD_LIST_BY_TYPE(DIRFILE)
+%             is equivalent to calling GD_ENTRY_LIST(DIRFILE,0,0,0)
+%
+%   See also GD_ENTRY_LIST
+
+  field_list = gd_entry_list(D, 0, 0, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_field_list_by_type.m b/bindings/matlab/gd_field_list_by_type.m
new file mode 100644
index 0000000..f73869d
--- /dev/null
+++ b/bindings/matlab/gd_field_list_by_type.m
@@ -0,0 +1,30 @@
+function field_list = gd_field_list_by_type(D, type)
+% GD_FIELD_LIST_BY_TYPE  Retrieve a list of field names
+%
+%   GD_FIELD_LIST_BY_TYPE(DIRFILE,TYPE)
+%             is equivalent to calling GD_ENTRY_LIST(DIRFILE,0,TYPE,0)
+%
+%   See also GD_ENTRY_LIST
+
+  field_list = gd_entry_list(D, 0, type, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_flags.c b/bindings/matlab/gd_flags.c
new file mode 100644
index 0000000..3423d12
--- /dev/null
+++ b/bindings/matlab/gd_flags.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 "gd_matlab.h"
+
+/*
+ % GD_FLAGS  Modify or report dirfile flags
+ %
+ %   F = GD_FLAGS(DIRFILE,SET,RESET)
+ %             sets the operational flags of the dirfile DIRFILE according to 
+ %             SET and RESET, which should be bitwise or'd collections of the
+ %             Dirfile flags provided by GETDATA_CONSTANTS.  This function then
+ %             returns the update flag register, F.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_flags(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  unsigned long set, reset, flags;
+
+  GDMX_CHECK_RHS(3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  set = gdmx_to_ulong(prhs, 1);
+  reset = gdmx_to_ulong(prhs, 2);
+
+  flags = gd_flags(D, set, reset);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ulong(flags);
+}
diff --git a/bindings/matlab/gd_flush.c b/bindings/matlab/gd_flush.c
new file mode 100644
index 0000000..b065036
--- /dev/null
+++ b/bindings/matlab/gd_flush.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 "gd_matlab.h"
+
+/*
+ % GD_FLUSH  Flush and close modified data files
+ %
+ %   GD_FLUSH(DIRFILE[,FIELD_CODE])
+ %             flushes the binary data files associated with the dirfile DIRFILE
+ %             to disk, and then closes open files.  If FIELD_CODE is given and
+ %             not numeric zero, only the specified field is flushed.  Otherwise
+ %             all open data files are flushed and closed.  In this second case,
+ %             modified metadata is also flushed.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_flush(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_CLOSE, GD_SYNC, GD_RAW_CLOSE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code = NULL;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    field_code = gdmx_to_string(prhs, 1, 1);
+
+  gd_flush(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_fragment_affixes.c b/bindings/matlab/gd_fragment_affixes.c
new file mode 100644
index 0000000..7999a0c
--- /dev/null
+++ b/bindings/matlab/gd_fragment_affixes.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 "gd_matlab.h"
+
+/*
+ % GD_FRAGMENT_AFFIXES  Retrieve the affixes of an included fragment
+ %
+ %  L = GD_FRAGMENT_AFFIXES(DIRFILE,FRAGMENT)
+ %             returns a two-element cell array containing the prefix and suffix
+ %             (in that order) of the fragment specified by FRAGMENT in the
+ %             dirfile DIRFILE.  If an affix is empty, numeric zero will be
+ %             reported in the corresponding cell.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_fragment_affixes(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ALTER_AFFIXES, GD_INCLUDE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  int fragment_index;
+  char *al[3];
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  fragment_index = gdmx_to_int(prhs, 1);
+
+  gd_fragment_affixes(D, fragment_index, al, al + 1);
+  al[2] = NULL;
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_string_list((const char**)al);
+
+  free(al[0]);
+  free(al[1]);
+}
diff --git a/bindings/matlab/gd_fragment_index.c b/bindings/matlab/gd_fragment_index.c
new file mode 100644
index 0000000..5d647b1
--- /dev/null
+++ b/bindings/matlab/gd_fragment_index.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_FRAGMENT_INDEX  Report the fragment index of a field
+ %
+ %   I = GD_FRAGMENT_INDEX(DIRFILE,FIELD_CODE)
+ %             returns the fragment index, I, of the field specified by
+ %             FIELD_CODE in the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_fragment_index(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ENTRY, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  int n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_fragment_index(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_int(n);
+}
diff --git a/bindings/matlab/gd_fragmentname.c b/bindings/matlab/gd_fragmentname.c
new file mode 100644
index 0000000..10a2c7f
--- /dev/null
+++ b/bindings/matlab/gd_fragmentname.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 "gd_matlab.h"
+
+/*
+ % GD_FRAGMENTNAME  Report the pathname of a metdata fragment
+ %
+ %   P = GD_FRAGMENTNAME(DIRFILE,FRAGMENT)
+ %             reports the pathname, P, of the fragment indexed by FRAGMENT in
+ %             the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_fragmentname(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN, GD_INCLUDE
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const char *s;
+  int i;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+
+  s = gd_fragmentname(D, i);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = mxCreateString(s);
+}
diff --git a/bindings/matlab/gd_framenum.c b/bindings/matlab/gd_framenum.c
new file mode 100644
index 0000000..f9902e7
--- /dev/null
+++ b/bindings/matlab/gd_framenum.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 "gd_matlab.h"
+
+/*
+ % GD_FRAMENUM  Reverse look-up on a field
+ %
+ %   F = GD_FRAMENUM(DIRFILE,FIELD_CODE,VALUE[,START[,END]])
+ %             performs a reverse look-up on the field FIELD_CODE, reporting the
+ %             (fractional) frame number, F, where it takes on the value VALUE.
+ %             If given and non-zero, only the portion of the field between
+ %             START and END are considered.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_framenum_subset(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_BOF, GD_EOF, GD_OPEN, GD_GETDATA
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  double r, value;
+  long long first_samp = 0, last_samp = 0;
+
+  GDMX_CHECK_RHS2(3,5);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  value = gdmx_to_double(prhs, 2);
+  if (nrhs > 3)
+    first_samp = gdmx_to_llong(prhs, 3);
+  if (nrhs > 4)
+    last_samp = gdmx_to_llong(prhs, 4);
+
+  r = gd_framenum_subset64(D, field_code, value, first_samp, last_samp);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_double(r);
+}
diff --git a/bindings/matlab/gd_frameoffset.c b/bindings/matlab/gd_frameoffset.c
new file mode 100644
index 0000000..c19b0f5
--- /dev/null
+++ b/bindings/matlab/gd_frameoffset.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 "gd_matlab.h"
+
+/*
+ % GD_FRAMEOFFSET  Report the frame offset of a fragment
+ %
+ %   O = GD_FRAME_OFFSET(DIRFILE,FRAGMENT)
+ %             reports the frame offset of the fragment specified by FRAGMENT
+ %             in the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_frame_offset(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ALTER_FRAMEOFFSET, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  unsigned long long n;
+  int i;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+
+  n = gd_frameoffset64(D, i);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ullong(n);
+}
diff --git a/bindings/matlab/gd_get_carray.c b/bindings/matlab/gd_get_carray.c
new file mode 100644
index 0000000..4a5fdb5
--- /dev/null
+++ b/bindings/matlab/gd_get_carray.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 "gd_matlab.h"
+
+/*
+ % GD_GET_CARRAY  Retrieve CARRAY data
+ %
+ %   A = GD_GET_CARRAY(DIRFILE,FIELD_CODE[,TYPE])
+ %             retrieves an array, A, of value of the CARRAY field called
+ %             FIELD_CODE.  If type is given, it should be one of the data type
+ %             symbols provided by GETDATA_CONSTANTS, otherwise the data are
+ %             returned in their native type.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_get_carray_slice(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_GET_CARRAY_SLICE, GD_PUT_CARRAY, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  gd_type_t type;
+  size_t len;
+
+  GDMX_CHECK_RHS2(2,3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  if (nrhs > 2)
+    type = gdmx_to_gd_type(prhs, 2);
+  else {
+    type = gd_native_type(D, field_code);
+    gdmx_err(D, 0);
+  }
+
+  len = gd_carray_len(D, field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_vector(type, len, &data);
+
+  gd_get_carray(D, field_code, type, data);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  gdmx_fix_vector(plhs[0], type, len, data);
+}
diff --git a/bindings/matlab/gd_get_carray_slice.c b/bindings/matlab/gd_get_carray_slice.c
new file mode 100644
index 0000000..7dc8245
--- /dev/null
+++ b/bindings/matlab/gd_get_carray_slice.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 "gd_matlab.h"
+
+/*
+ % GD_GET_CARRAY_SLICE  Retrieve CARRAY data
+ %
+ %   A = GD_GET_CARRAY_SLICE(DIRFILE,FIELD_CODE,START,LEN[,TYPE])
+ %             retrieves a subset, A, of the CARRAY field called FIELD_CODE.
+ %             LEN elements are retrieved, starting with element START.  If type
+ %             is given, it should be one of the data type symbols provided by
+ %             GETDATA_CONSTANTS, otherwise the data are returned in their
+ %             native type.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_get_carray_slice(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_GET_CARRAY, GD_PUT_CARRAY_SLICE, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  unsigned int start;
+  size_t len;
+  gd_type_t type;
+
+  GDMX_CHECK_RHS2(4,5);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  start = gdmx_to_uint(prhs, 2);
+  len = gdmx_to_size_t(prhs, 3);
+  if (nrhs > 4)
+    type = gdmx_to_gd_type(prhs, 4);
+  else {
+    type = gd_native_type(D, field_code);
+    gdmx_err(D, 0);
+  }
+
+  plhs[0] = gdmx_vector(type, len, &data);
+
+  gd_get_carray_slice(D, field_code, start, len, type, data);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  gdmx_fix_vector(plhs[0], type, len, data);
+}
diff --git a/bindings/matlab/gd_get_constant.m b/bindings/matlab/gd_get_constant.m
new file mode 100644
index 0000000..08ce4c8
--- /dev/null
+++ b/bindings/matlab/gd_get_constant.m
@@ -0,0 +1,37 @@
+function n = gd_get_constant(D, field_code, varargin)
+% GD_GET_CONSTANT  Retrieve CONST data
+%
+%   N = GD_GET_CONSTANT(DIRFILE,FIELD,TYPE)
+%             is equivalent to N = GD_GET_CARRAY_SLICE(DIRFILE,FIELD,0,1,TYPE)
+%
+%   N = GD_GET_CONSTANT(DIRFILE,FIELD)
+%             is equivalent to N = GD_GET_CARRAY_SLICE(DIRFILE,FIELD,0,1)
+%
+%   See also GD_GET_CARRAY_SLICE
+
+if (numel(varargin) > 0)
+  n = gd_get_carray_slice(D, field_code, 0, 1, varargin{1});
+else
+  n = gd_get_carray_slice(D, field_code, 0, 1);
+end
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_get_string.c b/bindings/matlab/gd_get_string.c
new file mode 100644
index 0000000..e47a699
--- /dev/null
+++ b/bindings/matlab/gd_get_string.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 "gd_matlab.h"
+
+/*
+ % GD_GET_CARRAY  Retrieve STRING data
+ %
+ %   S = GD_GET_CARRAY(DIRFILE,FIELD_CODE)
+ %             retrieves the value, S, the STRING field called FIELD_CODE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_get_string(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_PUT_STRING, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  size_t len;
+  char *s;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  /* get length */
+  len = gd_get_string(D, field_code, 0, NULL);
+
+  gdmx_err(D, 0);
+
+  s = mxMalloc(len);
+
+  gd_get_string(D, field_code, len, s);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = mxCreateString(s);
+  mxFree(s);
+}
diff --git a/bindings/matlab/gd_getdata.c b/bindings/matlab/gd_getdata.c
new file mode 100644
index 0000000..176e4a6
--- /dev/null
+++ b/bindings/matlab/gd_getdata.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 "gd_matlab.h"
+
+/*
+ % GD_GETDATA  Retrieve vector data
+ %
+ %   V = GD_GETDATA(DIRFILE,FIELD_CODE,FIRST_FRAME,FIRST_SAMP,NFRAMES,NSAMP ...
+ %                  [,TYPE])
+ %             retrieves a vector, V, of NFRAMES frames plus NSAMPLES samples of
+ %             data from the vector field FIELD_CODE starting FIRST_SAMP samples
+ %             past the start of FIRST_FRAME.  If type is given, it should be
+ %             one of the data type symbols provided by GETDATA_CONSTANTS,
+ %             otherwise the data are returned in their native type.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_getdata(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_PUTDATA, GD_OPEN
+ */
+
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  long long first_frame, first_samp;
+  size_t nsamp;
+  gd_type_t type;
+
+  GDMX_CHECK_RHS2(6,7);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  first_frame = gdmx_to_llong(prhs, 2);
+  first_samp = gdmx_to_llong(prhs, 3);
+  nsamp = gdmx_to_nsamp(D, field_code, prhs, 4, 5);
+  if (nrhs > 6)
+    type = gdmx_to_gd_type(prhs, 6);
+  else {
+    type = gd_native_type(D, field_code);
+    gdmx_err(D, 0);
+  }
+
+  plhs[0] = gdmx_vector(type, nsamp, &data);
+
+  gd_getdata64(D, field_code, (gd_off64_t)first_frame, (gd_off64_t)first_samp,
+      0, nsamp, type, data);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  gdmx_fix_vector(plhs[0], type, nsamp, data);
+}
diff --git a/bindings/matlab/gd_hidden.c b/bindings/matlab/gd_hidden.c
new file mode 100644
index 0000000..afbbe10
--- /dev/null
+++ b/bindings/matlab/gd_hidden.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 "gd_matlab.h"
+
+/*
+ % GD_HIDDEN  Report whether a field is hidden
+ %
+ %   B = GD_HIDDEN(DIRFILE,FIELD_CODE)
+ %             returns boolean true, B, if FIELD_CODE is hidden in the metadata.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_hidden(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_HIDE, GD_UNHIDE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  int n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_hidden(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_bool(n);
+}
diff --git a/bindings/matlab/gd_hide.c b/bindings/matlab/gd_hide.c
new file mode 100644
index 0000000..a607775
--- /dev/null
+++ b/bindings/matlab/gd_hide.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 "gd_matlab.h"
+
+/*
+ % GD_HIDE  Hide a field
+ %
+ %   GD_HIDE(DIRFILE,FIELD_CODE)
+ %             hides the field called FIELD_CODE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_hide(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_HIDDEN, GD_UNHIDE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  gd_hide(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_include.c b/bindings/matlab/gd_include.c
new file mode 100644
index 0000000..fc6551a
--- /dev/null
+++ b/bindings/matlab/gd_include.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 "gd_matlab.h"
+
+/*
+ % GD_INCLUDE  Add a format metadata fragment
+ %
+ %   GD_INCLUDE(DIRFILE,PATH,PARENT,FLAGS[,PREFIX[,SUFFIX]])
+ %             adds the fragment at PATH to the open dirfile DIRFILE below the
+ %             current fragment indexed by PARENT.  FLAGS should be zero or more
+ %             Dirfile flags provided by GETDATA_CONSTANTS, bitwise-or'd
+ %             together.  If given an not numeric zero, PREFIX and SUFFIX
+ %             provide the fragment affixes.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_include_affix(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_UNINCLUDE, GD_FRAGMENT_AFFIXES, GD_ALTER_AFFIXEX, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *filename;
+  char *prefix = NULL, *suffix = NULL;
+  int parent, n;
+  unsigned long flags;
+
+  GDMX_CHECK_RHS2(4,6);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  filename = gdmx_to_string(prhs, 1, 0);
+  parent = gdmx_to_int(prhs, 2);
+  flags = gdmx_to_ulong(prhs, 3);
+  if (nrhs > 4)
+    prefix = gdmx_to_string(prhs, 4, 1);
+  if (nrhs > 5)
+    suffix = gdmx_to_string(prhs, 5, 1);
+
+  n = gd_include_affix(D, filename, parent, prefix, suffix, flags);
+
+  mxFree(filename);
+  mxFree(prefix);
+  mxFree(suffix);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_int(n);
+}
diff --git a/bindings/matlab/gd_invalid_dirfile.c b/bindings/matlab/gd_invalid_dirfile.c
new file mode 100644
index 0000000..4b01565
--- /dev/null
+++ b/bindings/matlab/gd_invalid_dirfile.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 "gd_matlab.h"
+
+/*
+ % GD_INVALID_DIRFILE  Create an invalid dirfile object
+ %
+ %   D = GD_INVALID_DIRFILE()
+ %             creates an invalid dirfile object, D.  It should be deallocated
+ %             with GD_CLOSE or GD_DISCARD when no longer needed.
+ %
+ %   See the documentation on the C API function gd_invalid_dirfile(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_CLOSE, GD_DISCARD, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+
+  GDMX_CHECK_RHS(0);
+
+  D = gd_invalid_dirfile();
+
+  plhs[0] = gdmx_from_dirfile(D);
+}
diff --git a/bindings/matlab/gd_linterp_tablename.c b/bindings/matlab/gd_linterp_tablename.c
new file mode 100644
index 0000000..028573c
--- /dev/null
+++ b/bindings/matlab/gd_linterp_tablename.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 "gd_matlab.h"
+
+/*
+ % GD_LINTER_TABLENAME  Report the pathname of binary file
+ %
+ %   P = GD_LINTER_TABLENAME(DIRFILE,FIELD_CODE)
+ %             reports the pathname, P, of the look-up table associated with the
+ %             LINTERP field specified by FIELD_CODE in the the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_linterp_tablename(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const char *s;
+  char *field_code;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  s = gd_linterp_tablename(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = mxCreateString(s);
+}
diff --git a/bindings/matlab/gd_madd.c b/bindings/matlab/gd_madd.c
new file mode 100644
index 0000000..b9d6780
--- /dev/null
+++ b/bindings/matlab/gd_madd.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 "gd_matlab.h"
+
+/*
+ % GD_MADD  Add a metafield
+ %
+ %   GD_MADD(DIRFILE,ENTRY,PARENT)
+ %             adds a metafield described by ENTRY to the dirfile DIRFILE under
+ %             parent field PARENT.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   The ENTRY object should be an entry struct; see GETDATA and gd_entry(3) in
+ %   the UNIX manual for details.
+ %
+ %   See the documentation on the C API function gd_madd(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ADD, GD_OPEN, GETDATA
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *parent;
+  gd_entry_t *E;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  E = gdmx_to_entry(prhs, 1, GDMX_ENO_FRAG);
+  parent = gdmx_to_string(prhs, 2, 0);
+
+  gd_madd(D, E, parent);
+
+  gdmx_free_entry(E);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_madd_alias.c b/bindings/matlab/gd_madd_alias.c
new file mode 100644
index 0000000..bb60e6c
--- /dev/null
+++ b/bindings/matlab/gd_madd_alias.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 "gd_matlab.h"
+
+/*
+ % GD_MADD_ALIAS  Add a field alias
+ %
+ %   GD_MADD_ALIAS(DIRFILE,PARENT,NAME,TARGET)
+ %             adds a field alias metafield called NAME pointing to TARGET under
+ %             parent field PARENT in the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_madd_alias(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ADD_ALIAS, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code, *target, *parent;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  parent = gdmx_to_string(prhs, 1, 0);
+  field_code = gdmx_to_string(prhs, 2, 0);
+  target = gdmx_to_string(prhs, 3, 0);
+
+  gd_madd_alias(D, parent, field_code, target);
+
+  mxFree(target);
+  mxFree(field_code);
+  mxFree(parent);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_madd_bit.m b/bindings/matlab/gd_madd_bit.m
new file mode 100644
index 0000000..8208d72
--- /dev/null
+++ b/bindings/matlab/gd_madd_bit.m
@@ -0,0 +1,39 @@
+function gd_madd_bit(D, parent, field_code, in_fields, bitnum, numbits)
+% GD_MADD_BIT  Add a BIT metafield
+%
+%   GD_MADD_BIT(DIRFILE,PARENT,NAME,INPUT,BITNUM,NUMBITS)
+%             adds a BIT metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input field is INPUT, the first bit is
+%             BITNUM and the length is NUMBITS.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_bit(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_BIT, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.BIT_ENTRY, ...
+  'in_fields', {in_fields}, 'bitnum', bitnum, 'numbits', numbits), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_carray.c b/bindings/matlab/gd_madd_carray.c
new file mode 100644
index 0000000..a72a75b
--- /dev/null
+++ b/bindings/matlab/gd_madd_carray.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 "gd_matlab.h"
+
+/*
+ % GD_MADD_CARRAY  Add a CARRAY field
+ %
+ %   GD_MADD_CARRAY(DIRFILE,PARENT,NAME,TYPE,VALUES)
+ %             adds a CARRAY metafield called NAME to the dirfile specified by
+ %             DIRFILE under parent field PARENT.  The storage type is TYPE,
+ %             and the values of the field are in VALUES.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_madd_carray(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MADD, GD_ADD_CARRAY, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_name, *parent;
+  size_t n;
+  gd_type_t const_type, data_type;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(5);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  parent = gdmx_to_string(prhs, 1, 0);
+  field_name = gdmx_to_string(prhs, 2, 0);
+  const_type = gdmx_to_gd_type(prhs, 3);
+  gdmx_to_data(&data, &data_type, &n, prhs, 4);
+
+  gd_madd_carray(D, parent, field_name, const_type, n, data_type, data);
+
+  gdmx_free_data(data, data_type);
+  mxFree(field_name);
+  mxFree(parent);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_madd_const.c b/bindings/matlab/gd_madd_const.c
new file mode 100644
index 0000000..480e824
--- /dev/null
+++ b/bindings/matlab/gd_madd_const.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 "gd_matlab.h"
+
+/*
+ % GD_MADD_CONST  Add a CONST metafield
+ %
+ %   GD_MADD_CONST(DIRFILE,PARENT,NAME,TYPE,VALUE)
+ %             adds a CONST metafield called NAME to the dirfile specified by
+ %             DIRFILE under parent PARENT.  The storage type is TYPE, and the
+ %             value of the field is VALUE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_madd_const(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MADD, GD_ADD_CONST, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_name, *parent;
+  size_t n;
+  gd_type_t const_type, data_type;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(5);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  parent = gdmx_to_string(prhs, 1, 0);
+  field_name = gdmx_to_string(prhs, 2, 0);
+  const_type = gdmx_to_gd_type(prhs, 3);
+  gdmx_to_data(&data, &data_type, &n, prhs, 4);
+
+  n = gd_madd_const(D, parent, field_name, const_type, data_type, data);
+
+  gdmx_free_data(data, data_type);
+  mxFree(field_name);
+  mxFree(parent);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_madd_divide.m b/bindings/matlab/gd_madd_divide.m
new file mode 100644
index 0000000..45e5ed2
--- /dev/null
+++ b/bindings/matlab/gd_madd_divide.m
@@ -0,0 +1,38 @@
+function gd_madd_divide(D, parent, field_code, in1, in2)
+% GD_MADD_DIVIDE  Add a DIVIDE metafield
+%
+%   GD_MADD_DIVIDE(DIRFILE,PARENT,NAME,INPUT1,INPUT2)
+%             adds a DIVIDE metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input fields are INPUT1 and INPUT2.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_divide(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_DIVIDE, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.DIVIDE_ENTRY, ...
+  'in_fields', {{in1; in2}}), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_lincom.m b/bindings/matlab/gd_madd_lincom.m
new file mode 100644
index 0000000..1fa7cf6
--- /dev/null
+++ b/bindings/matlab/gd_madd_lincom.m
@@ -0,0 +1,40 @@
+function gd_madd_lincom(D, parent, field_code, in_fields, m, b);
+% GD_MADD_LINCOM  Add a LINCOM metafield
+%
+%   GD_MADD_LINCOM(DIRFILE,PARENT,NAME,IPUTS,M,B)
+%             adds a LINCOM metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE. The input fields are provided in the cell
+%             array INPUTS and the slopes and offsets given by the numeric
+%             arrays M and B, which may be complex valued.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_lincom(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_LINCOM, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.LINCOM_ENTRY, ...
+  'in_fields', {in_fields}, 'm', m, 'b', b), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_linterp.m b/bindings/matlab/gd_madd_linterp.m
new file mode 100644
index 0000000..e984d56
--- /dev/null
+++ b/bindings/matlab/gd_madd_linterp.m
@@ -0,0 +1,39 @@
+function gd_madd_linterp(D, parent, field_code, in_fields, table)
+% GD_MADD_LINTERP  Add a LINTERP metafield
+%
+%   GD_MADD_LINTERP(DIRFILE,PARENT,NAME,INPUT,TABLE)
+%             adds a LINTERP metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input field is INPUT and the associated
+%             look-up table is given by the path TABLE.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_linterp(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_LINTERP, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.LINTERP_ENTRY, ...
+  'in_fields', in_fields, 'table', table), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_mplex.m b/bindings/matlab/gd_madd_mplex.m
new file mode 100644
index 0000000..884d48a
--- /dev/null
+++ b/bindings/matlab/gd_madd_mplex.m
@@ -0,0 +1,42 @@
+function gd_madd_mplex(D, parent, field_code, in_field1, in_field2, ...
+count_val, period)
+% GD_MADD_MPLEX  Add a MPLEX metafield
+%
+%   GD_MADD_MPLEX(DIRFILE,PARENT,NAME,INPUT1,INPUT2,COUNT_VAL,COUNT_MAX)
+%             adds a MPLEX metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input data field is INPUT1, the index
+%             field is INPUT2.  The target value is COUNT_VAL and the maximum
+%             value of INPUT2 is COUNT_MAX.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_mplex(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_MPLEX, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.MPLEX_ENTRY, ...
+  'in_fields', {{in_field1; in_field2}}, 'count_val', count_val, ...
+  'period', period), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_multiply.m b/bindings/matlab/gd_madd_multiply.m
new file mode 100644
index 0000000..679cdcd
--- /dev/null
+++ b/bindings/matlab/gd_madd_multiply.m
@@ -0,0 +1,38 @@
+function gd_madd_multiply(D, parent, field_code, in1, in2)
+% GD_MADD_MULTIPLY  Add a MULTIPLY metafield
+%
+%   GD_MADD_MULTIPLY(DIRFILE,PARENT,NAME,INPUT1,INPUT2)
+%             adds a MULTIPLY metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input fields are INPUT1 and INPUT2.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_multiply(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_MULTIPLY, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.MULTIPLY_ENTRY, ...
+  'in_fields', {{in1; in2}}), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_phase.m b/bindings/matlab/gd_madd_phase.m
new file mode 100644
index 0000000..81287b2
--- /dev/null
+++ b/bindings/matlab/gd_madd_phase.m
@@ -0,0 +1,39 @@
+function gd_madd_phase(D, parent, field_code, in_fields, shift)
+% GD_MADD_PHASE  Add a PHASE metafield
+%
+%   GD_MADD_PHASE(DIRFILE,PARENT,NAME,INPUT,SHIFT)
+%             adds a PHASE metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input field is INPUT and the phase
+%             shift SHIFT.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_phase(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_PHASE, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.PHASE_ENTRY, ...
+  'in_fields', {in_fields}, 'shift', shift), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_polynom.m b/bindings/matlab/gd_madd_polynom.m
new file mode 100644
index 0000000..ed750d5
--- /dev/null
+++ b/bindings/matlab/gd_madd_polynom.m
@@ -0,0 +1,39 @@
+function gd_madd_polynom(D, parent, field_code, in_fields, a)
+% GD_MADD_POLYNOM  Add a POLYNOM metafield
+%
+%   GD_MADD_POLYNOM(DIRFILE,PARENT,NAME,INPUT,A)
+%             adds a POLYNOM metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input field is INPUT and the vector of
+%             co-efficients is A.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_polynom(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_POLYNOM, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.POLYNOM_ENTRY, ...
+  'in_fields', {in_fields}, 'a', a), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_recip.m b/bindings/matlab/gd_madd_recip.m
new file mode 100644
index 0000000..1b99d09
--- /dev/null
+++ b/bindings/matlab/gd_madd_recip.m
@@ -0,0 +1,39 @@
+function gd_madd_recip(D, parent, field_code, in_fields, dividend)
+% GD_MADD_RECIP  Add a RECIP metafield
+%
+%   GD_MADD_RECIP(DIRFILE,PARENT,NAME,INPUT,DIVIDEND)
+%             adds a RECIP metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input field is INPUT, and the dividend
+%             DIVIDEND.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_recip(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_RECIP, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.RECIP_ENTRY, ...
+  'in_fields', {in_fields}, 'dividend', dividend), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_sbit.m b/bindings/matlab/gd_madd_sbit.m
new file mode 100644
index 0000000..4a35307
--- /dev/null
+++ b/bindings/matlab/gd_madd_sbit.m
@@ -0,0 +1,39 @@
+function gd_madd_sbit(D, parent, field_code, in_fields, bitnum, numbits)
+% GD_MADD_SBIT  Add a SBIT metafield
+%
+%   GD_MADD_SBIT(DIRFILE,PARENT,NAME,INPUT,BITNUM,NUMBITS)
+%             adds a SBIT metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The input field is INPUT, the first bit is
+%             BITNUM and the length is NUMBITS.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_sbit(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_SBIT, GD_MADD, GD_OPEN
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.SBIT_ENTRY, ...
+  'in_fields', {in_fields}, 'bitnum', bitnum, 'numbits', numbits), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_madd_spec.c b/bindings/matlab/gd_madd_spec.c
new file mode 100644
index 0000000..1d23f5a
--- /dev/null
+++ b/bindings/matlab/gd_madd_spec.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 "gd_matlab.h"
+
+/*
+ % GD_MADD_SPEC  Add a metafield
+ %
+ %   GD_MADD_SPEC(DIRFILE,SPEC,PARENT)
+ %             adds a metafield described by the field specification line SPEC
+ %             to the dirfile DIRFILE under parent field PARENT.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_madd_spec(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MADD, GD_ADD_SPEC, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *spec, *parent;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  spec = gdmx_to_string(prhs, 1, 0);
+  parent = gdmx_to_string(prhs, 2, 0);
+
+  gd_madd_spec(D, spec, parent);
+
+  mxFree(parent);
+  mxFree(spec);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_madd_string.c b/bindings/matlab/gd_madd_string.c
new file mode 100644
index 0000000..1f5573e
--- /dev/null
+++ b/bindings/matlab/gd_madd_string.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 "gd_matlab.h"
+
+/*
+ % GD_MADD_STRING  Add a STRING field
+ %
+ %   GD_MADD_STRING(DIRFILE,PARENT,NAME,VALUE)
+ %             adds a STRING metafield called NAME to the dirfile specified by
+ %             DIRFILE under parent field PARENT.  The value of the field is
+ %             set to VALUE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_madd_string(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MADD, GD_ADD_STRING, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_name, *value, *parent;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  parent = gdmx_to_string(prhs, 1, 0);
+  field_name = gdmx_to_string(prhs, 2, 0);
+  value = gdmx_to_string(prhs, 3, 0);
+
+  gd_madd_string(D, parent, field_name, value);
+
+  mxFree(field_name);
+  mxFree(value);
+  mxFree(parent);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_madd_window.m b/bindings/matlab/gd_madd_window.m
new file mode 100644
index 0000000..8dcab8c
--- /dev/null
+++ b/bindings/matlab/gd_madd_window.m
@@ -0,0 +1,43 @@
+function gd_madd_window(D, parent, field_code, in_field1, in_field2, windop, ...
+threshold)
+% GD_MADD_WINDOW  Add a WINDOW metafield
+%
+%   GD_MADD_WINDOW(DIRFILE,PARENT,NAME,INPUT1,INPUT2)
+%             adds a WINDOW metafield called NAME under PARENT to the dirfile
+%             specified by DIRFILE.  The data input field is INPUT1, and the
+%             mask field is INPUT2. The operator is specified by WINDOP, which
+%             should be one of the GD.WINDOP_... members provided by
+%             GETDATA_CONSTANTS, and the threshold is THRESHOLD.
+%
+%   The DIRFILE object should have previously been created with GD_OPEN.
+%
+%   See the documentation on the C API function gd_madd_window(3) in section 3
+%   of the UNIX manual for more details.
+%
+%   See also GD_ADD_WINDOW, GD_MADD, GD_OPEN, GETDATA_CONSTANTS
+
+  GD = getdata_constants();
+  gd_madd(D, struct('field', field_code, 'field_type', GD.WINDOW_ENTRY, ...
+  'in_fields', {{in_field1; in_field2}}, 'windop', windop, ...
+  'threshold', threshold), parent);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_malter_spec.c b/bindings/matlab/gd_malter_spec.c
new file mode 100644
index 0000000..8e4a1a4
--- /dev/null
+++ b/bindings/matlab/gd_malter_spec.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 "gd_matlab.h"
+
+/*
+ % GD_ALTER_SPEC  Modify metafield metadata
+ %
+ %   GD_ALTER_SPEC(DIRFILE,SPEC,PARENT[,RECODE])
+ %             modifies the metadata of a metafield under parent field PARENT in
+ %             the dirfile DIRFILE according to the field specification line
+ %             SPEC.  If RECODE is given and non-zero, other data will be
+ %             updated to reflect metadata changes.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_malter_spec(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ALTER_SPEC, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *spec, *parent;
+  int recode = 0;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(3,4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  spec = gdmx_to_string(prhs, 1, 0);
+  parent = gdmx_to_string(prhs, 2, 0);
+  if (nrhs > 3)
+    recode = gdmx_to_int(prhs, 3);
+
+  gd_malter_spec(D, spec, parent, recode);
+
+  mxFree(spec);
+  mxFree(parent);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_matlab.h b/bindings/matlab/gd_matlab.h
new file mode 100644
index 0000000..f3f0b83
--- /dev/null
+++ b/bindings/matlab/gd_matlab.h
@@ -0,0 +1,113 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifndef GD_MATLAB_H
+
+/* mex runs GCC in -ansi mode */
+#ifndef GDMXLIB
+#define GD_C89_API
+#endif
+#define GD_64BIT_API
+#include "getdata.h"
+
+#include <mex.h>
+
+#define GDMX_INTERNAL_ERROR \
+  mexErrMsgIdAndTxt("GetData:GDMX:InternalError", \
+      "Internal error at [%s,%i]", __FILE__, __LINE__ )
+
+#define GDMX_NO_LHS \
+  if (nlhs > 0) \
+    mexErrMsgIdAndTxt("GetData:GDMX:nLHS", \
+        "Too many output arguments.")
+
+#define GDMX_CHECK_RHS(n) \
+  if (nrhs != (n)) \
+    mexErrMsgIdAndTxt("GetData:GDMX:nRHS", \
+        "Invalid argument count; wanted %i, given %i", \
+        (n), nrhs)
+
+#define GDMX_CHECK_RHS2(m,n) \
+  if (nrhs < (m)) \
+    mexErrMsgIdAndTxt("GetData:GDMX:nRHS", \
+        "Invalid argument count; wanted at least %i, given %i", \
+        (m), nrhs); \
+  else if (nrhs > (n)) \
+    mexErrMsgIdAndTxt("GetData:GDMX:nRHS", \
+        "Invalid argument count; wanted at most %i, given %i", \
+        (n), nrhs)
+
+/* integer type aliases */
+#if SIZEOF_SIZE_T == 8
+#define gdmx_to_size_t(a,b) ((size_t)gdmx_to_ullong(a,b))
+#define gdmx_from_size_t gdmx_from_ullong
+#else
+#define gdmx_to_size_t(a,b) ((size_t)gdmx_to_ulong(a,b))
+#define gdmx_from_size_t gdmx_from_ulong
+#endif
+#define gdmx_to_gd_type(a,b) ((gd_type_t)gdmx_to_int(a,b))
+#define gdmx_from_gd_type gdmx_from_int
+#define gdmx_from_entype gdmx_from_int
+#define gdmx_from_windop gdmx_from_int
+
+void gdmx_err(DIRFILE *, int);
+mxClassID gdmx_classid(gd_type_t);
+void gdmx_free_entry(gd_entry_t *);
+
+/* convert to MATLAB type */
+#define gdmx_from_string mxCreateString
+mxArray *gdmx_from_dirfile(const DIRFILE*);
+mxArray *gdmx_from_data(const void *, gd_type_t, size_t);
+mxArray *gdmx_from_entry(const gd_entry_t*);
+mxArray *gdmx_from_string_list(const char **);
+
+#define gdmx_from_int gdmx_from_long
+#define gdmx_from_uint gdmx_from_ulong
+#define gdmx_from_double mxCreateDoubleScalar
+mxArray *gdmx_from_bool(int);
+mxArray *gdmx_from_long(long);
+mxArray *gdmx_from_llong(long long);
+mxArray *gdmx_from_ulong(unsigned long);
+mxArray *gdmx_from_ullong(unsigned long long);
+
+mxArray *gdmx_from_carrays(const gd_carray_t *, gd_type_t);
+mxArray *gdmx_vector(gd_type_t, size_t, void**);
+
+/* convert from MATLAB type */
+DIRFILE *gdmx_to_dirfile(const mxArray *);
+char *gdmx_to_string(const mxArray **, int, int);
+int gdmx_to_int(const mxArray **, int);
+
+#define GDMX_ENO_FRAG  0x1
+#define GDMX_ENO_FIELD 0x2
+gd_entry_t *gdmx_to_entry(const mxArray **, int, unsigned);
+
+double gdmx_to_double(const mxArray **, int);
+long gdmx_to_long(const mxArray **, int);
+long long gdmx_to_llong(const mxArray **, int);
+#define gdmx_to_uint(a,b) ((unsigned int)gdmx_to_ulong(a,b))
+unsigned long gdmx_to_ulong(const mxArray **, int);
+unsigned long long gdmx_to_ullong(const mxArray **, int);
+
+size_t gdmx_to_nsamp(DIRFILE*, const char*, const mxArray**, int, int);
+void gdmx_to_data(void**, gd_type_t*, size_t*, const mxArray**, int);
+void gdmx_free_data(void*, gd_type_t);
+
+#endif
diff --git a/bindings/matlab/gd_mcarrays.c b/bindings/matlab/gd_mcarrays.c
new file mode 100644
index 0000000..42c402b
--- /dev/null
+++ b/bindings/matlab/gd_mcarrays.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 "gd_matlab.h"
+#include <string.h>
+
+/*
+ % GD_MCARRAYS  Fetch all CARRAY metafield values
+ %
+ %   A = GD_MCARRAYS(DIRFILE,PARENT[,TYPE])
+ %             returns a cell array of numeric arrays, A, containing all the
+ %             CARRAY data in the for metafields under parent field PARENT.  A
+ %             corresponding array of field names can be produced with
+ %             GD_MFIELD_LIST_BY_TYPE.  The type of the returned data is given
+ %             by TYPE, one of the data type symbols provided by
+ %             GETDATA_CONSTANTS.  If omitted, the default type, GD.FLOAT64, is
+ %             used.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_mcarrays(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_CARRAYS, GD_MFIELD_LIST_BY_TYPE, GD_GET_CARRAY_SLICE
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  gd_type_t type = GD_FLOAT64;
+  const gd_carray_t *c;
+  char *parent;
+
+  GDMX_CHECK_RHS2(2,3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  parent = gdmx_to_string(prhs, 1, 0);
+  if (nrhs > 2)
+    type = gdmx_to_gd_type(prhs, 2);
+
+  c = gd_mcarrays(D, parent, type);
+  mxFree(parent);
+
+  gdmx_err(D, 0);
+
+  /* convert to array of arrays */
+  plhs[0] = gdmx_from_carrays(c, type);
+}
diff --git a/bindings/matlab/gd_mconstants.c b/bindings/matlab/gd_mconstants.c
new file mode 100644
index 0000000..2479120
--- /dev/null
+++ b/bindings/matlab/gd_mconstants.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 "gd_matlab.h"
+
+/*
+ % GD_MCONSTANTS  Fetch all CONST metafield values
+ %
+ %   A = GD_MCONSTANTS(DIRFILE,PARENT[,TYPE])
+ %             returns a numeric array, A, containing all the CONST metafield
+ %             data under parent field PARENT.  A corresponding array of field
+ %             names can be produced with GD_MFIELD_LIST_BY_TYPE.  The type of
+ %             the returned data is given by TYPE, one of the data type symbols
+ %             provided by GETDATA_CONSTANTS.  If omitted, the default type,
+ %             GD.FLOAT64, is used.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_mconstants(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_CONSTANTS, GD_FIELD_LIST_BY_TYPE, GD_GET_CONSTANT,
+ %            GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const void *data;
+  unsigned int n;
+  char *field_code;
+  gd_type_t type = GD_FLOAT64;
+
+  GDMX_CHECK_RHS2(2,3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  if (nrhs > 2)
+    type = gdmx_to_gd_type(prhs, 2);
+
+  data = gd_mconstants(D, field_code, type);
+
+  gdmx_err(D, 0);
+  
+  /* length */
+  n = gd_nmfields_by_type(D, field_code, GD_CONST_ENTRY);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_data(data, type, n);
+}
diff --git a/bindings/matlab/gd_metaflush.c b/bindings/matlab/gd_metaflush.c
new file mode 100644
index 0000000..c7aa140
--- /dev/null
+++ b/bindings/matlab/gd_metaflush.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_METAFLUSH  Flush metadata changes to disk
+ %
+ %   GD_METAFLUSH(DIRFILE)
+ %             flushes all pending metadata changes in the dirfile DIRFILE to
+ %             disk.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_metaflush(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_CLOSE, GD_FLUSH, GD_OPEN, GD_REWRITE_FRAGMENT
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  gd_metaflush(D);
+
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_mfield_list.m b/bindings/matlab/gd_mfield_list.m
new file mode 100644
index 0000000..864fde0
--- /dev/null
+++ b/bindings/matlab/gd_mfield_list.m
@@ -0,0 +1,30 @@
+function field_list = gd_mfield_list(D, parent)
+% GD_MFIELD_LIST  Retrieve a list of field names
+%
+%   GD_FIELD_LIST(DIRFILE,PARENT)
+%             is equivalent to calling GD_ENTRY_LIST(DIRFILE,PARENT,0,0)
+%
+%   See also GD_ENTRY_LIST
+
+  field_list = gd_entry_list(D, parent, 0, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_mfield_list_by_type.m b/bindings/matlab/gd_mfield_list_by_type.m
new file mode 100644
index 0000000..f5f36f6
--- /dev/null
+++ b/bindings/matlab/gd_mfield_list_by_type.m
@@ -0,0 +1,30 @@
+function field_list = gd_mfield_list_by_type(D, parent, type)
+% GD_MFIELD_LIST_BY_TYPE  Retrieve a list of field names
+%
+%   GD_MFIELD_LIST_BY_TYPE(DIRFILE,PARENT,TYPE)
+%             is equivalent to calling GD_ENTRY_LIST(DIRFILE,PARENT,TYPE,0)
+%
+%   See also GD_ENTRY_LIST
+
+  field_list = gd_entry_list(D, parent, type, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_move.c b/bindings/matlab/gd_move.c
new file mode 100644
index 0000000..b6a3ee5
--- /dev/null
+++ b/bindings/matlab/gd_move.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 "gd_matlab.h"
+
+/*
+ % GD_MOVE  Move a field between fragments
+ %
+ %   GD_MOVE(DIRFILE,FIELD_CODE,NEW_FRAGMENT[,MOVE_DATA])
+ %             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.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_move(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_MOVE_ALIAS, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code;
+  int new_frag, move_data = 0;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(3,4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  new_frag = gdmx_to_int(prhs, 2);
+  if (nrhs > 3)
+    move_data = gdmx_to_int(prhs, 3);
+
+  gd_move(D, field_code, new_frag, move_data);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_move_alias.c b/bindings/matlab/gd_move_alias.c
new file mode 100644
index 0000000..ba3ad6c
--- /dev/null
+++ b/bindings/matlab/gd_move_alias.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 "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_mplex_lookback.c b/bindings/matlab/gd_mplex_lookback.c
new file mode 100644
index 0000000..485143a
--- /dev/null
+++ b/bindings/matlab/gd_mplex_lookback.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 "gd_matlab.h"
+
+/*
+ % GD_MPLEX_LOOKBACK  Set the MPLEX look-back length
+ %
+ %   GD_MPLEX_LOOKBACK(DIRFILE,LOOKBACK)
+ %             sets the lookback length to LOOKBACK, which should be a number
+ %             or the special symbol GD.LOOKBACK_ALL provided by
+ %             GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_mplex_lookback(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_GETDATA, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  int lookback;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  lookback = gdmx_to_int(prhs, 1);
+
+  gd_mplex_lookback(D, lookback);
+
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_mstrings.c b/bindings/matlab/gd_mstrings.c
new file mode 100644
index 0000000..34d0664
--- /dev/null
+++ b/bindings/matlab/gd_mstrings.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 "gd_matlab.h"
+
+/*
+ % GD_MSTRINGS  Fetch all STRING metafield values
+ %
+ %   A = GD_MSTRINGS(DIRFILE,PARENT)
+ %             returns a cell array of strings, A, containing the values of all
+ %             STRING metafields under parent field PARENT.  A corresponding
+ %             array of field names can be produced with GD_MFIELD_LIST_BY_TYPE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_mstrings(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_STRINGS, GD_MFIELD_LIST_BY_TYPE, GD_GET_STRING
+ */
+
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *parent;
+  const char **sl;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  parent = gdmx_to_string(prhs, 1, 0);
+
+  sl = gd_mstrings(D, parent);
+
+  mxFree(parent);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_string_list(sl);
+}
diff --git a/bindings/matlab/gd_mvector_list.m b/bindings/matlab/gd_mvector_list.m
new file mode 100644
index 0000000..ade6ebc
--- /dev/null
+++ b/bindings/matlab/gd_mvector_list.m
@@ -0,0 +1,34 @@
+function field_list = gd_mvector_list(D, parent)
+% GD_MVECTOR_LIST  Retrieve a list of field names
+%
+%   GD_MVECTOR_LIST(DIRFILE,PARENT)
+%             is equivalent to calling GD_ENTRY_LIST(DIRFILE,PARENT, ...
+%                                                           GD.VECTOR_ENTRIES,0)
+%
+%   For GD, see GETDATA_CONSTANTS.
+%
+%   See also GD_ENTRY_LIST, GETDATA_CONSTANTS
+
+  GD = getdata_constants();
+  field_list = gd_entry_list(D, parent, GD.VECTOR_ENTRIES, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_naliases.c b/bindings/matlab/gd_naliases.c
new file mode 100644
index 0000000..9be49a7
--- /dev/null
+++ b/bindings/matlab/gd_naliases.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 "gd_matlab.h"
+
+/*
+ % GD_NALIASES  Retrieve the number of names for a field
+ %
+ %   N = GD_NALIASES(DIRFILE,FIELD_CODE)
+ %             returns the number of aliases, N, of FIELD_CODE (including
+ %             FIELD_CODE itself.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_naliases(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ALIASES, GD_NENTRIES, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code = NULL;
+  unsigned int n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_naliases(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_uint(n);
+}
diff --git a/bindings/matlab/gd_native_type.c b/bindings/matlab/gd_native_type.c
new file mode 100644
index 0000000..19d290d
--- /dev/null
+++ b/bindings/matlab/gd_native_type.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 "gd_matlab.h"
+
+/*
+ % GD_NATIVE_TYPE  Report the native data type of a field
+ %
+ %   T = GD_NATIVE_TYPE(DIRFILE,FIELD_CODE)
+ %             returns the native data type, T, of the field specified by
+ %             FIELD_CODE.  The returned value will be one of the data type
+ %             symbols provided by GETDATA_CONSTATNS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_native_type(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  gd_type_t n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_native_type(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_gd_type(n);
+}
diff --git a/bindings/matlab/gd_nentries.c b/bindings/matlab/gd_nentries.c
new file mode 100644
index 0000000..6cb26e6
--- /dev/null
+++ b/bindings/matlab/gd_nentries.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 "gd_matlab.h"
+
+/*
+ % GD_NENTRIES  Retrieve a count of fields
+ %
+ %   N = GD_NENTRIES(DIRFILE[,PARENT[,TYPE[,FLAGS]]])
+ %             returns the number of fields, N, in the dirfile DIRFILE which
+ %             satisfy the supplied PARENT, TYPE, and/or FLAGS.
+ %
+ %   If PARENT is given, and not numeric zero, metafields of the specified
+ %   parent field will be searched.  Otherwise, only top level fields are
+ %   considered.  If non-zero (matching all types), TYPE should be either one
+ %   of the GD.xxx_ENTRY symbols or else one of the special GD.xxx_ENTRIES
+ %   symbols provided by GETDATA_CONSTANTS.  FLAGS, if given, should be zero
+ %   or more of the GD.ENTRIES_... flags, bitwise or'd together.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_nentries(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_ENTRY_LIST, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *parent = NULL;
+  unsigned int n, type = 0, flags = 0;
+
+  GDMX_CHECK_RHS2(1,4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    parent = gdmx_to_string(prhs, 1, 1);
+  if (nrhs > 2)
+    type = gdmx_to_uint(prhs, 2);
+  if (nrhs > 3)
+    flags = gdmx_to_uint(prhs, 3);
+
+  n = gd_nentries(D, parent, type, flags);
+
+  mxFree(parent);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_uint(n);
+}
diff --git a/bindings/matlab/gd_nfields.m b/bindings/matlab/gd_nfields.m
new file mode 100644
index 0000000..bd63c37
--- /dev/null
+++ b/bindings/matlab/gd_nfields.m
@@ -0,0 +1,30 @@
+function nfields = gd_nfields(D)
+% GD_NFIELDS  Retrieve a count of fields
+%
+%   GD_NFIELDS(DIRFILE)
+%             is equivalent to calling GD_NENTRIES(DIRFILE,0,0,0)
+%
+%   See also GD_NENTRIES
+
+  nfields = gd_nentries(D, 0, 0, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_nfields_by_type.m b/bindings/matlab/gd_nfields_by_type.m
new file mode 100644
index 0000000..78db654
--- /dev/null
+++ b/bindings/matlab/gd_nfields_by_type.m
@@ -0,0 +1,30 @@
+function nfields = gd_nfields_by_type(D, type)
+% GD_NFIELDS_BY_TYPE  Retrieve a count of fields
+%
+%   GD_NFIELDS_BY_TYPE(DIRFILE,TYPE)
+%             is equivalent to calling GD_NENTRIES(DIRFILE,0,TYPE,0)
+%
+%   See also GD_NENTRIES
+
+  nfields = gd_nentries(D, 0, type, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_nfragments.c b/bindings/matlab/gd_nfragments.c
new file mode 100644
index 0000000..d11d334
--- /dev/null
+++ b/bindings/matlab/gd_nfragments.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_NFRAGMETNS  Report the number of fragments in a dirfile
+ %
+ %   N = GD_NFRAGMENTS(DIRFILE)
+ %             returns the number of fragments, N, in the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_nfragments(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  int n;
+
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  n = gd_nfragments(D);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_int(n);
+}
diff --git a/bindings/matlab/gd_nframes.c b/bindings/matlab/gd_nframes.c
new file mode 100644
index 0000000..280f995
--- /dev/null
+++ b/bindings/matlab/gd_nframes.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_NFRAMES  Report the length of a dirfile
+ %
+ %   N = GD_NFRAMES(DIRFILE)
+ %             returns the nominal number of frames, N, in the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_nframes(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  unsigned long long n;
+
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  n = gd_nframes64(D);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ullong(n);
+}
diff --git a/bindings/matlab/gd_nmfields.m b/bindings/matlab/gd_nmfields.m
new file mode 100644
index 0000000..551355c
--- /dev/null
+++ b/bindings/matlab/gd_nmfields.m
@@ -0,0 +1,30 @@
+function nfields = gd_nmfields(D, parent)
+% GD_NMFIELDS  Retrieve a count of fields
+%
+%   GD_NMFIELDS(DIRFILE,PARENT)
+%             is equivalent to calling GD_NENTRIES(DIRFILE,PARENT,0,0)
+%
+%   See also GD_NENTRIES
+
+  nfields = gd_nentries(D, parent, 0, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_nmfields_by_type.m b/bindings/matlab/gd_nmfields_by_type.m
new file mode 100644
index 0000000..dca8cee
--- /dev/null
+++ b/bindings/matlab/gd_nmfields_by_type.m
@@ -0,0 +1,30 @@
+function nfields = gd_nmfields_by_type(D, parent, type)
+% GD_NMFIELDS_BY_TYPE  Retrieve a count of fields
+%
+%   GD_NMFIELDS_BY_TYPE(DIRFILE,PARENT,TYPE)
+%             is equivalent to calling GD_NENTRIES(DIRFILE,PARENT,TYPE,0)
+%
+%   See also GD_NENTRIES
+
+  nfields = gd_nentries(D, parent, type, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_nmvectors.m b/bindings/matlab/gd_nmvectors.m
new file mode 100644
index 0000000..f5780cd
--- /dev/null
+++ b/bindings/matlab/gd_nmvectors.m
@@ -0,0 +1,34 @@
+function nfields = gd_nmvectors(D, parent)
+% GD_NMVECTORS  Retrieve a count of fields
+%
+%   GD_NMVECTORS(DIRFILE,PARENT)
+%             is equivalent to calling GD_NENTRIES(DIRFILE,PARENT, ...
+%                                                           GD.VECTOR_ENTRIES,0)
+%
+%   For GD, see GETDATA_CONSTANTS.
+%
+%   See also GD_NENTRIES, GETDATA_CONSTANTS
+
+  GD = getdata_constants();
+  nfields = gd_nentries(D, parent, GD.VECTOR_ENTRIES, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_nvectors.m b/bindings/matlab/gd_nvectors.m
new file mode 100644
index 0000000..e7dabc7
--- /dev/null
+++ b/bindings/matlab/gd_nvectors.m
@@ -0,0 +1,34 @@
+function nvectors = gd_nvectors(D)
+% GD_NVECTORS  Retrieve a count of fields
+%
+%   GD_NVECTORS(DIRFILE)
+%             is equivalent to calling GD_NENTRIES(DIRFILE,0, ...
+%                                                           GD.VECTOR_ENTRIES,0)
+%
+%   For GD, see GETDATA_CONSTANTS.
+%
+%   See also GD_NENTRIES, GETDATA_CONSTANTS
+
+  GD = getdata_constants();
+  nvectors = gd_nentries(D, 0, GD.VECTOR_ENTRIES, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_open.c b/bindings/matlab/gd_open.c
new file mode 100644
index 0000000..4b579f9
--- /dev/null
+++ b/bindings/matlab/gd_open.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 "gd_matlab.h"
+
+/*
+ % GD_OPEN  Open or create a dirfile
+ %
+ %   D = GD_OPEN(PATH[,FLAGS])
+ %             opens the dirfile PATH, returning a dirfile object, D.  If
+ %             given, FLAGS should be a bitwise or'd collection of dirfile flags
+ %             provided by GETDATA_CONSTANTS.  If omitted, FLAGS defaults to
+ %             GD.RDONLY.
+ %
+ %   Unlike in the C API, an error in GD_OPEN does not result in the creation of
+ %   an invalid dirfile (so GD_ERROR and GD_ERROR_STRING cannot be used in a
+ %   CATCH block after a failed a GD_OPEN call).  Open dirfiles should be
+ %   deallocated by calling GD_DISCARD or GD_CLOSE when no longer needed.
+ %
+ %   See the documentation on the C API function gd_open(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_DISCARD, GD_CLOSE, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  char *filename;
+  unsigned long flags = GD_RDONLY;
+  DIRFILE *D;
+
+  GDMX_CHECK_RHS2(1,2);
+
+  filename = gdmx_to_string(prhs, 0, 0);
+
+  if (nrhs > 1)
+    flags = gdmx_to_ulong(prhs, 1);
+
+  D = gd_open(filename, flags);
+  mxFree(filename);
+
+  gdmx_err(D, 1);
+
+  plhs[0] = gdmx_from_dirfile(D);
+}
diff --git a/bindings/matlab/gd_parent_fragment.c b/bindings/matlab/gd_parent_fragment.c
new file mode 100644
index 0000000..52f984b
--- /dev/null
+++ b/bindings/matlab/gd_parent_fragment.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 "gd_matlab.h"
+
+/*
+ % GD_PARENT_FRAGMENT  Report the parent of a fragment
+ %
+ %  F = GD_PARENT_FRAGMENT(DIRFILE,FRAGMENT)
+ %             reports the parent fragment index, F, of the fragment indexed by
+ %             FRAGMENT.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_parent_fragment(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_INCLUDE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  int i, n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+
+  n = gd_parent_fragment(D, i);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_int(n);
+}
diff --git a/bindings/matlab/gd_protection.c b/bindings/matlab/gd_protection.c
new file mode 100644
index 0000000..428cc3d
--- /dev/null
+++ b/bindings/matlab/gd_protection.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 "gd_matlab.h"
+
+/*
+ % GD_PROTECTION  Report the protection level of a fragment
+ %
+ %   P = GD_PROTECTION(DIRFILE,FRAGMENT)
+ %             reports the protection level, P, of the fragment given by
+ %             FRAGMENT.  The returned value will be one of the GD.PROTECT_...
+ %             symbols provided by GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_protection(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_ALTER_PROTECTION, GD_OPEN, GETDATA_CONSTANTS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  int i, n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+
+  n = gd_protection(D, i);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_int(n);
+}
diff --git a/bindings/matlab/gd_put_carray.m b/bindings/matlab/gd_put_carray.m
new file mode 100644
index 0000000..bc28e49
--- /dev/null
+++ b/bindings/matlab/gd_put_carray.m
@@ -0,0 +1,31 @@
+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, ...
+%                                                             FIELD_CODE,0,DATA)
+%
+%   See also GD_PUT_ARRAY_SLICE
+
+  gd_put_carray_slice(D, field_code, 0, data);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_put_carray_slice.c b/bindings/matlab/gd_put_carray_slice.c
new file mode 100644
index 0000000..ff6463d
--- /dev/null
+++ b/bindings/matlab/gd_put_carray_slice.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 "gd_matlab.h"
+
+/*
+ % GD_PUT_CARRAY_SLICE  Modify CARRAY or CONST values
+ %
+ %   GD_PUT_CARRAY_SLICE(DIRFILE,FIELD_CODE,START,VALUES)
+ %             sets elements of the CARRAY or CONST field called FIELD_CODE
+ %             starting at element START to the values in the array VALUE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_put_carray_slice(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_GET_CARRAY_SLICE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  unsigned int start;
+  size_t nsamp, n;
+  gd_type_t type;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  start = gdmx_to_uint(prhs, 2);
+  gdmx_to_data(&data, &type, &nsamp, prhs, 3);
+
+  gd_put_carray_slice(D, field_code, start, nsamp, type, data);
+
+  gdmx_free_data(data, type);
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_put_constant.m b/bindings/matlab/gd_put_constant.m
new file mode 100644
index 0000000..181e35c
--- /dev/null
+++ b/bindings/matlab/gd_put_constant.m
@@ -0,0 +1,31 @@
+function gd_put_constant(D, field_code, data)
+% GD_PUT_CONSTANT  Modify CONST values
+%
+%   GD_PUT_CONSTANT(DIRFILE,FIELD_CODE,DATA)
+%             is equivalent to calling GD_PUT_ARRAY_SLICE(DIRFILE, ...
+%                                                             FIELD_CODE,0,DATA)
+%
+%   See also GD_PUT_ARRAY_SLICE
+
+  gd_put_carray_slice(D, field_code, 0, data(1));
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_put_string.c b/bindings/matlab/gd_put_string.c
new file mode 100644
index 0000000..931a2fc
--- /dev/null
+++ b/bindings/matlab/gd_put_string.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 "gd_matlab.h"
+
+/*
+ % GD_PUT_STRING  Modify STRING values
+ %
+ %   GD_PUT_STRING(DIRFILE,FIELD_CODE,VALUE)
+ %             sets the value of the STRING field FIELD_CODE to VALUE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_put_string(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_GET_STRING, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_name, *value;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_name = gdmx_to_string(prhs, 1, 0);
+  value = gdmx_to_string(prhs, 2, 0);
+
+  gd_put_string(D, field_name, value);
+
+  mxFree(field_name);
+  mxFree(value);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_putdata.c b/bindings/matlab/gd_putdata.c
new file mode 100644
index 0000000..623b2af
--- /dev/null
+++ b/bindings/matlab/gd_putdata.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 "gd_matlab.h"
+
+/*
+ % GD_PUTDATA  Write vector data
+ %
+ %   GD_PUTDATA(DIRFILE,FIELD_CODE,FIRST_FRAME,FIRST_SAMPLE,DATA)
+ %             writes the data in DATA to the field called FIELD_CODE.  The
+ %             sequential samples are written starting FIRST_SAMPLE samples
+ %             after the start of frame FIRST_FRAME.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_putdata(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_GETDATA, GD_PUT_CARRAY_SLICE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  long long first_frame, first_samp;
+  size_t nsamp, n;
+  gd_type_t type;
+
+  GDMX_CHECK_RHS(5);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  first_frame = gdmx_to_llong(prhs, 2);
+  first_samp = gdmx_to_llong(prhs, 3);
+  gdmx_to_data(&data, &type, &nsamp, prhs, 4);
+
+  n = gd_putdata64(D, field_code, (gd_off64_t)first_frame,
+      (gd_off64_t)first_samp, 0, nsamp, type, data);
+
+  gdmx_free_data(data, type);
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_size_t(n);
+}
diff --git a/bindings/matlab/gd_raw_close.c b/bindings/matlab/gd_raw_close.c
new file mode 100644
index 0000000..2a8fd1e
--- /dev/null
+++ b/bindings/matlab/gd_raw_close.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 "gd_matlab.h"
+
+/*
+ % GD_RAW_CLOSE  Close binary files
+ %
+ %   GD_RAW_CLOSE(DIRFILE[,FIELD_CODE])
+ %             closes open binary data files associated with the dirfile
+ %             DIRFILE.  If FIELD_CODE is given and not numeric zero, only the
+ %             specified field is closed.  Otherwise all open data files closed.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_raw_close(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_CLOSE, GD_SYNC, GD_FLUSH, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code = NULL;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    field_code = gdmx_to_string(prhs, 1, 1);
+
+  gd_raw_close(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_raw_filename.c b/bindings/matlab/gd_raw_filename.c
new file mode 100644
index 0000000..df1f25c
--- /dev/null
+++ b/bindings/matlab/gd_raw_filename.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 "gd_matlab.h"
+
+/*
+ % GD_RAW_FILENAME  Report the pathname of a binary data file
+ %
+ %   P = GD_RAW_FILENAME(DIRFILE,FIELD_CODE)
+ %             reports the pathname, P, of the binary file backing the RAW field
+ %             specified by FIELD_CODE in the the dirfile DIRFILE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_raw_filename(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const char *s;
+  char *field_code;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  s = gd_raw_filename(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = mxCreateString(s);
+}
diff --git a/bindings/matlab/gd_reference.c b/bindings/matlab/gd_reference.c
new file mode 100644
index 0000000..8786d12
--- /dev/null
+++ b/bindings/matlab/gd_reference.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 "gd_matlab.h"
+
+/*
+ % GD_REFERENCE  Set or report the reference field name
+ %
+ %   F = GD_REFERENCE(DIRFILE[,FIELD_CODE])
+ %             sets the reference field of DIRFILE to FIELD_CODE, if given and
+ %             not numeric zero.  Returns the reference field, F, after possibly
+ %             updating it.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_reference(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_NFRAMES, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const char *s;
+  char *field_code = NULL;
+
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    field_code = gdmx_to_string(prhs, 1, 1);
+
+  s = gd_reference(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = mxCreateString(s);
+}
diff --git a/bindings/matlab/gd_rename.c b/bindings/matlab/gd_rename.c
new file mode 100644
index 0000000..99b27ca
--- /dev/null
+++ b/bindings/matlab/gd_rename.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 "gd_matlab.h"
+
+/*
+ % GD_RENAME  Rename a field or alias
+ %
+ %   GD_RENAME(DIRFILE,OLD_NAME,NEW_NAME[,FLAGS])
+ %             renames the field called OLD_NAME to NEW_NAME.  If given, FLAGS
+ %             should be zero or more of the GD.REN_... symbols provided by
+ %             GETDATA_CONSTANTS.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_rename(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code, *new_code;
+  unsigned int flags = 0;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(3,4);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  new_code = gdmx_to_string(prhs, 2, 0);
+  if (nrhs > 3)
+    flags = gdmx_to_uint(prhs, 3);
+
+  gd_rename(D, field_code, new_code, flags);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_rewrite_fragment.c b/bindings/matlab/gd_rewrite_fragment.c
new file mode 100644
index 0000000..c1fbe73
--- /dev/null
+++ b/bindings/matlab/gd_rewrite_fragment.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 "gd_matlab.h"
+
+/*
+ % GD_REWRITE_FRAGMENT  Rewrite fragment metadata to disk
+ %
+ %   GD_REWRITE_FRAGMENT(DIRFILE[,FRAGMENT])
+ %             forces a rewrite of the fragment metadata on disk of the fragment
+ %             indexed by FRAGMENT, if given, or else all fragments.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_rewrite_fragment(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_METAFLUSH, GD_OPEN, GD_CLOSE
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  int i = GD_ALL_FRAGMENTS;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    i = gdmx_to_int(prhs, 1);
+
+  gd_rewrite_fragment(D, i);
+
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_seek.c b/bindings/matlab/gd_seek.c
new file mode 100644
index 0000000..0b9f161
--- /dev/null
+++ b/bindings/matlab/gd_seek.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_SEEK  Set the location of a field's I/O pointer
+ %
+ %   P = GD_SEEK(DIRFILE,FIELD_CODE,FRAME,SAMPLE,FLAGS)
+ %             places the I/O pointer of the field FIELD_CODE SAMPLE samples
+ %             after the start of frame number FRAME.  Flags should be one of
+ %             GD.SEEK_SET, GD.SEEK_CUR, or GD.SEEK_END, possibly bitwise or'd
+ %             with GD.SEEK_WRITE.  These symbols are provided by
+ %             GETDATA_CONSTANTS.  Returns the position, P, in samples, after
+ %             setting it.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_seek(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_TELL, GD_GETDATA, GD_OPEN.
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  long long first_frame, first_samp;
+  int flags;
+  unsigned long long pos;
+
+  GDMX_CHECK_RHS(5);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+  first_frame = gdmx_to_llong(prhs, 2);
+  first_samp = gdmx_to_llong(prhs, 3);
+  flags = gdmx_to_int(prhs, 4);
+
+  pos = gd_seek64(D, field_code, (gd_off64_t)first_frame,
+      (gd_off64_t)first_samp, flags);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ullong(pos);
+}
diff --git a/bindings/matlab/gd_spf.c b/bindings/matlab/gd_spf.c
new file mode 100644
index 0000000..207e322
--- /dev/null
+++ b/bindings/matlab/gd_spf.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 "gd_matlab.h"
+
+/*
+ % GD_SPF  Report the samples-per-frame of a field
+ %
+ %   S = GD_SPF(DIRFILE,FIELD_CODE)
+ %             reports the samples-per-frame, S, of the field called FIELD_CODE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_spf(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code;
+  unsigned int n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_spf(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_uint(n);
+}
diff --git a/bindings/matlab/gd_strings.c b/bindings/matlab/gd_strings.c
new file mode 100644
index 0000000..28f003a
--- /dev/null
+++ b/bindings/matlab/gd_strings.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_STRINGS  Fetch all STRING values
+ %
+ %   A = GD_STRINGS(DIRFILE)
+ %             returns a cell array of strings, A, containing all the STRING
+ %             data in the dirfile DIRFILE.  A corresponding array of field
+ %             names can be produced with GD_FIELD_LIST_BY_TYPE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_strings(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_MSTRINGS, GD_FIELD_LIST_BY_TYPE, GD_GET_STRING
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  const char **sl;
+
+  GDMX_CHECK_RHS(1);
+
+  D = gdmx_to_dirfile(prhs[0]);
+
+  sl = gd_strings(D);
+
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_string_list(sl);
+}
diff --git a/bindings/matlab/gd_strtok.c b/bindings/matlab/gd_strtok.c
new file mode 100644
index 0000000..0c89a7d
--- /dev/null
+++ b/bindings/matlab/gd_strtok.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 "gd_matlab.h"
+
+/*
+ % GD_STRTOK  Tokenise a string using the GetData parser
+ %
+ %   A = GD_STRTOK(DIRFILE,STRING)
+ %             Converts the string STRING into a cell array of strings, A, by
+ %             tokenising it using the GetData library parser.  Unlike the C API
+ %             this function completely tokenises the provided string at once,
+ %             returning all tokens, and should not be called repeatedly.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_strtok(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN, GD_DIRFILE_STANDARDS
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *tok, *s;
+  mxArray **sl = NULL;
+  size_t i, n = 0;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  s = gdmx_to_string(prhs, 1, 0);
+
+  /* convert */
+  for (tok = gd_strtok(D, s); tok; tok = gd_strtok(D, NULL)) {
+    mxArray **ptr = (mxArray**)mxRealloc(sl, sizeof(mxArray*) * (n + 1));
+    if (ptr == NULL)
+      mexErrMsgIdAndTxt("GetData:GDMX:Alloc", "Out of memory.");
+
+    sl = ptr;
+    sl[n++] = mxCreateString(tok);
+    free(tok);
+  }
+
+  gdmx_err(D, 0);
+
+  plhs[0] = mxCreateCellMatrix(1, n);
+  for (i = 0; i < n; ++i)
+    mxSetCell(plhs[0], i, sl[i]);
+  mxFree(sl);
+}
diff --git a/bindings/matlab/gd_sync.c b/bindings/matlab/gd_sync.c
new file mode 100644
index 0000000..5b36d9d
--- /dev/null
+++ b/bindings/matlab/gd_sync.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_SYNC  Flush modifications to disk
+ %
+ %   GD_SYNC(DIRFILE[,FIELD_CODE])
+ %             flushes the binary data files associated with the dirfile DIRFILE
+ %             to disk.  If FIELD_CODE is given and not numeric zero, only the
+ %             specified field is synced.  Otherwise all open data files are
+ %             synced.  In this second case, modified metadata is also flushed.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_sync(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_CLOSE, GD_FLUSH, GD_RAW_CLOSE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code = NULL;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(1,2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  if (nrhs > 1)
+    field_code = gdmx_to_string(prhs, 1, 1);
+
+  gd_sync(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_tell.c b/bindings/matlab/gd_tell.c
new file mode 100644
index 0000000..4546ec5
--- /dev/null
+++ b/bindings/matlab/gd_tell.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_TELL  Report the location of a field's I/O pointer
+ %
+ %   P = GD_TELL(DIRFILE,FIELD_CODE)
+ %             returns the position, P, in samples, of the field FIELD_CODE's
+ %             I/O pointer.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_tell(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_SEEK, GD_GETDATA, GD_OPEN.
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  unsigned long long pos;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  pos = gd_tell64(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_ullong(pos);
+}
diff --git a/bindings/matlab/gd_unhide.c b/bindings/matlab/gd_unhide.c
new file mode 100644
index 0000000..d562e41
--- /dev/null
+++ b/bindings/matlab/gd_unhide.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 "gd_matlab.h"
+
+/*
+ % GD_UNHIDE  Unhide a field
+ %
+ %   GD_UNHIDE(DIRFILE,FIELD_CODE)
+ %             unhides the field called FIELD_CODE.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_unhide(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_HIDDEN, GD_HIDE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *field_code;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  gd_unhide(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_uninclude.c b/bindings/matlab/gd_uninclude.c
new file mode 100644
index 0000000..0157226
--- /dev/null
+++ b/bindings/matlab/gd_uninclude.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
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_UNINCLUDE  Remove a metadata fragment from a dirfile
+ %
+ %   GD_FLUSH(DIRFILE,FRAGMENT[,DEL])
+ %             removes the fragment indexed by FRAGMENT from the dirfile
+ %             DIRFILE.  If DEL is given and non-zero, also deletes the file
+ %             on disk.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_uninclude(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_INCLUDE, GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  int i, d = 0;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS2(2,3);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  i = gdmx_to_int(prhs, 1);
+  if (nrhs > 2)
+    d = gdmx_to_int(prhs, 2);
+
+  gd_uninclude(D, i, d);
+
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/gd_validate.c b/bindings/matlab/gd_validate.c
new file mode 100644
index 0000000..40a4019
--- /dev/null
+++ b/bindings/matlab/gd_validate.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 "gd_matlab.h"
+
+/*
+ % GD_VALIDATE  flush modifications to disk
+ %
+ %   B = GD_VALIDATE(DIRFILE,FIELD_CODE)
+ %             returns boolean true, B, if FIELD_CODE is a valid field.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_validate(3) in section 3
+ %   of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  void *data;
+  char *field_code;
+  int n;
+
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  field_code = gdmx_to_string(prhs, 1, 0);
+
+  n = gd_validate(D, field_code);
+
+  mxFree(field_code);
+  gdmx_err(D, 0);
+
+  plhs[0] = gdmx_from_int(n);
+}
diff --git a/bindings/matlab/gd_vector_list.m b/bindings/matlab/gd_vector_list.m
new file mode 100644
index 0000000..2b145ba
--- /dev/null
+++ b/bindings/matlab/gd_vector_list.m
@@ -0,0 +1,34 @@
+function field_list = gd_vector_list(D)
+% GD_VECTOR_LIST  Retrieve a list of field names
+%
+%   GD_VECTOR_LIST(DIRFILE)
+%             is equivalent to calling GD_ENTRY_LIST(DIRFILE,0, ...
+%                                                           GD.VECTOR_ENTRIES,0)
+%
+%   For GD, see GETDATA_CONSTANTS.
+%
+%   See also GD_ENTRY_LIST, GETDATA_CONSTANTS
+
+  GD = getdata_constants();
+  field_list = gd_entry_list(D, 0, GD.VECTOR_ENTRIES, 0);
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/gd_verbose_prefix.c b/bindings/matlab/gd_verbose_prefix.c
new file mode 100644
index 0000000..ed4add4
--- /dev/null
+++ b/bindings/matlab/gd_verbose_prefix.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "gd_matlab.h"
+
+/*
+ % GD_VERBOSE_PREFIX  set the prefix on error messages
+ %
+ %   GD_FLUSH(DIRFILE,PREFIX)
+ %             set the prefix on Library error messages printed when running in
+ %             verbose mode to PREFIX.
+ %
+ %   The DIRFILE object should have previously been created with GD_OPEN.
+ %
+ %   See the documentation on the C API function gd_verbose_prefix(3) in
+ %   section 3 of the UNIX manual for more details.
+ %
+ %   See also GD_OPEN, GD_ERROR_STRING
+ */
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
+{
+  DIRFILE *D;
+  char *prefix;
+
+  GDMX_NO_LHS;
+  GDMX_CHECK_RHS(2);
+
+  D = gdmx_to_dirfile(prhs[0]);
+  prefix = gdmx_to_string(prhs, 1, 1);
+
+  gd_verbose_prefix(D, prefix);
+
+  mxFree(prefix);
+  gdmx_err(D, 0);
+}
diff --git a/bindings/matlab/getdata_constants.m b/bindings/matlab/getdata_constants.m
new file mode 100644
index 0000000..aef0cbf
--- /dev/null
+++ b/bindings/matlab/getdata_constants.m
@@ -0,0 +1,221 @@
+function GD = getdata_constants()
+% GETDATA_CONSTANTS  Define GetData symbolic constants
+%
+%   GETDATA_CONSTANTS  produces a structure containing the symbolic constants
+%   used by the GetData bindings.  Member names of the structure correspond to
+%   names of symbolic constants used in the GetData C API.
+%
+%   Although it can be used in immediate context by doing something like
+%
+%     >> GETDATA_CONSTANTS.FLOAT64
+%
+%     ans =
+%
+%              136
+%
+%   it is usually assigned to a variable, which prevents having to evaluate this
+%   function more than once.  We recommend calling this variable GD:
+%
+%     >> GD = GETDATA_CONSTANTS;
+%     >> GD.FLOAT64
+%
+%     ans =
+%
+%              136
+%
+%   providing more succinct symbol names which closely resemble the cor-
+%   respondng C API symbol names (e.g. GD_FLOAT64).  In the documentation for
+%   these bindings, we assume such a GD variable has been defined, and refer to
+%   symbolic constants as GD.<...> when necessary.
+%
+%   See also GETDATA
+
+  GD = struct(...
+    'VERSION', '0.8.9', ...
+    '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_INTERNAL_ERROR', int32(9), ...
+    'E_ALLOC', int32(10), ...
+    'E_RANGE', int32(11), ...
+    'E_OPEN_LINFILE', int32(12), ...
+    'E_RECURSE_LEVEL', int32(13), ...
+    'E_BAD_DIRFILE', int32(14), ...
+    'E_BAD_FIELD_TYPE', int32(15), ...
+    'E_ACCMODE', int32(16), ...
+    'E_UNSUPPORTED', int32(17), ...
+    'E_UNKNOWN_ENCODING', int32(18), ...
+    'E_BAD_ENTRY', int32(19), ...
+    'E_DUPLICATE', int32(20), ...
+    'E_DIMENSION', int32(21), ...
+    'E_BAD_INDEX', int32(22), ...
+    'E_BAD_SCALAR', int32(23), ...
+    'E_BAD_REFERENCE', int32(24), ...
+    'E_PROTECTED', int32(25), ...
+    'E_DELETE', int32(26), ...
+    'E_ARGUMENT', int32(27), ...
+    'E_CALLBACK', int32(28), ...
+    'E_EXISTS', int32(29), ...
+    'E_UNCLEAN_DB', int32(30), ...
+    'E_DOMAIN', int32(31), ...
+    'E_BAD_REPR', int32(32), ...
+    'E_FLUSH', int32(34), ...
+    '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), ...
+    'RDONLY', int32(0), ...
+    'RDWR', int32(1), ...
+    'FORCE_ENDIAN', int32(2), ...
+    'BIG_ENDIAN', int32(4), ...
+    'LITTLE_ENDIAN', int32(8), ...
+    'CREAT', int32(16), ...
+    'EXCL', int32(32), ...
+    'TRUNC', int32(64), ...
+    'PEDANTIC', int32(128), ...
+    'FORCE_ENCODING', int32(256), ...
+    'VERBOSE', int32(512), ...
+    'IGNORE_DUPS', int32(1024), ...
+    'IGNORE_REFS', int32(2048), ...
+    'PRETTY_PRINT', int32(4096), ...
+    'ARM_ENDIAN', int32(8192), ...
+    'NOT_ARM_ENDIAN', int32(0), ...
+    'PERMISSIVE', int32(16384), ...
+    'TRUNCSUB', int32(32768), ...
+    'AUTO_ENCODED', int32(0), ...
+    'BZIP2_ENCODED', int32(83886080), ...
+    'GZIP_ENCODED', int32(67108864), ...
+    'LZMA_ENCODED', int32(100663296), ...
+    'SIE_ENCODED', int32(117440512), ...
+    'SLIM_ENCODED', int32(50331648), ...
+    'TEXT_ENCODED', int32(33554432), ...
+    'UNENCODED', int32(16777216), ...
+    'ZZSLIM_ENCODED', int32(150994944), ...
+    'ZZIP_ENCODED', int32(134217728), ...
+    'NO_ENTRY', int32(0), ...
+    'RAW_ENTRY', int32(1), ...
+    'LINCOM_ENTRY', int32(2), ...
+    'LINTERP_ENTRY', int32(3), ...
+    'BIT_ENTRY', int32(4), ...
+    'MULTIPLY_ENTRY', int32(5), ...
+    'PHASE_ENTRY', int32(6), ...
+    'INDEX_ENTRY', int32(7), ...
+    'POLYNOM_ENTRY', int32(8), ...
+    'SBIT_ENTRY', int32(9), ...
+    'DIVIDE_ENTRY', int32(10), ...
+    'RECIP_ENTRY', int32(11), ...
+    'WINDOW_ENTRY', int32(12), ...
+    'MPLEX_ENTRY', int32(13), ...
+    'CONST_ENTRY', int32(16), ...
+    'CARRAY_ENTRY', int32(18), ...
+    'STRING_ENTRY', int32(17), ...
+    'NULL', int32(0), ...
+    'UINT8', int32(1), ...
+    'INT8', int32(33), ...
+    'UINT16', int32(2), ...
+    'INT16', int32(34), ...
+    'UINT32', int32(4), ...
+    'INT32', int32(36), ...
+    'UINT64', int32(8), ...
+    'INT64', int32(40), ...
+    'FLOAT32', int32(132), ...
+    'FLOAT64', int32(136), ...
+    'COMPLEX64', int32(264), ...
+    'COMPLEX128', int32(272), ...
+    'DEL_META', int32(1), ...
+    'DEL_DATA', int32(2), ...
+    'DEL_DEREF', int32(4), ...
+    'DEL_FORCE', int32(8), ...
+    'REN_DATA', int32(1), ...
+    'REN_UPDB', int32(2), ...
+    'PROTECT_NONE', int32(0), ...
+    'PROTECT_FORMAT', int32(1), ...
+    'PROTECT_DATA', int32(2), ...
+    'PROTECT_ALL', int32(3), ...
+    'SYNTAX_ABORT', int32(0), ...
+    'SYNTAX_RESCAN', int32(1), ...
+    'SYNTAX_IGNORE', int32(2), ...
+    'SYNTAX_CONTINUE', int32(3), ...
+    'E_FORMAT_BAD_SPF', int32(1), ...
+    'E_FORMAT_N_FIELDS', int32(2), ...
+    'E_FORMAT_N_TOK', int32(3), ...
+    'E_FORMAT_NUMBITS', int32(4), ...
+    'E_FORMAT_BITNUM', int32(5), ...
+    'E_FORMAT_BITSIZE', int32(6), ...
+    'E_FORMAT_CHARACTER', int32(7), ...
+    'E_FORMAT_BAD_LINE', int32(8), ...
+    'E_FORMAT_RES_NAME', int32(9), ...
+    'E_FORMAT_ENDIAN', int32(10), ...
+    'E_FORMAT_BAD_TYPE', int32(11), ...
+    'E_FORMAT_BAD_NAME', int32(12), ...
+    'E_FORMAT_UNTERM', int32(13), ...
+    'E_FORMAT_METARAW', int32(14), ...
+    'E_FORMAT_NO_PARENT', int32(15), ...
+    'E_FORMAT_DUPLICATE', int32(16), ...
+    'E_FORMAT_LOCATION', int32(17), ...
+    'E_FORMAT_PROTECT', int32(18), ...
+    'E_FORMAT_LITERAL', int32(19), ...
+    'E_FORMAT_WINDOP', int32(20), ...
+    'E_FORMAT_META_META', int32(21), ...
+    'E_FORMAT_ALIAS', int32(22), ...
+    'E_FORMAT_MPLEXVAL', int32(23), ...
+    'VERSION_CURRENT', int32(-1), ...
+    'VERSION_LATEST', int32(-2), ...
+    'VERSION_EARLIEST', int32(-3), ...
+    'SEEK_SET', int32(0), ...
+    'SEEK_CUR', int32(1), ...
+    'SEEK_END', int32(2), ...
+    'SEEK_WRITE', int32(4), ...
+    'WINDOP_UNK', int32(0), ...
+    'WINDOP_EQ', int32(1), ...
+    'WINDOP_GE', int32(2), ...
+    'WINDOP_GT', int32(3), ...
+    'WINDOP_LE', int32(4), ...
+    'WINDOP_LT', int32(5), ...
+    'WINDOP_NE', int32(6), ...
+    'WINDOP_SET', int32(7), ...
+    'WINDOP_CLR', int32(8), ...
+    'DESYNC_PATHCHECK', int32(1), ...
+    'DESYNC_REOPEN', int32(2), ...
+    'ALL_ENTRIES', int32(0), ...
+    'VECTOR_ENTRIES', int32(33), ...
+    'SCALAR_ENTRIES', int32(34), ...
+    'ALIAS_ENTRIES', int32(-1), ...
+    'ENTRIES_HIDDEN', int32(1), ...
+    'ENTRIES_NOALIAS', int32(2), ...
+    'ALL_FRAGMENTS', int32(-1), ...
+    'DEFAULT_LOOKBACK', int32(10), ...
+    'DIRFILE_STANDARDS_VERSION', int32(9), ...
+    'HERE', int32(-1), ...
+    'LOOKBACK_ALL', int32(-1), ...
+    'MAX_LINE_LENGTH', int32(4096) ...
+  );
+end
+
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
diff --git a/bindings/matlab/make_contents.sh.in b/bindings/matlab/make_contents.sh.in
new file mode 100644
index 0000000..1d8dcd7
--- /dev/null
+++ b/bindings/matlab/make_contents.sh.in
@@ -0,0 +1,55 @@
+#!/bin/sh
+# Copyright (C) 2013 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# 
+# @configure_input@
+
+AWK=@AWK@
+DATE=@DATE@
+GREP=@GREP@
+PRINTF=@PRINTF@
+SED=@SED@
+VERSION=@GETDATA_MAJOR at .@GETDATA_MINOR@
+REVISION=R at GETDATA_REVISION@@GETDATA_VERSION_SUFFIX@
+SRCDIR=$1
+
+if test $SRCDIR != "."; then
+  BUILT_FILES=$SRCDIR/gd_*.m
+fi
+
+if test "x$DATE" == "xnot found"; then
+  BUILD_DATE=
+else
+  BUILD_DATE=`$DATE +%d-%b-%Y`
+fi
+
+echo "% GetData bindings for MATLAB"
+echo "% Version $VERSION ($REVISION) $BUILD_DATE"
+echo "%"
+cat $SRCDIR/Contents.m.head
+if test "x$PRINTF" != "xnot found"; then
+  (
+  ls getdata*.m gd_*.m ${BUILT_FILES} | while read x; do
+    ${PRINTF} "%%   %-22s - %s\n" \
+      "`basename $x | ${AWK} 'BEGIN{FS="."} { print toupper($1) }'`" \
+      "`${GREP} -m 1 '^%' $x | ${SED} 's/% *[A-Z_]* *\(.*\)/\1/'`"
+  done
+  ) | sort
+fi
diff --git a/bindings/matlab/matlab.c b/bindings/matlab/matlab.c
new file mode 100644
index 0000000..16f0404
--- /dev/null
+++ b/bindings/matlab/matlab.c
@@ -0,0 +1,1541 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "gd_config.h"
+#endif
+
+#ifdef GD_EXTERNAL
+# define GD_C89_API
+# define dtracevoid()
+# define dtrace(...)
+# define dprintf(...)
+# define dreturnvoid()
+# define dreturn(...)
+# define dwatch(...)
+# define GD_SIZE_T_MAX ((size_t)-1)
+# define GD_INT_TYPE ((gd_type_t)((sizeof(int)) | GD_SIGNED))
+# define GD_UINT_TYPE ((gd_type_t)(sizeof(unsigned int)))
+# define EN(t,v) u.t.v
+# define GD_DCOMPLEXP_t double *
+# define GD_DCOMPLEXV(v) double v[][2]
+# define gd_cs2cs_(a,b) do { (a)[0] = (b)[0]; (a)[1] = (b)[1]; } while(0)
+# define gd_ca2cs_(a,b,i) gd_cs2cs_((a),(b) + 2 * i)
+#else
+#include "internal.h"
+#endif
+
+#define GDMXLIB
+#include "gd_matlab.h"
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <string.h>
+
+#define GD_LIBCOMP "GetData:Lib:"
+static const char *gdmx_msgid[GD_N_ERROR_CODES] =
+{
+  NULL, /* GD_E_OK */
+  GD_LIBCOMP "Open",
+  GD_LIBCOMP "Format",
+  GD_LIBCOMP "Trunc",
+  GD_LIBCOMP "Creat",
+  GD_LIBCOMP "BadCode",
+  GD_LIBCOMP "BadType",
+  GD_LIBCOMP "RawIO",
+  GD_LIBCOMP "OpenFragment",
+  GD_LIBCOMP "InternalError",
+  GD_LIBCOMP "Alloc",
+  GD_LIBCOMP "Range",
+  GD_LIBCOMP "OpenLinfile",
+  GD_LIBCOMP "RecurseLevel",
+  GD_LIBCOMP "BadDirfile",
+  GD_LIBCOMP "BadFieldType",
+  GD_LIBCOMP "AccMode",
+  GD_LIBCOMP "Unsupported",
+  GD_LIBCOMP "UnknownEncoding",
+  GD_LIBCOMP "BadEntry",
+  GD_LIBCOMP "Duplicate",
+  GD_LIBCOMP "Dimension",
+  GD_LIBCOMP "BadIndex",
+  GD_LIBCOMP "BadScalar",
+  GD_LIBCOMP "BadReference",
+  GD_LIBCOMP "Protected",
+  GD_LIBCOMP "Delete",
+  GD_LIBCOMP "Argument",
+  GD_LIBCOMP "Callback",
+  GD_LIBCOMP "Exists",
+  GD_LIBCOMP "UncleanDB",
+  GD_LIBCOMP "Domain",
+  GD_LIBCOMP "BadRepr",
+  GD_LIBCOMP "Error33", /* unused */
+  GD_LIBCOMP "Flush",
+  GD_LIBCOMP "Bounds",
+  GD_LIBCOMP "LineTooLong"
+};
+
+/* persistent errors */
+static int gdmx_errno = GD_E_OK;
+static char *gdmx_estring = NULL;
+
+/* for error reporting */
+struct gdmx_context_t {
+  const char *name;
+  const char *field;
+  int num;
+};
+
+static char gdmx_context_buf[1024];
+const char *gdmx_context(const struct gdmx_context_t *x, int uc)
+{
+  dtrace("%p, %i", x, uc);
+
+  if (x == NULL)
+    strcpy(gdmx_context_buf, "(unknown item)");
+  else {
+    if (x->name == NULL) {
+      if (x->field == NULL)
+        sprintf(gdmx_context_buf, "parameter %i", x->num);
+      else
+        sprintf(gdmx_context_buf, "field '%s' of struct parameter %i",
+            x->field, x->num);
+    } else {
+      if (x->field == NULL)
+        strcpy(gdmx_context_buf, x->name);
+      else
+        sprintf(gdmx_context_buf, "field '%s' of %s", x->field, x->name);
+    }
+
+    gdmx_context_buf[1023] = 0;
+    if (uc)
+      gdmx_context_buf[0] += 'A' - 'a';
+  }
+
+  dreturn("\"%s\"", gdmx_context_buf);
+  return gdmx_context_buf;
+}
+
+/* doesn't return on error */
+void gdmx_err(DIRFILE *D, int discard)
+{
+  dtrace("%p, %i", D, discard);
+
+  if (gdmx_estring) {
+    free(gdmx_estring);
+    gdmx_estring = NULL;
+  }
+
+  gdmx_errno = gd_error(D);
+
+  if (gdmx_errno == GD_E_OK) {
+    dreturnvoid();
+    return;
+  }
+
+  gdmx_estring = gd_error_string(D, NULL, 0);
+
+  if (discard)
+    gd_discard(D);
+
+#ifdef GETDATA_DEBUG
+  gd_colclear();
+#endif
+
+  mexErrMsgIdAndTxt(gdmx_msgid[gdmx_errno],
+      gdmx_estring);
+}
+
+static gd_type_t gdmx_type(const mxArray *a, const struct gdmx_context_t *ctx,
+    int cflag)
+{
+  gd_type_t t = GD_UNKNOWN;
+  mxClassID id;
+
+  dtrace("%p, %p, %i", a, ctx, cflag);
+
+  id = mxGetClassID(a);
+
+  switch (id) {
+    case mxDOUBLE_CLASS:
+      t = GD_FLOAT64;
+      break;
+    case mxSINGLE_CLASS:
+      t = GD_FLOAT32;
+      break;
+    case mxINT8_CLASS:
+      t = GD_INT8;
+      break;
+    case mxUINT8_CLASS:
+      t = GD_UINT8;
+      break;
+    case mxINT16_CLASS:
+      t = GD_INT16;
+      break;
+    case mxUINT16_CLASS:
+      t = GD_UINT16;
+      break;
+    case mxINT32_CLASS:
+      t = GD_INT32;
+      break;
+    case mxUINT32_CLASS:
+      t = GD_UINT32;
+      break;
+    case mxINT64_CLASS:
+      t = GD_INT64;
+      break;
+    case mxUINT64_CLASS:
+      t = GD_UINT64;
+      break;
+    default:
+      if (ctx)
+        mexErrMsgIdAndTxt("GetData:GDMX:NotNumber", "%s must be numerical.",
+            gdmx_context(ctx, 1));
+  }
+
+  /* handle complex data */
+  if (cflag) {
+    if (t == GD_FLOAT64)
+      t = GD_COMPLEX128;
+    else if (t == GD_FLOAT32)
+      t = GD_COMPLEX64;
+    else if (ctx)
+      mexErrMsgIdAndTxt("GetData:GDMX:ComplexInt",
+          "GetData cannot handle integer complex data in %s.",
+          gdmx_context(ctx, 0));
+    else
+      t = GD_UNKNOWN;
+  }
+
+  dreturn("0x%X", (unsigned)t);
+  return t;
+}
+
+mxClassID gdmx_classid(gd_type_t t)
+{
+  mxClassID id = mxUNKNOWN_CLASS;
+
+  dtrace("0x%X", t);
+
+  switch (t) {
+    case GD_UINT8:
+      id = mxUINT8_CLASS;
+      break;
+    case GD_INT8:
+      id = mxINT8_CLASS;
+      break;
+    case GD_UINT16:
+      id = mxUINT16_CLASS;
+      break;
+    case GD_INT16:
+      id = mxINT16_CLASS;
+      break;
+    case GD_UINT32:
+      id = mxUINT32_CLASS;
+      break;
+    case GD_INT32:
+      id = mxINT32_CLASS;
+      break;
+    case GD_UINT64:
+      id = mxUINT64_CLASS;
+      break;
+    case GD_INT64:
+      id = mxINT64_CLASS;
+      break;
+    case GD_FLOAT32:
+    case GD_COMPLEX64:
+      id = mxSINGLE_CLASS;
+      break;
+    case GD_FLOAT64:
+    case GD_COMPLEX128:
+      id = mxDOUBLE_CLASS;
+      break;
+    default:
+      mexErrMsgIdAndTxt("GetData:GDMX:BadType",
+          "Bad GetData data type: 0x%X", t);
+  }
+
+  dreturn("%i", (int)id);
+  return id;
+}
+
+static size_t gdmx_get_length(const mxArray *a)
+{
+  const mwSize *dims;
+  int i, ndims;
+  size_t nelem = 1;
+
+  dtrace("%p", a);
+
+  ndims = mxGetNumberOfDimensions(a);
+
+  dims = mxGetDimensions(a);
+  for (i = 0; i < ndims; ++i)
+    nelem *= dims[i];
+
+  dreturn("%zu", nelem);
+  return nelem;
+}
+
+/* returns zero if it's a scalar */
+static int gdmx_check_scalar(const mxArray *a, const struct gdmx_context_t *ctx)
+{
+  size_t nelem;
+
+  dtrace("%p, %p", a, ctx);
+
+  nelem = gdmx_get_length(a);
+
+  if (ctx && nelem > 1)
+    mexErrMsgIdAndTxt("GetData:GDMX:NotScalar", "%s must be scalar.",
+        gdmx_context(ctx, 1));
+
+  dreturn("%i", (nelem > 1) ? 1 : 0);
+  return (nelem > 1) ? 1 : 0;
+}
+
+/* convert to a desired scalar type */
+#define CONVERT_TO_CTYPE(f,t) \
+  switch (t) { \
+    case GD_UINT8:       *((uint8_t*)v) = ((f*)datum)[i]; break; \
+    case GD_INT8:         *((int8_t*)v) = ((f*)datum)[i]; break; \
+    case GD_UINT16:     *((uint16_t*)v) = ((f*)datum)[i]; break; \
+    case GD_INT16:       *((int16_t*)v) = ((f*)datum)[i]; break; \
+    case GD_UINT32:     *((uint32_t*)v) = ((f*)datum)[i]; break; \
+    case GD_INT32:       *((int32_t*)v) = ((f*)datum)[i]; break; \
+    case GD_UINT64:     *((uint64_t*)v) = ((f*)datum)[i]; break; \
+    case GD_INT64:       *((int64_t*)v) = ((f*)datum)[i]; break; \
+    case GD_FLOAT32:       *((float*)v) = ((f*)datum)[i]; break; \
+    case GD_FLOAT64:      *((double*)v) = ((f*)datum)[i]; break; \
+    case GD_COMPLEX64:   ((float*)v)[0] = ((f*)datum)[i]; \
+                         ((float*)v)[1] = c ? ((f*)idatum)[i] : 0; break; \
+    case GD_COMPLEX128: ((double*)v)[0] = ((f*)datum)[i]; \
+                        ((double*)v)[1] = c ? ((f*)idatum)[i] : 0; break; \
+    default: GDMX_INTERNAL_ERROR; \
+  }
+
+static mxArray *gdmx_get_field(const mxArray *a,
+    const struct gdmx_context_t *ctx, const char *field)
+{
+  mxArray *v;
+
+  dtrace("%p, %p, \"%s\"", a, ctx, field);
+
+  v = mxGetField(a, 0, field);
+  if (ctx && v == NULL)
+    mexErrMsgIdAndTxt("GetData:GDMX:BadStruct",
+        "Missing required field '%s' in %s", field, gdmx_context(ctx, 0));
+
+  dreturn("%p", v);
+  return v;
+}
+
+static int gdmx_convert_scalar(const mxArray *a,
+    const struct gdmx_context_t *ctx, gd_type_t t, int i, void *v)
+{
+  mxClassID id;
+  void *datum, *idatum = NULL;
+  int c;
+
+  dtrace("%p, %p, 0x%X, %i, %p", a, ctx, t, v);
+
+  /* check for scalarity */
+  if (i == -1) {
+    gdmx_check_scalar(a, ctx);
+    i = 0;
+  }
+
+  /* matlab type */
+  c = mxIsComplex(a);
+  id = mxGetClassID(a);
+
+  /* data pointer */
+  datum = mxGetData(a);
+  if (c)
+    idatum = mxGetImagData(a);
+
+  switch (id) {
+    case mxDOUBLE_CLASS:
+      CONVERT_TO_CTYPE(double,t);
+      break;
+    case mxSINGLE_CLASS:
+      CONVERT_TO_CTYPE(float,t);
+      break;
+    case mxINT8_CLASS:
+      CONVERT_TO_CTYPE(int8_t,t);
+      break;
+    case mxUINT8_CLASS:
+      CONVERT_TO_CTYPE(uint8_t,t);
+      break;
+    case mxINT16_CLASS:
+      CONVERT_TO_CTYPE(int16_t,t);
+      break;
+    case mxUINT16_CLASS:
+      CONVERT_TO_CTYPE(uint16_t,t);
+      break;
+    case mxINT32_CLASS:
+      CONVERT_TO_CTYPE(int32_t,t);
+      break;
+    case mxUINT32_CLASS:
+      CONVERT_TO_CTYPE(uint32_t,t);
+      break;
+    case mxINT64_CLASS:
+      CONVERT_TO_CTYPE(int64_t,t);
+      break;
+    case mxUINT64_CLASS:
+      CONVERT_TO_CTYPE(uint64_t,t);
+      break;
+    default:
+      if (ctx)
+        mexErrMsgIdAndTxt("GetData:GDMX:NotNumber",
+            "%s must be numerical.", gdmx_context(ctx, 1));
+      dreturn("%i", 1);
+      return 1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* this is only really appropriate for small arrays */
+static void *gdmx_convert_array(const mxArray *a,
+    const struct gdmx_context_t *ctx, gd_type_t t, size_t *n)
+{
+  char *ptr;
+  size_t i, nelem;
+
+  dtrace("%p, %p, 0x%X, %p(%zu)", a, ctx, t, n, *n);
+
+  nelem = gdmx_get_length(a);
+  if (nelem > *n)
+    nelem = *n;
+  else if (nelem < *n)
+    *n = nelem;
+
+  if (nelem == 0) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  ptr = (char*)mxMalloc(GD_SIZE(t) * nelem);
+  if (!ptr)
+    mexErrMsgIdAndTxt("GetData:GDMX:Alloc", "Out of memory.");
+
+  for (i = 0; i < nelem; ++i)
+    gdmx_convert_scalar(a, ctx, t, i, ptr + GD_SIZE(t) * i);
+
+  dreturn("%p", ptr);
+  return ptr;
+}
+
+static void gdmx_convert_struct_scalar(const mxArray *a,
+    const struct gdmx_context_t *ctx_in, const char *field, gd_type_t t,
+    void *v)
+{
+  mxArray *e;
+  struct gdmx_context_t ctx = { ctx_in->name, field, ctx_in->num };
+
+  dtrace("%p, %p, \"%s\", 0x%X, %p", a, ctx_in, field, t, v);
+
+  e = gdmx_get_field(a, ctx_in, field);
+
+  gdmx_convert_scalar(e, &ctx, t, -1, v);
+
+  dreturnvoid();
+}
+
+static int gdmx_is_zero(const mxArray *a)
+{
+  double v;
+
+  dtrace("%p", a);
+
+  if (gdmx_convert_scalar(a, NULL, GD_FLOAT64, -1, &v)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  dreturn("%i", v ? 0 : 1);
+  return v ? 0 : 1;
+}
+
+
+/* strings created thus need to be mxFree'd by the caller */
+static char *gdmx_to_string_(const mxArray *a, const struct gdmx_context_t *ctx,
+    int null_ok)
+{
+  char *s = NULL;
+
+  dtrace("%p, %p, %i", a, ctx, null_ok);
+
+  s = mxArrayToString(a);
+
+  if (s == NULL) {
+    if (null_ok && gdmx_is_zero(a)) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+    if (ctx)
+      mexErrMsgIdAndTxt("GetData:GDMX:StringConversion",
+          "Unable to interpret %s as string.", gdmx_context(ctx, 0));
+  }
+
+  dreturn("\"%s\"", s);
+
+  return s;
+}
+
+char *gdmx_to_string(const mxArray **rhs, int n, int null_ok)
+{
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+  return gdmx_to_string_(rhs[n], &ctx, null_ok);
+}
+
+static char *gdmx_convert_struct_string(const mxArray *a,
+    const struct gdmx_context_t *ctx_in, const char *field)
+{
+  char *s;
+  mxArray *e;
+  struct gdmx_context_t ctx = { ctx_in->name, field, ctx_in->num };
+
+  dtrace("%p, %p, \"%s\"", a, ctx_in, field);
+
+  e = gdmx_get_field(a, ctx_in, field);
+
+  s = gdmx_to_string_(e, &ctx, 1);
+
+  dreturn("\"%s\"", s ? s : "(nil)");
+  return s;
+}
+
+static double gdmx_to_double_(const mxArray *a,
+    const struct gdmx_context_t *ctx)
+{
+  double v;
+
+  dtrace("%p, %p", a, ctx);
+
+  gdmx_convert_scalar(a, ctx, GD_FLOAT64, -1, &v);
+
+  dreturn("%g", v);
+
+  return v;
+}
+
+double gdmx_to_double(const mxArray **rhs, int n)
+{
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+  return gdmx_to_double_(rhs[n], &ctx);
+}
+
+static int gdmx_to_int_(const mxArray *a, const struct gdmx_context_t *ctx)
+{
+  int v;
+
+  dtrace("%p, %p", a, ctx);
+
+  gdmx_convert_scalar(a, ctx, GD_INT_TYPE, -1, &v);
+
+  dreturn("%i", v);
+
+  return v;
+}
+
+int gdmx_to_int(const mxArray **rhs, int n)
+{
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+  return gdmx_to_int_(rhs[n], &ctx);
+}
+
+
+static long long gdmx_to_llong_(const mxArray *a,
+    const struct gdmx_context_t *ctx)
+{
+  int64_t v;
+
+  dtrace("%p, %p", a, ctx);
+
+  gdmx_convert_scalar(a, ctx, GD_INT64, -1, &v);
+
+  dreturn("%lli", (long long)v);
+
+  return (long long)v;
+}
+
+long long gdmx_to_llong(const mxArray **rhs, int n)
+{
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+  return gdmx_to_llong_(rhs[n], &ctx);
+}
+
+static unsigned long long gdmx_to_ullong_(const mxArray *a,
+    const struct gdmx_context_t *ctx)
+{
+  uint64_t v;
+
+  dtrace("%p, %p", a, ctx);
+
+  gdmx_convert_scalar(a, ctx, GD_UINT64, -1, &v);
+
+  dreturn("%llu", (unsigned long long)v);
+
+  return (unsigned long long)v;
+}
+
+unsigned long long gdmx_to_ullong(const mxArray **rhs, int n)
+{
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+  return gdmx_to_ullong_(rhs[n], &ctx);
+}
+
+static unsigned long gdmx_to_ulong_(const mxArray *a,
+    const struct gdmx_context_t *ctx)
+{
+  uint64_t v;
+
+  dtrace("%p, %p", a, ctx);
+
+  gdmx_convert_scalar(a, ctx, GD_UINT64, -1, &v);
+
+  dreturn("%lu", (unsigned long)v);
+
+  return (unsigned long)v;
+}
+
+unsigned long gdmx_to_ulong(const mxArray **rhs, int n)
+{
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+  return gdmx_to_ulong_(rhs[n], &ctx);
+}
+
+static mxArray *gdmx_from_cdouble(double* x)
+{
+  mxArray *lhs;
+
+  dtrace("{%g, %g}", x[0], x[1]);
+
+  lhs = mxCreateNumericMatrix(1, 1, mxDOUBLE_CLASS, mxCOMPLEX);
+  *((double*)mxGetData(lhs)) = x[0];
+  *((double*)mxGetImagData(lhs)) = x[1];
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+mxArray *gdmx_from_bool(int x)
+{
+  mxArray *lhs;
+
+  dtrace("%i", x);
+
+  lhs = mxCreateLogicalScalar(x ? true : false);
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+mxArray *gdmx_from_long(long x)
+{
+  mxArray *lhs;
+
+  dtrace("%li", x);
+
+  lhs = mxCreateNumericMatrix(1, 1, mxINT32_CLASS, mxREAL);
+  *((int32_t*)mxGetData(lhs)) = x;
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+mxArray *gdmx_from_llong(long long x)
+{
+  mxArray *lhs;
+
+  dtrace("%lli", x);
+
+  lhs = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL);
+  *((int64_t*)mxGetData(lhs)) = x;
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+mxArray *gdmx_from_ulong(unsigned long x)
+{
+  mxArray *lhs;
+
+  dtrace("%lu", x);
+
+  lhs = mxCreateNumericMatrix(1, 1, mxUINT32_CLASS, mxREAL);
+  *((uint32_t*)mxGetData(lhs)) = x;
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+mxArray *gdmx_from_ullong(unsigned long long x)
+{
+  mxArray *lhs;
+
+  dtrace("%llu", x);
+
+  lhs = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL);
+  *((uint64_t*)mxGetData(lhs)) = x;
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+mxArray *gdmx_from_triplet(gd_triplet_t datum, gd_windop_t windop)
+{
+  mxArray *a;
+
+  dtrace("{%g, %llu, %lli}, %i", datum.r, datum.u, datum.i, windop);
+
+  switch (windop) {
+    case GD_WINDOP_EQ:
+    case GD_WINDOP_NE:
+      a = gdmx_from_llong(datum.i);
+      break;
+    case GD_WINDOP_SET:
+    case GD_WINDOP_CLR:
+      a = gdmx_from_ullong(datum.u);
+      break;
+    default:
+      a = gdmx_from_double(datum.r);
+      break;
+  }
+
+  dreturn("%p", a);
+  return a;
+}
+
+mxArray *gdmx_from_data(const void *data, gd_type_t type, size_t n)
+{
+  mxArray *a;
+
+  dtrace("%p, 0x%X, %zu", data, type, n);
+
+  a = mxCreateNumericMatrix(1, n, gdmx_classid(type),
+      (type & GD_COMPLEX) ? mxCOMPLEX : mxREAL);
+
+  if (type == GD_COMPLEX64) {
+    size_t i;
+    float *p, *pr, *pi;
+
+    p = (float*)data;
+    pr = (float*)mxGetData(a);
+    pi = (float*)mxGetImagData(a);
+
+    for (i = 0; i < n; ++i) {
+      pr[i] = *(p++);
+      pi[i] = *(p++);
+    }
+  } else if (type == GD_COMPLEX128) {
+    size_t i;
+    double *p, *pr, *pi;
+
+    p = (double*)data;
+    pr = (double*)mxGetData(a);
+    pi = (double*)mxGetImagData(a);
+
+    for (i = 0; i < n; ++i) {
+      pr[i] = *(p++);
+      pi[i] = *(p++);
+    }
+  } else
+    memcpy(mxGetData(a), data, GD_SIZE(type) * n);
+
+  dreturn("%p", a);
+  return a;
+}
+
+mxArray *gdmx_from_nstring_list(const char **l, size_t n)
+{
+  mxArray *lhs;
+  size_t i;
+
+  dtrace("%p", l);
+
+  /* create and populate cell array */
+  lhs = mxCreateCellMatrix(1, n);
+  for (i = 0; i < n; ++i)
+    if (l[i] == NULL)
+      mxSetCell(lhs, i, mxCreateDoubleScalar(0));
+    else
+      mxSetCell(lhs, i, mxCreateString(l[i]));
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+mxArray *gdmx_from_string_list(const char **l)
+{
+  mxArray *lhs;
+  mxArray **s = NULL, **ptr;
+  int i;
+
+  dtrace("%p", l);
+
+  /* count and stringify */
+  for (i = 0; l[i]; ++i) {
+    ptr = (mxArray **)mxRealloc(s, sizeof(mxArray*) * (i + 1));
+    if (ptr == NULL) {
+      free(s);
+      mexErrMsgIdAndTxt("GetData:GDMX:Alloc", "Out of memory.");
+    }
+    s = ptr;
+    s[i] = mxCreateString(l[i]);
+  }
+
+  /* create and populate cell array */
+  lhs = mxCreateCellMatrix(1, i);
+  for (--i; i >= 0; --i)
+    mxSetCell(lhs, i, s[i]);
+
+  mxFree(s);
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+#define GDMX_COMMON_FIELDS "field", "field_type", "fragment_index"
+#define GDMX_NCOMMON 3
+#define GDMX_SCALAR_FIELDS "scalar", "scalar_ind"
+#define GDMX_NSCALAR 2
+mxArray *gdmx_from_entry(const gd_entry_t *E)
+{
+  mxArray *lhs;
+  int nfields = 0;
+  int nscalar = 0;
+  const char **field_names = NULL;
+
+  /* field lists */
+  const int bit_nfields = GDMX_NSCALAR + 3;
+  const char *bit_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "bitnum",
+    "numbits", GDMX_SCALAR_FIELDS};
+  const int carray_nfields = 2;
+  const char *carray_fields[] = {GDMX_COMMON_FIELDS, "const_type", "array_len"};
+  const int const_nfields = 1;
+  const char *const_fields[] = {GDMX_COMMON_FIELDS, "const_type"};
+  const int lincom_nfields = GDMX_NSCALAR + 3;
+  const char *lincom_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "m", "b",
+    GDMX_SCALAR_FIELDS};
+  const int linterp_nfields = 2;
+  const char *linterp_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "table"};
+  const int mplex_nfields = GDMX_NSCALAR + 3;
+  const char *mplex_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "count_val",
+    "period", GDMX_SCALAR_FIELDS};
+  const int multiply_nfields = 1;
+  const char *multiply_fields[] = {GDMX_COMMON_FIELDS, "in_fields"};
+  const int phase_nfields = GDMX_NSCALAR + 2;
+  const char *phase_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "shift",
+    GDMX_SCALAR_FIELDS};
+  const int polynom_nfields = GDMX_NSCALAR + 2;
+  const char *polynom_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "a",
+    GDMX_SCALAR_FIELDS};
+  const int raw_nfields = GDMX_NSCALAR + 2;
+  const char *raw_fields[] = {GDMX_COMMON_FIELDS, "spf", "data_type",
+    GDMX_SCALAR_FIELDS};
+  const int recip_nfields = GDMX_NSCALAR + 2;
+  const char *recip_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "dividend",
+    GDMX_SCALAR_FIELDS};
+  const int window_nfields = GDMX_NSCALAR + 3;
+  const char *window_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "windop",
+    "threshold", GDMX_SCALAR_FIELDS};
+  const char *common_fields[] = {GDMX_COMMON_FIELDS};
+
+  dtrace("%p", E);
+
+  switch (E->field_type) {
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      nfields = GDMX_NCOMMON + bit_nfields;
+      field_names = bit_fields;
+      break;
+    case GD_CARRAY_ENTRY:
+      nfields = GDMX_NCOMMON + carray_nfields;
+      field_names = carray_fields;
+      break;
+    case GD_CONST_ENTRY:
+      nfields = GDMX_NCOMMON + const_nfields;
+      field_names = const_fields;
+      break;
+    case GD_INDEX_ENTRY:
+    case GD_STRING_ENTRY:
+      nfields = GDMX_NCOMMON;
+      field_names = common_fields;
+      break;
+    case GD_LINCOM_ENTRY:
+      nfields = GDMX_NCOMMON + lincom_nfields;
+      field_names = lincom_fields;
+      break;
+    case GD_LINTERP_ENTRY:
+      nfields = GDMX_NCOMMON + linterp_nfields;
+      field_names = linterp_fields;
+      break;
+    case GD_MPLEX_ENTRY:
+      nfields = GDMX_NCOMMON + mplex_nfields;
+      field_names = mplex_fields;
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      nfields = GDMX_NCOMMON + multiply_nfields;
+      field_names = multiply_fields;
+      break;
+    case GD_PHASE_ENTRY:
+      nfields = GDMX_NCOMMON + phase_nfields;
+      field_names = phase_fields;
+      break;
+    case GD_POLYNOM_ENTRY:
+      nfields = GDMX_NCOMMON + polynom_nfields;
+      field_names = polynom_fields;
+      break;
+    case GD_RAW_ENTRY:
+      nfields = GDMX_NCOMMON + raw_nfields;
+      field_names = raw_fields;
+      break;
+    case GD_RECIP_ENTRY:
+      nfields = GDMX_NCOMMON + recip_nfields;
+      field_names = recip_fields;
+      break;
+    case GD_WINDOW_ENTRY:
+      nfields = GDMX_NCOMMON + window_nfields;
+      field_names = window_fields;
+      break;
+    default:
+      GDMX_INTERNAL_ERROR;
+  }
+
+  lhs = mxCreateStructMatrix(1, 1, nfields, field_names);
+
+  /* populate */
+  mxSetField(lhs, 0, "field", mxCreateString(E->field));
+  mxSetField(lhs, 0, "field_type", gdmx_from_entype(E->field_type));
+  mxSetField(lhs, 0, "fragment_index", gdmx_from_int(E->fragment_index));
+  switch (E->field_type) {
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0]));
+      mxSetField(lhs, 0, "bitnum", gdmx_from_int(E->EN(bit,bitnum)));
+      mxSetField(lhs, 0, "numbits", gdmx_from_int(E->EN(bit,numbits)));
+      nscalar = 2;
+      break;
+    case GD_CARRAY_ENTRY:
+      mxSetField(lhs, 0, "array_len",
+          gdmx_from_size_t(E->EN(scalar,array_len)));
+      /* fallthrough */
+    case GD_CONST_ENTRY:
+      mxSetField(lhs, 0, "const_type",
+          gdmx_from_gd_type(E->EN(scalar,const_type)));
+      break;
+    case GD_INDEX_ENTRY:
+    case GD_STRING_ENTRY:
+      break;
+    case GD_LINCOM_ENTRY:
+      mxSetField(lhs, 0, "in_fields",
+          gdmx_from_nstring_list((const char**)E->in_fields,
+            E->EN(lincom,n_fields)));
+      if (E->comp_scal) {
+        mxSetField(lhs, 0, "m", gdmx_from_data(E->EN(lincom,cm), GD_COMPLEX128,
+              E->EN(lincom,n_fields)));
+        mxSetField(lhs, 0, "b", gdmx_from_data(E->EN(lincom,cb), GD_COMPLEX128,
+              E->EN(lincom,n_fields)));
+      } else {
+        mxSetField(lhs, 0, "m", gdmx_from_data(E->EN(lincom,m), GD_FLOAT64,
+              E->EN(lincom,n_fields)));
+        mxSetField(lhs, 0, "b", gdmx_from_data(E->EN(lincom,b), GD_FLOAT64,
+              E->EN(lincom,n_fields)));
+      }
+      nscalar = GD_MAX_LINCOM * 2;
+      break;
+    case GD_LINTERP_ENTRY:
+      mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0]));
+      mxSetField(lhs, 0, "table", mxCreateString(E->EN(linterp,table)));
+      break;
+    case GD_MPLEX_ENTRY:
+      mxSetField(lhs, 0, "in_fields",
+          gdmx_from_nstring_list((const char**)E->in_fields, 2));
+      mxSetField(lhs, 0, "count_val", gdmx_from_int(E->EN(mplex,count_val)));
+      mxSetField(lhs, 0, "period", gdmx_from_int(E->EN(mplex,period)));
+      nscalar = 2;
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      mxSetField(lhs, 0, "in_fields",
+          gdmx_from_nstring_list((const char**)E->in_fields, 2));
+      break;
+    case GD_PHASE_ENTRY:
+      mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0]));
+      mxSetField(lhs, 0, "shift", gdmx_from_llong(E->EN(phase,shift)));
+      nscalar = 1;
+      break;
+    case GD_POLYNOM_ENTRY:
+      mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0]));
+      if (E->comp_scal) {
+        mxSetField(lhs, 0, "a", gdmx_from_data(E->EN(polynom,ca), GD_COMPLEX128,
+              E->EN(polynom,poly_ord) + 1));
+      } else {
+        mxSetField(lhs, 0, "a", gdmx_from_data(E->EN(polynom,a), GD_FLOAT64,
+              E->EN(polynom,poly_ord) + 1));
+      }
+      nscalar = E->EN(polynom,poly_ord) + 1;
+      break;
+    case GD_RAW_ENTRY:
+      mxSetField(lhs, 0, "data_type", gdmx_from_gd_type(E->EN(raw,data_type)));
+      mxSetField(lhs, 0, "spf", gdmx_from_uint(E->EN(raw,spf)));
+      nscalar = 1;
+      break;
+    case GD_RECIP_ENTRY:
+      mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0]));
+      if (E->comp_scal)
+        mxSetField(lhs, 0, "dividend",
+            gdmx_from_cdouble((double*)&E->EN(recip,cdividend)));
+      else
+        mxSetField(lhs, 0, "dividend", gdmx_from_double(E->EN(recip,dividend)));
+      nscalar = 1;
+      break;
+    case GD_WINDOW_ENTRY:
+      mxSetField(lhs, 0, "in_fields",
+          gdmx_from_nstring_list((const char**)E->in_fields, 2));
+      mxSetField(lhs, 0, "windop", gdmx_from_windop(E->EN(window,windop)));
+      mxSetField(lhs, 0, "threshold", gdmx_from_triplet(E->EN(window,threshold),
+            E->EN(window,windop)));
+      nscalar = 1;
+      break;
+    default:
+      GDMX_INTERNAL_ERROR;
+  }
+
+  /* handle scalars */
+  if (nscalar > 0) {
+    mxSetField(lhs, 0, "scalar",
+        gdmx_from_nstring_list((const char **)E->scalar, nscalar));
+    mxSetField(lhs, 0, "scalar_ind", gdmx_from_data(E->scalar_ind, GD_INT_TYPE,
+          nscalar));
+  }
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+mxArray *gdmx_from_carrays(const gd_carray_t *c, gd_type_t type)
+{
+  size_t i, n, comp;
+  mxArray *lhs;
+  mxClassID id;
+
+  dtrace("%p, 0x%X", c, type);
+
+  id = gdmx_classid(type);
+  comp = type & GD_COMPLEX;
+
+  /* count */
+  for (n = 0; c[n].n; ++n)
+    ;
+
+  lhs = mxCreateCellMatrix(1, n);
+
+  for (n = 0; c[n].n; ++n) {
+    mxArray *a = mxCreateNumericMatrix(1, c[n].n, id,
+        comp ? mxCOMPLEX : mxREAL);
+    void *pr = mxGetData(a);
+
+    if (type == GD_COMPLEX128) {
+      double *pi = mxGetImagData(a);
+      for (i = 0; i < c[n].n; ++i) {
+        ((double*)pr)[i] = ((double*)c[n].d)[2 * i];
+        pi[i] = ((double*)c[n].d)[2 * i + 1];
+      }
+    } else if (type == GD_COMPLEX64) {
+      float *pi = mxGetImagData(a);
+      for (i = 0; i < c[n].n; ++i) {
+        ((float*)pr)[i] = ((float*)c[n].d)[2 * i];
+        pi[i] = ((float*)c[n].d)[2 * i + 1];
+      }
+    } else
+      memcpy(pr, c[n].d, GD_SIZE(type) * c[n].n);
+
+    mxSetCell(lhs, n, a);
+  }
+
+  dreturn("%p", lhs);
+  return lhs;
+}
+
+#define GDMX_MXDIRFILE_FMT "MXDIRFILE:%p;"
+mxArray *gdmx_from_dirfile(const DIRFILE *D)
+{
+  dtrace("%p", D);
+
+  mxArray *a;
+  char s[100];
+
+  sprintf(s, GDMX_MXDIRFILE_FMT, D);
+
+  a = mxCreateString(s);
+
+  dreturn("%p (\"%s\")", a, s);
+  return a;
+}
+
+DIRFILE *gdmx_to_dirfile(const mxArray *mxa)
+{
+  DIRFILE *D = NULL;
+  const char *dirfile;
+
+  dtrace("%p", mxa);
+
+  dirfile = mxArrayToString(mxa);
+
+  if (dirfile)
+    sscanf(dirfile, GDMX_MXDIRFILE_FMT, &D);
+  else
+    mexErrMsgIdAndTxt("GetData:GDMX:BadMXDirfile",
+        "Indeciperhable MXDirfile.", dirfile);
+
+  if (D == NULL)
+    mexErrMsgIdAndTxt("GetData:GDMX:BadMXDirfile",
+        "Indeciperhable MXDirfile: '%s'.", dirfile);
+
+  dreturn("%p", D);
+
+  return D;
+}
+
+void gdmx_free_entry(gd_entry_t *E)
+{
+  int i, ns = 0, ni = 0;
+
+  dtrace("%p", E);
+
+  if (E) {
+    switch (E->field_type) {
+      case GD_LINCOM_ENTRY:
+        ni = E->EN(lincom,n_fields);
+        ns = ni * 2;
+        break;
+      case GD_LINTERP_ENTRY:
+        mxFree(E->EN(linterp,table));
+      case GD_DIVIDE_ENTRY:
+      case GD_MULTIPLY_ENTRY:
+        ni = 2;
+        break;
+      case GD_BIT_ENTRY:
+      case GD_SBIT_ENTRY:
+        ni = 1;
+        ns = 2;
+        break;
+      case GD_PHASE_ENTRY:
+      case GD_RECIP_ENTRY:
+        ns = ni = 1;
+        break;
+      case GD_POLYNOM_ENTRY:
+        ni = 1;
+        ns = E->EN(polynom,poly_ord) + 1;
+        break;
+      case GD_RAW_ENTRY:
+        ni = 1;
+        break;
+      case GD_WINDOW_ENTRY:
+        ni = 2;
+        ns = 1;
+        break;
+      case GD_MPLEX_ENTRY:
+        ni = ns = 2;
+        break;
+      default:
+        break;
+    }
+
+    for (i = 0; i < ni; ++i)
+      if (E->in_fields[i])
+        mxFree(E->in_fields[i]);
+
+    for (i = 0; i < ns; ++i)
+      if (E->scalar[i])
+        mxFree(E->scalar[i]);
+    mxFree(E);
+  }
+
+  dreturnvoid();
+}
+
+static int gdmx_convert_in_fields(const mxArray *str,
+    const struct gdmx_context_t *ctx, gd_entry_t *E)
+{
+  mxArray *a;
+  size_t i, nelem = 1;
+  struct gdmx_context_t ectx = { ctx->name, "in_fields", ctx->num };
+
+  dtrace("%p, %p, %p", str, ctx, E);
+
+  a = gdmx_get_field(str, ctx, "in_fields");
+
+  if (mxIsCell(a)) {
+    nelem = gdmx_get_length(a);
+    if (nelem > GD_MAX_LINCOM)
+      nelem = GD_MAX_LINCOM;
+
+    for (i = 0; i < nelem; ++i) {
+      E->in_fields[i] = gdmx_to_string_(mxGetCell(a, i), &ectx, 1);
+    }
+  } else if (mxIsChar(a)) /* a single in_field */
+    E->in_fields[0] = gdmx_to_string_(a, &ectx, 0);
+  else if (gdmx_is_zero(a))
+    E->in_fields[0] = NULL;
+  else
+    mexErrMsgIdAndTxt("GetData:GDMX:BadEntry",
+        "Expected cell array or string %s.", gdmx_context(&ectx, 0));
+
+  dreturn("%i", nelem);
+  return nelem;
+}
+
+static int gdmx_convert_entry_array(const mxArray *str,
+    const struct gdmx_context_t *ctx, const char *field, GD_DCOMPLEXV(d),
+    size_t nelem)
+{
+  size_t i;
+  mxArray *a;
+  GD_DCOMPLEXP_t v;
+  struct gdmx_context_t ectx = { ctx->name, field, ctx->num };
+
+  dtrace("%p, %p, \"%s\", %p, %zu", str, ctx, field, d, nelem);
+
+  a = gdmx_get_field(str, ctx, field);
+  v = gdmx_convert_array(a, &ectx, GD_COMPLEX128, &nelem);
+
+  for (i = 0; i < nelem; ++i)
+    gd_ca2cs_(d[i],v,i);
+
+  mxFree(v);
+
+  dreturn("%i", nelem);
+  return nelem;
+}
+
+
+gd_entry_t *gdmx_to_entry(const mxArray **rhs, int n, unsigned flags)
+{
+  int v;
+  uint64_t s;
+  size_t nscalar = 0;
+  gd_entry_t *E;
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+
+  dtrace("%p, %i, %x", rhs, n, flags);
+
+  /* check for struct */
+  if (!mxIsStruct(rhs[n]))
+    mexErrMsgIdAndTxt("GetData:GDMX:BadEntry",
+        "Expected entry struct for %s.", gdmx_context(&ctx, 0));
+
+  E = mxMalloc(sizeof(gd_entry_t));
+  memset(E, 0, sizeof(gd_entry_t));
+
+  /* fill the entry */
+  if (~flags & GDMX_ENO_FIELD)
+    E->field = gdmx_convert_struct_string(rhs[n], &ctx, "field");
+
+  gdmx_convert_struct_scalar(rhs[n], &ctx, "field_type", GD_INT_TYPE, &v);
+  E->field_type = v;
+  if (~flags & GDMX_ENO_FRAG)
+    gdmx_convert_struct_scalar(rhs[n], &ctx, "fragment_index", GD_INT_TYPE,
+        &E->fragment_index);
+
+  switch (E->field_type) {
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      gdmx_convert_in_fields(rhs[n], &ctx, E);
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "bitnum", GD_INT_TYPE,
+          &E->EN(bit,bitnum));
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "numbits", GD_INT_TYPE,
+          &E->EN(bit,numbits));
+      break;
+    case GD_CARRAY_ENTRY:
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "array_len", GD_UINT64, &s);
+      E->EN(scalar,array_len) = (size_t)s;
+      /* fallthrough */
+    case GD_CONST_ENTRY:
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "const_type", GD_INT_TYPE, &v);
+      E->EN(scalar,const_type) = v;
+      break;
+    case GD_DIVIDE_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+      gdmx_convert_in_fields(rhs[n], &ctx, E);
+      break;
+    case GD_LINCOM_ENTRY:
+      E->EN(lincom,n_fields) = gdmx_convert_in_fields(rhs[n], &ctx, E);
+      E->comp_scal = 1;
+      gdmx_convert_entry_array(rhs[n], &ctx, "m", E->EN(lincom,cm),
+          E->EN(lincom,n_fields));
+      gdmx_convert_entry_array(rhs[n], &ctx, "b", E->EN(lincom,cb),
+          E->EN(lincom,n_fields));
+      break;
+    case GD_LINTERP_ENTRY:
+      gdmx_convert_in_fields(rhs[n], &ctx, E);
+      E->EN(linterp,table) = gdmx_convert_struct_string(rhs[n], &ctx, "table");
+      break;
+    case GD_MPLEX_ENTRY:
+      gdmx_convert_in_fields(rhs[n], &ctx, E);
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "count_val", GD_INT_TYPE,
+          &E->EN(mplex,count_val));
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "period", GD_INT_TYPE,
+          &E->EN(mplex,period));
+      break;
+    case GD_PHASE_ENTRY:
+      gdmx_convert_in_fields(rhs[n], &ctx, E);
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "shift", GD_INT64,
+          &E->EN(phase,shift));
+      break;
+    case GD_POLYNOM_ENTRY:
+      gdmx_convert_in_fields(rhs[n], &ctx, E);
+      E->comp_scal = 1;
+      E->EN(polynom,poly_ord) = gdmx_convert_entry_array(rhs[n], &ctx, "a",
+          E->EN(polynom,ca), GD_MAX_POLYORD + 1) - 1;
+      break;
+    case GD_RAW_ENTRY:
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "data_type", GD_INT_TYPE, &v);
+      E->EN(raw,data_type) = v;
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "spf", GD_UINT_TYPE,
+          &E->EN(raw,spf));
+      nscalar = 1;
+      break;
+    case GD_RECIP_ENTRY:
+      gdmx_convert_in_fields(rhs[n], &ctx, E);
+      E->comp_scal = 1;
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "dividend", GD_COMPLEX128,
+          &E->EN(recip,cdividend));
+      break;
+    case GD_STRING_ENTRY:
+      break;
+    case GD_WINDOW_ENTRY:
+      gdmx_convert_in_fields(rhs[n], &ctx, E);
+      gdmx_convert_struct_scalar(rhs[n], &ctx, "windop", GD_INT_TYPE, &v);
+      E->EN(window,windop) = v;
+      switch (v) {
+        case GD_WINDOP_EQ:
+        case GD_WINDOP_NE:
+          gdmx_convert_struct_scalar(rhs[n], &ctx, "threshold", GD_INT64,
+              &E->EN(window,threshold).i);
+          break;
+        case GD_WINDOP_SET:
+        case GD_WINDOP_CLR:
+          gdmx_convert_struct_scalar(rhs[n], &ctx, "threshold", GD_UINT64,
+              &E->EN(window,threshold).u);
+          break;
+        default:
+          gdmx_convert_struct_scalar(rhs[n], &ctx, "threshold", GD_FLOAT64,
+              &E->EN(window,threshold).r);
+          break;
+      }
+      break;
+    default:
+      mexErrMsgIdAndTxt("GetData:GDMX:BadEntryType",
+          "Invalid field_type %i for entry struct in parameter %i.",
+          E->field_type, n);
+  }
+
+  if (nscalar > 0) {
+    mxArray *scalar = gdmx_get_field(rhs[n], NULL, "scalar");
+
+    if (scalar) {
+      int *si = NULL;
+      mxArray *scalar_ind = gdmx_get_field(rhs[n], NULL, "scalar_ind");
+
+      if (scalar_ind) {
+        struct gdmx_context_t si_ctx = { NULL, "scalar_ind", n };
+        si = gdmx_convert_array(scalar_ind, &si_ctx, GD_INT_TYPE, &nscalar);
+      }
+
+      if (mxIsChar(scalar)) {
+        /* a single scalar */
+        E->scalar[0] = gdmx_to_string_(scalar, NULL, 0);
+        if (si)
+          E->scalar_ind[0] = si[0];
+        else
+          E->scalar_ind[0] = -1;
+      } else if (!mxIsCell(scalar))
+        mexErrMsgIdAndTxt("GetData:GDMX:BadEntryScalars",
+            "Field 'scalar' must be a string or cell array in parameter %i", n,
+            mxGetClassName(scalar));
+      else {
+        abort();
+      }
+
+      mxFree(si);
+    }
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* convert nframes and nsamples from the rhs into nsamples */
+size_t gdmx_to_nsamp(DIRFILE *D, const char *field_code, const mxArray **rhs,
+    int nf, int ns)
+{
+  size_t nframes;
+  size_t nsamp;
+
+  dtrace("%p, %i, %i", rhs, nf, ns);
+
+  nframes = gdmx_to_size_t(rhs, nf);
+  nsamp = gdmx_to_size_t(rhs, ns);
+
+  if (nframes > 0) {
+    unsigned int spf = gd_spf(D, field_code);
+    gdmx_err(D, 0);
+
+    /* overflow */
+    if ((GD_SIZE_T_MAX - nsamp) / spf <= nframes)
+      mexErrMsgIdAndTxt("GetData:GDMX:Overflow", "Data range too large.");
+
+    nsamp += spf * nframes;
+  }
+
+  dreturn("%zu", nsamp);
+  return nsamp;
+}
+
+/* create a matlab vector; call gdmx_fix_vector after loading data */
+mxArray *gdmx_vector(gd_type_t type, size_t nsamp, void **data)
+{
+  mxArray *lhs;
+  mxComplexity cflag = (type & GD_COMPLEX) ? mxCOMPLEX : mxREAL;
+
+  dtrace("0x%X, %zu, %p", type, nsamp, data);
+
+  lhs = mxCreateNumericMatrix(1, (mwSize)nsamp, gdmx_classid(type), cflag);
+
+  if (data) {
+    /* in the complex place, we have to do the load out-of-place */
+    if (type & GD_COMPLEX)
+      *data = mxMalloc(GD_SIZE(type) * nsamp);
+    else
+      *data = mxGetData(lhs);
+  }
+
+  dreturn("%p (%p)", lhs, data ? *data : NULL);
+  return lhs;
+}
+
+/* store complex data, if necessary */
+void gdmx_fix_vector(mxArray *lhs, gd_type_t type, size_t nsamp, void *data)
+{
+  dtrace("%p, 0x%x, %zu, %p", lhs, type, nsamp, data);
+
+  if (type & GD_COMPLEX) {
+    size_t i;
+
+    if (type == GD_COMPLEX64) {
+      const float *ptr = (float *)data;
+      float *pr = (float*)mxGetData(lhs);
+      float *pi = (float*)mxGetImagData(lhs);
+
+      for (i = 0; i < nsamp; ++i) {
+        pr[i] = *(ptr++);
+        pi[i] = *(ptr++);
+      }
+    } else {
+      const double *ptr = (double *)data;
+      double *pr = (double*)mxGetData(lhs);
+      double *pi = (double*)mxGetImagData(lhs);
+
+      for (i = 0; i < nsamp; ++i) {
+        pr[i] = *(ptr++);
+        pi[i] = *(ptr++);
+      }
+    }
+    mxFree(data);
+  }
+
+  dreturnvoid();
+}
+
+void gdmx_to_data(void **data, gd_type_t *type, size_t *nsamp,
+    const mxArray **rhs, int n)
+{
+  int cflag = 0;
+  size_t i, ndims, ns = 1;
+  gd_type_t t;
+  const mwSize *dims;
+  struct gdmx_context_t ctx = { NULL, NULL, n };
+
+  dtrace("%p, %p, %p, %p, %i", data, type, nsamp, rhs, n);
+
+  /* check for complex data */
+  if (mxIsComplex(rhs[n]))
+    cflag = 1;
+
+  /* datatype */
+  *type = t = gdmx_type(rhs[n], &ctx, cflag);
+
+  /* length */
+  ndims = mxGetNumberOfDimensions(rhs[n]);
+
+  dims = mxGetDimensions(rhs[n]);
+  for (i = 0; i < ndims; ++i)
+    ns *= dims[i];
+
+  *nsamp = ns;
+
+  /* complex data needs a temporary buffer */
+  if (t == GD_COMPLEX64) {
+    float *d, *pr, *pi;
+    *data = mxMalloc(sizeof(float) * 2 * ns);
+    d = (float*)*data;
+
+    pr = (float*)mxGetData(rhs[n]);
+    pi = (float*)mxGetImagData(rhs[n]);
+
+    for (i = 0; i < ns; ++i) {
+      d[i * 2] = pr[i];
+      d[i * 2 + 1] = pi[i];
+    }
+  } else if (t == GD_COMPLEX128) {
+    double *d, *pr, *pi;
+    *data = mxMalloc(sizeof(double) * 2 * ns);
+    d = (double*)*data;
+
+    pr = (double*)mxGetData(rhs[n]);
+    pi = (double*)mxGetImagData(rhs[n]);
+
+    for (i = 0; i < ns; ++i) {
+      d[i * 2] = pr[i];
+      d[i * 2 + 1] = pi[i];
+    }
+  } else
+    *data = mxGetData(rhs[n]);
+
+  dreturn("%p; 0x%X, %zu", *data, *type, *nsamp);
+}
+
+void gdmx_free_data(void *data, gd_type_t type)
+{
+  dtrace("%p, 0x%X", data, type);
+
+  if (type & GD_COMPLEX)
+    mxFree(data);
+
+  dreturnvoid();
+}
diff --git a/bindings/matlab/test/Makefile.am b/bindings/matlab/test/Makefile.am
new file mode 100644
index 0000000..bdd3c05
--- /dev/null
+++ b/bindings/matlab/test/Makefile.am
@@ -0,0 +1,41 @@
+# Copyright (C) 2013, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign serial-tests
+
+if TEST_MATLAB
+TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:../.libs:${${DL_LIBRARY_PATH}} MATLABPATH=${srcdir}:..:${srcdir}/.. ${srcdir}/test.sh ${MATLAB}
+
+matlabTESTS=big_test.m
+
+TESTS=$(addprefix ${srcdir}/,$(matlabTESTS))
+endif
+
+EXTRA_DIST=${matlabTESTS} test.sh
+
+check-local: check-TESTS
+	echo $(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~
diff --git a/bindings/matlab/test/Makefile.in b/bindings/matlab/test/Makefile.in
new file mode 100644
index 0000000..ccab349
--- /dev/null
+++ b/bindings/matlab/test/Makefile.in
@@ -0,0 +1,672 @@
+# 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/matlab/test
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/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_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2013, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign serial-tests
+ at TEST_MATLAB_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:../.libs:${${DL_LIBRARY_PATH}} MATLABPATH=${srcdir}:..:${srcdir}/.. ${srcdir}/test.sh ${MATLAB}
+ at TEST_MATLAB_TRUE@matlabTESTS = big_test.m
+ at TEST_MATLAB_TRUE@TESTS = $(addprefix ${srcdir}/,$(matlabTESTS))
+EXTRA_DIST = ${matlabTESTS} test.sh
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/matlab/test/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/matlab/test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am check-local clean \
+	clean-generic clean-libtool clean-local cscopelist-am ctags-am \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am
+
+
+check-local: check-TESTS
+	echo $(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/matlab/test/big_test.m b/bindings/matlab/test/big_test.m
new file mode 100644
index 0000000..631f146
--- /dev/null
+++ b/bindings/matlab/test/big_test.m
@@ -0,0 +1,2241 @@
+% Copyright (C) 2013 D. V. Wiebe
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This file is part of the GetData project.
+%
+% GetData is free software; you can redistribute it and/or modify it under
+% the terms of the GNU Lesser General Public License as published by the
+% Free Software Foundation; either version 2.1 of the License, or (at your
+% option) any later version.
+%
+% GetData is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with GetData; if not, write to the Free Software Foundation, Inc.,
+% 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+function big_test
+try
+  ne = 0;
+
+  filedir='dirfile';
+  format=strcat(filedir, '/format');
+  format1=strcat(filedir, '/format1');
+  form2=strcat(filedir, '/form2');
+  data=strcat(filedir, '/data');
+  new1=strcat(filedir, '/new1');
+  format_data =[...
+  '/ENDIAN little\n'...
+  'data RAW INT8 8\n'...
+  'lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const\n'...
+  '/META data mstr STRING "This is a string constant."\n'...
+  '/META data mconst CONST COMPLEX128 3.3;4.4\n'...
+  '/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5\n'...
+  '/META data mlut LINTERP DATA ./lut\n'...
+  'const CONST FLOAT64 5.5\n'...
+  'carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6\n'...
+  'linterp LINTERP data ./lut\n'...
+  'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const\n'...
+  'bit BIT data 3 4\n'...
+  'sbit SBIT data 5 6\n'...
+  'mplex MPLEX data sbit 1 10\n'...
+  'mult MULTIPLY data sbit\n'...
+  'div DIVIDE mult bit\n'...
+  'recip RECIP div 6.5;4.3\n'...
+  'phase PHASE data 11\n'...
+  'window WINDOW linterp mult LT 4.1\n'...
+  '/ALIAS alias data\n'...
+  'string STRING "Zaphod Beeblebrox"\n'];
+  form2_data = 'const2 CONST INT8 -19\n';
+
+  fields = {'INDEX'; 'alias'; 'bit'; 'carray'; 'const'; 'data'; 'div'; ...
+  'lincom'; 'linterp'; 'mplex'; 'mult'; 'phase'; 'polynom'; 'recip'; 'sbit'; ...
+  'string'; 'window'};
+  nfields = 17;
+
+  % Create the dirfile
+  mkdir(filedir);
+
+  fid=fopen(format, 'w');
+  fprintf(fid, format_data);
+  fclose(fid);
+
+  fid=fopen(form2, 'w');
+  fprintf(fid, form2_data);
+  fclose(fid);
+
+  data_data=0:1:80;
+  fid=fopen(data, 'w');
+  fwrite(fid, data_data);
+  fclose(fid);
+
+  % 140: getdata_constants check
+  GD = getdata_constants();
+  ne = ne + check_num(140, GD.RDWR, 1);
+
+  % 0: gd_error check
+  try
+    D = gd_open('x');
+  catch exc
+    ne = ne + check_exc(exc, 0, 'Open');
+  end
+
+  % 1: gd_open check
+  try
+    D = gd_open(filedir, GD.RDWR);
+  catch exc
+    ne = ne + check_ok(exc, 1);
+  end
+
+  % 2: getdata check
+  try
+    d = gd_getdata(D, 'data', 5, 0, 1, 0);
+    ne = ne + check_array(2, d, [40:47]);
+  catch exc
+    ne = ne + check_ok(exc, 2);
+  end
+
+  % 108: 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);
+  end
+
+  % 3: gd_get_constant check
+  try
+    d = gd_get_constant(D, 'const');
+    ne = ne + check_num(3, d, 5.5);
+  catch exc
+    ne = ne + check_ok(exc, 3);
+  end
+
+  % 6: gd_nfields check
+  try
+    d = gd_nfields(D);
+    ne = ne + check_num(6, d, nfields);
+  catch exc
+    ne = ne + check_ok(exc, 6);
+  end
+
+  % 8: gd_field_list check
+  try
+    d = gd_field_list(D);
+    ne = ne + check_sarray(8, d, fields);
+  catch exc
+    ne = ne + check_ok(exc, 8);
+  end
+
+  % 9: gd_nmfields check
+  try
+    d = gd_nmfields(D, 'data');
+    ne = ne + check_num(9, d, 4);
+  catch exc
+    ne = ne + check_ok(exc, 9);
+  end
+
+  % 10: gd_mfield_list check
+  try
+    d = gd_mfield_list(D, 'data');
+    ne = ne + check_sarray(10, d, { 'mstr'; 'mconst'; 'mcarray'; 'mlut' });
+  catch exc
+    ne = ne + check_ok(exc, 10);
+  end
+
+  % 11: gd_nframes check
+  try
+    d = gd_nframes(D);
+    ne = ne + check_num(11, d, 10);
+  catch exc
+    ne = ne + check_ok(exc, 11);
+  end
+
+  % 12: gd_spf check
+  try
+    d = gd_spf(D, 'data');
+    ne = ne + check_num(12, d, 8);
+  catch exc
+    ne = ne + check_ok(exc, 12);
+  end
+
+  % 13: gd_putdata check
+  p = [ 13, 14, 15, 16 ];
+  try
+    d = gd_putdata(D, 'data', 5, 1, p);
+    ne = ne + check_num(13, d, 4);
+  catch exc
+    ne = ne + check_ok2(exc, 13, 1);
+  end
+
+  try
+    d = gd_getdata(D, 'data', 5, 0, 1, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 13, 2);
+  end
+
+  % 124: 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);
+  catch exc
+    ne = ne + check_ok2(exc, 124, 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]);
+  catch exc
+    ne = ne + check_ok2(exc, 124, 2);
+  end
+
+  % 14: error_string
+  try
+    gd_getdata(D, 'x', 1, 0, 1, 0);
+  catch exc
+    ne = ne + check_exc(exc, 14, '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');
+
+  % 15: entry_type
+  try
+    d = gd_entry_type(D, 'data');
+    ne = ne + check_num(15, d, GD.RAW_ENTRY);
+  catch exc
+    ne = ne + check_ok(exc, 15);
+  end
+
+  % 16: 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);
+  catch exc
+    ne = ne + check_ok(exc, 16);
+  end
+
+  % 18: 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]);
+  catch exc
+    ne = ne + check_ok(exc, 18);
+  end
+
+  % 20: 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), ...
+    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]);
+  catch exc
+    ne = ne + check_ok(exc, 20);
+  end
+
+  % 21: 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');
+  catch exc
+    ne = ne + check_ok(exc, 21);
+  end
+
+  % 22: 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);
+  catch exc
+    ne = ne + check_ok(exc, 22);
+  end
+
+  % 23: 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);
+  catch exc
+    ne = ne + check_ok(exc, 23);
+  end
+
+  % 24: 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'; });
+  catch exc
+    ne = ne + check_ok(exc, 24);
+  end
+
+  % 25: 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);
+  catch exc
+    ne = ne + check_ok(exc, 25);
+  end
+
+  % 26: 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);
+  catch exc
+    ne = ne + check_ok(exc, 26);
+  end
+
+  % 134: 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);
+  catch exc
+    ne = ne + check_ok(exc, 134);
+  end
+
+  % 27: gd_fragment_index check
+  try
+    d = gd_fragment_index(D, 'data');
+  catch exc
+    ne = ne + check_ok(exc, 27);
+  end
+  ne = ne + check_num(27, d, 0);
+
+  % 28: add_raw
+  try
+    gd_add_raw(D, 'new1', GD.FLOAT64, 3, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 28, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 28, 2);
+  end
+
+  % 29: 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);
+  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 ]);
+  catch exc
+    ne = ne + check_ok2(exc, 29, 2);
+  end
+
+  % 32: 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);
+  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)]);
+  catch exc
+    ne = ne + check_ok2(exc, 32, 2);
+  end
+
+  % 33: add entry (linterp) check
+  try
+    gd_add_linterp(D, 'new6', 'in', './some/table', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 33, 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');
+  catch exc
+    ne = ne + check_ok2(exc, 33, 2);
+  end
+
+  % 34: add entry (bit) check
+  try
+    gd_add_bit(D, 'new7', 'in', 13, 12, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 34, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 34, 2);
+  end
+
+  % 35: add entry (sbit) check
+  try
+    gd_add_sbit(D, 'new8', 'in', 14, 15, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 35, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 35, 2);
+  end
+
+  % 36: add entry (mult) check
+  try
+    gd_add_multiply(D, 'new9', 'in1', 'in2', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 36, 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'; });
+  catch exc
+    ne = ne + check_ok2(exc, 36, 2);
+  end
+
+  % 37: add entry (phase) check
+  try
+    gd_add_phase(D, 'new10', 'in1', 22, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 37, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 37, 2);
+  end
+
+  % 38: add entry (const) check
+  try
+    gd_add_const(D, 'new11', GD.COMPLEX128, 2.6, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 38, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 38, 2);
+  end
+
+  try
+    d = gd_get_constant(D, 'new11', GD.FLOAT64);
+    ne = ne + check_num2(38, 6, d, 2.6);
+  catch exc
+    ne = ne + check_ok2(exc, 38, 3);
+  end
+
+  % 39: fragmentname
+  try
+    d = gd_fragmentname(D, 0);
+    ne = ne + check_eostring(39, d, 'dirfile/format');
+  catch exc
+    ne = ne + check_ok(exc, 39);
+  end
+
+  % 40: nfragments
+  try
+    d = gd_nfragments(D);
+    ne = ne + check_num(40, d, 1);
+  catch exc
+    ne = ne + check_ok(exc, 40);
+  end
+
+  % 41: include
+  try
+    d = gd_include(D, 'form2', 0, 0);
+    ne = ne + check_num2(41, 1, d, 1);
+  catch exc
+    ne = ne + check_ok2(exc, 41, 1);
+  end
+
+  try
+    d = gd_get_constant(D, 'const2');
+    ne = ne + check_num2(41, 2, d, -19);
+  catch exc
+    ne = ne + check_ok2(exc, 41, 2);
+  end
+
+  % 42: nfields_by_type
+  try
+    d = gd_nfields_by_type(D, GD.LINCOM_ENTRY);
+    ne = ne + check_num(42, d, 2);
+  catch exc
+    ne = ne + check_ok(exc, 42);
+  end
+
+  % 43: field_list_by_type
+  try
+    d = gd_field_list_by_type(D, GD.LINCOM_ENTRY);
+    ne = ne + check_sarray(43, d, { 'lincom', 'new2' });
+  catch exc
+    ne = ne + check_ok(exc, 43);
+  end
+
+  % 44: nfields_by_type
+  try
+    d = gd_nvectors(D);
+    ne = ne + check_num(44, d, 22);
+  catch exc
+    ne = ne + check_ok(exc, 44);
+  end
+
+  % 45: 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'});
+  catch exc
+    ne = ne + check_ok(exc, 45);
+  end
+
+  % 46: 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);
+  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 ]);
+  catch exc
+    ne = ne + check_ok2(exc, 46, 2);
+  end
+
+  % 49: 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);
+  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)]);
+  catch exc
+    ne = ne + check_ok2(exc, 49, 2);
+  end
+
+  % 50: add entry (linterp) check
+  try
+    gd_madd_linterp(D, 'data', 'mnew6', 'in', './some/table');
+  catch exc
+    ne = ne + check_ok2(exc, 50, 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');
+  catch exc
+    ne = ne + check_ok2(exc, 50, 2);
+  end
+
+  % 51: add entry (bit) check
+  try
+    gd_madd_bit(D, 'data', 'mnew7', 'in', 13, 12);
+  catch exc
+    ne = ne + check_ok2(exc, 51, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 34, 2);
+  end
+
+  % 52: add entry (sbit) check
+  try
+    gd_madd_sbit(D, 'data', 'mnew8', 'in', 14, 15);
+  catch exc
+    ne = ne + check_ok2(exc, 52, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 52, 2);
+  end
+
+  % 53: add entry (mult) check
+  try
+    gd_madd_multiply(D, 'data', 'mnew9', 'in1', 'in2');
+  catch exc
+    ne = ne + check_ok2(exc, 53, 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'; });
+  catch exc
+    ne = ne + check_ok2(exc, 53, 2);
+  end
+
+  % 54: add entry (phase) check
+  try
+    gd_madd_phase(D, 'data', 'mnew10', 'in1', 22);
+  catch exc
+    ne = ne + check_ok2(exc, 54, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 54, 2);
+  end
+
+  % 55: madd entry (const) check
+  try
+    gd_madd_const(D, 'data', 'mnew11', GD.FLOAT64, 2.6);
+  catch exc
+    ne = ne + check_ok2(exc, 55, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 55, 2);
+  end
+
+  try
+    d = gd_get_constant(D, 'data/mnew11');
+    ne = ne + check_num2(55, 6, d, 2.6);
+  catch exc
+    ne = ne + check_ok2(exc, 55, 3);
+  end
+
+  % 56: get_string
+  try
+    d = gd_get_string(D, 'string');
+    ne = ne + check_string(56, d, 'Zaphod Beeblebrox');
+  catch exc
+    ne = ne + check_ok(exc, 56);
+  end
+
+  % 57: add string
+  try
+    gd_add_string(D, 'new12', '---string---', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 57, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 57, 2);
+  end
+
+  try
+    d = gd_get_string(D, 'new12');
+    ne = ne + check_string(57, d, '---string---');
+  catch exc
+    ne = ne + check_ok(exc, 57);
+  end
+
+  % 58: madd string
+  try
+    gd_madd_string(D, 'data', 'mnew12', '---mstring---');
+  catch exc
+    ne = ne + check_ok2(exc, 58, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 58, 2);
+  end
+
+  try
+    d = gd_get_string(D, 'data/mnew12');
+    ne = ne + check_string(58, d, '---mstring---');
+  catch exc
+    ne = ne + check_ok(exc, 58);
+  end
+
+  % 59: add_spec
+  try
+    gd_add_spec(D, 'lorem STRING "Lorem ipsum"', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 59, 1);
+  end
+
+  try
+    d = gd_get_string(D, 'lorem');
+    ne = ne + check_string(59, d, 'Lorem ipsum');
+  catch exc
+    ne = ne + check_ok2(exc, 59, 2);
+  end
+
+  % 60: madd_spec
+  try
+    gd_madd_spec(D, 'ipsum STRING "dolor sit amet."', 'lorem');
+  catch exc
+    ne = ne + check_ok2(exc, 60, 1);
+  end
+
+  try
+    d = gd_get_string(D, 'lorem/ipsum');
+    ne = ne + check_string(60, d, 'dolor sit amet.');
+  catch exc
+    ne = ne + check_ok2(exc, 60, 2);
+  end
+
+  % 61: put_constant
+  try
+    gd_put_constant(D, 'const', 61);
+  catch exc
+    ne = ne + check_ok2(exc, 61, 1);
+  end
+
+  try
+    d = gd_get_constant(D, 'const');
+    ne = ne + check_num2(61, 6, d, 61);
+  catch exc
+    ne = ne + check_ok2(exc, 61, 2);
+  end
+
+  % 133: put_constant
+  try
+    gd_put_constant(D, 'new11', complex(133,134));
+  catch exc
+    ne = ne + check_ok2(exc, 133, 1);
+  end
+
+  try
+    d = gd_get_constant(D, 'new11');
+    ne = ne + check_num2(133, 6, d, complex(133,134));
+  catch exc
+    ne = ne + check_ok2(exc, 133, 2);
+  end
+
+  % 62: put_string
+  try
+    gd_put_string(D, 'string', 'Arthur Dent');
+  catch exc
+    ne = ne + check_ok2(exc, 62, 1);
+  end
+
+  try
+    d = gd_get_string(D, 'string');
+    ne = ne + check_string(62, d, 'Arthur Dent');
+  catch exc
+    ne = ne + check_ok2(exc, 62, 2);
+  end
+
+  % 63: nmfields_by_type
+  try
+    d = gd_nmfields_by_type(D, 'data', GD.LINCOM_ENTRY);
+    ne = ne + check_num(63, d, 1);
+  catch exc
+    ne = ne + check_ok(exc, 63);
+  end
+
+  % 64: mfield_list_by_type
+  try
+    d = gd_mfield_list_by_type(D, 'data', GD.LINCOM_ENTRY);
+    ne = ne + check_sarray(64, d, {'mnew1'});
+  catch exc
+    ne = ne + check_ok(exc, 64);
+  end
+
+  % 65: nmvectors
+  try
+    d = gd_nmvectors(D, 'data');
+    ne = ne + check_num(65, d, 8);
+  catch exc
+    ne = ne + check_ok(exc, 65);
+  end
+
+  % 66: mvector_list
+  try
+    d = gd_mvector_list(D, 'data');
+    ne = ne + check_sarray(66, d, {'mlut', 'mnew1', 'mnew4', 'mnew6', ...
+    'mnew7', 'mnew8', 'mnew9', 'mnew10'});
+  catch exc
+    ne = ne + check_ok(exc, 66);
+  end
+
+  % 67: gd_alter_raw
+  try
+    gd_alter_raw(D, 'new1', GD.INT32, 4, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 67, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 67, 2);
+  end
+
+  % 68: 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);
+  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 ]);
+  catch exc
+    ne = ne + check_ok2(exc, 68, 2);
+  end
+
+  % 70: 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);
+  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]);
+  catch exc
+    ne = ne + check_ok2(exc, 70, 2);
+  end
+
+  % 72: gd_alter_linterp
+  try
+    gd_alter_linterp(D, 'new6', 'in3', 0, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 72, 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');
+  catch exc
+    ne = ne + check_ok2(exc, 72, 2);
+  end
+
+  % 73: gd_alter_bit
+  try
+    gd_alter_bit(D, 'new7', 'in3', 3, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 73, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 73, 2);
+  end
+
+  % 74: gd_alter_sbit
+  try
+    gd_alter_sbit(D, 'new8', 'in3', 3, 9);
+  catch exc
+    ne = ne + check_ok2(exc, 74, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 74, 2);
+  end
+
+  % 75: gd_alter_multiply
+  try
+    gd_alter_multiply(D, 'new9', 'in6', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 75, 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'; });
+  catch exc
+    ne = ne + check_ok2(exc, 75, 2);
+  end
+
+  % 76: alter phase
+  try
+    gd_alter_phase(D, 'new10', 'in2', 23);
+  catch exc
+    ne = ne + check_ok2(exc, 76, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 76, 2);
+  end
+
+  % 77: atler const
+  try
+    gd_alter_const(D, 'new11', GD.FLOAT64);
+  catch exc
+    ne = ne + check_ok2(exc, 77, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 77, 2);
+  end
+
+  % 78: gd_encoding
+  try
+    d = gd_encoding(D, 0);
+    ne = ne + check_num(78, d, GD.UNENCODED);
+  catch exc
+    ne = ne + check_ok(exc, 78);
+  end
+
+  % 79: gd_encoding
+  try
+    d = gd_endianness(D, 0);
+    ne = ne + check_num(79, d, GD.LITTLE_ENDIAN + GD.NOT_ARM_ENDIAN);
+  catch exc
+    ne = ne + check_ok(exc, 79);
+  end
+
+  % 80: dirfilename
+  try
+    d = gd_dirfilename(D);
+    ne = ne + check_eostring(80, d, 'dirfile');
+  catch exc
+    ne = ne + check_ok(exc, 80);
+  end
+
+  % 81: gd_parent_fragment
+  try
+    d = gd_parent_fragment(D, 1);
+    ne = ne + check_num(81, d, 0);
+  catch exc
+    ne = ne + check_ok(exc, 81);
+  end
+
+  % 82: gd_alter_protection
+  try
+    gd_alter_protection(D, 0, GD.PROTECT_DATA);
+  catch exc
+    ne = ne + check_ok(exc, 82);
+  end
+
+  % 83: gd_protection
+  try
+    d = gd_protection(D, 0);
+    ne = ne + check_num(83, d, GD.PROTECT_DATA);
+  catch exc
+    ne = ne + check_ok(exc, 83);
+  end
+
+  % 84: gd_raw_filename
+  try
+    d = gd_raw_filename(D, 'data');
+    ne = ne + check_eostring(84, d, 'dirfile/data');
+  catch exc
+    ne = ne + check_ok(exc, 84);
+  end
+
+  % 85: gd_reference
+  try
+    d = gd_reference(D);
+    ne = ne + check_string2(85, 1, d, 'data');
+  catch exc
+    ne = ne + check_ok2(exc, 85, 1);
+  end
+
+  try
+    d = gd_reference(D, 'new1');
+    ne = ne + check_string2(85, 2, d, 'new1');
+  catch exc
+    ne = ne + check_ok2(exc, 85, 2);
+  end
+
+  % 87: gd_alter_encoding
+  try
+    gd_alter_encoding(D, GD.SLIM_ENCODED, 1, 0);
+  catch exc
+    ne = ne + check_ok(exc, 87);
+  end
+
+  % 88: gd_alter_endiannness
+  try
+    gd_alter_endianness(D, GD.BIG_ENDIAN, 1, 0);
+  catch exc
+    ne = ne + check_ok(exc, 88);
+  end
+
+  % 89: gd_alter_spec
+  try
+    gd_alter_spec(D, 'new10 PHASE in5 3', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 89, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 89, 2);
+  end
+
+  % 90: gd_delete
+  try
+    gd_delete(D, 'new10', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 90, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new10');
+  catch exc
+    ne = ne + check_exc2(exc, 90, 2, 'BadCode');
+  end
+
+  % 91: gd_malter_spec
+  try
+    gd_malter_spec(D, 'mnew10 PHASE in4 11', 'data', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 91, 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);
+  catch exc
+    ne = ne + check_ok2(exc, 91, 2);
+  end
+
+  % 92: move
+  try
+    gd_move(D, 'new9', 1, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 92, 1);
+  end
+
+  try
+    d = gd_fragment_index(D, 'new9');
+    ne = ne + check_num(92, d, 1);
+  catch exc
+    ne = ne + check_ok2(exc, 92, 2);
+  end
+
+  % 93: rename
+  try
+    gd_rename(D, 'new9', 'newer', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 93, 1);
+  end
+
+  try
+    d = gd_fragment_index(D, 'newer');
+    ne = ne + check_num(93, d, 1);
+  catch exc
+    ne = ne + check_ok2(exc, 93, 2);
+  end
+
+  % 94: unclude
+  try
+    gd_uninclude(D, 1, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 94, 1);
+  end
+
+  try
+    d = gd_nfragments(D);
+    ne = ne + check_num(94, d, 1);
+  catch exc
+    ne = ne + check_ok2(exc, 94, 2);
+  end
+
+  % 95: frameoffset
+  try
+    d = gd_frameoffset(D, 0);
+    ne = ne + check_num(95, d, 0);
+  catch exc
+    ne = ne + check_ok(exc, 95);
+  end
+
+  % 96: alter_frameoffset
+  try
+    gd_alter_frameoffset(D, 33, 0, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 96, 1);
+  end
+
+  try
+    d = gd_frameoffset(D, 0);
+    ne = ne + check_num(96, d, 33);
+  catch exc
+    ne = ne + check_ok2(exc, 96, 2);
+  end
+
+  % 97: native_type
+  try
+    d = gd_native_type(D, 'data');
+    ne = ne + check_num(97, d, GD.INT8);
+  catch exc
+    ne = ne + check_ok(exc, 97);
+  end
+
+  % 99: validate
+  try
+    d = gd_validate(D, 'new7');
+  catch exc
+    ne = ne + check_exc(exc, 99, 'BadCode');
+  end
+
+  % 100: framenum
+  try
+    gd_reference(D, 'data');
+    d = gd_framenum(D, 'data', 33.3);
+    ne = ne + check_num(100, d, 37.1625);
+  catch exc
+    ne = ne + check_ok(exc, 100);
+  end
+
+  % 101: 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);
+  catch exc
+    ne = ne + check_ok(exc, 86);
+  end
+
+  % 142: gd_bof
+  try
+    d = gd_bof(D, 'lincom');
+    ne = ne + check_num(142, d, 264);
+  catch exc
+    ne = ne + check_ok(exc, 142);
+  end
+
+  % 143: entry (div) check
+  try
+    d = gd_entry(D, 'div');
+    ne = ne + check_string2(143, 1, d.field, 'div');
+    ne = ne + check_num2(143, 2, d.field_type, GD.DIVIDE_ENTRY);
+    ne = ne + check_num2(143, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(143, 4, d.in_fields, { 'mult'; 'bit'; });
+  catch exc
+    ne = ne + check_ok(exc, 143);
+  end
+
+  % 145: entry (recip) check
+  try
+    d = gd_entry(D, 'recip');
+    ne = ne + check_string2(145, 1, d.field, 'recip');
+    ne = ne + check_num2(145, 2, d.field_type, GD.RECIP_ENTRY);
+    ne = ne + check_num2(145, 3, d.fragment_index, 0);
+    ne = ne + check_num2(145, 4, d.dividend, complex(6.5,4.3));
+  catch exc
+    ne = ne + check_ok(exc, 145);
+  end
+
+  % 146: add entry (mult) check
+  try
+    gd_add_divide(D, 'new14', 'in1', 'in2', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 146, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new14');
+    ne = ne + check_string2(146, 1, d.field, 'new14');
+    ne = ne + check_num2(146, 2, d.field_type, GD.DIVIDE_ENTRY);
+    ne = ne + check_num2(146, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(146, 4, d.in_fields, { 'in1'; 'in2'; });
+  catch exc
+    ne = ne + check_ok2(exc, 146, 2);
+  end
+
+  % 148: add entry (recip) check
+  try
+    gd_add_recip(D, 'new16', 'in3', 33.3, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 148, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new16');
+    ne = ne + check_string2(148, 1, d.field, 'new16');
+    ne = ne + check_num2(148, 2, d.field_type, GD.RECIP_ENTRY);
+    ne = ne + check_num2(148, 3, d.fragment_index, 0);
+    ne = ne + check_string2(148, 4, d.in_fields, 'in3');
+    ne = ne + check_num2(148, 3, d.dividend, 33.3);
+  catch exc
+    ne = ne + check_ok2(exc, 148, 2);
+  end
+
+  % 149: madd entry (div) check
+  try
+    gd_madd_divide(D, 'data', 'mnew14', 'in1', 'in2');
+  catch exc
+    ne = ne + check_ok2(exc, 149, 1);
+  end
+
+  try
+    d = gd_entry(D, 'data/mnew14');
+    ne = ne + check_string2(149, 1, d.field, 'data/mnew14');
+    ne = ne + check_num2(149, 2, d.field_type, GD.DIVIDE_ENTRY);
+    ne = ne + check_num2(149, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(149, 4, d.in_fields, { 'in1'; 'in2'; });
+  catch exc
+    ne = ne + check_ok2(exc, 149, 2);
+  end
+
+  % 151: madd entry (recip) check
+  try
+    gd_madd_recip(D, 'data', 'mnew16', 'in1', complex(5.5,6.6));
+  catch exc
+    ne = ne + check_ok2(exc, 151, 1);
+  end
+
+  try
+    d = gd_entry(D, 'data/mnew16');
+    ne = ne + check_string2(151, 1, d.field, 'data/mnew16');
+    ne = ne + check_num2(151, 2, d.field_type, GD.RECIP_ENTRY);
+    ne = ne + check_num2(151, 3, d.fragment_index, 0);
+    ne = ne + check_string2(151, 4, d.in_fields, 'in1');
+    ne = ne + check_num2(151, 5, d.dividend, complex(5.5,6.6));
+  catch exc
+    ne = ne + check_ok2(exc, 151, 2);
+  end
+
+  % 155: rewrite_fragment
+  try
+    gd_rewrite_fragment(D, 0);
+  catch exc
+    ne = ne + check_ok(exc, 155);
+  end
+
+  % 156: invalid_dirfile
+  try
+    d = gd_invalid_dirfile();
+  catch exc
+    ne = ne + check_ok(exc, 156);
+  end
+
+  try
+    gd_discard(d);
+  catch
+    [];
+  end
+
+  % 157: standards
+  try
+    d = gd_dirfile_standards(D);
+    ne = ne + check_num(157, d, GD.DIRFILE_STANDARDS_VERSION);
+  catch exc
+    ne = ne + check_ok2(exc, 157, 1);
+  end
+
+  try
+    d = gd_dirfile_standards(D, 0);
+  catch exc
+    ne = ne + check_exc2(exc, 157, 2, 'Argument');
+  end
+
+  % 158: get_carray
+  try
+    d = gd_get_carray(D, 'carray');
+    ne = ne + check_array(158, d, [1.1, 2.2, 3.3, 4.4, 5.5, 6.6]);
+  catch exc
+    ne = ne + check_ok(exc, 158);
+  end
+
+  % 159: gd_carray_slice
+  try
+    d = gd_get_carray_slice(D, 'carray', 2, 2);
+    ne = ne + check_array(159, d, [3.3, 4.4]);
+  catch exc
+    ne = ne + check_ok(exc, 159);
+  end
+
+  % 167: gd_carrays
+  try
+    d = gd_carrays(D);
+    ne = ne + check_num(167, length(d), 1);
+    ne = ne + check_array(167, d{1}, [1.1, 2.2, 3.3, 4.4, 5.5, 6.6]);
+  catch exc
+    ne = ne + check_ok(exc, 167);
+  end
+
+  % 168: gd_put_carray
+  try
+    gd_put_carray(D, 'carray', [9,8,7,6,5,4]);
+  catch exc
+    ne = ne + check_ok2(exc, 168, 1);
+  end
+
+  try
+    d = gd_get_carray(D, 'carray');
+    ne = ne + check_array(168, d, [9,8,7,6,5,4]);
+  catch exc
+    ne = ne + check_ok2(exc, 168, 2);
+  end
+
+  % 169: gd_put_carray
+  try
+    gd_put_carray_slice(D, 'carray', 2, [169,169]);
+  catch exc
+    ne = ne + check_ok2(exc, 169, 1);
+  end
+
+  try
+    d = gd_get_carray(D, 'carray');
+    ne = ne + check_array(169, d, [9,8,169,169,5,4]);
+  catch exc
+    ne = ne + check_ok2(exc, 169, 2);
+  end
+
+  % 177: gd_carray_len
+  try
+    d = gd_carray_len(D, 'carray');
+    ne = ne + check_num(177, d, 6);
+  catch exc
+    ne = ne + check_ok(exc, 177);
+  end
+
+  % 178: gd_entry (carray)
+  try
+    d = gd_entry(D, 'carray');
+    ne = ne + check_string2(178, 1, d.field, 'carray');
+    ne = ne + check_num2(178, 2, d.field_type, GD.CARRAY_ENTRY);
+    ne = ne + check_num2(178, 3, d.fragment_index, 0);
+    ne = ne + check_num2(178, 4, d.const_type, GD.FLOAT64);
+    ne = ne + check_num2(178, 4, d.array_len, 6);
+  catch exc
+    ne = ne + check_ok(exc, 178);
+  end
+
+  % 179: add_carray
+  try
+    gd_add_carray(D, 'new17', GD.FLOAT64, [1.1,2.2,3.3,4.4], 0);
+  catch exc
+    ne = ne + check_ok2(exc, 179, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new17');
+    ne = ne + check_string2(179, 1, d.field, 'new17');
+    ne = ne + check_num2(179, 2, d.field_type, GD.CARRAY_ENTRY);
+    ne = ne + check_num2(179, 3, d.fragment_index, 0);
+    ne = ne + check_num2(179, 4, d.const_type, GD.FLOAT64);
+    ne = ne + check_num2(179, 4, d.array_len, 4);
+  catch exc
+    ne = ne + check_ok2(exc, 179, 2);
+  end
+
+  try
+    d = gd_get_carray(D, 'new17');
+    ne = ne + check_array(179, d, [1.1,2.2,3.3,4.4]);
+  catch exc
+    ne = ne + check_ok2(exc, 179, 3);
+  end
+
+  % 180: add_carray
+  try
+    gd_madd_carray(D, 'data', 'mnew17', GD.FLOAT64, [1.8, 18.0]);
+  catch exc
+    ne = ne + check_ok2(exc, 180, 1);
+  end
+
+  try
+    d = gd_entry(D, 'data/mnew17');
+    ne = ne + check_string2(180, 1, d.field, 'data/mnew17');
+    ne = ne + check_num2(180, 2, d.field_type, GD.CARRAY_ENTRY);
+    ne = ne + check_num2(180, 3, d.fragment_index, 0);
+    ne = ne + check_num2(180, 4, d.const_type, GD.FLOAT64);
+    ne = ne + check_num2(180, 4, d.array_len, 2);
+  catch exc
+    ne = ne + check_ok2(exc, 180, 2);
+  end
+
+  try
+    d = gd_get_carray(D, 'data/mnew17');
+    ne = ne + check_array(180, d, [1.8, 18.0]);
+  catch exc
+    ne = ne + check_ok2(exc, 180, 3);
+  end
+
+  % 181: add_carray
+  try
+    gd_alter_carray(D, 'new17', GD.INT32, 5);
+  catch exc
+    ne = ne + check_ok2(exc, 181, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new17');
+    ne = ne + check_string2(181, 1, d.field, 'new17');
+    ne = ne + check_num2(181, 2, d.field_type, GD.CARRAY_ENTRY);
+    ne = ne + check_num2(181, 3, d.fragment_index, 0);
+    ne = ne + check_num2(181, 4, d.const_type, GD.INT32);
+    ne = ne + check_num2(181, 4, d.array_len, 5);
+  catch exc
+    ne = ne + check_ok2(exc, 181, 2);
+  end
+
+  try
+    d = gd_get_carray(D, 'new17');
+    ne = ne + check_array(181, d, [1,2,3,4,0]);
+  catch exc
+    ne = ne + check_ok2(exc, 181, 3);
+  end
+
+  % 183: gd_constants
+  try
+    d = gd_constants(D);
+    ne = ne + check_array(183, d, [61, 133]);
+  catch exc
+    ne = ne + check_ok(exc, 183);
+  end
+
+  % 191: gd_mconstants
+  try
+    d = gd_mconstants(D, 'data');
+    ne = ne + check_array(191, d, [3.3, 2.6]);
+  catch exc
+    ne = ne + check_ok(exc, 191);
+  end
+
+  % 199: gd_strings
+  try
+    d = gd_strings(D);
+    ne = ne + check_sarray(199, d, {'Lorem ipsum'; '---string---'; ...
+    'Arthur Dent'});
+  catch exc
+    ne = ne + check_ok(exc, 199);
+  end
+
+  % 200: gd_mstrings
+  try
+    d = gd_mstrings(D, 'data');
+    ne = ne + check_sarray(200, d, {'This is a string constant.'; ...
+    '---mstring---'});
+  catch exc
+    ne = ne + check_ok(exc, 200);
+  end
+
+  % 203: seek
+  try
+    d = gd_seek(D, 'data', 35, 0, GD.SEEK_SET);
+    ne = ne + check_num(203, d, 280);
+  catch exc
+    ne = ne + check_ok2(exc, 203, 1);
+  end
+
+  try
+    d = gd_getdata(D, 'data', GD.HERE, 0, 1, 0);
+    ne = ne + check_array(203, d, [16:1:23]);
+  catch exc
+    ne = ne + check_ok2(exc, 203, 2);
+  end
+
+  % 204: tell
+  try
+    d = gd_tell(D, 'data');
+    ne = ne + check_num(204, d, 288);
+  catch exc
+    ne = ne + check_ok(exc, 204);
+  end
+
+  % 205: hide
+  try
+    gd_hide(D, 'data');
+  catch exc
+    ne = ne + check_ok(exc, 205);
+  end
+
+  % 206: hidden
+  try
+    d = gd_hidden(D, 'data');
+    ne = ne + check_num(206, d, 1);
+  catch exc
+    ne = ne + check_ok(exc, 206);
+  end
+
+  % 207: unhide
+  try
+    gd_unhide(D, 'data');
+  catch exc
+    ne = ne + check_ok2(exc, 207, 1);
+  end
+
+  try
+    d = gd_hidden(D, 'data');
+    ne = ne + check_num(207, d, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 207, 2);
+  end
+
+  % 208: sync
+  try
+    gd_sync(D, 'data');
+  catch exc
+    ne = ne + check_ok(exc, 208);
+  end
+
+  % 209: sync
+  try
+    gd_flush(D, 'data');
+  catch exc
+    ne = ne + check_ok(exc, 209);
+  end
+
+  % 210: metaflush
+  try
+    gd_metaflush(D);
+  catch exc
+    ne = ne + check_ok(exc, 210);
+  end
+
+  % 211: gd_entry (window)
+  try
+    d = gd_entry(D, 'window');
+    ne = ne + check_string2(211, 1, d.field, 'window');
+    ne = ne + check_num2(211, 2, d.field_type, GD.WINDOW_ENTRY);
+    ne = ne + check_num2(211, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(211, 4, d.in_fields, { 'linterp'; 'mult' });
+    ne = ne + check_num2(211, 5, d.windop, GD.WINDOP_LT);
+    ne = ne + check_num2(211, 6, d.threshold, 4.1);
+  catch exc
+    ne = ne + check_ok(exc, 211);
+  end
+
+  % 212: gd_add_window
+  try
+    gd_add_window(D, 'new18', 'in1', 'in2', GD.WINDOP_NE, 32, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 212, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new18');
+    ne = ne + check_string2(212, 1, d.field, 'new18');
+    ne = ne + check_num2(212, 2, d.field_type, GD.WINDOW_ENTRY);
+    ne = ne + check_num2(212, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(212, 4, d.in_fields, { 'in1'; 'in2' });
+    ne = ne + check_num2(212, 5, d.windop, GD.WINDOP_NE);
+    ne = ne + check_num2(212, 6, d.threshold, 32);
+  catch exc
+    ne = ne + check_ok2(exc, 212, 2);
+  end
+
+  % 214: gd_add_window
+  try
+    gd_madd_window(D, 'data', 'mnew18', 'in1', 'in2', GD.WINDOP_EQ, 214);
+  catch exc
+    ne = ne + check_ok2(exc, 214, 1);
+  end
+
+  try
+    d = gd_entry(D, 'data/mnew18');
+    ne = ne + check_string2(214, 1, d.field, 'data/mnew18');
+    ne = ne + check_num2(214, 2, d.field_type, GD.WINDOW_ENTRY);
+    ne = ne + check_num2(214, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(214, 4, d.in_fields, { 'in1'; 'in2' });
+    ne = ne + check_num2(214, 5, d.windop, GD.WINDOP_EQ);
+    ne = ne + check_num2(214, 6, d.threshold, 214);
+  catch exc
+    ne = ne + check_ok2(exc, 214, 2);
+  end
+
+  % 217: gd_alter_window
+  try
+    gd_alter_window(D, 'new18', 'in3', 0, GD.WINDOP_GE, 32e2);
+  catch exc
+    ne = ne + check_ok2(exc, 217, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new18');
+    ne = ne + check_string2(217, 1, d.field, 'new18');
+    ne = ne + check_num2(217, 2, d.field_type, GD.WINDOW_ENTRY);
+    ne = ne + check_num2(217, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(217, 4, d.in_fields, { 'in3'; 'in2' });
+    ne = ne + check_num2(217, 5, d.windop, GD.WINDOP_GE);
+    ne = ne + check_num2(217, 6, d.threshold, 32e2);
+  catch exc
+    ne = ne + check_ok2(exc, 217, 2);
+  end
+
+  % 218: gd_alias_target
+  try
+    d = gd_alias_target(D, 'alias');
+    ne = ne + check_string(218, d, 'data');
+  catch exc
+    ne = ne + check_ok(exc, 218);
+  end
+
+  % 219: gd_add_alias
+  try
+    gd_add_alias(D, 'new20', 'data', 0);
+  catch exc
+    ne = ne + check_ok2(exc, 219, 1);
+  end
+
+  try
+    d = gd_alias_target(D, 'new20');
+    ne = ne + check_string(219, d, 'data');
+  catch exc
+    ne = ne + check_ok2(exc, 219, 2);
+  end
+
+  % 220: madd_alias
+  try
+    gd_madd_alias(D, 'data', 'mnew20', 'data');
+  catch exc
+    ne = ne + check_ok2(exc, 219, 1);
+  end
+
+  try
+    d = gd_alias_target(D, 'data/mnew20');
+    ne = ne + check_string(219, d, 'data');
+  catch exc
+    ne = ne + check_ok2(exc, 219, 2);
+  end
+
+  % 221: naliases
+  try
+    d = gd_naliases(D, 'data');
+    ne = ne + check_num(221, d, 4);
+  catch exc
+    ne = ne + check_ok(exc, 221);
+  end
+
+  % 222: aliases
+  try
+    d = gd_aliases(D, 'data');
+    ne = ne + check_sarray(222, d, {'data'; 'alias'; 'data/mnew20'; 'new20'});
+  catch exc
+    ne = ne + check_ok(exc, 222);
+  end
+
+  % 223: include_affix
+  try
+    gd_include(D, 'format1', 0, GD.CREAT + GD.EXCL, 'A', 'Z');
+  catch exc
+    ne = ne + check_ok2(exc, 41, 1);
+  end
+
+  % 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);
+    ne = ne + check_sarray(226, d, {'A'; 'Z'});
+  catch exc
+    ne = ne + check_ok(exc, 226);
+  end
+
+  % 227: alter_affixes
+  try
+    gd_alter_affixes(D, 1, 'B', '');
+  catch exc
+    ne = ne + check_ok2(exc, 227, 1);
+  end
+
+  try
+    d = gd_fragment_affixes(D, 1);
+    ne = ne + check_sarray(226, d, {'B'; ''});
+  catch exc
+    ne = ne + check_ok2(exc, 227, 2);
+  end
+
+  % 228: gd_entry (mplex)
+  try
+    d = gd_entry(D, 'mplex');
+    ne = ne + check_string2(228, 1, d.field, 'mplex');
+    ne = ne + check_num2(228, 2, d.field_type, GD.MPLEX_ENTRY);
+    ne = ne + check_num2(228, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(228, 4, d.in_fields, { 'data'; 'sbit' });
+    ne = ne + check_num2(228, 5, d.count_val, 1);
+    ne = ne + check_num2(228, 6, d.period, 10);
+  catch exc
+    ne = ne + check_ok(exc, 228);
+  end
+
+  % 229: gd_add_mplex
+  try
+    gd_add_mplex(D, 'new21', 'in1', 'in2', 5, 6, 0);
+  catch exc
+    ne = ne + check_ok2(exc, 229, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new21');
+    ne = ne + check_string2(229, 1, d.field, 'new21');
+    ne = ne + check_num2(229, 2, d.field_type, GD.MPLEX_ENTRY);
+    ne = ne + check_num2(229, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(229, 4, d.in_fields, { 'in1'; 'in2' });
+    ne = ne + check_num2(229, 5, d.count_val, 5);
+    ne = ne + check_num2(229, 6, d.period, 6);
+  catch exc
+    ne = ne + check_ok2(exc, 229, 2);
+  end
+
+  % 230: gd_add_mplex
+  try
+    gd_madd_mplex(D, 'data', 'mnew21', 'in3', 'in2', 0, 12);
+  catch exc
+    ne = ne + check_ok2(exc, 230, 1);
+  end
+
+  try
+    d = gd_entry(D, 'data/mnew21');
+    ne = ne + check_string2(230, 1, d.field, 'data/mnew21');
+    ne = ne + check_num2(230, 2, d.field_type, GD.MPLEX_ENTRY);
+    ne = ne + check_num2(230, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(230, 4, d.in_fields, { 'in3'; 'in2' });
+    ne = ne + check_num2(230, 5, d.count_val, 0);
+    ne = ne + check_num2(230, 6, d.period, 12);
+  catch exc
+    ne = ne + check_ok2(exc, 230, 2);
+  end
+
+  % 231: gd_alter_mplex
+  try
+    gd_alter_mplex(D, 'new21', 'in4', 0, 3, 7);
+  catch exc
+    ne = ne + check_ok2(exc, 231, 1);
+  end
+
+  try
+    d = gd_entry(D, 'new21');
+    ne = ne + check_string2(231, 1, d.field, 'new21');
+    ne = ne + check_num2(231, 2, d.field_type, GD.MPLEX_ENTRY);
+    ne = ne + check_num2(231, 3, d.fragment_index, 0);
+    ne = ne + check_sarray2(231, 4, d.in_fields, { 'in4'; 'in2' });
+    ne = ne + check_num2(231, 5, d.count_val, 3);
+    ne = ne + check_num2(231, 6, d.period, 7);
+  catch exc
+    ne = ne + check_ok2(exc, 231, 2);
+  end
+
+  % 232: gd_strtok
+  try
+    d = gd_strtok(D, '"test1 test2" test3\ test4');
+    ne = ne + check_sarray(232, d, {'test1 test2'; 'test3 test4'});
+  catch exc
+    ne = ne + check_ok(exc, 232);
+  end
+
+  % 233: raw_close
+  try
+    gd_raw_close(D, 'data');
+  catch exc
+    ne = ne + check_ok(exc, 233);
+  end
+
+  % 234: desync
+  try
+    d = gd_desync(D);
+    ne = ne + check_num(234, d, 0);
+  catch exc
+    ne = ne + check_ok(exc, 234);
+  end
+
+  % 235: gd_flags
+  try
+    d = gd_flags(D, GD.PRETTY_PRINT, 0);
+    ne = ne + check_num(235, d, GD.PRETTY_PRINT);
+  catch exc
+    ne = ne + check_ok(exc, 235);
+  end
+
+  % 236: gd_verbose_prefix
+  try
+    gd_verbose_prefix(D, 'big_test: ');
+  catch exc
+    ne = ne + check_ok(exc, 236);
+  end
+
+  % 237: gd_nentries
+  try
+    d = gd_nentries(D, 'data', GD.SCALAR_ENTRIES, ...
+    GD.ENTRIES_HIDDEN + GD.ENTRIES_NOALIAS);
+    ne = ne + check_num(237, d, 6);
+  catch exc
+    ne = ne + check_ok(exc, 237);
+  end
+
+  % 239: gd_nentries
+  try
+    d = gd_entry_list(D, 'data', GD.SCALAR_ENTRIES, ...
+    GD.ENTRIES_HIDDEN + GD.ENTRIES_NOALIAS);
+    ne = ne + check_sarray(239, d, {'mstr', 'mconst', 'mcarray', 'mnew11', ...
+    'mnew12', 'mnew17'});
+  catch exc
+    ne = ne + check_ok(exc, 239);
+  end
+
+  % 240: gd_mplex_lookback
+  try
+    gd_mplex_lookback(D, GD.LOOKBACK_ALL);
+  catch exc
+    ne = ne + check_ok(exc, 240);
+  end
+
+  % 241: gd_linterp_tablename
+  try
+    d = gd_linterp_tablename(D, 'linterp');
+    ne = ne + check_eostring(241, d, 'dirfile/lut');
+  catch exc
+    ne = ne + check_ok(exc, 241);
+  end
+
+  % 242: gd_carrays
+  try
+    d = gd_mcarrays(D, 'data');
+    ne = ne + check_num2(242, 1, length(d), 2);
+    ne = ne + check_array2(242, 2, d{1}, [1.9, 2.8, 3.7, 4.6, 5.5]);
+    ne = ne + check_array2(242, 3, d{2}, [1.8, 18.0]);
+  catch exc
+    ne = ne + check_ok(exc, 242);
+  end
+
+  % 243: 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);
+  end
+
+  try
+    d = gd_reference(d);
+    ne = ne + check_string(242, d, '');
+  catch exc
+    ne = ne + check_ok2(exc, 242, 1);
+  end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  gd_discard(D);
+  rmdir(filedir, 's');
+  if ne > 0
+    ne
+    fail;
+  end
+
+catch exc
+  disp(exc.getReport);
+  disp('Stack:');
+  disp(struct2cell(transpose(exc.stack)));
+  fail
+end
+end
+
+% hackery
+function fail
+  fid=fopen('test_failed', 'w');
+  fclose(fid);
+  exit force
+end
+
+% pretty-print an array
+function str = pp_array(a)
+  str = ['[ ', num2str(a), ' ]'];
+end
+
+function str = pp_sarray(a)
+  str = '[';
+  for i = 1:length(a)
+    if (isnumeric(a{i}))
+      str = strcat(str, sprintf(' %s', num2str(a{i})));
+    else
+      str = strcat(str, sprintf(' %s', a{i}));
+    end
+  end
+  str = strcat(str, ' ]');
+end
+
+% Check functions
+
+function ne = check_ok(exc, t)
+  if (isempty(strmatch('GetData:', exc.identifier)))
+    rethrow(exc);
+  end
+  fprintf(2, 'e[%i] = %s\n', t, exc.identifier);
+  disp(exc.getReport);
+  ne = 1;
+end
+
+function ne = check_ok2(exc, t, m)
+  if (isempty(strmatch('GetData:', exc.identifier)))
+    rethrow(exc);
+  end
+  fprintf(2, 'e[%i,%i] = %s\n', t, m, exc.identifier);
+  disp(exc.getReport);
+  ne = 1;
+end
+
+function ne = check_exc(exc, t, v)
+  if (isempty(strmatch('GetData:', exc.identifier)))
+    rethrow(exc);
+  end
+  ne = check_string(t,exc.identifier,strcat('GetData:Lib:', v));
+end
+
+function ne = check_exc2(exc, t, m, v)
+  if (isempty(strmatch('GetData:', exc.identifier)))
+    rethrow(exc);
+  end
+  ne = check_string2(t,m,exc.identifier,strcat('GetData:Lib:', v));
+end
+
+function ne = check_eostring(t,v,g)
+  l = length(v);
+  f = l - length(g) + 1;
+  if (strcmp(v(f:l), g) == 0)
+    fprintf(2, 's[%i] = [...]''%s'', expected [...]''%s''\n', t, v(f:l), g);
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
+function ne = check_string(t,v,g)
+  if (strcmp(v, g) == 0)
+    fprintf(2, 's[%i] = ''%s'', expected ''%s''\n', t, v, g);
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
+
+function ne = check_string2(t,m,v,g)
+  if (strcmp(v, g) == 0)
+    fprintf(2, 's[%i,%i] = ''%s'', expected ''%s''\n', t, m, v, g);
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
+
+function ne = check_sarray(t,v,g)
+  same = 1;
+  if (length(v) ~= length(g))
+    same = 0;
+  else
+    for i = 1:length(v)
+      if (isnumeric(v{i}) ~= isnumeric(g{i}))
+        same = 0;
+      elseif (isnumeric(v{i}))
+        if (v{i} ~= g{i})
+          same = 0;
+        end
+      elseif (strcmp(v{i},g{i}) == 0)
+        same = 0;
+      end
+    end
+  end
+  if (~same)
+    fprintf(2, 's[%i] = %s, expected %s\n', t, pp_sarray(v), pp_sarray(g));
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
+
+function ne = check_sarray2(t,m,v,g)
+  same = 1;
+  if (length(v) ~= length(g))
+    same = 0;
+  else
+    for i = 1:length(v)
+      if (isnumeric(v{i}) ~= isnumeric(g{i}))
+        same = 0;
+      elseif (isnumeric(v{i}))
+        if (v{i} ~= g{i})
+          same = 0;
+        end
+      elseif (strcmp(v{i},g{i}) == 0)
+        same = 0;
+      end
+    end
+  end
+  if (~same)
+    fprintf(2, 's[%i,%i] = %s, expected %s\n', t, m, pp_sarray(v), ...
+      pp_sarray(g));
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
+
+function ne = check_array(t,v,g)
+  if (~isequal(v,g))
+    fprintf(2, 'a[%i] = %s, expected %s\n', t, pp_array(v), pp_array(g));
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
+
+function ne = check_array2(t,m,v,g)
+  if (~isequal(v,g))
+    fprintf(2, 'a[%i,%i] = %s, expected %s\n', t, m, pp_array(v), pp_array(g));
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
+
+function ne = check_num(t,v,g)
+  if (v ~= g)
+    fprintf(2, 'n[%i] = %s, expected %s\n', t, num2str(v), num2str(g));
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
+
+function ne = check_num2(t,m,v,g)
+  if (v ~= g)
+    fprintf(2, 'n[%i,%i] = %s, expected %s\n', t, m, num2str(v), num2str(g));
+    ne = 1;
+  else
+    ne = 0;
+  end
+end
diff --git a/bindings/matlab/test/test.sh b/bindings/matlab/test/test.sh
new file mode 100755
index 0000000..1aa0192
--- /dev/null
+++ b/bindings/matlab/test/test.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+s=`basename $2 .m`
+rm -f ./test_failed
+$1 -nodesktop -nodisplay -nosplash -nojvm -r "$s; quit;"
+
+#lame
+if test -e ./test_failed; then
+  rm -f ./test_failed
+  exit 1
+fi
diff --git a/bindings/perl/Build.PL.in b/bindings/perl/Build.PL.in
new file mode 100644
index 0000000..8bc6450
--- /dev/null
+++ b/bindings/perl/Build.PL.in
@@ -0,0 +1,57 @@
+# Copyright (C) 2011-2013 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#
+# @configure_input@
+
+use Module::Build;
+
+# divert up_to_date to allow consideration of various other dependencies
+my $class = Module::Build->subclass(
+  class => "GetData::Build",
+  code => <<'SUBCLASS' );
+
+sub up_to_date {
+  my ($self, $source, $derived) = @_;
+
+  if ($source eq "lib/GetData.xs") {
+    return 0 if (not $self->up_to_date("lib/typemap", $derived));
+    return 0 if (not $self->up_to_date("lib/simple_funcs.xs", $derived));
+    return 0 if (not $self->up_to_date("@top_builddir@/src/getdata.h",
+      $derived));
+    return 0 if (not $self->up_to_date("@top_builddir@/src/internal.h",
+      $derived));
+  }
+  return $self->SUPER::up_to_date($source, $derived);
+}
+SUBCLASS
+
+my $build = $class->new(
+  dist_abstract => "Perl bindings to the GetData library",
+  dist_author => 'The GetData Project <@PACKAGE_BUGREPORT@>',
+  dist_version_from => "GetData.pm",
+  extra_compiler_flags => ['@DEFS@', '-I at top_builddir@/src'],
+  extra_linker_flags => ['-L at top_builddir@/src/.libs/', '-lgetdata'],
+  include_dirs => ['@top_srcdir@/src'],
+  license => 'lgpl',
+  module_name => "GetData",
+  pm_files => { 'GetData.pm' => 'lib/GetData.pm' },
+  release_status => "testing",
+  requires => {
+    perl => '5.6.0',
+    'Math::Complex' => '1.34'
+  },
+  test_files => '@srcdir@/t/*.t',
+  xs_files => { 'lib/GetData.xs' => 'lib/GetData.xs' }
+);
+$build->create_build_script;
diff --git a/bindings/perl/GetData.pm.in b/bindings/perl/GetData.pm.in
new file mode 100644
index 0000000..d206fb0
--- /dev/null
+++ b/bindings/perl/GetData.pm.in
@@ -0,0 +1,1239 @@
+# Copyright (C) 2011, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+package GetData;
+
+use 5.00800;
+use strict;
+use warnings;
+
+require Exporter;
+require XSLoader;
+require Math::Complex;
+
+our @ISA = qw(Exporter);
+our %EXPORT_TAGS = ('all' => [qw(VERSION @FUNCLIST@ @PARAMLIST@)],
+'constants' => [qw(VERSION @PARAMLIST@)], 'functions' => [qw(@FUNCLIST@)]);
+
+our @EXPORT_OK = (@{$EXPORT_TAGS{'all'}});
+our @EXPORT = qw();
+
+ at PARAMETERS@
+
+XSLoader::load('GetData', $VERSION);
+
+1;
+__END__
+
+=head1 NAME
+
+GetData - Perl bindings to the GetData library for Dirfile access
+
+=head1 SYNOPSIS
+
+  use GetData;
+
+  my $DIRFILE = GetData::open("./dirfile/", $GetData::RDONLY);
+
+  # the following calls are equivalent
+  my $data = GetData::getdata($DIRFILE, "field", 5, 0, 1,
+                              $GetData::UINT8);
+  my $data = $DIRFILE->getdata("field", 5, 0, 1, $GetData::UINT8);
+
+=head1 DESCRIPTION
+
+This module provides simple, lightweight bindings from Perl to the C GetData
+library.  It provides a simple mapping between public C functions and Perl
+methods.  All C functions and constants are replicated in the GetData package.
+These methods have the same name as their C counterparts, excluding the C
+namespace prefix `gd_' (or `GD_', for C preprocessor constants).
+
+The dirfile lvalue returned by GetData::open is a simplistic object.  Any
+GetData method which takes a dirfile as a parameter, may instead be called as
+method of the dirfile object itself.  (See the synopsis above for an example.)
+Dirfile metadata entries (which are C structs of type gd_entry_t) are
+represented as simple hashes.
+
+By default, GetData does not export any symbols.  All symbols in the GetData
+package may be exported with:
+
+  use GetData "all";
+
+but this is discouraged, as it will overwrite useful things like &CORE::open.
+
+Throughout the module, complex data are generally represented as
+C<Math::Complex> objects, but may be simplified to ordinary floating point
+numbers if the imaginary part is zero.
+
+=head1 CONSTANTS
+
+The module defines a large number of symbolic constants used by the API which
+mirror the constants defined in the C API.  The "constants" tag may be used to
+export just the constants from the module, if desired.  Some genericly useful
+sets of constants are discussed below.  Other constants are discussed in the
+method descriptions where they are used.
+
+=head2 Data Types
+
+GetData knows the following data types:
+
+=over
+
+=item $GetData::NULL
+
+the null data type, which returns no data.
+
+=item $GetData::UINT8
+
+unsigned 8-bit integer
+
+=item $GetData::INT8
+
+signed (two's complement) 8-bit integer
+
+=item $GetData::UINT16
+
+unsigned 16-bit integer
+
+=item $GetData::INT16
+
+signed (two's complement) 16-bit integer
+
+=item $GetData::UINT32
+
+unsigned 32-bit integer
+
+=item $GetData::INT32
+
+signed (two's complement) 32-bit integer
+
+=item $GetData::UINT64
+
+unsigned 64-bit integer
+
+=item $GetData::INT64
+
+signed (two's complement) 64-bit integer
+
+=item $GetData::FLOAT32
+
+IEEE-754 standard 32-bit single precision floating point number
+
+=item $GetData::FLOAT64
+
+IEEE-754 standard 64-bit double precision floating point number
+
+=item $GetData::COMPLEX64
+
+FORTRAN and C99 conformant 64-bit single precision floating point complex number
+
+=item $GetData::COMPLEX128
+
+FORTRAN and C99 conformant 128-bit double precision floating point complex
+number
+
+=back
+
+=head2 Encoding Types
+
+The following encoding types are known by GetData:
+
+=over
+
+$GetData::BZIP2_ENCODED,
+$GetData::GZIP_ENCODED,
+$GetData::LZMA_ENCODED,
+$GetData::SIE_ENCODED,
+$GetData::SLIM_ENCODED,
+$GetData::TEXT_ENCODED,
+$GetData::ZZIP_ENCODED,
+$GetData::ZZSLIM_ENCODED,
+$GetData::UNENCODED.
+
+=back
+
+Details of these encoding types are given in the dirfile-format(5) manual page.
+
+=head2 Entry Types
+
+The following symbols are used to indicate entry types:
+
+=over
+
+$GetData::NO_ENTRY,
+$GetData::BIT_ENTRY,
+$GetData::CARRAY_ENTRY,
+$GetData::CONST_ENTRY,
+$GetData::DIVIDE_ENTRY,
+$GetData::INDEX_ENTRY,
+$GetData::LINCOM_ENTRY,
+$GetData::LINTERP_ENTRY,
+$GetData::MPLEX_ENTRY,
+$GetData::MULTIPLY_ENTRY,
+$GetData::PHASE_ENTRY,
+$GetData::POLYNOM_ENTRY,
+$GetData::RAW_ENTRY,
+$GetData::RECIP_ENTRY,
+$GetData::SBIT_ENTRY,
+$GetData::STRING_ENTRY,
+$GetData::WINDOW_ENTRY
+
+=back
+
+Of these, C<$GetData::NO_ENTRY> is used to flag invalid entry types and
+C<$GetData::INDEX_ENTRY> is used only for the implicit B<INDEX> field.  See
+gd_entry(3) and dirfile-format(5) for details of the other entry types.
+
+=head2 WINDOW Operators
+
+The following symbols are used to indicate WINDOW operators:
+
+=over
+
+$GetData::WINDOP_EQ,
+$GetData::WINDOP_GE,
+$GetData::WINDOP_GT,
+$GetData::WINDOP_LE,
+$GetData::WINDOP_LT,
+$GetData::WINDOP_NE,
+$GetData::WINDOP_CLR,
+$GetData::WINDOP_SET.
+
+=back
+
+=head1 INPUT DATA
+
+Functions which take sets of data as input (L<add_carray>, L<madd_carray>,
+L<put_carray>, L<put_carray_slice>, and L<putdata>) accept data in a number of
+ways.  The arguments specifying the data always appear at the end of the
+argument list.  They are represented as C<{DATA...}> in the method descriptions
+below.  Input data arguments are parsed as follows.
+
+=over
+
+=item 1.
+
+If the first data argument is undef, then it is ignored and all subsequent
+arguments are taken as data:
+
+    $dirfile->putdata("field_code", $first_frame, $first_sample,
+                      undef, @data)
+
+or
+
+    $dirfile->putdata("field_code", $first_frame, $first_sample,
+                      undef, $data[0], $data[1], $data[2], ...)
+
+=item 2.
+
+Otherwise, if the first data argument is a reference to an array, the array is
+taken as data (and any further arguments are ignored):
+
+    $dirfile->putdata("field_code", $first_frame, $first_sample,
+                      \@data)
+
+=item 3.
+
+Otherwise, if only two arguments make up the data argument list, and the second
+is a reference to an array, the first is taken as a type code specifing the
+conversion type, and the second is taken as the data:
+
+    $dirfile->putdata("field_code", $first_frame, $first_sample,
+                      $GetData::UINT8, \@data)
+
+=item 4.
+
+Otherwise, if only two arguments make up the data argument list, and the second
+is not a reference to an array, the first is, again, taken as a type code, and
+the second is assumed to be a packed string containing the data in a format
+appropriate for the type code specified:
+
+    $packed_data = pack("C", @data)
+    $dirfile->putdata("field_code", $first_frame, $first_sample,
+                      $GetData::UINT8, $packed_data)
+
+=item 5.
+
+Otherwise, finally, the data argument list elements are simply taken as data
+themselves:
+
+    $dirfile->putdata("field_code", $first_frame, $first_sample,
+                      @data)
+
+or
+
+    $dirfile->putdata("field_code", $first_frame, $first_sample,
+                      $data[0], $data[1], $data[2], ...)
+
+
+=back
+
+GetData internally converts the Perl data into a format readable by the C API.
+In cases 3 and 4 above, the type the data is converted into is specified
+explicitly in the call.  In the other cases, GetData must guess an appropriate
+C type into which to convert the data.  It does so by looking at the first
+data value:
+
+=over
+
+=item *
+
+if the value is a C<Math::Complex> object, the data are converted to double
+precision complex data (C<COMPLEX128>)
+
+=item *
+
+if the value is an integer, the data are converted to a 64-bit signed integer
+(C<INT64>)
+
+=item *
+
+otherwise, the data are converted to a double precision float (C<FLOAT64>).
+
+=back
+
+Of the above methods, the first is only necessary when the data array has only
+two elements, and so would be mistaken for method four if specified without the
+initial undef.  Furthermore, the fourth method is typically the most efficient,
+since the packed data scalar can often be used as the input to the C API without
+need for type conversion.
+
+=head1 ENTRY HASHES
+
+The replacement for the C<gd_entry_t> object of the C API is a simple hash.  The
+key names are the same as the names of the C<gd_entry_t> members.  (See
+gd_entry(3) for details).
+
+In entry hashes returned by GetData, only those keys appropriate for the entry
+type specified will be present.  Entry hashes passed to GetData from the caller
+may have other keys than those required by the entry type.  They will be
+ignored.
+
+The value associated with the C<field_type> key will be one of the symbols
+listed under L</"Entry Types"> above.  For entry types which have (potentially)
+more than one input field (DIVIDE, LINCOM, MPLEX, MULTIPLY, WINDOW), the value
+associated with the C<"in_fields"> key will be a list of strings, regardless of
+how many elements it has; other entry types which provide C<"in_fields"> will be
+a scalar, even though the key name is still plural.
+
+Elements of the C<scalar> array which are undef indicate literal parameters
+(equivalent to C<NULL> in the C<gd_entry_t>'s C<scalar> member).  Similarly,
+undef is used in C<scalar_ind> where the C API uses -1, to indicate CONST
+fields, instead of CARRAYs.
+
+=head1 DIRFILE CREATION METHODS
+
+=over
+
+=item open ($DIRFILENAME, $FLAGS, $SEHANDLER=undef, $EXTRA=undef)
+
+Create or open a Dirfile database called C<$DIRFILENAME>.  C<$FLAGS> should be
+either C<$GetData::RDONLY> (for read-only access) or C<$GetData::RDWR> (for
+read-write access), optionally bitwise or'd with any of the following flags:
+
+=over
+
+$GetData::ARM_ENDIAN,
+$GetData::BIG_ENDIAN,
+$GetData::CREAT,
+$GetData::EXCL,
+$GetData::FORCE_ENCODING,
+$GetData::FORCE_ENDIAN,
+$GetData::IGNORE_DUPS,
+$GetData::IGNORE_REFS,
+$GetData::LITTLE_ENDIAN,
+$GetData::NOT_ARM_ENDIAN,
+$GetData::PEDANTIC,
+$GetData::PERMISSIVE,
+$GetData::PRETTY_PRINT,
+$GetData::TRUNC,
+$GetData::TRUNCSUB,
+$GetData::VERBOSE,
+
+=back
+
+and at most one of the encoding symbols listed above in the L</"Encoding Types">
+section or else C<$GetData::AUTO_ENCODED> indicating that GetData should attempt
+to automatically determine the encoding.  The meaning of the dirfile flags
+may be found in the gd_cbopen(3) manual page.
+
+$SEHANDLER is a Perl callback function which will be executed whenever a syntax
+error is encountered.  It may be undef, if no callback is desired.  When
+called, C<$SEHANDLER> will be passed two arguments.  The first is a reference to
+a hash containing the parser data.  The second is the C<$EXTRA> scalar passed to
+this method.  C<$SEHANDLER> is called in scalar context, and should return
+either:
+
+=over
+
+=item *
+
+an integer, one of the symbolic constants:
+
+=over
+
+$GetData::SYNTAX_ABORT,
+$GetData::SYNTAX_CONTINUE,
+$GetData::SYNTAX_IGNORE,
+$GetData::SYNTAX_RESCAN;
+
+=back
+
+(see gd_cbopen(3) for their meaning), or
+
+=item *
+
+a string containing the corrected line, in which case C<$GetData::SYNTAX_RESCAN>
+is assumed; or,
+
+=item *
+
+a reference to a list consisting of an integer, one of the
+C<$GetData::SYNTAX_...> constants listed above, and then, optionally, a string
+containing the corrected line.
+
+=back
+
+This function always returns a Dirfile object, even if the call failed;
+the caller should use the returned dirfile's L<error>() method to test for
+success.  On error, the returned object will be flagged as invalid.
+
+=item invalid_dirfile ()
+
+This function always returns a newly created, but invalid, Dirfile object.
+Unlike an invalid dirfile created (either accidentally or purposefully) using
+L<open>(), the dirfile returned by this function always has a zero error code.
+See gd_invalid_dirfile(3).
+
+=back
+
+=head1 DIRFILE OBJECT METHODS
+
+The following methods all operate on a dirfile object returned by one of the
+above methods and can either be called as:
+
+  $GetData::method($dirfile, ...)
+
+or else, as
+
+  $dirfile->method(...)
+
+without change in operation.
+
+=head2 List of Methods
+
+=over
+
+=item $dirfile->add_carray ($FIELD_NAME, $DATA_TYPE, $FRAGMENT_INDEX,
+{DATA...})
+
+Adds a new CARRAY field called C<$FIELD_NAME> to the metadata fragment indexed
+by C<$FRAGMENT_INDEX>.  The storage type of the CARRAY is given by
+C<$DATA_TYPE>, which should be one of the symbols listed above under
+L</"Data Types">.  The value of the CARRAY is then set to the data given in
+the C<{DATA...}> argument list, which also determines its length.  See the
+L</"Input Data"> section above for details on the allowed forms of C<{DATA...}>.
+See gd_add_carray(3).
+
+=item $dirfile->add_const ($FIELD_NAME, $DATA_TYPE, [$VALUE, $FRAGMENT_INDEX])
+
+Adds a new CONST field called C<$FIELD_NAME> to the metadata fragment indexed
+by C<$FRAGMENT_INDEX>, or to the primary format file if omitted.  The
+C<$DATA_TYPE> argument indicates the storage type, which should be one of the
+symbols listed above under L</"Data Types">.  If given, the value of the field
+is set to C<$VALUE>, otherwise the field will be initialised to zero.  See
+gd_add_const(3).
+
+=item $dirfile->aliases ($FIELD_CODE)
+
+In scalar context, returns the number of aliases of C<$FIELD_CODE>.  In list
+context, returns an array of alias names for C<$FIELD_CODE>.  See gd_naliases(3)
+and gd_aliases(3).
+
+=item $dirfile->carrays ($RETURN_TYPE)
+
+Returns the value of all carrays (excluding metafields) in the dirfile after
+converting them to the return type C<$RETURN_TYPE>, which should be one of the
+symbols listed under L</"Data Types"> above.  If called in scalar context,
+returns a reference to an array of packed string data.  If called in list
+context, returns an array of arrays of unpacked data.  See gd_carrays(3).
+
+=item $dirfile->close ()
+
+Closes the dirfile, writing changes to disk.  Upon successful completion, the
+dirfile object will be invalidated, prohibiting further operation on it.  A
+dirfile which is destroyed by garbage collection is discarded (see L</"discard">
+below).  This function should be called if metadata need to be written to disk
+before the object goes out of scope.  See gd_close(3).
+
+=item $dirfile->constants ($RETURN_TYPE)
+
+Returns the value of all constants (excluding metafields) in the dirfile after
+converting them to the return type C<$RETURN_TYPE>, which should be one of the
+symbols listed under L</"Data Types"> above.  If called in scalar context,
+returns a packed string containing the data.  If called in list context, the
+data will be unpacked and returned as an array.  See gd_constants(3).
+
+=item $dirfile->discard ()
+
+Closes the dirfile, ignoring changes to metadata, but writing changed data to
+disk.  Upon successful completion, the dirfile object will be invalidated,
+prohibiting further operation on it.  This function is called automatically by
+the dirfile destructor, and need not be called explicitly.  To save the metadata
+on close, use L</close>.  See gd_discard(3).
+
+=item $dirfile->entry ($FIELD_CODE)
+
+If called in scalar context, returns the entry type of C<$FIELD_CODE>, one
+of the symbols listed above under L</"Entry Types">.  In array context, returns
+a hash describing the indicated field.  See gd_entry_type(3) and gd_entry(3).
+
+=item $dirfile->entry_list ($PARENT, $TYPE, $FLAGS)
+
+In scalar context, returns the number of entries matching the supplied criteria.
+In list context, returns an array of the names of the entries.  If C<$PARENT>
+is undef, top-level entries are considered, otherwise meta entries under
+C<$PARENT> are considered.  If C<$TYPE> is one of the entry types listed above
+under L</"Entry Types">, only entries of that type are considered.  Alternatley,
+C<$TYPE> may be one of:
+
+=over
+
+$GetData::ALL_ENTRIES,
+$GetData::SCALAR_ENTRIES,
+$GetData::VECTOR_ENTRIES.
+
+=back
+
+Setting C<$TYPE> to undef is equivalent to setting it to
+C<$GetData::ALL_ENTRIES>.  If not undef, which is treated as zero, C<$FLAGS>
+should be zero or more of the following flags:
+
+=over
+
+$GetData::ENTRIES_HIDDEN,
+$GetData::ENTRIES_NOALIAS.
+
+=back
+
+See gd_nentries(3) and gd_entry_list(3) for the meaning of these symbols.
+
+=item $dirfile->error ()
+
+Returns the error code of the last operation on this dirfile.  See gd_error(3).
+
+=item $dirfile->error_string ()
+
+Returns a string describing the error encountered (if any) by the last operation
+on this dirfile.  See gd_error_string(3).
+
+=item $dirfile->field_list ()
+
+Equivalent to: C<$dirfile-E<gt>entry_list(undef, undef, undef)>.
+
+=item $dirfile->field_list_by_type ($TYPE)
+
+Equivalent to: C<$dirfile-E<gt>entry_list(undef, $TYPE, undef)>.
+
+=item $dirfile->fragment_affixes ($FRAGMENT_INDEX)
+
+Returns an array containing the prefix (first) and suffix (second) of the
+fragment indexed by C<$FRAGMENT_INDEX>.  See gd_fragment_affixes(3).
+
+=item $dirfile->fragments ()
+
+In scalar context, returns the number of metadata fragments in the dirfile.
+In list context, returns an array of pathnames to the fragments on disk, in the
+order that they're indexed.  See gd_nfragments(3) and gd_fragmentname(3).
+
+=item $dirfile->get_carray ($FIELD_CODE, $RETURN_TYPE)
+
+Returns the value of the CARRAY named C<$FIELD_CODE> after converting its
+elements to the return type C<$RETURN_TYPE>, which should be one of the symbols
+listed under L</"Data Types"> above.  If called in scalar context, returns a
+packed string containing the data.  If called in list context, the data will be
+unpacked and returned as an array.  See gd_get_carray(3).
+
+=item $dirfile->get_carray_slice ($FIELD_CODE, $START, $LEN, $RETURN_TYPE)
+
+Returns the value of a portion of the CARRAY named C<$FIELD_CODE> after
+converting its elements to the return type C<$RETURN_TYPE>, which should be one
+of the symbols listed under L</"Data Types"> above.  The first element returned
+is given by C<$START>, and the number of elements by C<$LEN>.  If called in
+scalar context, returns a packed string containing the data.  If called in list
+context, the data will be unpacked and returned as an array.  Less data than
+requested may be returned, if insufficient data exists.  See
+gd_get_carray_slice(3).
+
+=item $dirfile->get_constant ($FIELD_CODE, $RETURN_TYPE)
+
+Returns the value of the CONST named C<$FIELD_CODE> after converting it to the
+return type C<$RETURN_TYPE>, which should be one of the symbols listed under
+L</"Data Types"> above.  See gd_get_constant(3).
+
+=item $dirfile->getdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMP, $NUM_FRAMES,
+$NUM_SAMP, $RETURN_TYPE)
+
+Returns data from the field specified by C<$FIELD_CODE> after converting them
+to the return type C<$RETURN_TYPE>, which should be one of the symbols listed
+under L</"Data Types"> above.  The first sample returned is C<$FIRST_SAMP>
+samples after the start of C<$FIRST_FRAME> and the amount of data returned is
+C<$NUM_FRAMES> frames plus C<$NUM_SAMP> samples.  If called in scalar context
+returns a string of packed data.  If called in array context, the data will be
+unpacked and returned as an array.  Complex data are returned as
+C<Math::Complex> objects.  See gd_getdata(3).
+
+=item $dirfile->get_string ($FIELD_CODE)
+
+Returns the value of the STRING named C<$FIELD_CODE>.  See gd_get_string(3).
+
+=item $dirfile->include ($FILE, $PARENT_FRAGMENT, $FLAGS, [$PREFIX, $SUFFIX])
+
+Includes the fragment metadata file C<$FILE> under the fragment indexed by
+C<$PARENT_FRAGMENT>.  C<$FLAGS> should be a bitwise or'd collection of zero or
+more of the following flags:
+
+=over
+
+$GetData::BIG_ENDIAN,
+$GetData::CREAT,
+$GetData::EXCL,
+$GetData::FORCE_ENCODING,
+$GetData::FORCE_ENDIAN,
+$GetData::IGNORE_DUPS,
+$GetData::IGNORE_REFS,
+$GetData::LITTLE_ENDIAN,
+$GetData::PEDANTIC,
+$GetData::TRUNC,
+
+=back
+
+and at most one of the encoding symbols listed above in the L</"Encoding Types">
+section or else C<$GetData::AUTO_ENCODED> indicating that GetData should attempt
+to automatically determine the encoding.  If C<$PREFIX> or C<$SUFFIX> are
+omitted or undef, the added fragment will contain no such affix.  See
+gd_include_affix(3).
+
+=item $dirfile->madd_carray ($PARENT, $FIELD_NAME, $DATA_TYPE, {DATA...})
+
+Adds a new CARRAY metafield called C<$FIELD_NAME> under the parent field
+C<$PARENT>.  The storage type of the CARRAY is given by C<$DATA_TYPE>, which
+should be one of the symbols listed above under L</"Data Types">.  The value of
+the CARRAY is then set to the data given in the C<{DATA...}> argument list,
+which also determines its length.  See the L</"Input Data"> section above for
+details on the allowed forms of C<{DATA...}>.  See gd_madd_carray(3).
+
+=item $dirfile->madd_const ($PARENT, $FIELD_NAME, $DATA_TYPE, [$VALUE])
+
+Adds a new CONST metafield called C<$FIELD_NAME> under the field C<$PARENT>.
+The C<$DATA_TYPE> argument indicates the storage type, which should be one of
+the symbols listed above under L</"Data Types">.  If given, the value of the
+field is set to C<$VALUE>, otherwise the field will be initialised to zero.
+See gd_madd_const(3).
+
+=item $dirfile->mcarrays ($PARENT, $RETURN_TYPE)
+
+Behaves analogously to L<carrays>() (I<q.v.>), but returns CARRAYs which are
+metafields under the parent specified by C<$PARENT>.
+
+=item $dirfile->mconstants ($PARENT, $RETURN_TYPE)
+
+Behaves analogously to L<constants>() (I<q.v.>), but returns CONSTs which are
+metafields under the parent specified by C<$PARENT>.
+
+=item $dirfile->mfield_list ($PARENT)
+
+Equivalent to C<$dirfile-E<gt>entry_list($PARENT, undef, undef)>.
+
+=item $dirfile->mfield_list_by_type ($PARENT, $TYPE)
+
+Equivalent to C<$dirfile-E<gt>entry_list($PARENT, $TYPE, undef)>.
+
+=item $dirfile->mstrings ($PARENT)
+
+Behaves analogously to L<strings>() (I<q.v.>), but returns STRINGs which are
+metafields under the parent specified by C<$PARENT>.
+
+=item $dirfile->mvector_list ($PARENT)
+
+Equivalent to:
+  $dirfile-E<gt>entry_list($PARENT, $GetData::VECTOR_ENTRIES, undef).
+
+=item $dirfile->parser_callback ($SEHANDLER, $EXTRA=undef)
+
+Sets the registered parser callback function for the dirfile to C<$SEHANDLER>,
+or to nothing if undef, and updates the C<$EXTRA> parameter.  See
+gd_parser_callback(3).
+
+=item $dirfile->put_carray ($FIELD_CODE, {DATA...})
+
+Sets the value of the CARRAY named C<$FIELD_CODE> to the values contained in
+the C<{DATA...}> argument list.  See the L</"Input Data"> section above for
+details on the allowed forms of C<{DATA...}>.  See gd_put_carray(3).
+
+=item $dirfile->put_carray_slice ($FIELD_CODE, $START, {DATA...})
+
+Sets a value of the portion of the CARRAY named C<$FIELD_CODE> beginning with
+element numbered C<$START> to the values contained in the C<{DATA...}> argument
+list.  See the L</"Input Data"> section above for details on the allowed forms
+of C<{DATA...}>.  See gd_put_carray_slice(3).
+
+=item $dirfile->put_constant ($FIELD_CODE, $DATUM)
+
+Sets the value of the CONST field C<$FIELD_CODE> to the value C<$DATUM>.  See
+gd_put_constant(3).
+
+=item $dirfile->putdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMPLE, {DATA...})
+
+Sets a portion of the vector given by C<$FIELD_CODE> to the values contained in
+the C<{DATA...}> argument list.  The first sample written is C<$FIRST_SAMPLE>
+samples after the start of C<$FIRST_FRAME>.  See the L</"Input Data"> section
+above for details on the allowed forms of C<{DATA...}>.  See gd_putdata(3).
+
+=item $dirfile->strings ()
+
+In scalar context, returns the number of STRING fields.  In list context,
+returns an array of strings containing the values of all the STRING fields.
+See gd_strings(3).
+
+=item $dirfile->strtok ($STRING)
+
+Tokenises C<$STRING>, returning an array of tokens.  See gd_strtok(3).
+
+=item $dirfile->vector_list ()
+
+Equivalent to:
+  $dirfile-E<gt>entry_list(undef, $GetData::VECTOR_ENTRIES, undef).
+
+=back
+
+=head2 Other Methods
+
+For the most part, following methods behave identically to their C API
+counterpart.  See the corresponding C API manual page for details.  Different
+behaviour, if any, is indicated.
+
+=over
+
+=item $dirfile->add ($ENTRY)
+
+C<$ENTRY> should be a reference to an entry hash; see L</"ENTRY HASHES"> above.
+
+=item $dirfile->add_alias ($FIELD_CODE, $TARGET, [$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_bit ($FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS,
+[$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_divide ($FIELD_CODE, $IN_FIELD1, $IN_FIELD2,
+[$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_lincom ($FIELD_CODE, $N_FIELDS, $IN_FIELDS, $M, $B,
+[$FRAGMENT_INDEX])
+
+C<$IN_FIELDS>, C<$M>, and C<$B> should be references to arrays of the
+appropriate length.  The elements of C<$M> and C<$B> may be of any numerical
+type, including C<Math::Complex>.  C<$FRAGMENT_INDEX> = 0 is assumed if not
+specified.
+
+=item $dirfile->add_linterp ($FIELD_CODE, $IN_FIELD, $TABLE, [$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_mplex ($FIELD_CODE, $IN_FIELD, $COUNT_FIELD, $COUNT_VAL,
+$COUNT_MAX, [$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_multiply ($FIELD_CODE, $IN_FIELD1, $IN_FIELD2,
+[$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_phase ($FIELD_CODE, $IN_FIELD, $SHIFT, [$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_polynom ($FIELD_CODE, $POLY_ORD, $IN_FIELD, $A,
+[$FRAGMENT_INDEX])
+
+C<$A> should be a reference to an array of numbers (of any numerical type,
+including C<Math::Complex>) of the appropriate length.  C<$FRAGMENT_INDEX> = 0
+is assumed if not specified.
+
+=item $dirfile->add_raw ($FIELD_CODE, $DATA_TYPE, $SPF, [$FRAGMENT_INDEX])
+
+C<$DATA_TYPE> should be one of the symbols listed under L</"Data Types"> above.
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_recip ($FIELD_CODE, $IN_FIELD, $DIVIDEND, [$FRAGMENT_INDEX])
+
+C<$DIVIDEND> may be of any numerical type, including C<Math::Complex>.
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_sbit ($FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS,
+[$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_spec ($LINE, [$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_string ($FIELD_CODE, $VALUE, [$FRAGMENT_INDEX])
+
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->add_window ($FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP,
+$THRESHOLD, [$FRAGMENT_INDEX])
+
+C<$WINDOP> should be one of the symbols listed under L</WINDOW Operators> above.
+C<$FRAGMENT_INDEX> = 0 is assumed if not specified.
+
+=item $dirfile->alias_target ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->alter_affixes ($FRAGMENT_INDEX, $PREFIX, [$SUFFIX])
+
+If C<$PREFIX> or C<$SUFFIX> are undef, or if C<$SUFFIX> is omitted, that
+affix is not changed.
+
+=item $dirfile->alter_bit ($FIELD_CODE, [$IN_FIELD, $BITNUM, $NUMBITS])
+
+Arguments not given or set to undef are not changed.
+Additionally, if C<$BITNUM == -1>, or C<$NUMBITS == 0>, that parameter is not
+changed.
+
+=item $dirfile->alter_carray ($FIELD_CODE, $CONST_TYPE, $ARRAY_LEN)
+
+C<$CONST_TYPE> should be one of the symbols listed under L</"Data Types"> above.
+
+=item $dirfile->alter_const ($FIELD_CODE, [$CONST_TYPE])
+
+If C<$CONST_TYPE> is omitted, or equal to C<$GetData::NULL>, it is not changed;
+otherwise, it should be one of the symbols listed under L</"Data Types"> above.
+
+=item $dirfile->alter_divide ($FIELD_CODE, [$IN_FIELD1, $IN_FIELD2])
+
+Arguments not given or set to undef are not changed.
+
+=item $dirfile->alter_encoding ($ENCODING, [$FRAGMENT_INDEX, $RECODE])
+
+Both C<$FRAGMENT_INDEX> and C<$RECODE> default to 0 if not given.
+
+=item $dirfile->alter_endianness ($BYTE_SEX, [$FRAGMENT_INDEX, $RECODE])
+
+Both C<$FRAGMENT_INDEX> and C<$RECODE> default to 0 if not given.
+
+=item $dirfile->alter_entry ($FIELD_CODE, $ENTRY, [$RECODE])
+
+C<$ENTRY> should be a reference to an entry hash; see L</"ENTRY HASHES"> above.
+If not given, C<$RECODE> defaults to 0.
+
+=item $dirfile->alter_frameoffset ($OFFSET, [$FRAGMENT_INDEX, $RECODE])
+
+Both C<$FRAGMENT_INDEX> and C<$RECODE> default to 0 if not given.
+
+=item $dirfile->alter_lincom ($FIELD_CODE, [$N_FIELDS, $IN_FIELDS, $M, $B])
+
+Arguments not given or set to undef are not changed.
+If given, C<$IN_FIELDS>, C<$M>, and C<$B> should be references to arrays of the
+appropriate length.
+
+=item $dirfile->alter_linterp ($FIELD_CODE, [$IN_FIELD, $TABLE, $RENAME_TABLE])
+
+Arguments not given or set to undef are not changed.
+If not given, C<$RENAME_TABLE> defaults to 0.
+
+=item $dirfile->alter_mplex ($FIELD_CODE, [$IN_FIELD, $COUNT_FIELD, $COUNT_VAL,
+$COUNT_MAX])
+
+Arguments not given or set to undef are not changed.
+Additionally, if C<$COUNT_VAL> or C<$COUNT_MAX> are -1, that parameter is not
+chaged.
+
+=item $dirfile->alter_multiply ($FIELD_CODE, [$IN_FIELD1, $IN_FIELD2])
+
+Arguments not given or set to undef are not changed.
+
+=item $dirfile->alter_phase ($FIELD_CODE, $IN_FIELD, $SHIFT)
+
+If C<$IN_FIELD == undef>, it is not changed.
+
+=item $dirfile->alter_polynom ($FIELD_CODE, [$POLY_ORD, $IN_FIELD, $A])
+
+Arguments not given or set to undef are not changed.
+Additionally, if C<$POLY_ORD == 0>, it is not changed.
+
+=item $dirfile->alter_protection ($PROTECTION_LEVEL, $FRAGMENT_INDEX)
+
+Z<>
+
+=item $dirfile->alter_raw ($FIELD_CODE, [$DATA_TYPE, $SPF, $RECODE])
+
+Arguments not given or set to undef are not changed.
+Additionally, if C<$DATA_TYPE == $GetData::NULL> or C<$SPF == 0>, that parameter
+is not changed.
+If not given, C<$RECODE> defaults to 0.
+
+=item $dirfile->alter_recip ($FIELD_CODE, [$IN_FIELD, $DIVIDEND])
+
+Arguments not given or set to undef are not changed.
+Additionally, if C<$DIVIDEND == 0>, it is not changed.
+C<$DIVIDEND> may be of any numerical type, including C<Math::Complex>.
+
+=item $dirfile->alter_sbit ($FIELD_CODE, [$IN_FIELD, $BITNUM, $NUMBITS])
+
+Arguments not given or set to undef are not changed.
+Additionally, if C<$BITNUM == -1>, or C<$NUMBITS == 0>, that parameter is not
+changed.
+
+=item $dirfile->alter_spec ($LINE, [$RECODE])
+
+If not given, C<$RECODE> defaults to 0.
+
+=item $dirfile->alter_window ($FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP,
+$THRESHOLD)
+
+If C<$IN_FIELD> or C<$CHECK_FIELD> are undef, or if C<$WINDOP ==
+$GetData::WINDOP_UNK>, that paremeter is not changed. Otherwise,
+C<$WINDOP> should be one of the symbols listed under L</WINDOW Operators> above.
+
+=item $dirfile->bof ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->carray_len ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->delete ($FIELD_CODE, [$FLAGS])
+
+If not given, C<$FLAGS> defaults to 0.  Otherwise, it should be a bitwise or'd
+collection of zero or more of the following flags:
+
+=over
+
+$GetData::DEL_DATA,
+$GetData::DEL_DEREF,
+$GetData::DEL_FORCE,
+$GetData::DEL_META.
+
+=back
+
+=item $dirfile->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
+of the following flags bitwise or'd together:
+
+=over
+
+$GetData::DESYNC_PATHCHECK,
+$GetData::DESYNC_REOPEN.
+
+=back
+
+=item $dirfile->dirfilename ()
+
+Z<>
+
+=item $dirfile->dirfile_standards ([$VERSION])
+
+In addition to a simple integer verison number, C<$VERSION> may be one of the
+symbols
+
+=over
+
+$GetData::VERSION_CURRENT,
+$GetData::VERSION_EARLIEST,
+$GetData::VERSION_LATEST.
+
+=back
+
+If not given, C<$GetData::VERSION_CURRENT> is assumed.
+
+=item $dirfile->encoding ($FRAGMENT_INDEX)
+
+Z<>
+
+=item $dirfile->endianness ($FRAGMENT_INDEX)
+
+Z<>
+
+=item $dirfile->eof ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->error_count ()
+
+Z<>
+
+=item $dirfile->flags ([$SET, $RESET])
+
+If omitted, C<$SET> and C<$RESET> default to 0.  Otherwise, they should be
+zero or more of the following flags, bitwise or'd together:
+
+=over
+
+$GetData::PRETTY_PRINT,
+$GetData::VERBOSE.
+
+=back
+
+=item $dirfile->flush ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->fragment_index ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->fragmentname ($FRAGMENT_INDEX)
+
+Z<>
+
+=item $dirfile->frameoffset ($FRAGMENT_INDEX)
+
+Z<>
+
+=item $dirfile->framenum ($FIELD_CODE, $VALUE, [$START, $END])
+
+C<$START> and C<$END> default to 0 if not given.
+
+=item $dirfile->hidden ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->hide ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->madd ($ENTRY, $PARENT)
+
+C<$ENTRY> should be a reference to an entry hash; see L</"ENTRY HASHES"> above.
+
+=item $dirfile->madd_alias ($PARENT, $FIELD_CODE, $TARGET)
+
+Z<>
+
+=item $dirfile->madd_bit ($PARENT, $FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS)
+
+Z<>
+
+=item $dirfile->madd_divide ($PARENT, $FIELD_CODE, $IN_FIELD1, $IN_FIELD2)
+
+Z<>
+
+=item $dirfile->madd_lincom ($PARENT, $FIELD_CODE, $N_FIELDS, $IN_FIELDS, $M,
+$B)
+
+C<$IN_FIELDS>, C<$M>, and C<$B> should be references to arrays of the
+appropriate length.  The elements of C<$M> and C<$B> may be of any numerical
+type, including C<Math::Complex>.
+
+=item $dirfile->madd_linterp ($PARENT, $FIELD_CODE, $IN_FIELD, $TABLE)
+
+Z<>
+
+=item $dirfile->madd_mplex ($PARENT, $FIELD_CODE, $IN_FIELD, $COUNT_FIELD,
+$COUNT_VAL, $COUNT_MAX)
+
+Z<>
+
+=item $dirfile->madd_multiply ($PARENT, $FIELD_CODE, $IN_FIELD1, $IN_FIELD2)
+
+Z<>
+
+=item $dirfile->madd_phase ($PARENT, $FIELD_CODE, $IN_FIELD, $SHIFT)
+
+Z<>
+
+=item $dirfile->madd_polynom ($PARENT, $FIELD_CODE, $POLY_ORD, $IN_FIELD, $A)
+
+C<$A> should be a reference to an array of numbers (of any numerical type,
+including C<Math::Complex>) of the appropriate length.
+
+=item $dirfile->madd_recip ($PARENT, $FIELD_CODE, $IN_FIELD, $DIVIDEND)
+
+C<$DIVIDEND> may be of any numerical type, including C<Math::Complex>.
+
+=item $dirfile->madd_sbit ($PARENT, $FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS)
+
+Z<>
+
+=item $dirfile->madd_spec ($LINE, $PARENT)
+
+Z<>
+
+=item $dirfile->madd_string ($PARENT, $FIELD_CODE, $VALUE)
+
+Z<>
+
+=item $dirfile->madd_window ($PARENT, $FIELD_CODE, $IN_FIELD, $CHECK_FIELD,
+$WINDOP, $THRESHOLD)
+
+C<$WINDOP> should be one of the symbols listed under L</WINDOW Operators> above.
+
+=item $dirfile->malter_spec ($LINE, $PARENT, [$RECODE])
+
+If not given, C<$RECODE> defaults to 0.
+
+=item $dirfile->metaflush ()
+
+Z<>
+
+=item $dirfile->move ($FIELD_CODE, $NEW_FRAGMENT, [$MOVE_DATA])
+
+If not given, C<$MOVE_DATA> defaults to 0.
+
+=item $dirfile->move_alias ($FIELD_CODE, $NEW_FRAGMENT)
+
+Z<>
+
+=item $dirfile->mplex_lookback ($LOOKBACK)
+
+Z<>
+
+=item $dirfile->native_type ($FIELD_CODE)
+
+The returned value will be one of the symbols listed above under
+L</"Data Types">.
+
+=item $dirfile->nframes ()
+
+Z<>
+
+=item $dirfile->parent_fragment ($FRAGMENT_INDEX)
+
+Z<>
+
+=item $dirfile->protection ($FRAGMENT_INDEX)
+
+Z<>
+
+=item $dirfile->put_string ($FIELD_CODE, $STRING)
+
+Z<>
+
+=item $dirfile->raw_close ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->raw_filename ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->reference ([$FIELD_CODE])
+
+If C<$FIELD_CODE> is not given or undef, this function simply reports the
+current reference field.
+
+=item $dirfile->rename ($OLD_CODE, $NEW_NAME, [$FLAGS])
+
+If not given, C<$FLAGS> defaults to 0.  Otherwise, it should be a bitwise or'd
+collection of zero or more of the following flags:
+
+=over
+
+$GetData::REN_DATA,
+$GetData::REN_UPDB.
+
+=back
+
+=item $dirfile->rewrite_fragment ($FRAGMENT_INDEX)
+
+Z<>
+
+=item $dirfile->seek ($FIELD_CODE, $FRAME_NUM, $SAMPLE_NUM, [$FLAGS])
+
+If not given, C<$FLAGS> defaults to C<$GetData::SEEK_SET>.  Otherwise, it should
+be one of:
+
+=over
+
+$GetData::SEEK_CUR,
+$GetData::SEEK_END,
+$GetData::SEEK_SET.
+
+=back
+
+Furthermore, this value should be bitwise or'd with C<$GetData::SEEK_WRITE> if
+the next operation on the field is a write (via L</putdata>).
+
+=item $dirfile->spf ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->sync ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->tell ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->unhide ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->uninclude ($FRAGMENT_INDEX, [$DEL])
+
+If not given, C<$DEL> defaults to 0.
+
+=item $dirfile->validate ($FIELD_CODE)
+
+Z<>
+
+=item $dirfile->verbose_prefix ([$PREFIX])
+
+If C<$PREFIX> is omitted or undef, the prefix is removed.
+
+=back 
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012 D. V. Wiebe
+
+GetData is free software; you can redistribute it and/or modify it under the
+terms of the GNU Lesser General Public License as published by the Free Software
+Foundation: either version 2.1 of the License, or (at your option) any later
+version.
+
+GetData is distributed in the hope that it will be useful, but without any
+warranty; without even the implied warranty of merchantability or fitness for
+a particular purpose. See the GNU Lesser General Public License for more
+details.
+
+=head1 SEE ALSO
+
+Math::Complex(3), dirfile(5)
+
+=cut
diff --git a/bindings/perl/GetData.xs b/bindings/perl/GetData.xs
new file mode 100644
index 0000000..5c24fcc
--- /dev/null
+++ b/bindings/perl/GetData.xs
@@ -0,0 +1,2098 @@
+/* Copyright (C) 2011-2013 D. V. Wiebe
+ *
+ **************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#undef _BSD_SOURCE
+#undef _POSIX_SOURCE
+#undef _SVID_SOURCE
+#undef VERSION
+#include "internal.h"
+
+#ifdef GETDATA_DEBUG
+#include "debug.c"
+#endif
+
+/* Perl 5.8.9 and earlier don't provide hv_fetchs */
+#ifdef hv_fetchs
+# define gdp_hv_fetchs hv_fetchs
+#else
+# define gdp_hv_fetchs(hv,key,lval) hv_fetch(hv, key, sizeof(key) - 1, lval)
+#endif
+
+#define undef &PL_sv_undef
+
+/* 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;
+
+#define GDP_DIRFILE_ALIAS \
+  const char *gdp_package = ix ? "GetData::Dirifle" : "GetData";
+
+#define GDP_UNDEF_ON_ERROR(x) \
+      if (gd_error(dirfile)) { x; dreturnvoid(); XSRETURN_UNDEF; }
+
+#define GDP_PUSHpvn(s)      XPUSHs(sv_2mortal(newSVpvn(s, sizeof(s) - 1)))
+#define GDP_PUSHpvz(s)      XPUSHs(sv_2mortal(newSVpv(s, 0)))
+#define GDP_PUSHuv(s)       XPUSHs(sv_2mortal(newSVuv(s)))
+#define GDP_PUSHiv(s)       XPUSHs(sv_2mortal(newSViv(s)))
+#define GDP_PUSHnv(s)       XPUSHs(sv_2mortal(newSVnv(s)))
+#define GDP_PUSHrv(s)       XPUSHs(sv_2mortal(newRV_noinc((SV*)s)))
+#define GDP_PUSHcmp(r,i)    XPUSHs(sv_2mortal(gdp_newSVcmp(r,i)))
+#define GDP_PUSHrvavpv(s,n) XPUSHs(sv_2mortal(gdp_newRVavpv((const char**)s,n)))
+#define GDP_PUSHrvavcmp(s,n) XPUSHs(sv_2mortal(gdp_newRVavcmp(s,n)))
+#define GDP_PUSHrvavnv(s,n) XPUSHs(sv_2mortal(gdp_newRVavnv(s,n)))
+
+struct gdp_callback_stuff_t {
+  SV *func;
+  SV *data;
+};
+
+struct gdp_dirfile_t {
+  DIRFILE *D;
+  struct gdp_callback_stuff_t cbdata;
+};
+
+static DIRFILE *gdp_invalid = NULL;
+
+
+/* sv might be NULL, indicating undef */
+static gd_type_t gdp_get_type(SV **sv, const char *pkg, const char *func)
+{
+  dtrace("%p, \"%s\", \"%s\"", sv, pkg, func);
+
+  if (sv == NULL && *sv == undef)
+    croak("%s::%s() - Value may not be undef", pkg, func);
+
+  if (sv_isa(*sv, "Math::Complex")) {
+    dreturn("%03x", GD_COMPLEX128);
+    return GD_COMPLEX128;
+  } else if (SvTYPE(*sv) == SVt_IV) {
+    dreturn("%03x", GD_INT64);
+    return GD_INT64;
+  }
+
+  dreturn("%03x", GD_FLOAT64);
+  return GD_FLOAT64;
+}
+
+/* convert a Perl object into a complex number */
+static void gdp_convert_cmp(GD_DCOMPLEXP_t val, SV *src, int *ok,
+    const char* pkg, const char *func)
+{
+  dtrace("%p, %p, %p, \"%s\", \"%s\"", val, src, ok, pkg, func);
+
+  if (sv_isa(src, "Math::Complex")) {
+    HV *hv = (HV *)SvRV(src);
+    SV **c_dirty = gdp_hv_fetchs(hv, "c_dirty", 0);
+    if (c_dirty == NULL)
+      croak("%s::%s() - Malformed Math::Complex object", pkg, func);
+    if (SvIV(*c_dirty)) {
+      SV **sv = gdp_hv_fetchs(hv, "polar", 0);
+      if (sv == NULL || !SvROK(*sv) || SvTYPE(SvRV(*sv)) != SVt_PVAV)
+        croak("%s::%s() - Malformed Math::Complex object", pkg, func);
+
+      AV *data = (AV*)SvRV(*sv);
+      SV **m = av_fetch(data, 0, 0);
+      SV **a = av_fetch(data, 1, 0);
+      if (m == NULL || a == NULL)
+        croak("%s::%s() - Malformed Math::Complex object", pkg, func);
+      gd_po2cp_(val, SvNV(*m), SvNV(*a));
+    } else {
+      SV **sv = gdp_hv_fetchs(hv, "cartesian", 0);
+      if (sv == NULL || !SvROK(*sv) || SvTYPE(SvRV(*sv)) != SVt_PVAV)
+        croak("%s::%s() - Malformed Math::Complex object", pkg, func);
+
+      AV *data = (AV*)SvRV(*sv);
+      SV **r = av_fetch(data, 0, 0);
+      SV **i = av_fetch(data, 1, 0);
+      if (r == NULL || i == NULL)
+        croak("%s::%s() - Malformed Math::Complex object", pkg, func);
+      gd_li2cp_(val, SvNV(*r), SvNV(*i));
+    }
+  } else if (ok) {
+    /* if ok is non-NULL, the caller is prepared to handle non-complex data */
+    *ok = 0;
+  } else {
+    gd_rs2cp_(val, SvNV(src));
+  }
+
+  dreturn("(%g;%g)", crealp(val), cimagp(val));
+}
+
+#define GDP_EHASH_FETCH(key) \
+  v = gdp_hv_fetchs((HV*)sv, key, 0); \
+  if (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); \
+  } 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_UV(key,member,type) \
+  do { GDP_EHASH_FETCH(key); E->member = (type)SvUV(*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_PV(key,member) \
+ do { \
+    GDP_EHASH_FETCH(key); \
+    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)
+{
+  dtrace("%p, %p, \"%s\", %i, \"%s\", \"%s\"", c, hv, key, n, pkg, func);
+  int i;
+  SV **v = hv_fetch(hv, key, strlen(key), 0);
+
+  if (v == NULL)
+    croak("%s::%s() - Missing required key '%s' in entry hash", pkg, func, key);
+
+  if (SvTYPE(*v) != SVt_PVAV)
+    croak("%s::%s() - Key '%s' must be list in entry hash", pkg, func, key);
+
+  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);
+  }
+
+  dreturnvoid();
+}
+
+/* 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)
+{
+  dtrace("%p, %p, %i, \"%s\", \"%s\"", in_fields, sv, n, pkg, func);
+  int i;
+  SV **v;
+
+  GDP_EHASH_FETCH("in_fields");
+
+  if (SvTYPE(*v) != SVt_PVAV)
+    croak("%s::%s() - Key 'in_fields' must be list in entry hash", pkg, func);
+
+  for (i = 0; i < n; ++i) {
+    v = av_fetch((AV*)*v, i, 0);
+    if (v)
+      in_fields[i] = SvPV_nolen(*v);
+  }
+
+  dreturnvoid();
+}
+
+/* populate scalar elements of gd_entry_t */
+static void 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;
+
+  SV **scalar = gdp_hv_fetchs(hv, "scalar", 0);
+  SV **scalar_ind = gdp_hv_fetchs(hv, "scalar_ind", 0);
+  SV **v;
+
+  /* there's no point in recording scalar indicies if we don't have scalars */
+  if (scalar == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  if (SvTYPE(*scalar) != SVt_PVAV)
+    croak("%s::%s() - Key 'scalar' must be list in entry hash", pkg, func);
+  if (scalar_ind && SvTYPE(*scalar_ind) != SVt_PVAV)
+    croak("%s::%s() - Key 'scalar_ind' must be list in entry hash", pkg, func);
+
+  for (i = 0; i <= GD_MAX_POLYORD; ++i)
+    if (mask & (1 << i)) {
+      v = av_fetch((AV*)*scalar, i, 0);
+      if (v) {
+        E->scalar[i] = SvPV_nolen(*v);
+        if (scalar_ind) {
+          v = av_fetch((AV*)*scalar_ind, i, 0);
+          if (v)
+            E->scalar_ind[i] = SvIV(*v);
+        }
+      }
+    }
+
+  dreturnvoid();
+}
+
+/* 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)
+{
+  dtrace("%p, %p, \"%s\", \"%s\"", E, sv, pkg, func);
+  SV **v;
+  int n;
+
+  memset(E, 0, sizeof(gd_entry_t));
+
+  /* de-reference as needed */
+  while (SvROK(sv))
+    sv = SvRV(sv);
+
+  if (SvTYPE(sv) != SVt_PVHV)
+    croak("%s::%s() - Entry must be hash", pkg, func);
+
+  GDP_EHASH_FETCH_UV("field_type", field_type, gd_entype_t);
+  GDP_EHASH_FETCH_PV("field", field);
+  GDP_EHASH_FETCH_UV("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);
+      break;
+    case GD_CARRAY_ENTRY:
+      GDP_EHASH_FETCH_IV("array_len", EN(scalar,array_len), size_t);
+      /* fallthrough */
+    case GD_CONST_ENTRY:
+      GDP_EHASH_FETCH_UV("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);
+      break;
+    case GD_LINTERP_ENTRY:
+      GDP_EHASH_FETCH_PV("in_fields", in_fields[0]);
+      GDP_EHASH_FETCH_PV("table", EN(linterp,table));
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      gdp_fetch_in_fields(E->in_fields, sv, 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);
+      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);
+      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);
+      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);
+      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);
+      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);
+      break;
+    case GD_NO_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_STRING_ENTRY:
+      break;
+    default:
+      croak("%s::%s() - Invalid field type %x in entry hash", pkg, func,
+        E->field_type);
+  }
+
+  dreturnvoid();
+}
+
+/* convert a single perl datum into the desired type */
+static void gdp_convert_from_perl(void *dest, SV *src, gd_type_t type,
+  const char *pkg, const char *func)
+{
+  dtrace("%p, %p, %03x, \"%s\", \"%s\"", dest, src, type, pkg, func);
+  GD_DCOMPLEXA(c);
+  int cmp = 1;
+
+  /* undef results in randomness */
+  if (src == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  /* check for and convert complex data */
+  gdp_convert_cmp(gd_csp_(c), src, &cmp, pkg, func);
+
+  switch (type) {
+    case GD_UINT8:
+      *(uint8_t*)dest = cmp ? (uint8_t)creal(c) : (uint8_t)SvUV(src);
+      break;
+    case GD_INT8:
+      *(int8_t*)dest = cmp ? (int8_t)creal(c) : (int8_t)SvIV(src);
+      break;
+    case GD_UINT16:
+      *(uint16_t*)dest = cmp ? (uint16_t)creal(c) : (uint16_t)SvUV(src);
+      break;
+    case GD_INT16:
+      *(int16_t*)dest = cmp ? (int16_t)creal(c) : (int16_t)SvIV(src);
+      break;
+    case GD_UINT32:
+      *(uint32_t*)dest = cmp ? (uint32_t)creal(c) : (uint32_t)SvUV(src);
+      break;
+    case GD_INT32:
+      *(int32_t*)dest = cmp ? (int32_t)creal(c) : (int32_t)SvIV(src);
+      break;
+    case GD_UINT64:
+      *(uint64_t*)dest = cmp ? (uint64_t)creal(c) : (uint64_t)SvUV(src);
+      break;
+    case GD_INT64:
+      *(int64_t*)dest = cmp ? (int64_t)creal(c) : (int64_t)SvIV(src);
+      break;
+    case GD_FLOAT32:
+      *(float*)dest = cmp ? (float)creal(c) : (float)SvNV(src);
+      break;
+    case GD_FLOAT64:
+      *(double*)dest = cmp ? (double)creal(c) : (double)SvNV(src);
+      break;
+    case GD_COMPLEX64:
+      if (cmp)
+        gd_cs2ca_(dest,0,c,float);
+      else
+        gd_rs2ca_(dest,0,SvNV(src),float);
+      break;
+    case GD_COMPLEX128:
+      if (cmp)
+        gd_cs2ca_(dest,0,c,double);
+      else
+        gd_rs2ca_(dest,0,SvNV(src),double);
+      break;
+    case GD_NULL:
+    case GD_UNKNOWN:
+      ;
+  }
+
+  dreturnvoid();
+}
+
+struct gdp_din {
+  void *data_in;
+  gd_type_t type;
+  int arg_type;
+  size_t nsamp;
+};
+
+#define GDP_DATA_IN_LIST 0
+#define GDP_DATA_IN_PACK 1
+#define GDP_DATA_IN_REF  2
+static struct gdp_din gdp_convert_data(SV *d, I32 items, I32 ax, size_t idx,
+  const char *pkg, const char *func)
+{
+  struct gdp_din din = {NULL, GD_NULL, GDP_DATA_IN_PACK, 0};
+  size_t i;
+  AV *av = NULL;
+
+  dtrace("%p, %i, %i, %zi, \"%s\", \"%s\"", d, (int)items, (int)ax, idx, pkg,
+      func);
+
+  /* argument grokking goes thus (in order!):
+   * if d == undef, the remaining arguments are taken to be data
+   * if d == reference to an array, the array is taken to be data, and
+   *            remaining arguments ignored
+   * if there is exactly one argument after d, d is taken as a type code
+   *            and the following argument as either packed data or a
+   *            reference to a list.
+   * otherwise, d is taken to be the first datum in a list of data.
+   */
+
+  if (d == undef) {
+    idx++;
+    din.arg_type = GDP_DATA_IN_LIST;
+  } else if (sv_isa(d, "Math::Complex"))
+    din.arg_type = GDP_DATA_IN_LIST;
+  else if (SvROK(d)) {
+    av = (AV*)SvRV(d);
+    din.arg_type = GDP_DATA_IN_REF;
+  } else if (items != 6)
+    din.arg_type = GDP_DATA_IN_LIST;
+  else if (SvROK(ST(5))) {
+    av = (AV*)SvRV(ST(5));
+    din.arg_type = GDP_DATA_IN_REF;
+  }
+
+  if (din.arg_type == GDP_DATA_IN_LIST) {
+    din.nsamp = items - idx;
+    din.type = gdp_get_type(&ST(idx), pkg, func);
+  } else if (din.arg_type == GDP_DATA_IN_REF) {
+    if (SvTYPE((SV*)av) != SVt_PVAV)
+      croak("%s::%s() - Expected array reference, but found some other "
+          "type of object", pkg, func);
+    din.nsamp = (size_t)av_len(av) + 1;
+    din.type = gdp_get_type(av_fetch(av, 0, 0), pkg, func);
+  } else {
+    din.type = (gd_type_t)SvIV(d);
+    if (GD_SIZE(din.type) == 0)
+      croak("%s::%s() - Invalid type code", pkg, func);
+    STRLEN n;
+    din.data_in = SvPV(ST(5), n);
+    din.nsamp = (size_t)n / GD_SIZE(din.type);
+  }
+
+  if (din.arg_type != GDP_DATA_IN_PACK)
+    din.data_in = safemalloc(din.nsamp * GD_SIZE(din.type));
+
+  if (din.arg_type == GDP_DATA_IN_LIST) {
+    for (i = idx; i < items; ++i)
+      gdp_convert_from_perl((char*)din.data_in + GD_SIZE(din.type) * (i - idx),
+          ST(i), din.type, pkg, func);
+  } else if (din.arg_type == GDP_DATA_IN_REF) {
+    for (i = 0; i < din.nsamp; ++i) {
+      SV **sv = av_fetch(av, i, 0);
+      if (sv == NULL)
+        croak("%s::%s() - Undefined datum encountered", pkg, func);
+      gdp_convert_from_perl((char*)din.data_in + GD_SIZE(din.type) * i, *sv,
+          din.type, pkg, func);
+    }
+  }
+
+  dreturn("{ %p, %03x, %i, %zi }", din.data_in, din.type, din.arg_type,
+    din.nsamp);
+  return din;
+}
+
+/* convert perl datum (in some sort of format) into an appropriate
+ * C datum, with type */
+static gd_type_t gdp_to_voidp(void *dest, SV *src, gd_type_t hint,
+  const char *pkg, const char *func)
+{
+  dtrace("%p, %p, %03x, \"%s\", \"%s\"", dest, src, hint, pkg, func);
+  gd_type_t type = GD_UNKNOWN;
+
+  /* treat undef as zero */
+  if (src == undef) {
+    memset(dest, 0, 1);
+    type = GD_UINT8;
+  } else {
+    int cmp = 0;
+    GD_DCOMPLEXA(c);
+    gdp_convert_cmp(gd_csp_(c), src, &cmp, pkg, func);
+
+    if (cmp) {
+      gd_cs2ca_(dest, 0, c, double);
+      type = GD_COMPLEX128;
+    } else if (SvNOK(src)) {
+      *(double*)dest = SvNV(src);
+      type = GD_FLOAT64;
+    } else if (SvUOK(src)) {
+      *(uint64_t*)dest = (uint64_t)SvUV(src);
+      type = GD_UINT64;
+    } else if (SvIOK(src)) {
+      *(int64_t*)dest = (int64_t)SvIV(src);
+      type = GD_INT64;
+    } else if (hint & GD_COMPLEX || hint & GD_IEEE754) {
+      *(double*)dest = SvNV(src);
+      type = GD_FLOAT64;
+    } else if (hint & GD_SIGNED) {
+      *(int64_t*)dest = (int64_t)SvIV(src);
+      type = GD_INT64;
+    } else {
+      *(uint64_t*)dest = (uint64_t)SvUV(src);
+      type = GD_UINT64;
+    }
+  }
+
+  dreturn("%03x", type);
+  return type;
+}
+
+static SV *gdp_newSVcmp(double r, double i)
+{
+  SV **dummy;
+  SV *sv;
+  AV *av;
+  HV *hv, *stash;
+
+  dtrace("%g; %g", r, i);
+
+  /* build a list containing the data, and take it's reference */
+  av = newAV();
+  av_extend(av, 1);
+  av_store(av, 0, newSVnv(r));
+  av_store(av, 1, newSVnv(i));
+  sv = newRV_noinc((SV*)av);
+
+  /* create a Math::Complex object */
+  hv = newHV();
+  dummy = hv_store(hv, "p_dirty", 7, newSVuv(1), 0);
+  dummy = hv_store(hv, "c_dirty", 7, newSVuv(0), 0);
+  dummy = hv_store(hv, "cartesian", 9, sv, 0);
+  stash = gv_stashpv("Math::Complex", GV_ADD);
+  sv = sv_bless(newRV_noinc((SV*)hv), stash);
+
+  dreturn("%p", sv);
+  return sv;
+}
+
+/* convert a char ** into a reference to a list of strings */
+static SV *gdp_newRVavpv(const char **l, size_t n)
+{
+  dtrace("%p, %zi", l, n);
+  SV *rv;
+  int i;
+  AV *av = newAV();
+  av_extend(av, n - 1);
+
+  for (i = 0; i < n; ++i)
+    av_store(av, i, newSVpv(l[i], 0));
+
+  rv = newRV_noinc((SV*)av);
+  dreturn("%p", rv);
+  return rv;
+}
+
+/* convert a complex double * into a reference to a list of complex data */
+static SV *gdp_newRVavcmp(GD_DCOMPLEXV(l), size_t n)
+{
+  dtrace("%p, %zi", l, n);
+  SV *rv;
+  int i;
+  AV *av = newAV();
+  av_extend(av, n - 1);
+
+  for (i = 0; i < n; ++i)
+    av_store(av, i, gdp_newSVcmp(creal(l[i]), cimag(l[i])));
+
+  rv = newRV_noinc((SV*)av);
+  dreturn("%p", rv);
+  return rv;
+}
+
+/* store some scalar values in the entry hash on the stack from the gd_entry_t
+*/
+static SV **gdp_store_scalars(SV **sp, const gd_entry_t *E, unsigned int mask)
+{
+  dtrace("%p, %p, %06x", sp, E, mask);
+  int i;
+
+  if (!mask) {
+    dreturn("%p", sp);
+    return sp;
+  }
+
+  AV *scalar = newAV();
+  AV *scalar_ind = newAV();
+  av_extend(scalar, GD_MAX_POLYORD);
+  av_extend(scalar_ind, GD_MAX_POLYORD);
+  for (i = 0; i <= GD_MAX_POLYORD; ++i)
+    if (mask & (1 << i)) {
+      av_store(scalar, i, newSVpv(E->scalar[i], 0));
+      if (E->scalar[i] == NULL)
+        av_store(scalar_ind, i, undef);
+      else
+        av_store(scalar_ind, i, newSViv(E->scalar_ind[i]));
+    }
+  GDP_PUSHpvn("scalar");
+  GDP_PUSHrv(scalar);
+  GDP_PUSHpvn("scalar_ind");
+  GDP_PUSHrv(scalar_ind);
+
+  dreturn("%p", sp);
+  return sp;
+}
+
+/* parser callback wrapper */
+static int gdp_parser_callback(gd_parser_data_t *pdata, void *extra)
+{
+  SV *callback_func = ((struct gdp_callback_stuff_t *)extra)->func;
+  SV *callback_data = ((struct gdp_callback_stuff_t *)extra)->data;
+  SV *ret, **dummy;
+  int n, sem = GD_SYNTAX_ABORT;
+  int was_rv = 0;
+
+  /* local stack pointer */
+  dSP;
+
+  dtrace("%p, %p", pdata, extra);
+
+  /* create pseudo-block */
+  ENTER;
+  SAVETMPS;
+
+  /* create the parser data hash */
+  HV *phash = newHV();
+  dummy = hv_store(phash, "suberror", 8, newSVuv(pdata->suberror), 0);
+  dummy = hv_store(phash, "linenum", 7, newSVuv(pdata->linenum), 0);
+  dummy = hv_store(phash, "line", 4, newSVpv(pdata->line, 0), 0);
+  dummy = hv_store(phash, "filename", 8, newSVpv(pdata->filename, 0), 0);
+
+  /* create stack frame */
+  PUSHMARK(SP);
+
+  XPUSHs(sv_2mortal(newRV_noinc((SV *)phash)));
+  XPUSHs(callback_data);
+
+  /* finalise stack frame */
+  PUTBACK;
+
+  /* call the object */
+  n = call_sv(callback_func, G_SCALAR);
+
+  /* refresh local stack pointer */
+  SPAGAIN;
+
+  /* delete the hash */
+  hv_undef(phash);
+
+  /* Make sure we got a scalar back; otherwise complain and abort */
+  if (n != 1) {
+    croak("GetData: expected scalar response from parser callback.");
+    return GD_SYNTAX_ABORT; /* ca'n't get here */
+  }
+
+  /* pop our return value */
+  ret = POPs;
+
+  /* de-reference as needed */
+  while (SvROK(ret)) {
+    ret = SvRV(ret);
+    was_rv = 1;
+  }
+
+  /* ferret out response */
+  switch (SvTYPE(ret)) {
+    AV *av;
+    int len;
+
+    case SVt_IV:
+    sem = SvIV(ret);
+    break;
+    case SVt_PVAV:
+    av = (AV *)ret;
+    len = av_len(av);
+    if (len < 0) {
+      croak("GetData: parser callback returned empty array.");
+      return GD_SYNTAX_ABORT; /* ca'n't get here */
+    } else if (len > 1) {
+      croak("GetData: too many elements in array returned by parser "
+          "callback.");
+      return GD_SYNTAX_ABORT; /* ca'n't get here */
+    } else if (len == 0) {
+      SV **val = av_fetch(av, 0, 0);
+      if (val == NULL || SvROK(*val)) {
+        croak("GetData: bad data type in array returned by parser callback.");
+        return GD_SYNTAX_ABORT; /* ca'n't get here */
+      }
+
+      if (SvTYPE(*val) == SVt_IV) {
+        sem = SvIV(*val);
+      } else if (SvTYPE(*val) == SVt_PV) {
+        pdata->line = strdup(SvPV_nolen(*val));
+        sem = GD_SYNTAX_RESCAN;
+      } else {
+        croak("GetData: bad data type in array returned by parser callback.");
+        return GD_SYNTAX_ABORT; /* ca'n't get here */
+      }
+    } else { /* len == 1 */
+      SV **val0 = av_fetch(av, 0, 0);
+      SV **val1 = av_fetch(av, 1, 0);
+
+      if (val0 == NULL || SvROK(*val0) || val1 == NULL || SvROK(*val1)) {
+        croak("GetData: bad data type in array returned by parser callback.");
+        return GD_SYNTAX_ABORT; /* ca'n't get here */
+      }
+
+      if (SvTYPE(*val0) == SVt_IV && SvTYPE(*val1) == SVt_PV) {
+        sem = SvIV(*val0);
+        pdata->line = strdup(SvPV_nolen(*val1));
+      } else {
+        croak("GetData: bad data type in array returned by parser callback.");
+        return GD_SYNTAX_ABORT; /* ca'n't get here */
+      }
+    }
+    break;
+    case SVt_PV:
+    pdata->line = strdup(SvPV_nolen(ret));
+    sem = GD_SYNTAX_RESCAN;
+    break;
+    default:
+    croak("GetData: bad data type returned by parser callback.");
+    return GD_SYNTAX_ABORT; /* ca'n't get here */
+  }
+
+  /* resync global stack pointer */
+  PUTBACK;
+
+  /* destroy pseudo-block */
+  FREETMPS;
+  LEAVE;
+
+  dreturn("%i", sem);
+  return sem;
+}
+
+#define GDP_UNPACKU(t) \
+  if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSVuv(((t*)data)[i]))); \
+  else    for (i = 0; i < n; ++i) av_store(av, i,   newSVuv(((t*)data)[i]));
+
+#define GDP_UNPACKI(t) \
+  if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSViv(((t*)data)[i]))); \
+  else    for (i = 0; i < n; ++i) av_store(av, i,   newSViv(((t*)data)[i]));
+
+#define GDP_UNPACKN(t) \
+  if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSVnv(((t*)data)[i]))); \
+  else    for (i = 0; i < n; ++i) av_store(av, i,   newSVnv(((t*)data)[i]));
+
+#define GDP_UNPACKC(t) \
+  if (sp) for (i = 0; i < n; ++i) \
+      XPUSHs(sv_2mortal(gdp_newSVcmp(((t*)data)[2 * i], \
+              ((t*)data)[2 * i + 1]))); \
+  else for (i = 0; i < n; ++i) av_store(av, i, \
+      gdp_newSVcmp(((t*)data)[2 * i], ((t*)data)[2 * i + 1]));
+
+/* unpack data. If sp is NULL, return an AV, otherwise push it onto the perl
+ * stack; returns the updated stack pointer */
+static void * gdp_unpack(SV **sp, const void *data, size_t n, gd_type_t type)
+{
+  dtrace("%p, %p, %zi, %03x", sp, data, n, type);
+  size_t i;
+  AV *av = NULL;
+
+  if (!sp) {
+    av = newAV();
+    av_extend(av, n - 1);
+  }
+
+  if (n == 0) {
+    dreturn("%p", sp);
+    return sp ? (void *)sp : (void *)av;
+  }
+
+  switch (type) {
+    case GD_UINT8:
+      GDP_UNPACKU(uint8_t);
+      break;
+    case GD_INT8:
+      GDP_UNPACKI(int8_t);
+      break;
+    case GD_UINT16:
+      GDP_UNPACKU(uint16_t);
+      break;
+    case GD_INT16:
+      GDP_UNPACKI(int16_t);
+      break;
+    case GD_UINT32:
+      GDP_UNPACKU(uint32_t);
+      break;
+    case GD_INT32:
+      GDP_UNPACKI(int32_t);
+      break;
+    case GD_UINT64:
+      GDP_UNPACKU(uint64_t);
+      break;
+    case GD_INT64:
+      GDP_UNPACKI(int64_t);
+      break;
+    case GD_FLOAT32:
+      GDP_UNPACKN(float);
+      break;
+    case GD_FLOAT64:
+      GDP_UNPACKN(double);
+      break;
+    case GD_COMPLEX64:
+      GDP_UNPACKC(float);
+      break;
+    case GD_COMPLEX128:
+      GDP_UNPACKC(double);
+      break;
+    case GD_UNKNOWN:
+    case GD_NULL:
+      break;
+  }
+
+  dreturn("%p", sp ? (void *)sp : (void *)av);
+  return sp ? (void *)sp : (void *)av;
+}
+
+/* Module starts here --------------------------------------------------- */
+MODULE = GetData  PACKAGE = GetData
+PROTOTYPES: ENABLE
+
+BOOT:
+  gdp_invalid = gd_invalid_dirfile();
+
+void
+DESTROY(dirfile)
+  DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::DESTROY = 1
+  CODE:
+    dtrace("%p", dirfile);
+    if (dirfile != gdp_invalid)
+      gd_discard(dirfile);
+    safefree(gdp_dirfile);
+  CLEANUP:
+    dreturnvoid();
+
+int
+error(dirfile)
+  DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::error = 1
+  CODE:
+    dtrace("%p", dirfile);
+
+    RETVAL = gd_error(dirfile);
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("%i", RETVAL);
+
+
+DIRFILE *
+open(dirfilename, flags, sehandler=undef, extra=undef)
+  const char * dirfilename
+  unsigned long flags
+  SV * sehandler
+  SV * extra
+  PREINIT:
+    struct gdp_dirfile_t *gdp_dirfile =
+    (struct gdp_dirfile_t *)safemalloc(sizeof(struct gdp_dirfile_t));
+  CODE:
+    dtrace("\"%s\", %lu, %p, %p", dirfilename, flags, sehandler, extra);
+    if (sehandler == undef) {
+      gdp_dirfile->cbdata.func = NULL;
+      gdp_dirfile->cbdata.data = NULL;
+
+      RETVAL = gd_cbopen(dirfilename, flags, NULL, NULL);
+    } else {
+      gdp_dirfile->cbdata.func = sehandler;
+      gdp_dirfile->cbdata.data = extra;
+
+      RETVAL = gd_cbopen(dirfilename, flags, gdp_parser_callback,
+          &gdp_dirfile->cbdata);
+    }
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("%p", gdp_dirfile);
+
+DIRFILE *
+invalid_dirfile()
+  PREINIT:
+    struct gdp_dirfile_t *gdp_dirfile =
+    (struct gdp_dirfile_t *)safemalloc(sizeof(struct gdp_dirfile_t));
+  CODE:
+    dtracevoid();
+    gdp_dirfile->cbdata.func = NULL;
+    gdp_dirfile->cbdata.data = NULL;
+
+    RETVAL = gd_invalid_dirfile();
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("%p", gdp_dirfile);
+
+void
+get_carray(dirfile, field_code, return_type)
+  DIRFILE * dirfile
+  const char * field_code
+  gd_type_t return_type
+  PREINIT:
+    void *data_out = NULL;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::get_carray = 1
+  PPCODE:
+    dtrace("%p, \"%s\", %03x; %i", dirfile, field_code, return_type,
+        (int)GIMME_V);
+    size_t len = gd_carray_len(dirfile, field_code);
+    data_out = safemalloc(GD_SIZE(return_type) * len);
+    gd_get_carray(dirfile, field_code, return_type, data_out);
+
+    GDP_UNDEF_ON_ERROR(safefree(data_out));
+
+    if (GIMME_V == G_ARRAY)
+      sp = (SV **)gdp_unpack(sp, data_out, len, return_type);
+    else
+      XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type))));
+
+    safefree(data_out);
+    dreturnvoid();
+
+void
+get_carray_slice(dirfile, field_code, start, len, return_type)
+  DIRFILE * dirfile
+  const char * field_code
+  gd_type_t return_type
+  unsigned int start
+  size_t len
+  PREINIT:
+    void *data_out = NULL;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::get_carray_slice = 1
+  PPCODE:
+    dtrace("%p, \"%s\", %u, %zi, %03x; %i", dirfile, field_code, start, len,
+      return_type, (int)GIMME_V);
+    data_out = safemalloc(GD_SIZE(return_type) * len);
+    gd_get_carray_slice(dirfile, field_code, start, len, return_type, data_out);
+
+    GDP_UNDEF_ON_ERROR(safefree(data_out));
+
+    if (GIMME_V == G_ARRAY)
+      sp = (SV **)gdp_unpack(sp, data_out, len, return_type);
+    else
+      XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type))));
+
+    safefree(data_out);
+    dreturnvoid();
+
+SV *
+get_constant(dirfile, field_code, return_type)
+  DIRFILE * dirfile
+  const char * field_code
+  gd_type_t return_type
+  PREINIT:
+    void *data_out = NULL;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::get_constant = 1
+  CODE:
+    gd_type_t type;
+    dtrace("%p, \"%s\", %03x", dirfile, field_code, return_type);
+    data_out = safemalloc(16);
+
+    if (return_type & GD_COMPLEX)
+      type = GD_COMPLEX128;
+    else if (return_type & GD_IEEE754)
+      type = GD_FLOAT64;
+    else if (return_type & GD_SIGNED)
+      type = GD_INT64;
+    else
+      type = GD_UINT64;
+
+    gd_get_constant(dirfile, field_code, type, data_out);
+
+    GDP_UNDEF_ON_ERROR(safefree(data_out));
+
+    if (type == GD_COMPLEX128)
+      RETVAL = gdp_newSVcmp(((double*)data_out)[0], ((double*)data_out)[1]);
+    else if (type == GD_FLOAT64)
+      RETVAL = newSVnv(*(double*)data_out);
+    else if (type == GD_INT64)
+      RETVAL = newSViv(*(int64_t*)data_out);
+    else
+      RETVAL = newSVuv(*(uint64_t*)data_out);
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    safefree(data_out);
+    dreturn("%p", RETVAL);
+
+void
+constants(dirfile, return_type)
+  DIRFILE * dirfile
+  gd_type_t return_type
+  PREINIT:
+    const void *data_out = NULL;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::constants = 1
+  PPCODE:
+    dtrace("%p, %03x; %i", dirfile, return_type, (int)GIMME_V);
+    int len = gd_nfields_by_type(dirfile, GD_CONST_ENTRY);
+    data_out = gd_constants(dirfile, return_type);
+
+    GDP_UNDEF_ON_ERROR();
+
+    if (GIMME_V == G_ARRAY)
+      sp = (SV **)gdp_unpack(sp, data_out, len, return_type);
+    else
+      XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type))));
+
+    dreturnvoid();
+
+void
+carrays(dirfile, return_type)
+  DIRFILE * dirfile
+  gd_type_t return_type
+  PREINIT:
+    const gd_carray_t *data_out = NULL;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::carrays = 1
+  PPCODE:
+    dtrace("%p, %03x; %i", dirfile, return_type, (int)GIMME_V);
+    I32 i, len = (I32)gd_nfields_by_type(dirfile, GD_CARRAY_ENTRY);
+    data_out = gd_carrays(dirfile, return_type);
+
+    GDP_UNDEF_ON_ERROR();
+
+    /* in array context, return an array of arrays of unpacked data.
+     * Otherwise, return a reference to an array of packed data. */
+    if (GIMME_V == G_ARRAY)
+      for (i = 0; i < len; ++i)
+        XPUSHs(sv_2mortal(newRV_noinc((SV *)gdp_unpack(NULL, data_out[i].d,
+                  data_out[i].n, return_type))));
+    else {
+      AV *av = newAV();
+      for (i = 0; i < len; ++i)
+        av_store(av, i, newSVpvn(data_out[i].d,
+              data_out[i].n * GD_SIZE(return_type)));
+      XPUSHs(sv_2mortal(newRV_noinc((SV*)av)));
+    }
+
+    dreturnvoid();
+
+void
+entry(dirfile, field_code)
+  DIRFILE * dirfile
+  const char * field_code
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::entry = 1
+  PPCODE:
+    dtrace("%p, \"%s\"; %i", dirfile, field_code, (int)GIMME_V);
+
+    if (GIMME_V == G_ARRAY) {
+      gd_entry_t E;
+      gd_entry(dirfile, field_code, &E);
+
+      GDP_UNDEF_ON_ERROR();
+
+      /* push the hash onto the stack */
+      GDP_PUSHpvn("field");
+      GDP_PUSHpvz(E.field);
+      GDP_PUSHpvn("field_type");
+      GDP_PUSHuv(E.field_type);
+      GDP_PUSHpvn("fragment_index");
+      GDP_PUSHuv(E.fragment_index);
+      switch (E.field_type) {
+        case GD_BIT_ENTRY:
+        case GD_SBIT_ENTRY:
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHpvz(E.in_fields[0]);
+          GDP_PUSHpvn("bitnum");
+          GDP_PUSHuv(E.EN(bit,bitnum));
+          GDP_PUSHpvn("numbits");
+          GDP_PUSHuv(E.EN(bit,numbits));
+          sp = gdp_store_scalars(sp, &E, 0x3);
+          break;
+        case GD_CARRAY_ENTRY:
+          GDP_PUSHpvn("array_len");
+          GDP_PUSHuv(E.EN(scalar,array_len));
+          /* fallthrough */
+        case GD_CONST_ENTRY:
+          GDP_PUSHpvn("const_type");
+          GDP_PUSHuv(E.EN(scalar,const_type));
+          break;
+        case GD_LINCOM_ENTRY:
+          GDP_PUSHpvn("n_fields");
+          GDP_PUSHiv(E.EN(lincom,n_fields));
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHrvavpv(E.in_fields, E.EN(lincom,n_fields));
+          GDP_PUSHpvn("m");
+          GDP_PUSHrvavcmp(E.EN(lincom,cm), E.EN(lincom,n_fields));
+          GDP_PUSHpvn("b");
+          GDP_PUSHrvavcmp(E.EN(lincom,cb), E.EN(lincom,n_fields));
+          sp = gdp_store_scalars(sp, &E, ((1 << E.EN(lincom,n_fields)) - 1) * 9);
+          break;
+        case GD_LINTERP_ENTRY:
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHpvz(E.in_fields[0]);
+          GDP_PUSHpvn("table");
+          GDP_PUSHpvz(E.EN(linterp,table));
+          break;
+        case GD_MULTIPLY_ENTRY:
+        case GD_DIVIDE_ENTRY:
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHrvavpv(E.in_fields, 2);
+          break;
+        case GD_PHASE_ENTRY:
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHpvz(E.in_fields[0]);
+          GDP_PUSHpvn("shift");
+          GDP_PUSHiv(E.EN(phase,shift));
+          sp = gdp_store_scalars(sp, &E, 1);
+          break;
+        case GD_POLYNOM_ENTRY:
+          GDP_PUSHpvn("poly_ord");
+          GDP_PUSHiv(E.EN(polynom,poly_ord));
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHpvz(E.in_fields[0]);
+          GDP_PUSHpvn("a");
+          GDP_PUSHrvavcmp(E.EN(polynom,ca), E.EN(polynom,poly_ord) + 1);
+          sp = gdp_store_scalars(sp, &E,
+              (1 << (E.EN(polynom,poly_ord) + 1)) - 1);
+          break;
+        case GD_RECIP_ENTRY:
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHpvz(E.in_fields[0]);
+          GDP_PUSHpvn("dividend");
+          GDP_PUSHcmp(creal(E.EN(recip,cdividend)),
+              cimag(E.EN(recip,cdividend)));
+          sp = gdp_store_scalars(sp, &E, 1);
+          break;
+        case GD_RAW_ENTRY:
+          GDP_PUSHpvn("spf");
+          GDP_PUSHuv(E.EN(raw,spf));
+          GDP_PUSHpvn("data_type");
+          GDP_PUSHuv(E.EN(raw,data_type));
+          sp = gdp_store_scalars(sp, &E, 1);
+          break;
+        case GD_WINDOW_ENTRY:
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHrvavpv(E.in_fields, 2);
+          GDP_PUSHpvn("windop");
+          GDP_PUSHiv(E.EN(window,windop));
+          GDP_PUSHpvn("threshold");
+          switch(E.EN(window,windop)) {
+            case GD_WINDOP_EQ:
+            case GD_WINDOP_NE:
+              GDP_PUSHiv(E.EN(window,threshold).i);
+              break;
+            case GD_WINDOP_SET:
+            case GD_WINDOP_CLR:
+              GDP_PUSHuv(E.EN(window,threshold).u);
+              break;
+            default:
+              GDP_PUSHnv(E.EN(window,threshold).r);
+              break;
+          }
+          sp = gdp_store_scalars(sp, &E, 1);
+          break;
+        case GD_MPLEX_ENTRY:
+          GDP_PUSHpvn("in_fields");
+          GDP_PUSHrvavpv(E.in_fields, 2);
+          GDP_PUSHpvn("count_val");
+          GDP_PUSHuv(E.EN(mplex,count_val));
+          GDP_PUSHpvn("period");
+          GDP_PUSHuv(E.EN(mplex,period));
+          sp = gdp_store_scalars(sp, &E, 0x3);
+          break;
+        case GD_INDEX_ENTRY:
+        case GD_STRING_ENTRY:
+        case GD_NO_ENTRY:
+          break;
+      }
+
+      gd_free_entry_strings(&E);
+    } else {
+      gd_entype_t t = gd_entry_type(dirfile, field_code);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHiv(t);
+    }
+    dreturnvoid();
+
+SV *
+error_string(dirfile)
+  DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::error_string = 1
+  CODE:
+    dtrace("%p", dirfile);
+    char *s = gd_error_string(dirfile, NULL, 0);
+
+    RETVAL = newSVpv(s, 0);
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    free(s);
+    dreturn("%p", RETVAL);
+
+AV *
+mcarrays(dirfile, parent, return_type)
+  DIRFILE * dirfile
+  const char * parent;
+  gd_type_t return_type
+  PREINIT:
+    const gd_carray_t *data_out = NULL;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::mcarrays = 1
+  PPCODE:
+    dtrace("%p, %03x; %i", dirfile, return_type, (int)GIMME_V);
+    I32 i, len = (I32)gd_nmfields_by_type(dirfile, parent, GD_CARRAY_ENTRY);
+    data_out = gd_mcarrays(dirfile, parent, return_type);
+
+    GDP_UNDEF_ON_ERROR();
+
+    /* in array context, return an array of arrays of unpacked data.
+     * Otherwise, return a reference to an array of packed data. */
+    if (GIMME_V == G_ARRAY)
+      for (i = 0; i < len; ++i)
+        XPUSHs(sv_2mortal(newRV_noinc((SV *)gdp_unpack(NULL, data_out[i].d,
+                  data_out[i].n, return_type))));
+    else {
+      AV *av = newAV();
+      for (i = 0; i < len; ++i)
+        av_store(av, i, newSVpvn(data_out[i].d,
+              data_out[i].n * GD_SIZE(return_type)));
+      XPUSHs(sv_2mortal(newRV_noinc((SV*)av)));
+    }
+
+    dreturnvoid();
+
+void
+mconstants(dirfile, parent, return_type)
+  DIRFILE * dirfile
+  const char * parent
+  gd_type_t return_type
+  PREINIT:
+    const void *data_out = NULL;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::mconstants = 1
+  PPCODE:
+    dtrace("%p, %03x; %i", dirfile, return_type, (int)GIMME_V);
+    int len = gd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY);
+    data_out = gd_mconstants(dirfile, parent, return_type);
+
+    GDP_UNDEF_ON_ERROR();
+
+    if (GIMME_V == G_ARRAY)
+      sp = (SV **)gdp_unpack(sp, data_out, len, return_type);
+    else
+      XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type))));
+
+    dreturnvoid();
+
+void
+parser_callback(dirfile, sehandler, extra=undef)
+  DIRFILE * dirfile
+  SV *sehandler
+  SV *extra
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::parser_callback = 1
+  CODE:
+    dtrace("%p, %p, %p", dirfile, sehandler, extra);
+    if (sehandler == undef) {
+      gdp_dirfile->cbdata.func = NULL;
+      gdp_dirfile->cbdata.data = NULL;
+
+      gd_parser_callback(dirfile, NULL, NULL);
+    } else {
+      gdp_dirfile->cbdata.func = sehandler;
+      gdp_dirfile->cbdata.data = extra;
+
+      gd_parser_callback(dirfile, gdp_parser_callback, &gdp_dirfile->cbdata);
+    }
+  CLEANUP:
+    dreturnvoid();
+
+char *
+get_string(dirfile, field_code)
+  DIRFILE * dirfile
+  const char * field_code
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::get_string = 1
+  CODE:
+    dtrace("%p, \"%s\"", dirfile, field_code);
+
+    /* get string length */
+    size_t len = gd_get_string(dirfile, field_code, 0, NULL);
+    RETVAL = safemalloc(len);
+
+    /* get string */
+    gd_get_string(dirfile, field_code, len, RETVAL);
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("\"%s\"", RETVAL);
+    safefree(RETVAL);
+
+int
+close(dirfile)
+  DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::close = 1
+  CODE:
+    dtrace("%p", dirfile);
+
+    if (dirfile != gdp_invalid) {
+      RETVAL = gd_close(dirfile);
+
+      if (!RETVAL)
+        gdp_dirfile->D = NULL;
+    } else
+      RETVAL = 0;
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("%i", RETVAL);
+
+int
+discard(dirfile)
+  DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::discard = 1
+  CODE:
+    dtrace("%p", dirfile);
+
+    if (dirfile != gdp_invalid) {
+      RETVAL = gd_discard(dirfile);
+
+      if (!RETVAL)
+        gdp_dirfile->D = NULL;
+    } else
+      RETVAL = 0;
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("%i", RETVAL);
+
+void
+getdata(dirfile, field_code, first_frame, first_samp, num_frames, num_samp, return_type)
+  DIRFILE * dirfile
+  const char * field_code
+  off64_t first_frame
+  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;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::getdata = 1
+  PPCODE:
+    dtrace("%p, \"%s\", %lli, %lli, %zi, %zi, %03x; %i", dirfile, field_code,
+        (long long)first_frame, (long long)first_samp, num_frames, num_samp,
+        return_type, (int)GIMME_V);
+
+    if (num_frames) {
+      spf = gd_spf(dirfile, field_code);
+
+      GDP_UNDEF_ON_ERROR();
+    }
+
+    data_out = safemalloc(GD_SIZE(return_type) * (spf * num_frames + num_samp));
+
+    size_t len = gdp64(gd_getdata)(dirfile, field_code, first_frame, first_samp,
+        num_frames, num_samp, return_type, data_out);
+
+    GDP_UNDEF_ON_ERROR(safefree(data_out));
+
+    /* In array context, unpack the array and push it onto the stack, otherwise
+     * just return the packed data */
+    if (GIMME_V == G_ARRAY)
+      sp = (SV **)gdp_unpack(sp, data_out, len, return_type);
+    else
+      XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type))));
+
+    safefree(data_out);
+    dreturnvoid();
+
+void
+field_list(dirfile)
+    DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::field_list = 1
+  PPCODE:
+    dtrace("%p; %i", dirfile, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_field_list(dirfile);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_nfields(dirfile);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+void
+field_list_by_type(dirfile, type)
+    DIRFILE * dirfile
+    gd_entype_t type
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::field_list_by_type = 1
+  PPCODE:
+    dtrace("%p, %i; %i", dirfile, type, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_field_list_by_type(dirfile, type);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_nfields_by_type(dirfile, type);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+void
+entry_list(dirfile, parent, type, flags)
+    DIRFILE * dirfile
+    gdpu_char * parent
+    gdpu_int    type
+    gdpu_uint_t flags
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::entry_list = 1
+  PPCODE:
+    dtrace("%p, \"%s\", %i, %u; %i", dirfile, parent, type, flags,
+      (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **el = gd_entry_list(dirfile, parent, type, flags);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; el[i]; ++i)
+        GDP_PUSHpvz(el[i]);
+    } else {
+      unsigned int ne = gd_nentries(dirfile, parent, type, flags);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(ne);
+    }
+
+    dreturnvoid();
+
+void
+vector_list(dirfile)
+    DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::vector_list = 1
+  PPCODE:
+    dtrace("%p; %i", dirfile, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_vector_list(dirfile);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_nvectors(dirfile);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+void
+strings(dirfile)
+    DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::strings = 1
+  PPCODE:
+    dtrace("%p; %i", dirfile, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_strings(dirfile);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_nfields_by_type(dirfile, GD_STRING_ENTRY);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+void
+mfield_list(dirfile, field_code)
+  DIRFILE * dirfile
+  const char * field_code
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::mfield_list = 1
+  PPCODE:
+    dtrace("%p, \"%s\"; %i", dirfile, field_code, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_mfield_list(dirfile, field_code);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_nmfields(dirfile, field_code);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+void
+mfield_list_by_type(dirfile, parent, type)
+    DIRFILE * dirfile
+    const char * parent
+    gd_entype_t type
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::mfield_list_by_type = 1
+  PPCODE:
+    dtrace("%p, \"%s\", %i; %i", dirfile, parent, type, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_mfield_list_by_type(dirfile, parent, type);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_nmfields_by_type(dirfile, parent, type);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+void
+mvector_list(dirfile, parent)
+    DIRFILE * dirfile
+    const char * parent
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::mvector_list = 1
+  PPCODE:
+    dtrace("%p; %i", dirfile, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_mvector_list(dirfile, parent);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_nmvectors(dirfile, parent);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+void
+mstrings(dirfile, field_code)
+  DIRFILE * dirfile
+  const char * field_code
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::mstrings = 1
+  PPCODE:
+    dtrace("%p, \"%s\"; %i", dirfile, field_code, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return nfields */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_mstrings(dirfile, field_code);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_nmfields_by_type(dirfile, field_code,
+          GD_STRING_ENTRY);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+int
+put_carray(dirfile, field_code, d, ...)
+    DIRFILE * dirfile
+    const char * field_code
+    SV *d;
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+    struct gdp_din din;
+  ALIAS:
+    GetData::Dirfile::put_carray = 1
+  CODE:
+    dtrace("%p, \"%s\", %p, ...[%li]", dirfile, field_code, d, (long)items - 3);
+
+    din = gdp_convert_data(d, items, ax, 2, gdp_package, "put_carray");
+
+    RETVAL = gd_put_carray(dirfile, field_code, din.type, din.data_in);
+
+    GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in));
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in);
+    dreturn("%i", RETVAL);
+
+int
+put_carray_slice(dirfile, field_code, start, d, ...)
+    DIRFILE * dirfile
+    const char * field_code
+    off64_t start
+    SV *d;
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+    struct gdp_din din;
+  ALIAS:
+    GetData::Dirfile::put_carray_slice = 1
+  CODE:
+    dtrace("%p, \"%s\", %lli, %p, ...[%li]", dirfile, field_code,
+        (long long)start, d, (long)items - 4);
+
+    din = gdp_convert_data(d, items, ax, 3, gdp_package, "put_carray");
+
+    RETVAL = gd_put_carray_slice(dirfile, field_code, start, din.nsamp,
+        din.type, din.data_in);
+
+    GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in));
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in);
+    dreturn("%i", RETVAL);
+
+int
+add_carray(dirfile, field_code, const_type, fragment_index, d, ...)
+    DIRFILE * dirfile
+    const char * field_code
+    int fragment_index
+    gd_type_t const_type
+    SV *d
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+    struct gdp_din din;
+  ALIAS:
+    GetData::Dirfile::add_carray = 1
+  CODE:
+    dtrace("%p, \"%s\", %03x, %i, %p, ...[%li]", dirfile, field_code,
+        const_type, fragment_index, d, (long)items - 5);
+
+    din = gdp_convert_data(d, items, ax, 4, gdp_package, "put_carray");
+
+    RETVAL = gd_add_carray(dirfile, field_code, const_type, din.nsamp,
+        din.type, din.data_in, fragment_index);
+
+    GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in));
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in);
+    dreturn("%i", RETVAL);
+
+int
+madd_carray(dirfile, parent, field_code, const_type, d, ...)
+    DIRFILE * dirfile
+    const char * parent
+    const char * field_code
+    gd_type_t const_type
+    SV *d
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+    struct gdp_din din;
+  ALIAS:
+    GetData::Dirfile::madd_carray = 1
+  CODE:
+    dtrace("%p, \"%s\", \"%s\", %03x, %p, ...[%li]", dirfile, parent,
+        field_code, const_type, d, (long)items - 5);
+
+    din = gdp_convert_data(d, items, ax, 4, gdp_package, "put_carray");
+
+    RETVAL = gd_madd_carray(dirfile, parent, field_code, const_type, din.nsamp,
+        din.type, din.data_in);
+
+    GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in));
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in);
+    dreturn("%i", RETVAL);
+
+size_t
+putdata(dirfile, field_code, first_frame, first_sample, d, ...)
+    DIRFILE * dirfile
+    const char * field_code
+    off64_t first_frame
+    off64_t first_sample
+    SV *d;
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+    struct gdp_din din;
+  ALIAS:
+    GetData::Dirfile::putdata = 1
+  CODE:
+    dtrace("%p, \"%s\", %lli, %lli, %p, ...[%li]", dirfile, field_code,
+        (long long)first_frame, (long long)first_sample, d, (long)items - 5);
+
+    din = gdp_convert_data(d, items, ax, 4, gdp_package, "putdata");
+
+    RETVAL = gd_putdata(dirfile, field_code, first_frame, first_sample, 0,
+        din.nsamp, din.type, din.data_in);
+
+    GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in));
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    if (din.arg_type != GDP_DATA_IN_PACK)
+      safefree(din.data_in);
+    dreturn("%zi", RETVAL);
+
+int
+add_const(dirfile, field_code, const_type, value=undef, fragment_index=0)
+  DIRFILE * dirfile
+  const char * field_code
+  gd_type_t const_type
+  SV * value
+  int fragment_index
+  PREINIT:
+    gd_type_t data_type;
+    char data_in[16];
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::add_const = 1
+  CODE:
+    dtrace("%p, \"%s\", %03x, %p, %i", dirfile, field_code, const_type, value,
+        fragment_index);
+
+    data_type = gdp_to_voidp(data_in, value, const_type, gdp_package,
+      "add_const");
+
+    RETVAL = gd_add_const(dirfile, field_code, const_type, data_type, data_in,
+        fragment_index);
+
+    GDP_UNDEF_ON_ERROR();
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("%i", RETVAL);
+
+int
+madd_const(dirfile, parent, field_code, const_type, value=undef)
+  DIRFILE * dirfile
+  const char * parent
+  const char * field_code
+  gd_type_t const_type
+  SV * value
+  PREINIT:
+    gd_type_t data_type;
+    char data_in[16];
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::madd_const = 1
+  CODE:
+    dtrace("%p, \"%s\", \"%s\", %03x, %p", dirfile, parent, field_code,
+        const_type, value);
+
+    data_type = gdp_to_voidp(data_in, value, const_type, gdp_package,
+      "madd_const");
+
+    RETVAL = gd_madd_const(dirfile, parent, field_code, const_type, data_type,
+        data_in);
+
+    GDP_UNDEF_ON_ERROR();
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("%i", RETVAL);
+
+int
+put_constant(dirfile, field_code, value)
+  DIRFILE * dirfile
+  const char * field_code
+  SV * value
+  PREINIT:
+    gd_type_t data_type;
+    char data_in[16];
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::put_constant = 1
+  CODE:
+    dtrace("%p, \"%s\", %p", dirfile, field_code, value);
+
+    data_type = gdp_to_voidp(data_in, value, GD_FLOAT64, gdp_package,
+      "put_constant");
+
+    RETVAL = gd_put_constant(dirfile, field_code, data_type, data_in);
+
+    GDP_UNDEF_ON_ERROR();
+  OUTPUT:
+    RETVAL
+  CLEANUP:
+    dreturn("%i", RETVAL);
+
+void
+fragments(dirfile)
+  DIRFILE * dirfile
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+    unsigned int nf;
+  ALIAS:
+    GetData::Dirfile::fragments = 1
+  PPCODE:
+    dtrace("%p; %i", dirfile, (int)GIMME_V);
+
+    nf = gd_nfragments(dirfile);
+
+    if (GIMME_V == G_ARRAY) {
+      unsigned int i;
+      for (i = 0; i < nf; ++i)
+        GDP_PUSHpvz(gd_fragmentname(dirfile, i));
+    } else
+      GDP_PUSHuv(nf);
+
+    dreturnvoid();
+
+void
+aliases(dirfile, field_code)
+  DIRFILE * dirfile
+  const char * field_code
+  PREINIT:
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::aliases = 1
+  PPCODE:
+    dtrace("%p, \"%s\"; %i", dirfile, field_code, (int)GIMME_V);
+
+    /* in array context, return the field list, otherwise return naliases */
+    if (GIMME_V == G_ARRAY) {
+      int i;
+      const char **fl = gd_aliases(dirfile, field_code);
+
+      GDP_UNDEF_ON_ERROR();
+
+      for (i = 0; fl[i]; ++i)
+        GDP_PUSHpvz(fl[i]);
+    } else {
+      unsigned int nf = gd_naliases(dirfile, field_code);
+
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHuv(nf);
+    }
+
+    dreturnvoid();
+
+void
+fragment_affixes(dirfile, fragment_index)
+  DIRFILE * dirfile
+  int fragment_index
+  PREINIT:
+    char *prefix;
+    char *suffix;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::fragment_affixes = 1
+  PPCODE:
+    dtrace("%p, %i", dirfile, fragment_index);
+
+    gd_fragment_affixes(dirfile, fragment_index, &prefix, &suffix);
+
+    GDP_UNDEF_ON_ERROR();
+
+    GDP_PUSHpvz(prefix);
+    GDP_PUSHpvz(suffix);
+
+    dreturnvoid();
+
+void
+strtok(dirfile, string)
+  DIRFILE * dirfile
+  const char * string
+  PREINIT:
+    int i;
+    char *token;
+    GDP_DIRFILE_ALIAS;
+  ALIAS:
+    GetData::Dirfile::strtok = 1
+  PPCODE:
+    dtrace("%p, \"%s\"", dirfile, string);
+
+    /* return an array of all the parsed tokens */
+    for (token = gd_strtok(dirfile, string); token;
+      token = gd_strtok(dirfile, NULL))
+    {
+      GDP_UNDEF_ON_ERROR();
+
+      GDP_PUSHpvz(token);
+      free(token);
+    }
+
+    dreturnvoid();
+
+int
+include(dirfile, file, fragment_index, flags, prefix=NULL, suffix=NULL)
+	DIRFILE * dirfile
+	const char * file
+	int fragment_index
+	unsigned long int flags
+	gdpu_char * prefix
+	gdpu_char * suffix
+	PREINIT:
+		GDP_DIRFILE_ALIAS;
+	ALIAS:
+		GetData::Dirfile::include = 1
+	CODE:
+		dtrace("%p, \"%s\", %i, %lu, \"%s\", \"%s\"", dirfile, file, fragment_index,
+        flags, prefix, suffix);
+		RETVAL = gd_include_affix(dirfile, file, fragment_index, prefix, suffix,
+        flags);
+		GDP_UNDEF_ON_ERROR();
+	OUTPUT:
+		RETVAL
+	CLEANUP:
+		dreturn("%i", RETVAL);
+
+INCLUDE: simple_funcs.xs
diff --git a/bindings/perl/MANIFEST.in b/bindings/perl/MANIFEST.in
new file mode 100644
index 0000000..c6136cc
--- /dev/null
+++ b/bindings/perl/MANIFEST.in
@@ -0,0 +1,2 @@
+MANIFEST			This list of files
+GetData.pm
diff --git a/bindings/perl/Makefile.am b/bindings/perl/Makefile.am
new file mode 100644
index 0000000..7a7a78d
--- /dev/null
+++ b/bindings/perl/Makefile.am
@@ -0,0 +1,103 @@
+# Copyright (C) 2011, 2012, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+
+if GETDATA_DEBUG
+TEST_VERBOSE=verbose=1
+endif
+
+plTESTS=t/big_test.t t/callback.t
+PERL_TESTS=$(addprefix ${srcdir}/, $(plTESTS))
+
+EXTRA_DIST=funclist.pl GetData.xs simple_funcs.pl simple_funcs.xsin typemap \
+					 GetData.pm.in MANIFEST.in ${plTESTS}
+
+man3dir=${perlmandir}
+nodist_man3_MANS=blib/libdoc/GetData.$(PERL_MAN3EXT)
+
+nodist_perl_SCRIPTS=blib/lib/GetData.pm
+
+perlautogetdatadir=${perldir}/auto/GetData
+nodist_perlautogetdata_SCRIPTS=blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so
+
+lib:
+	mkdir -p $@
+
+lib/GetData.xs: GetData.xs
+	$(MAKE) lib
+	cat $(srcdir)/GetData.xs > $@
+
+lib/typemap: typemap
+	$(MAKE) lib
+	cat $(srcdir)/typemap > $@
+
+lib/simple_funcs.xs: simple_funcs.xsin simple_funcs.pl
+	$(MAKE) lib
+	$(PERL) $(srcdir)/simple_funcs.pl $(srcdir)/simple_funcs.xsin > $@
+
+MANIFEST: MANIFEST.in
+	cat $(srcdir)/MANIFEST.in > $@
+
+make_parameters.sed: ../make_parameters ../../src/getdata.h
+	  ../make_parameters P > $@
+
+../make_parameters: ../make_parameters.c ../../src/gd_config.h
+	  cd .. && ${MAKE} make_parameters
+
+GetData.pm: GetData.pm.in make_parameters.sed funclist.pl lib/GetData.xs \
+	lib/simple_funcs.xs
+	rm -f $@
+	$(SED) -f make_parameters.sed $(srcdir)/GetData.pm.in | \
+		$(PERL) $(srcdir)/funclist.pl lib/GetData.xs lib/simple_funcs.xs > $@
+	chmod a-w $@
+
+blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so \
+	blib/lib/GetData.pm blib/libdoc/GetData.$(PERL_MAN3EXT): build.stamp
+	
+build.stamp: Build lib/GetData.xs lib/simple_funcs.xs lib/typemap
+	$(PERL) Build build
+	touch $@
+
+.PRECIOUS: Build
+Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap \
+	MANIFEST
+	$(PERL) Build.PL
+
+clean-local: 
+	rm -rf lib blib
+	if test -e Build; then \
+		$(PERL) Build clean || true; \
+	fi
+	rm -f $(BUILT_SOURCES) make_parameters.sed MYMETA.yml MYMETA.json GetData.pm
+	rm -rf Build _build MANIFEST build.stamp t/*~
+
+uninstall-hook:
+	rmdir $(DESTDIR)${perlautogetdatadir}
+
+if TEST_PERL
+check: $(PERL_TESTS)
+	${DL_LIBRARY_PATH}=../../src/.libs:${${DL_LIBRARY_PATH}} $(PERL) ./Build test ${TEST_VERBOSE}
+
+testdb testcover: $(PERL_TESTS)
+	${DL_LIBRARY_PATH}=../../src/.libs:${${DL_LIBRARY_PATH}} $(PERL) ./Build $@ ${TEST_VERBOSE}
+
+.PHONY: check testdb testcover
+endif
diff --git a/bindings/perl/Makefile.in b/bindings/perl/Makefile.in
new file mode 100644
index 0000000..f971384
--- /dev/null
+++ b/bindings/perl/Makefile.in
@@ -0,0 +1,772 @@
+# 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/perl
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(srcdir)/Build.PL.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES = Build.PL
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(perldir)" \
+	"$(DESTDIR)$(perlautogetdatadir)" "$(DESTDIR)$(man3dir)"
+SCRIPTS = $(nodist_perl_SCRIPTS) $(nodist_perlautogetdata_SCRIPTS)
+AM_V_P = $(am__v_P_ 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
+NROFF = nroff
+MANS = $(nodist_man3_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2011, 2012, 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
+ at GETDATA_DEBUG_TRUE@TEST_VERBOSE = verbose=1
+plTESTS = t/big_test.t t/callback.t
+PERL_TESTS = $(addprefix ${srcdir}/, $(plTESTS))
+EXTRA_DIST = funclist.pl GetData.xs simple_funcs.pl simple_funcs.xsin typemap \
+					 GetData.pm.in MANIFEST.in ${plTESTS}
+
+man3dir = ${perlmandir}
+nodist_man3_MANS = blib/libdoc/GetData.$(PERL_MAN3EXT)
+nodist_perl_SCRIPTS = blib/lib/GetData.pm
+perlautogetdatadir = ${perldir}/auto/GetData
+nodist_perlautogetdata_SCRIPTS = blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/perl/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/perl/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+Build.PL: $(top_builddir)/config.status $(srcdir)/Build.PL.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-nodist_perlSCRIPTS: $(nodist_perl_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_perl_SCRIPTS)'; test -n "$(perldir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(perldir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(perldir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(perldir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(perldir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-nodist_perlSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_perl_SCRIPTS)'; test -n "$(perldir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	dir='$(DESTDIR)$(perldir)'; $(am__uninstall_files_from_dir)
+install-nodist_perlautogetdataSCRIPTS: $(nodist_perlautogetdata_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_perlautogetdata_SCRIPTS)'; test -n "$(perlautogetdatadir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(perlautogetdatadir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(perlautogetdatadir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(perlautogetdatadir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(perlautogetdatadir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-nodist_perlautogetdataSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_perlautogetdata_SCRIPTS)'; test -n "$(perlautogetdatadir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	dir='$(DESTDIR)$(perlautogetdatadir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man3: $(nodist_man3_MANS)
+	@$(NORMAL_INSTALL)
+	@list1='$(nodist_man3_MANS)'; \
+	list2=''; \
+	test -n "$(man3dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.3[a-z]*$$/p'; \
+	fi; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man3:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_man3_MANS)'; test -n "$(man3dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS)
+installdirs:
+	for dir in "$(DESTDIR)$(perldir)" "$(DESTDIR)$(perlautogetdatadir)" "$(DESTDIR)$(man3dir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man install-nodist_perlSCRIPTS \
+	install-nodist_perlautogetdataSCRIPTS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man3
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man uninstall-nodist_perlSCRIPTS \
+	uninstall-nodist_perlautogetdataSCRIPTS
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
+uninstall-man: uninstall-man3
+
+.MAKE: install-am install-strip uninstall-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	clean-local cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-man3 install-nodist_perlSCRIPTS \
+	install-nodist_perlautogetdataSCRIPTS install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-hook uninstall-man uninstall-man3 \
+	uninstall-nodist_perlSCRIPTS \
+	uninstall-nodist_perlautogetdataSCRIPTS
+
+
+lib:
+	mkdir -p $@
+
+lib/GetData.xs: GetData.xs
+	$(MAKE) lib
+	cat $(srcdir)/GetData.xs > $@
+
+lib/typemap: typemap
+	$(MAKE) lib
+	cat $(srcdir)/typemap > $@
+
+lib/simple_funcs.xs: simple_funcs.xsin simple_funcs.pl
+	$(MAKE) lib
+	$(PERL) $(srcdir)/simple_funcs.pl $(srcdir)/simple_funcs.xsin > $@
+
+MANIFEST: MANIFEST.in
+	cat $(srcdir)/MANIFEST.in > $@
+
+make_parameters.sed: ../make_parameters ../../src/getdata.h
+	  ../make_parameters P > $@
+
+../make_parameters: ../make_parameters.c ../../src/gd_config.h
+	  cd .. && ${MAKE} make_parameters
+
+GetData.pm: GetData.pm.in make_parameters.sed funclist.pl lib/GetData.xs \
+	lib/simple_funcs.xs
+	rm -f $@
+	$(SED) -f make_parameters.sed $(srcdir)/GetData.pm.in | \
+		$(PERL) $(srcdir)/funclist.pl lib/GetData.xs lib/simple_funcs.xs > $@
+	chmod a-w $@
+
+blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so \
+	blib/lib/GetData.pm blib/libdoc/GetData.$(PERL_MAN3EXT): build.stamp
+
+build.stamp: Build lib/GetData.xs lib/simple_funcs.xs lib/typemap
+	$(PERL) Build build
+	touch $@
+
+.PRECIOUS: Build
+Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap \
+	MANIFEST
+	$(PERL) Build.PL
+
+clean-local: 
+	rm -rf lib blib
+	if test -e Build; then \
+		$(PERL) Build clean || true; \
+	fi
+	rm -f $(BUILT_SOURCES) make_parameters.sed MYMETA.yml MYMETA.json GetData.pm
+	rm -rf Build _build MANIFEST build.stamp t/*~
+
+uninstall-hook:
+	rmdir $(DESTDIR)${perlautogetdatadir}
+
+ at TEST_PERL_TRUE@check: $(PERL_TESTS)
+ at TEST_PERL_TRUE@	${DL_LIBRARY_PATH}=../../src/.libs:${${DL_LIBRARY_PATH}} $(PERL) ./Build test ${TEST_VERBOSE}
+
+ at TEST_PERL_TRUE@testdb testcover: $(PERL_TESTS)
+ at TEST_PERL_TRUE@	${DL_LIBRARY_PATH}=../../src/.libs:${${DL_LIBRARY_PATH}} $(PERL) ./Build $@ ${TEST_VERBOSE}
+
+ at TEST_PERL_TRUE@.PHONY: check testdb testcover
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/perl/funclist.pl b/bindings/perl/funclist.pl
new file mode 100644
index 0000000..2f61a80
--- /dev/null
+++ b/bindings/perl/funclist.pl
@@ -0,0 +1,19 @@
+use strict;
+use warnings;
+
+my $preamble = 1;
+
+# Generate the list
+my @funclist;
+for (<>) {
+  $preamble = 0 if (/^MODULE/);
+  next if $preamble;
+  next unless /^(\w*)\(/;
+  push @funclist, $1;
+}
+my $funclist = join(' ', sort @funclist);
+
+for (<STDIN>) {
+  s/\@FUNCLIST@/$funclist/g;
+  print $_;
+}
diff --git a/bindings/perl/simple_funcs.pl b/bindings/perl/simple_funcs.pl
new file mode 100644
index 0000000..4864a42
--- /dev/null
+++ b/bindings/perl/simple_funcs.pl
@@ -0,0 +1,160 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2011-2013 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+use strict;
+use warnings;
+
+my %rec;
+my $i;
+
+sub printcleanup {
+  $_ = shift;
+  my ($t, $n) = @$_;
+
+  return "\t\tsafefree($n);\n" if (
+    $t eq "gdp_complex_in" or $t eq "const char **" or $t eq "gdp_data_in *"
+      or $t eq "gdp_double_in *"
+  );
+  return "";
+}
+
+sub printmunge {
+  $_ = shift;
+  my ($t, $n) = @$_;
+
+  return "&$n" if ($t =~ /&$/);
+  return "(long long)$n" if ($t eq "off64_t" or $t eq "gd_shift_t" or
+    $t eq "gdpu_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");
+  return "$n.r, (unsigned long long)$n.u, (long long)$n.i"
+  if ($t eq "gd_triplet_t");
+  return $n;
+}
+
+sub printfmt {
+  $_ = shift;
+  s/^const //g;
+
+  if (/char \*$/) {
+    return "\\\"%s\\\"";
+  } elsif (/[\*&]$/ or $_ eq "gdp_complex_in") {
+    return "%p";
+  } elsif ($_ eq "_Complex double" or $_ eq "gdpu_complex") {
+    return "%g;%g";
+  } elsif ($_ eq "double") {
+    return "%g";
+  } elsif ($_ eq "gdpu_bitnum_t" or $_ eq "gdpu_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") {
+    return "%lli";
+  } elsif ($_ eq "gdpu_uint_t") {
+    return "%u";
+  } elsif ($_ eq "gd_type_t" or $_ eq "gdpu_type_t") {
+    return "%03x";
+  } elsif ($_ eq "int" or $_ eq "gdpu_int") {
+    return "%i";
+  } elsif ($_ eq "off64_t") {
+    return "%lli";
+  } elsif ($_ eq "size_t") {
+    return "%zi";
+  } elsif ($_ eq "unsigned int") {
+    return "%u";
+  } elsif ($_ eq "unsigned long int") {
+    return "%lu";
+  } elsif ($_ eq "gd_triplet_t") {
+    return "{%g,%llX,%lli}";
+  } else {
+    die "Can't format \"$_\"";
+  }
+}
+
+while (<>) {
+  chomp;
+  until (/\)/) {
+    $_ .= " " . <>;
+    chomp;
+  }
+
+  my ($ret, $func, $args) = /(.*?) *([:\w]+)\((.*)\)/;
+  die "Spurious gd_" if ($func =~ /^gd_/);
+  my $lfs = ($func =~ /64$/);
+  $func =~ s/64$// if ($lfs);
+  my $name = $func;
+  if ($func =~ /:/) {
+    ($func, $name) = $func =~ /(.*):(.*)/;
+  }
+
+  die $_ unless $args;
+  my @args = split ",", $args;
+
+  my (@argtype, @arg);
+  my $arglist = undef;
+  my $prmlist = undef;
+  for (@args) {
+    my ($t, $n, $d) = /\s*(.*?)\s*(\w+)(?:=(.*))?$/;
+    push @argtype, $t;
+    push @arg, [ $t, $n ];
+    $_ = "$t $n";
+    $arglist .= ", " if $arglist;
+    $prmlist .= ", " if $prmlist;
+    $arglist .= "&" if ($t =~ /&$/);
+    $arglist .= $n;
+    $prmlist .= $n;
+    $prmlist .= "=$d" if defined $d;
+  }
+  s/^\s*// for @args;
+
+  print "$ret\n$name($prmlist)\n\t", join("\n\t", @args), "\n";
+  print "\tPREINIT:\n\t\tGDP_DIRFILE_ALIAS;\n" . 
+        "\tALIAS:\n\t\tGetData::Dirfile::$name = 1\n"
+    if ($args[0] =~ /DIRFILE/);
+
+  print "\tCODE:\n\t\tdtrace(\"", join(", ", map(printfmt($_), @argtype));
+  print "\", ", join(", ", map(printmunge($_), @arg)), ");\n";
+
+  print "\t\t";
+  if ($ret ne "void") {
+    print "RETVAL = ";
+  }
+  print (($lfs) ? "gdp64(gd_$func)" : "gd_$func");
+  print "($arglist);\n";
+
+  if ($ret ne "void") {
+    print "\t\tGDP_UNDEF_ON_ERROR();\n";
+    print "\tOUTPUT:\n\t\tRETVAL\n";
+  }
+
+  print "\tCLEANUP:\n", map(printcleanup($_), @arg);
+  if ($ret eq "void") {
+    print "\t\tdreturnvoid();\n";
+  } else {
+    print "\t\tdreturn(\"", &printfmt($ret), "\", ";
+    print &printmunge([$ret, "RETVAL"]), ");\n";
+  }
+  print "\t\tsafefree(RETVAL);\n" if $ret eq "char *";
+  print "\n";
+}
diff --git a/bindings/perl/simple_funcs.xsin b/bindings/perl/simple_funcs.xsin
new file mode 100644
index 0000000..bb365af
--- /dev/null
+++ b/bindings/perl/simple_funcs.xsin
@@ -0,0 +1,157 @@
+int add_bit(DIRFILE *dirfile, const char *field_code, const char *in_field,
+    int bitnum, int numbits, int fragment_index=0)
+int add_clincom:add_lincom(DIRFILE *dirfile, const char *field_code,
+    int n_fields, const char **in_fields, gdp_complex_in cm,
+    gdp_complex_in cb, int fragment_index=0)
+int add_cpolynom:add_polynom(DIRFILE *dirfile, const char *field_code,
+    int poly_ord, const char *in_field, gdp_complex_in ca,
+    int fragment_index=0)
+int add_crecip:add_recip(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, gdpu_complex cdividend, int fragment_index=0)
+int add_divide(DIRFILE *dirfile, const char *field_code, const char *in_field1,
+    const char *in_field2, int fragment_index=0)
+int add_linterp(DIRFILE *dirfile, const char *field_code, const char *in_field,
+    const char *table, int fragment_index=0)
+int add_multiply(DIRFILE *dirfile, const char *field_code,
+    const char *in_field1, const char *in_field2, int fragment_index=0)
+int add_phase(DIRFILE *dirfile, const char *field_code, const char *in_field,
+    gd_shift_t shift, int fragment_index=0)
+int add_sbit(DIRFILE *dirfile, const char *field_code, const char *in_field,
+    int bitnum, int numbits, int fragment_index=0)
+int add_string(DIRFILE *dirfile, const char *field_code, const char *value,
+    int fragment_index=0)
+int alter_bit(DIRFILE *dirfile, const char *field_code,
+    gdpu_char *in_field=NULL, gdpu_bitnum_t bitnum=-1, gdpu_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_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)
+int alter_crecip:alter_recip(DIRFILE *dirfile, const char *field_code,
+    gdpu_char *in_field=NULL, gdpu_complex cdividend)
+int alter_divide(DIRFILE *dirfile, const char *field_code,
+    gdpu_char *in_field1=NULL, gdpu_char *in_field2=NULL)
+int alter_multiply(DIRFILE *dirfile, const char *field_code,
+    gdpu_char *in_field1=NULL, gdpu_char *in_field2=NULL)
+int alter_phase(DIRFILE *dirfile, const char *field_code,
+    gdpu_char *in_field, gdpu_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)
+unsigned long int encoding(DIRFILE *dirfile, int fragment)
+unsigned long int endianness(DIRFILE *dirfile, int fragment)
+int fragment_index(DIRFILE *dirfile, const char *field_code)
+const char *fragmentname(DIRFILE *dirfile, int index)
+int madd(DIRFILE *dirfile, gd_entry_t &entry, const char *parent)
+int madd_bit(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *in_field, int bitnum, int numbits)
+int madd_clincom:madd_lincom(DIRFILE *dirfile, const char *parent,
+    const char *field_code, int n_fields, const char **in_fields,
+    gdp_complex_in cm, gdp_complex_in cb)
+int madd_cpolynom:madd_polynom(DIRFILE *dirfile, const char *parent,
+    const char *field_code, int poly_ord, const char *in_field,
+    gdp_complex_in ca)
+int madd_crecip:madd_recip(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, gdpu_complex cdividend)
+int madd_divide(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *in_field1, const char *in_field2)
+int madd_linterp(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *in_field, const char *table)
+int madd_multiply(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *in_field1, const char *in_field2)
+int madd_phase(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *in_field, gd_shift_t shift)
+int madd_sbit(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *in_field, int bitnum, int numbits)
+int madd_spec(DIRFILE *dirfile, const char *line, const char *parent)
+int madd_string(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *value)
+int dirfile_standards(DIRFILE *dirfile, int version=GD_VERSION_CURRENT)
+const char *dirfilename(DIRFILE *dirfile)
+gd_type_t native_type(DIRFILE *dirfile, const char *field_code)
+int parent_fragment(DIRFILE *dirfile, int fragment_index)
+int alter_protection(DIRFILE *dirfile, int protection_level, int fragment_index)
+int protection(DIRFILE *dirfile, int fragment_index)
+const char *raw_filename(DIRFILE *dirfile, const char *field_code)
+const char *reference(DIRFILE *dirfile, gdpu_char *field_code=NULL)
+unsigned int spf(DIRFILE *dirfile, const char *field_code)
+size_t put_string(DIRFILE *dirfile, const char *field_code, const char *data)
+int validate(DIRFILE *dirfile, const char *field_code)
+int add(DIRFILE *dirfile, gd_entry_t &entry)
+int add_raw(DIRFILE *dirfile, const char *field_code, gd_type_t data_type,
+    unsigned int spf, int fragment_index=0)
+int add_spec(DIRFILE *dirfile, const char *line, int fragment_index=0)
+int alter_const(DIRFILE *dirfile, const char *field_code,
+    gdpu_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 recode=0)
+int alter_linterp(DIRFILE *dirfile, const char *field_code,
+    gdpu_char *in_field=NULL, gdpu_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)
+int alter_spec(DIRFILE *dirfile, const char *line, int recode=0)
+int delete(DIRFILE *dirfile, const char *field_code, int flags=0)
+int flush(DIRFILE *dirfile, const char *field_code)
+int malter_spec(DIRFILE *dirfile, const char *line, const char *parent,
+    int recode=0)
+int metaflush(DIRFILE *dirfile)
+int move(DIRFILE *dirfile, const char *field_code, int new_fragment,
+    unsigned int flags=0)
+int rename(DIRFILE *dirfile, const char *old_code, const char *new_name,
+    int move_data=0)
+int rewrite_fragment(DIRFILE *dirfile, int fragment)
+int uninclude(DIRFILE *dirfile, int fragment_index, int del=0)
+int alter_frameoffset64(DIRFILE *dirfile, off64_t offset, int fragment=0,
+    int recode=0)
+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)
+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)
+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)
+int madd_alias(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *target)
+int add_window(DIRFILE *dirfile, const char *field_code, const char *in_field,
+    const char *check_field, gd_windop_t windop, gd_triplet_t threshold,
+    int fragment_index=0)
+int madd_window(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *in_field, const char *check_field, gd_windop_t windop,
+    gd_triplet_t threshold)
+int alter_window(DIRFILE *dirfile, const char *field_code, 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 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,
+    int period=-1)
+int madd_mplex(DIRFILE *dirfile, const char *parent, const char *field_code,
+    const char *in_field, const char *count_field, int count_val,
+    int period)
+int raw_close(DIRFILE *dirfile, const char *field_code)
+int desync(DIRFILE *dirfile, unsigned int flags=0)
+unsigned long int flags(DIRFILE *dirfile, unsigned long int set=0,
+    unsigned long int reset=0)
+int verbose_prefix(DIRFILE *dirfile, gdpu_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
new file mode 100644
index 0000000..78f1df3
--- /dev/null
+++ b/bindings/perl/t/big_test.t
@@ -0,0 +1,1739 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2011-2012 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+use GetData;
+use Math::Complex;
+use strict;
+use Test::More tests => 1320;
+
+my $ne = 0;
+my ($s, @a, %h);
+select STDERR; $| = 1;
+select STDOUT; $| = 1;
+
+sub isn {
+  cmp_ok (
+    (defined $_[0]) ? $_[0] : "undef",
+    (defined $_[0] and defined $_[1]) ? '==' : 'eq',
+    (defined $_[1]) ? $_[1] : "undef", $_[2] . " = " .
+    ((defined $_[0]) ? $_[0] : "undef") . ", expected " .
+    ((defined $_[1]) ? $_[1] : "undef"));
+}
+
+sub CheckError {
+  my $e = $_->error;
+  print "\n";
+  is ($e, $_[1], "e[$_[0]] = $e, expected $_[1]");
+  print "#";
+}
+
+sub CheckError2 {
+  my $e = $_->error;
+  print "\n";
+  is ($e, $_[2], "e[$_[0],$_[1]] = $e, expected $_[2]");
+  print "#";
+}
+
+sub CheckArray {
+  my $i;
+  print "\n";
+  is ($#{$_[1]}, $#_ - 2,
+    "a[$_[0]]: " . (1 + $#{$_[1]}) . " elements, expected " . ($#_ - 1));
+  for $i (0 .. $#_ - 2) {
+    isn (${$_[1]}[$i], $_[$i + 2], "a($i)[$_[0]]");
+  }
+  print "#";
+}
+
+sub CheckArray2 {
+  my $i;
+  print "\n";
+  is ($#{$_[2]}, $#_ - 3,
+    "a[$_[0],$_[1]]: " . (1 + $#{$_[2]}) . " elements, expected " . ($#_ - 2));
+  for $i (0 .. $#_ - 3) {
+    isn (${$_[2]}[$i], $_[$i + 3], "a($i)[$_[0],$_[1]]" );
+  }
+  print "#";
+}
+
+sub CheckSArray {
+  my $i;
+  print "\n";
+  is ($#{$_[1]}, $#_ - 2,
+    "a[$_[0]]: " . (1 + $#{$_[1]}) . " elements, expected " . ($#_ - 1));
+  for $i (0 .. $#_ - 2) {
+    is (${$_[1]}[$i], $_[$i + 2],
+      "s($i)[$_[0]] = \"${$_[1]}[$i]\", expected \"" . $_[$i + 2] . "\"");
+  }
+  print "#";
+}
+
+sub CheckSArray2 {
+  my $i;
+  print "\n";
+  is ($#{$_[2]}, $#_ - 3,
+    "a[$_[0],$_[1]]: " . (1 + $#{$_[2]}) . " elements, expected " . ($#_ - 2));
+  for $i (0 .. $#_ - 3) {
+    is (${$_[2]}[$i], $_[$i + 3], "s($i)[$_[0],$_[1]] = " .
+      ((defined ${$_[2]}[$i]) ? "\"" . ${$_[2]}[$i] . "\"" : "undef") .
+      ", expected " .
+      ((defined $_[$i + 3]) ? "\"" . $_[$i + 3] . "\"" : "undef"));
+  }
+  print "#";
+}
+
+sub CheckNum {
+  print "\n";
+  isn ($_[1], $_[2], "n[$_[0]]");
+  print "#";
+}
+sub CheckNum2 {
+  print "\n";
+  isn ($_[2], $_[3], "n[$_[0],$_[1]]");
+  print "#";
+}
+
+sub CheckString {
+  print "\n";
+  is ($_[1], $_[2], "s[$_[0]] = \"$_[1]\", expected \"$_[2]\"");
+  print "#";
+}
+
+sub CheckString2 {
+  print "\n";
+  is ($_[2], $_[3], "s[$_[0],$_[1]] = \"$_[2]\", expected \"$_[3]\"");
+  print "#";
+}
+
+sub CheckEOString {
+  print "\n";
+  ok ($_[1] =~ m#$_[2]$#, "s[$_[0]] = \"$_[1]\", expected \"$_[2]\"");
+  print "#";
+}
+
+sub CheckEOSArray {
+  my $i;
+  print "\n";
+  is ($#{$_[1]}, $#_ - 2,
+    "a[$_[0]]: " . (1 + $#{$_[1]}) . " elements, expected " . ($#_ - 1));
+  for $i (0 .. $#_ - 2) {
+    ok (${$_[1]}[$i] =~ m#$_[$i + 2]$#,
+      "s($i)[$_[0]] = \"${$_[1]}[$i]\", expected \"$_[$i + 2]\"");
+  }
+  print "#";
+}
+
+sub CheckOK { &CheckError($_[0], 0) }
+sub CheckOK2 { &CheckError2(@_, 0) }
+
+my $nfields = 17;
+my @fields = (qw(INDEX alias bit carray const data div lincom linterp mplex mult
+  phase polynom recip sbit string window));
+
+#create the dirfile
+system "rm -rf dirfile" if (-e "dirfile" and not -d "dirfile");
+(mkdir "dirfile" or die) unless -e "dirfile";
+
+open GLOB, ">dirfile/data" or die;
+print GLOB map chr, 1 .. 81;
+
+open GLOB, ">dirfile/format" or die;
+print GLOB <<EOF
+/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\"
+EOF
+  or die;
+
+open GLOB, ">dirfile/form2" or die;
+print GLOB "const2 CONST INT8 -19\n" or die;
+close GLOB;
+
+# 0: error check
+$_ = &GetData::open("x", $GetData::RDONLY);
+CheckError(0, $GetData::E_OPEN);
+
+# 1: open check
+$_ = &GetData::open("dirfile", $GetData::RDWR);
+CheckOK(1);
+
+# 2: getdata (INT8) check
+$s = $_->getdata("data", 5, 0, 1, 0, $GetData::INT8);
+CheckOK(2);
+CheckString(2, $s, join "", map chr, 41 .. 48);
+
+# 102: getdata (unpacked) check
+ at a = $_->getdata("data", 5, 0, 1, 0, $GetData::INT16);
+CheckOK(102);
+CheckArray(102, \@a, 41 .. 48);
+
+# 108: getdata (complex unpacked) check
+ at a = $_->getdata("data", 5, 0, 1, 0, $GetData::COMPLEX128);
+CheckOK(108);
+CheckArray(108, \@a, 41 .. 48);
+
+# 3: constant (INT8) check
+$s = $_->get_constant("const", $GetData::INT8);
+CheckOK(3);
+CheckNum(3, $s, 5);
+
+# 116: constant (COMPLEX128) check
+$s = $_->get_constant("const", $GetData::COMPLEX128);
+CheckOK(116);
+CheckNum(116, $s, 5.5);
+
+# 6: nfields check
+$s = $_->field_list;
+CheckOK(6);
+CheckNum(6, $s, $nfields);
+
+# 8: field_list check
+ at a = $_->field_list;
+CheckOK(8);
+CheckSArray(8, \@a, @fields);
+
+# 9: nmfields check
+$s = $_->mfield_list("data");
+CheckOK(9);
+CheckNum(9, $s, 4);
+
+# 10: mfield_list check
+ at a = $_->mfield_list("data");
+CheckOK(10);
+CheckSArray(10, \@a, qw(mstr mconst mcarray mlut));
+
+# 11: nframes check
+$s = $_->nframes;
+CheckOK(11);
+CheckNum(11, $s, 10);
+
+# 12: spf check
+$s = $_->spf("data");
+CheckOK(12);
+CheckNum(12, $s, 8);
+
+# 13: putdata (packed) check
+$s = $_->putdata("data", 5, 1, $GetData::UINT8, "\15\16\17\20");
+CheckOK2(13,1);
+CheckNum(13,$s,4);
+
+ at a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
+CheckOK2(13,2);
+CheckArray(13, \@a, 41, 015, 016, 017, 020, 46, 47, 48);
+
+# 118: putdata (typed ref) check
+$s = $_->putdata("data", 5, 1, $GetData::UINT16, [ 23, 24, 25, 26 ]);
+CheckOK2(118,1);
+CheckNum(118,$s,4);
+
+ at a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
+CheckOK2(118,2);
+CheckArray(118, \@a, 41, 23, 24, 25, 26, 46, 47, 48);
+
+# 120: putdata (untyped ref) check
+$s = $_->putdata("data", 5, 1, [ 33, 34, 35, 36 ]);
+CheckOK2(120,1);
+CheckNum(120,$s,4);
+
+ at a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
+CheckOK2(120,2);
+CheckArray(120, \@a, 41, 33, 34, 35, 36, 46, 47, 48);
+
+# 122: putdata (simple list) check
+$s = $_->putdata("data", 5, 1, 23., 24., 25., 26.);
+CheckOK2(122,1);
+CheckNum(122,$s,4);
+
+ at a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
+CheckOK2(122,2);
+CheckArray(122, \@a, 41, 23, 24, 25, 26, 46, 47, 48);
+
+# 124: 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);
+
+ at a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8);
+CheckOK2(124,2);
+CheckArray(124, \@a, 41, 13, 14, 15, 16, 46, 47, 48);
+
+# 14: 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");
+
+# 15: get_entry check
+$s = $_->entry("data");
+CheckOK(15);
+CheckNum(15,$s,$GetData::RAW_ENTRY);
+
+# 16: get_entry check
+%h = $_->entry("data");
+CheckOK(16);
+CheckSArray2(16, 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
+%h = $_->entry("lincom");
+CheckOK(18);
+CheckSArray2(18, 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,
+  "const");
+CheckArray2(18, 12, $h{'scalar_ind'}, undef, undef, -1, undef, undef, -1);
+
+# 20: get_entry check
+%h = $_->entry("polynom");
+CheckOK(20);
+CheckSArray2(20, 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
+%h = $_->entry("linterp");
+CheckOK(21);
+CheckSArray2(21, 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");
+
+# 22: get_entry check
+%h = $_->entry("bit");
+CheckOK(22);
+CheckSArray2(22, 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
+%h = $_->entry("sbit");
+CheckOK(23);
+CheckSArray2(23, 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
+%h = $_->entry("mult");
+CheckOK(24);
+CheckSArray2(24, 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));
+
+# 25: get_entry check
+%h = $_->entry("phase");
+CheckOK(25);
+CheckSArray2(25, 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
+%h = $_->entry("const");
+CheckOK(26);
+CheckSArray2(26, 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);
+
+# 134: 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);
+
+# 27: fragment_index check
+$s = $_->fragment_index("data");
+CheckOK(27);
+CheckNum(27, $s, 0);
+
+# 28: add_raw check
+$s = $_->add_raw("new1", $GetData::FLOAT64, 3);
+CheckOK2(28, 1);
+CheckNum2(28, 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
+$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);
+
+%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
+$s = $_->add_polynom("new4", 3, "in1", [ 3.9, 4.8, 5.7, 6.6 ], 0);
+CheckOK2(31, 1);
+CheckNum2(31, 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
+$s = $_->add_linterp("new6", "in", "./some/table");
+CheckOK2(33, 1);
+CheckNum2(33, 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
+$s = $_->add_bit("new7", "in1", 11, 22);
+CheckOK2(34, 1);
+CheckNum2(34, 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
+$s = $_->add_sbit("new8", "in2", 5, 10);
+CheckOK2(35, 1);
+CheckNum2(35, 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
+$s = $_->add_multiply("new9", "in2", "in3");
+CheckOK2(36, 1);
+CheckNum2(36, 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));
+
+# 37: add_phase
+$s = $_->add_phase("new10", "in6", 42);
+CheckOK2(37, 1);
+CheckNum2(37, 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
+$s = $_->add_const("new11", $GetData::FLOAT64, "33.3");
+CheckOK2(38, 1);
+CheckNum2(38, 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);
+
+$s = $_->get_constant("new11", $GetData::FLOAT64);
+CheckOK2(38, 8);
+CheckNum2(38, 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
+$s = $_->fragmentname(0);
+CheckOK(39);
+CheckEOString(39, $s, "dirfile/format");
+
+# 40: nfragments
+$s = $_->fragments;
+CheckOK(40);
+CheckNum(40, $s, 1);
+
+# 182: fragment list
+ at a = $_->fragments;
+CheckOK(182);
+CheckEOSArray(182, \@a, "dirfile/format");
+
+# 41: include
+$s = $_->include("form2", 0, 0);
+CheckOK2(41, 1);
+CheckNum2(41, 2, $s, 1);
+
+$s = $_->get_constant("const2", $GetData::INT32);
+CheckOK2(41, 3);
+CheckNum2(41, 4, $s, -19);
+
+# 42: nfields_by_type
+$s = $_->field_list_by_type($GetData::LINCOM_ENTRY);
+CheckOK(42);
+CheckNum(42, $s, 2);
+
+# 43: field_list_by_type
+ at a = $_->field_list_by_type($GetData::LINCOM_ENTRY);
+CheckOK(43);
+CheckSArray(43, \@a, qw(lincom new3));
+
+# 44: nvectors
+$s = $_->vector_list;
+CheckOK(44);
+CheckNum(44, $s, 23);
+
+# 45: vector_list
+ at 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));
+
+#47: 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);
+
+%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
+$s = $_->madd_polynom("data", "mnew3", 3, "in1", [ 3.9, 4.8, 5.7, 6.6 ]);
+CheckOK2(48, 1);
+CheckNum2(48, 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
+$s = $_->madd_linterp("data", "mnew6", "in", "./more/table");
+CheckOK2(50, 1);
+CheckNum2(50, 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
+$s = $_->madd_bit("data", "mnew7", "in1", 3, 2);
+CheckOK2(51, 1);
+CheckNum2(51, 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
+$s = $_->madd_sbit("data", "mnew8", "in2", 4, 5);
+CheckOK2(52, 1);
+CheckNum2(52, 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
+$s = $_->madd_multiply("data", "mnew9", "in3", "in2");
+CheckOK2(53, 1);
+CheckNum2(53, 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));
+
+# 54: madd_phase
+$s = $_->madd_phase("data", "mnew10", "in6", 44);
+CheckOK2(54, 1);
+CheckNum2(54, 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
+$s = $_->madd_const("data", "mnew11", $GetData::FLOAT64, 9.2);
+CheckOK2(55, 1);
+CheckNum2(55, 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);
+
+$s = $_->get_constant("data/mnew11", $GetData::FLOAT64);
+CheckOK2(55, 8);
+CheckNum2(55, 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
+$s = $_->get_string("string");
+CheckOK(56);
+CheckString(56, $s, "Zaphod Beeblebrox");
+
+# 57: add_string
+$s = $_->add_string("new12", "a string");
+CheckOK2(57, 1);
+CheckNum2(57, 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);
+
+$s = $_->get_string("new12");
+CheckOK2(57, 7);
+CheckString2(57, 8, $s, "a string");
+
+# 58: madd_string
+$s = $_->madd_string("data", "mnew12", "another string");
+CheckOK2(58, 1);
+CheckNum2(58, 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);
+
+$s = $_->get_string("data/mnew12");
+CheckOK2(58, 7);
+CheckString2(58, 8, $s, "another string");
+
+# 59: add_spec
+$s = $_->add_spec("lorem STRING \"Lorem ipsum\"", 0);
+CheckOK2(59, 1);
+CheckNum2(59, 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);
+
+$s = $_->get_string("lorem");
+CheckOK2(59, 7);
+CheckString2(59, 8, $s, "Lorem ipsum");
+
+# 60: add_spec
+$s = $_->madd_spec("ipsum STRING \"dolor sit amet.\"", "lorem");
+CheckOK2(60, 1);
+CheckNum2(60, 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);
+
+$s = $_->get_string("lorem/ipsum");
+CheckOK2(60, 7);
+CheckString2(60, 8, $s, "dolor sit amet.");
+
+# 61: put_constant
+$s = $_->put_constant("const", 61);
+CheckOK2(61, 1);
+CheckNum2(61, 2, $s, 0);
+
+$s = $_->get_constant("const", $GetData::FLOAT64);
+CheckOK2(61, 3);
+CheckNum2(61, 4, $s, 61.);
+
+# 62: put_string
+$s = $_->put_string("string", "Arthur Dent");
+CheckOK2(62, 1);
+CheckNum2(62, 2, $s, 12);
+
+$s = $_->get_string("string");
+CheckOK2(62, 3);
+CheckString2(62, 4, $s, "Arthur Dent");
+
+# 63: nmfields_by_type
+$s = $_->mfield_list_by_type("data", $GetData::LINCOM_ENTRY);
+CheckOK(63);
+CheckNum(63, $s, 1);
+
+# 64: mfield_list_by_type
+ at a = $_->mfield_list_by_type("data", $GetData::LINCOM_ENTRY);
+CheckOK(64);
+CheckSArray(64, \@a, qw(mnew2));
+
+# 65: nmfields_by_type
+$s = $_->mvector_list("data");
+CheckOK(65);
+CheckNum(65, $s, 9);
+
+# 66: mfield_list_by_type
+ at a = $_->mvector_list("data");
+CheckOK(66);
+CheckSArray(66, \@a,
+  qw(mlut mnew2 mnew3 mnew6 mnew7 mnew8 mnew9 mnew10 mnew13));
+
+# 67: alter raw
+$s = $_->alter_raw("new1", $GetData::INT32, undef);
+CheckOK2(67, 1);
+CheckNum2(67, 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
+$s = $_->alter_lincom("new3", undef, [ qw(in3 in4) ], [ 3., 4. ]);
+CheckOK2(69, 1);
+CheckNum2(69, 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
+$s = $_->alter_polynom("new4", 4, undef, [ 1*i, 2*i, 3*i, 4*i, 5*i ]);
+CheckOK2(71, 1);
+CheckNum2(71, 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
+$s = $_->alter_linterp("new6", undef, "./other/table");
+CheckOK2(72, 1);
+CheckNum2(72, 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
+$s = $_->alter_bit("new7", "in3", undef, 8);
+CheckOK2(73, 1);
+CheckNum2(73, 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
+$s = $_->alter_sbit("new8", "in1");
+CheckOK2(74, 1);
+CheckNum2(74, 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
+$s = $_->alter_multiply("new9", "in1");
+CheckOK2(75, 1);
+CheckNum2(75, 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));
+
+# 76: alter_phase
+$s = $_->alter_phase("new10", undef, -3);
+CheckOK2(76, 1);
+CheckNum2(76, 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
+$s = $_->alter_const("new11", $GetData::FLOAT32);
+CheckOK2(77, 1);
+CheckNum2(77, 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);
+
+%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
+$s = $_->encoding(0);
+CheckOK(78);
+CheckNum(78, $s, $GetData::UNENCODED);
+
+# 79: endianness check
+$s = $_->endianness(0);
+CheckOK(79);
+CheckNum(79, $s, $GetData::LITTLE_ENDIAN | $GetData::NOT_ARM_ENDIAN);
+
+# 80: dirfilename
+$s = $_->dirfilename;
+CheckOK(80);
+CheckEOString(80, $s, "dirfile");
+
+# 81: parent_fragment
+$s = $_->parent_fragment(1);
+CheckOK(81);
+CheckNum(81, $s, 0);
+
+# 82: alter_protection
+$s = $_->alter_protection($GetData::PROTECT_DATA, 1);
+CheckOK(82);
+CheckNum(82, $s, 0);
+
+# 83: protection
+$s = $_->protection(1);
+CheckOK(83);
+CheckNum(83, $s, $GetData::PROTECT_DATA);
+
+# 84: raw_filename
+$s = $_->raw_filename("data");
+CheckOK(84);
+CheckEOString(84, $s, "dirfile/data");
+
+# 85: reference
+$s = $_->reference("new1");
+CheckOK(85);
+CheckString(85, $s, "new1");
+
+# 87: alter_encoding
+$s = $_->alter_encoding($GetData::SLIM_ENCODED, 1);
+CheckOK2(87, 1);
+CheckNum2(87, 2, $s, 0);
+
+$s = $_->encoding(1);
+CheckOK2(87, 3);
+CheckNum2(87, 4, $s, $GetData::SLIM_ENCODED);
+
+# 88: alter_endianness
+$s = $_->alter_endianness($GetData::BIG_ENDIAN, 1);
+CheckOK2(88, 1);
+CheckNum2(88, 2, $s, 0);
+
+$s = $_->endianness(1);
+CheckOK2(88, 3);
+CheckNum2(88, 4, $s, $GetData::BIG_ENDIAN);
+
+# 89: alter_spec
+$s = $_->alter_spec("new10 PHASE in const");
+CheckOK2(89, 1);
+CheckNum2(89, 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
+$s = $_->delete("new10");
+CheckOK2(90, 0);
+CheckNum2(90, 1, $s, 0);
+
+$s = $_->entry("new10");
+CheckError2(90, 2, $GetData::E_BAD_CODE);
+CheckNum2(90, 3, $s, undef);
+
+# 91: malter_spec
+$s = $_->malter_spec("mnew10 PHASE in4 11", "data");
+CheckOK2(91, 0);
+CheckNum2(91, 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
+$s = $_->move("new9", 1);
+CheckOK2(92, 0);
+CheckNum2(92, 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));
+
+# 93: move
+$s = $_->rename(qw(new9 newer));
+CheckOK2(93, 0);
+CheckNum2(93, 1, $s, 0);
+
+$s = $_->entry("new9");
+CheckError2(93, 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));
+
+# 94: uninclude
+$s = $_->uninclude(1);
+CheckOK2(94, 0);
+CheckNum2(94, 1, $s, 0);
+
+$s = $_->entry("newer");
+CheckError2(94, 2, $GetData::E_BAD_CODE);
+
+# 95: frameoffset
+$s = $_->frameoffset(0);
+CheckOK(95);
+CheckNum(95, $s, 0);
+
+# 96: alter_frameoffset
+$s = $_->alter_frameoffset(33, 0);
+CheckOK2(96, 0);
+CheckNum2(96, 1, $s, 0);
+
+$s = $_->frameoffset(0);
+CheckOK2(96, 2);
+CheckNum2(96, 3, $s, 33);
+
+# 97: native_type
+$s = $_->native_type("data");
+CheckOK(97);
+CheckNum(97, $s, $GetData::INT8);
+
+# 99: validate
+$s = $_->validate("new7");
+CheckError(99, $GetData::E_BAD_CODE);
+CheckNum(99, $s, undef);
+
+# 101: framenum
+$s = $_->framenum("data", 33.3, 6);
+CheckOK(101);
+CheckNum(101, $s, 37.0375);
+
+# 86: gd_eof
+$s = $_->eof("lincom");
+CheckOK(86);
+CheckNum(86, $s, 345);
+
+# 142: gd_bof
+$s = $_->bof("lincom");
+CheckOK(142);
+CheckNum(142, $s, 264);
+
+# 143: divide entry
+%h = $_->entry("div");
+CheckOK(143);
+CheckSArray2(143, 0, [ sort keys %h ], qw(field field_type fragment_index),
+  "in_fields");
+CheckString2(143, 1, $h{'field'}, "div");
+CheckNum2(143, 2, $h{'field_type'}, $GetData::DIVIDE_ENTRY);
+CheckNum2(143, 3, $h{'fragment_index'}, 0);
+CheckSArray2(143, 4, $h{'in_fields'}, qw(mult bit));
+
+# 145: recip entry
+%h = $_->entry("recip");
+CheckOK(145);
+CheckSArray2(145, 1, [ sort keys %h ], qw(dividend field field_type),
+  qw(fragment_index in_fields scalar scalar_ind));
+CheckNum2(145, 2, $h{'dividend'}, 6.5 + 4.3 * i);
+CheckString2(145, 3, $h{'field'}, "recip");
+CheckNum2(145, 4, $h{'field_type'}, $GetData::RECIP_ENTRY);
+CheckNum2(145, 5, $h{'fragment_index'}, 0);
+CheckString2(145, 6, $h{'in_fields'}, "div");
+CheckSArray2(145, 7, $h{'scalar'}, undef);
+CheckArray2(145, 8, $h{'scalar_ind'}, undef);
+
+# 146: add divide
+$s = $_->add_divide(qw(new14 in2 in3));
+CheckOK2(146, 0);
+CheckNum2(146, 1, $s, 0);
+
+%h = $_->entry("new14");
+CheckOK(146);
+CheckString2(146, 1, $h{'field'}, "new14");
+CheckNum2(146, 2, $h{'field_type'}, $GetData::DIVIDE_ENTRY);
+CheckNum2(146, 3, $h{'fragment_index'}, 0);
+CheckSArray2(146, 4, $h{'in_fields'}, qw(in2 in3));
+
+# 148: add recip
+$s = $_->add_recip(qw(new16 in2), 33.3 + 44.4 * i);
+CheckOK2(148, 0);
+CheckNum2(148, 1, $s, 0);
+
+%h = $_->entry("new16");
+CheckOK(148);
+CheckNum2(148, 2, $h{'dividend'}, 33.3 + 44.4 * i);
+CheckString2(148, 3, $h{'field'}, "new16");
+CheckNum2(148, 4, $h{'field_type'}, $GetData::RECIP_ENTRY);
+CheckNum2(148, 5, $h{'fragment_index'}, 0);
+CheckString2(148, 6, $h{'in_fields'}, "in2");
+CheckSArray2(148, 7, $h{'scalar'}, undef);
+CheckArray2(148, 8, $h{'scalar_ind'}, undef);
+
+# 149: madd divide
+$s = $_->madd_divide(qw(data mnew14 in1 in8));
+CheckOK2(149, 0);
+CheckNum2(149, 1, $s, 0);
+
+%h = $_->entry("data/mnew14");
+CheckOK(149);
+CheckString2(149, 1, $h{'field'}, "data/mnew14");
+CheckNum2(149, 2, $h{'field_type'}, $GetData::DIVIDE_ENTRY);
+CheckNum2(149, 3, $h{'fragment_index'}, 0);
+CheckSArray2(149, 4, $h{'in_fields'}, qw(in1 in8));
+
+# 151: add recip
+$s = $_->madd_recip(qw(data mnew16 in2), 1.0);
+CheckOK2(151, 0);
+CheckNum2(151, 1, $s, 0);
+
+%h = $_->entry("data/mnew16");
+CheckOK(151);
+CheckNum2(151, 2, $h{'dividend'}, 1);
+CheckString2(151, 3, $h{'field'}, "data/mnew16");
+CheckNum2(151, 4, $h{'field_type'}, $GetData::RECIP_ENTRY);
+CheckNum2(151, 5, $h{'fragment_index'}, 0);
+CheckString2(151, 6, $h{'in_fields'}, "in2");
+CheckSArray2(151, 7, $h{'scalar'}, undef);
+CheckArray2(151, 8, $h{'scalar_ind'}, undef);
+
+# 152: alter_divide
+$s = $_->alter_divide("new14", "in5");
+CheckOK2(152, 1);
+CheckNum2(152, 2, $s, 0);
+
+%h = $_->entry("new14");
+CheckOK2(152, 3);
+CheckString2(152, 4, $h{'field'}, "new14");
+CheckNum2(152, 5, $h{'field_type'}, $GetData::DIVIDE_ENTRY);
+CheckNum2(152, 6, $h{'fragment_index'}, 0);
+CheckSArray2(152, 7, $h{'in_fields'}, qw(in5 in3));
+
+# 153: alter recip
+$s = $_->alter_recip("new16", "in6", undef);
+CheckOK2(153, 1);
+CheckNum2(153, 2, $s, 0);
+
+%h = $_->entry("new16");
+CheckOK(151);
+CheckNum2(151, 2, $h{'dividend'}, 33.3 + 44.4 * i);
+CheckString2(151, 3, $h{'field'}, "new16");
+CheckNum2(151, 4, $h{'field_type'}, $GetData::RECIP_ENTRY);
+CheckNum2(151, 5, $h{'fragment_index'}, 0);
+CheckString2(151, 6, $h{'in_fields'}, "in6");
+CheckSArray2(151, 7, $h{'scalar'}, undef);
+CheckArray2(151, 8, $h{'scalar_ind'}, undef);
+
+# 155: rewrite fragment
+$s = $_->rewrite_fragment(0);
+CheckOK(155, 0);
+CheckNum(155, $s, 0);
+
+# 156: invalid dirfile
+my $d = $_;
+$_ = &GetData::invalid_dirfile;
+CheckOK2(156, 0);
+$s = $_->fragments;
+CheckError2(156, 1, $GetData::E_BAD_DIRFILE);
+CheckNum2(156, 2, $s, 0);
+$_->close;
+$_ = $d;
+
+# 157: dirfile standards
+$s = $_->dirfile_standards;
+CheckOK2(157, 1);
+CheckNum2(157, 2, $s, $GetData::DIRFILE_STANDARDS_VERSION);
+
+$s = $_->dirfile_standards(0);
+CheckError2(157, 3, $GetData::E_ARGUMENT);
+CheckNum2(157, 4, $s, undef);
+
+# 158: get_carray
+$s = $_->get_carray("carray", $GetData::INT8);
+CheckOK(158);
+CheckString(158, $s, "\1\2\3\4\5\6");
+
+# 164: get_carray_slice
+ at a = $_->get_carray_slice("carray", 2, 2, $GetData::FLOAT64);
+CheckOK(164);
+CheckArray(164, \@a, 3.3, 4.4);
+
+# 167: carrays
+$s = $_->carrays($GetData::INT8);
+CheckOK2(167, 1);
+CheckNum2(167, 2, $#$s, 0);
+CheckSArray2(167, 3, $s, "\1\2\3\4\5\6");
+
+ at a = $_->carrays($GetData::FLOAT64);
+CheckOK2(167, 4);
+CheckNum2(167, 5, $#a, 0);
+CheckArray2(167, 6, $a[0], 1.1, 2.2, 3.3, 4.4, 5.5, 6.6 );
+
+# 168: put carray
+$s = $_->put_carray("carray", 9, 8, 7, 6, 5, 4);
+CheckOK2(168, 1);
+CheckNum2(168, 2, $s, 0);
+
+ at a = $_->get_carray("carray", $GetData::INT8);
+CheckOK2(168, 3);
+CheckArray2(168, 4, \@a, 9, 8, 7, 6, 5, 4);
+
+#169 put caray slice
+$s = $_->put_carray_slice("carray", 2, [ 169, 169 ]);
+CheckOK2(168, 1);
+CheckNum2(168, 2, $s, 0);
+
+ at a = $_->get_carray("carray", $GetData::UINT8);
+CheckOK2(168, 3);
+CheckArray2(168, 4, \@a, 9, 8, 169, 169, 5, 4);
+
+# 177: carray len
+$s = $_->carray_len("carray");
+CheckOK(177);
+CheckNum(177, $s, 6);
+
+# 178: carray entry
+%h = $_->entry("carray");
+CheckOK2(178, 1);
+CheckSArray2(178, 2, [ sort keys %h ],
+  qw(array_len const_type field field_type fragment_index));
+CheckNum2(178, 3, $h{'array_len'}, 6);
+CheckNum2(178, 4, $h{'const_type'}, $GetData::FLOAT64);
+CheckString2(178, 5, $h{'field'}, "carray");
+CheckNum2(178, 6, $h{'field_type'}, $GetData::CARRAY_ENTRY);
+CheckNum2(178, 7, $h{'fragment_index'}, 0);
+
+# 179: add carray
+$s = $_->add_carray("new17", $GetData::FLOAT64, 0, undef, 1.79, 17.9);
+CheckOK2(179, 1);
+CheckNum2(179, 2, $s, 0);
+
+%h = $_->entry("new17");
+CheckOK2(179, 3);
+CheckNum2(179, 4, $h{'array_len'}, 2);
+CheckNum2(179, 5, $h{'const_type'}, $GetData::FLOAT64);
+CheckString2(179, 6, $h{'field'}, "new17");
+CheckNum2(179, 7, $h{'field_type'}, $GetData::CARRAY_ENTRY);
+CheckNum2(179, 8, $h{'fragment_index'}, 0);
+
+ at a = $_->get_carray("new17", $GetData::FLOAT64);
+CheckOK2(179, 9);
+CheckArray2(179, 10, \@a, 1.79, 17.9);
+
+# 180: add carray
+$s = $_->madd_carray("data", "mnew17", $GetData::FLOAT64, undef, 1.80, 18.0);
+CheckOK2(180, 1);
+CheckNum2(180, 2, $s, 0);
+
+%h = $_->entry("data/mnew17");
+CheckOK2(180, 3);
+CheckNum2(180, 4, $h{'array_len'}, 2);
+CheckNum2(180, 5, $h{'const_type'}, $GetData::FLOAT64);
+CheckString2(180, 6, $h{'field'}, "data/mnew17");
+CheckNum2(180, 7, $h{'field_type'}, $GetData::CARRAY_ENTRY);
+CheckNum2(180, 8, $h{'fragment_index'}, 0);
+
+ at a = $_->get_carray("data/mnew17", $GetData::FLOAT64);
+CheckOK2(180, 9);
+CheckArray2(180, 10, \@a, 1.80, 18.0);
+
+# 183: constants
+$s = $_->constants($GetData::UINT8);
+CheckOK2(183, 0);
+CheckString2(183, 1, $s, "=!");
+
+ at a = $_->constants($GetData::FLOAT64);
+CheckOK2(183, 2);
+CheckArray2(183, 3, \@a, 61, 33.3);
+
+# 191: mconstants
+$s = $_->mconstants("data", $GetData::UINT8);
+CheckOK2(191, 0);
+CheckString2(191, 1, $s, "\3\011");
+
+ at a = $_->mconstants("data", $GetData::FLOAT64);
+CheckOK2(191, 2);
+CheckArray2(191, 3, \@a, 3.3, 9.2);
+
+# 199: strings
+$s = $_->strings;
+CheckOK2(199, 1);
+CheckNum2(199, 2, $s, 3);
+
+ at a = $_->strings;
+CheckOK2(199, 3);
+CheckSArray2(199, 4, \@a, "Lorem ipsum", "a string", "Arthur Dent");
+
+# 200: mstrings
+$s = $_->mstrings("data");
+CheckOK2(200, 1);
+CheckNum2(200, 2, $s, 2);
+
+ at a = $_->mstrings("data");
+CheckOK2(200, 3);
+CheckSArray2(200, 4, \@a, "This is a string constant.", "another string");
+
+# 203: seek
+$s = $_->seek("data", 35, 0, $GetData::SEEK_SET);
+CheckOK2(203, 0);
+CheckNum2(203, 0, $s, 280);
+
+$s = $_->getdata("data", $GetData::HERE, 0, 1, 0, $GetData::INT8);
+CheckOK2(203, 1);
+CheckNum2(203, 1, length($s), 8);
+CheckString2(203, 2, $s, join "", map chr, 17 .. 24);
+
+# 204: tell
+$s = $_->tell("data");
+CheckOK(204);
+CheckNum(204,$s,288);
+
+# 205: gd_hide check
+$s = $_->hide('data');
+CheckOK(205);
+
+# 206: gd_hidden check
+$s = $_->hidden('data');
+CheckOK2(206, 1);
+CheckNum2(206, 1, $s, 1);
+
+$s = $_->hidden('lincom');
+CheckOK2(206, 2);
+CheckNum2(206, 2, $s, 0);
+
+# 207: gd_unhide check
+$s = $_->unhide('data');
+CheckOK2(206, 1);
+$s = $_->hidden('data');
+CheckOK2(206, 2);
+CheckNum(206, $s, 0);
+
+# 208: gd_sync check
+$s = $_->sync('data');
+CheckOK(208);
+
+# 209: gd_flush check
+$s = $_->flush('data');
+CheckOK(209);
+
+# 210: gd_metaflush check
+$s = $_->metaflush();
+CheckOK(210);
+
+# 211: gd_entry (WINDOW) check
+%h = $_->entry('window');
+CheckOK(211);
+CheckNum2(211, 1, $h{"field_type"}, $GetData::WINDOW_ENTRY);
+CheckNum2(211, 2, $h{"fragment_index"}, 0);
+CheckNum2(211, 3, $h{"windop"}, $GetData::WINDOP_LT);
+CheckSArray2(211, 4, $h{"in_fields"}, 'linterp', 'mult');
+CheckNum2(211, 5, $h{"threshold"}, 4.1);
+
+# 212: gd_add_window check
+$s = $_->add_window('new18', 'in1', 'in2', $GetData::WINDOP_NE, 32, 0);
+CheckOK2(212, 1);
+
+%h = $_->entry('new18');
+CheckOK2(212, 2);
+CheckNum2(212, 1, $h{"field_type"}, $GetData::WINDOW_ENTRY);
+CheckNum2(212, 2, $h{"fragment_index"}, 0);
+CheckNum2(212, 3, $h{"windop"}, $GetData::WINDOP_NE);
+CheckSArray2(212, 4, $h{"in_fields"}, 'in1', 'in2');
+CheckNum2(212, 5, $h{"threshold"}, 32);
+
+# 214: gd_madd_window check
+$s = $_->madd_window('data', 'mnew18', 'in2', 'in3', $GetData::WINDOP_SET, 128);
+CheckOK2(214, 1);
+
+%h = $_->entry('data/mnew18');
+CheckOK2(214, 2);
+CheckNum2(214, 1, $h{"field_type"}, $GetData::WINDOW_ENTRY);
+CheckNum2(214, 2, $h{"fragment_index"}, 0);
+CheckNum2(214, 3, $h{"windop"}, $GetData::WINDOP_SET);
+CheckSArray2(214, 4, $h{"in_fields"}, 'in2', 'in3');
+CheckNum2(214, 5, $h{"threshold"}, 128);
+
+# 217: gd_alter_window check
+$s = $_->alter_window('new18', 'in3', 'in4', $GetData::WINDOP_GE, 32e3);
+CheckOK2(217, 1);
+
+%h = $_->entry('new18');
+CheckOK2(217, 2);
+CheckNum2(217, 1, $h{"field_type"}, $GetData::WINDOW_ENTRY);
+CheckNum2(217, 2, $h{"fragment_index"}, 0);
+CheckNum2(217, 3, $h{"windop"}, $GetData::WINDOP_GE);
+CheckSArray2(217, 4, $h{"in_fields"}, 'in3', 'in4');
+CheckNum2(217, 5, $h{"threshold"}, 32e3);
+
+# 218: gd_alias_target check
+$s = $_->alias_target('alias');
+CheckOK(218);
+CheckString(218, $s, 'data');
+
+# 219: gd_add_alias check
+$s = $_->add_alias('new20', 'data', 0);
+CheckOK2(219, 1);
+
+$s = $_->alias_target('new20');
+CheckOK2(219, 2);
+CheckString(219, $s, 'data');
+
+# 220: gd_madd_alias check
+$s = $_->madd_alias('data', 'mnew20', 'data');
+CheckOK2(220, 1);
+
+$s = $_->alias_target('data/mnew20');
+CheckOK2(220, 2);
+CheckString(220, $s, 'data');
+
+# 221: gd_naliases check
+$s = $_->aliases('data');
+CheckOK(221);
+CheckNum(221, $s, 4);
+
+# 222: gd_aliases check
+ at a = $_->aliases('data');
+CheckOK(222);
+CheckSArray(222, \@a, "data", "alias", "data/mnew20", "new20");
+
+# 223: gd_include_affix check
+$s = $_->include('format1', 0, $GetData::CREAT | $GetData::EXCL, 'A', 'Z');
+CheckOK(223);
+
+# 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
+ at a = $_->fragment_affixes(1);
+CheckOK(226);
+CheckSArray(226, \@a, "A", "Z");
+
+# 227: gd_alter_affixes check
+$s = $_->alter_affixes(1, 'B', '');
+CheckOK2(227, 1);
+
+ at a = $_->fragment_affixes(1);
+CheckOK2(227, 2);
+CheckSArray(227, \@a, "B", "");
+
+# 228: gd_entry (MPLEX) check
+%h = $_->entry('mplex');
+CheckOK(228);
+CheckNum2(228, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY);
+CheckNum2(228, 2, $h{"fragment_index"}, 0);
+CheckNum2(228, 3, $h{"count_val"}, 1);
+CheckSArray2(228, 4, $h{"in_fields"}, 'data', 'sbit');
+CheckNum2(228, 5, $h{"period"}, 10);
+
+# 229: gd_add_mplex check
+$s = $_->add_mplex('new21', 'in1', 'in2', 5, 6, 0);
+CheckOK2(229, 1);
+
+%h = $_->entry('new21');
+CheckOK2(229, 2);
+CheckNum2(229, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY);
+CheckNum2(229, 2, $h{"fragment_index"}, 0);
+CheckNum2(229, 3, $h{"count_val"}, 5);
+CheckSArray2(229, 4, $h{"in_fields"}, 'in1', 'in2');
+CheckNum2(229, 5, $h{"period"}, 6);
+
+# 230: gd_madd_mplex check
+$s = $_->madd_mplex('data', 'mnew21', 'in2', 'in3', 0, 12);
+CheckOK2(230, 1);
+
+%h = $_->entry('data/mnew21');
+CheckOK2(230, 2);
+CheckNum2(230, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY);
+CheckNum2(230, 2, $h{"fragment_index"}, 0);
+CheckNum2(230, 3, $h{"count_val"}, 0);
+CheckSArray2(230, 4, $h{"in_fields"}, 'in2', 'in3');
+CheckNum2(230, 5, $h{"period"}, 12);
+
+# 231: gd_alter_mplex check
+$s = $_->alter_mplex('new21', 'in3', 'in4', 7, -1);
+CheckOK2(231, 1);
+
+%h = $_->entry('new21');
+CheckOK2(231, 2);
+CheckNum2(231, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY);
+CheckNum2(231, 2, $h{"fragment_index"}, 0);
+CheckNum2(231, 3, $h{"count_val"}, 7);
+CheckSArray2(231, 4, $h{"in_fields"}, 'in3', 'in4');
+CheckNum2(231, 5, $h{"period"}, 6);
+
+# 232: gd_strtok check
+ at a = $_->strtok('"test1 test2" test3\ test4 test5');
+CheckOK(232);
+CheckSArray(232, \@a, "test1 test2", "test3 test4", "test5");
+
+# 233: gd_raw_close check
+$s = $_->raw_close('data');
+CheckOK(233);
+
+# 234: gd_desync
+$s = $_->desync(0);
+CheckOK(234);
+CheckNum(234, $s, 0);
+
+# 235: gd_flags
+$s = $_->flags($GetData::PRETTY_PRINT, 0);
+CheckOK(235);
+CheckNum(235, $s, $GetData::PRETTY_PRINT);
+
+# 236: gd_verbose_prefix
+$s = $_->verbose_prefix("big_test: ");
+CheckOK(236);
+CheckNum(236, $s, 0);
+
+# 237: gd_nentries
+$s = $_->entry_list("data", $GetData::SCALAR_ENTRIES,
+  $GetData::ENTRIES_HIDDEN | $GetData::ENTRIES_NOALIAS);
+CheckOK2(237, 1);
+CheckNum2(237, 1, $s, 6);
+$s = $_->entry_list(undef, $GetData::VECTOR_ENTRIES,
+  $GetData::ENTRIES_HIDDEN | $GetData::ENTRIES_NOALIAS);
+CheckOK2(237, 2);
+CheckNum2(237, 2, $s, 24);
+
+# 239: gd_entry_list
+ at 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));
+
+# 240: gd_mplex_lookback
+$_->mplex_lookback($GetData::LOOKBACK_ALL);
+CheckOK(240);
+
+# 241: raw_filename
+$s = $_->linterp_tablename("linterp");
+CheckOK(241);
+CheckEOString(241, $s, "dirfile/lut");
+
+# 242: mcarrays
+ at a = $_->mcarrays("data", $GetData::FLOAT64);
+CheckOK2(242, 1);
+CheckNum2(242, 2, $#a, 1);
+CheckArray2(242, 3, $a[0], 1.9, 2.8, 3.7, 4.6, 5.5 );
+CheckArray2(242, 4, $a[1], 1.8, 18 );
+
+# 243: NULL return from gd_reference
+{
+  local $_ = &GetData::open("dirfile/empty",
+    $GetData::RDWR | $GetData::CREAT | $GetData::EXCL);
+  CheckOK2(243, 1);
+
+  $s = $_->reference();
+  CheckOK2(243, 2);
+  CheckString(243, $s, undef);
+}
+
+
+
+
+
+
+
+
+$d = $_ = undef;
+system "rm -rf dirfile";
diff --git a/bindings/perl/t/callback.t b/bindings/perl/t/callback.t
new file mode 100644
index 0000000..edb7192
--- /dev/null
+++ b/bindings/perl/t/callback.t
@@ -0,0 +1,37 @@
+use GetData;
+use strict;
+use Test::More tests => 8;
+
+# callback
+sub callback {
+  my ($pdata, $extra) = @_;
+
+  print "\n";
+  is ($extra, "extra stuff", "\$extra parameter good");
+  is ($$pdata{'suberror'}, $GetData::E_FORMAT_BAD_LINE, "suberror good");
+  is ($$pdata{'linenum'}, 2, "linenum good");
+  ok ($$pdata{'filename'} =~ m"dirfile/format$", "filename good");
+
+  $GetData::SYNTAX_IGNORE
+}
+
+# create the dirfile
+system "rm -rf dirfile" if (-e "dirfile" and not -d "dirfile");
+print "\n";
+ok(-e "dirfile" or mkdir "dirfile");
+
+open GLOB, ">dirfile/format" or die;
+print GLOB "data RAW UINT16 8\nbad line\n" or die;
+close GLOB or die;
+
+my $d = &GetData::open("dirfile", $GetData::RDONLY, \&callback, "extra stuff");
+print "\n";
+ok (defined $d, "open created an object");
+my $e = &GetData::error($d);
+print "\n";
+is ($e, $GetData::E_OK, "no error from open");
+my $close_ret = $d->close();
+print "\n";
+is ($close_ret, 0, "close succeeded");
+
+system "rm -rf dirfile";
diff --git a/bindings/perl/typemap b/bindings/perl/typemap
new file mode 100644
index 0000000..6dc84f7
--- /dev/null
+++ b/bindings/perl/typemap
@@ -0,0 +1,148 @@
+# Copyright (C) 2011-2013 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+
+TYPEMAP
+# basic C types
+const char ** T_CONST_AVPV
+_Complex double T_COMPLEX
+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_shift_t T_IV
+gd_triplet_t T_TRIPLET
+gd_type_t T_IV
+gd_windop_t T_IV
+
+# GetData Perl pseudotypes
+gdp_complex_in T_COMPLEXIN
+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
+
+
+INPUT
+T_DIRFILE
+  struct gdp_dirfile_t *gdp_dirfile;
+  if (sv_isa($arg, \"GetData::Dirfile\")) {
+    gdp_dirfile = INT2PTR(struct gdp_dirfile_t*, SvIV((SV*)SvRV($arg)));
+    $var = gdp_dirfile->D;
+    if ($var == NULL)
+      $var = gdp_invalid;
+  } else
+    croak(\"%s::${func_name}() - Invalid dirfile object\", gdp_package);
+T_COMPLEXIN
+  if ($arg == undef)
+    $var = NULL;
+  else if (SvROK($arg) && SvTYPE(SvRV($arg)) == SVt_PVAV) {
+    AV *av = (AV*)SvRV($arg);
+    I32 i, len = av_len(av);
+
+    $var = ($type)safemalloc(2 * sizeof(double) * (1 + len));
+    for (i = 0; i <= len; ++i) {
+      SV **sv = av_fetch(av, i, 0);
+      if (sv == NULL) {
+        safefree($var);
+        croak(\"%s::${func_name}() - Expected array of complex numbers\",
+            gdp_package);
+      }
+      gdp_convert_cmp(gd_cap_(${var}, i), *sv, NULL, gdp_package,
+          \"${func_name}\");
+    }
+  } else {
+    $var = NULL;
+    croak(\"%s::${func_name}() - Expected array of complex numbers\",
+      gdp_package);
+  }
+T_CONST_AVPV
+  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);
+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}\");
+T_IV_FFFF
+  if ($arg == undef)
+    $var = ($type)-1;
+  else
+    $var = ($type)SvIV($arg);
+T_IV_ZERO
+  if ($arg == undef)
+    $var = ($type)0;
+  else
+    $var = ($type)SvIV($arg);
+T_UV_ZERO
+  if ($arg == undef)
+    $var = ($type)0;
+  else
+    $var = ($type)SvUV($arg);
+T_PV_NULL
+  if ($arg == undef)
+    $var = NULL;
+  else
+    $var = SvPV_nolen($arg);
+T_COMPLEX_ZERO
+  if ($arg == undef)
+    gd_rs2cs_($var, 0);
+  else
+    gdp_convert_cmp(gd_csp_($var), $arg, NULL, gdp_package, \"${func_name}\");
+T_TRIPLET
+  { switch (windop) {
+    case GD_WINDOP_EQ:
+    case GD_WINDOP_NE:
+      $var.i = (int64_t)SvIV($arg);
+      break;
+    case GD_WINDOP_SET:
+    case GD_WINDOP_CLR:
+      $var.u = (uint64_t)SvUV($arg);
+      break;
+    default:
+      $var.r = SvNV($arg);
+      break;
+  }}
+
+ 
+
+OUTPUT
+T_DIRFILE
+  gdp_dirfile->D = $var;
+  sv_setref_uv($arg, \"${Package}::Dirfile\", PTR2UV(gdp_dirfile));
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
new file mode 100644
index 0000000..33b5755
--- /dev/null
+++ b/bindings/python/Makefile.am
@@ -0,0 +1,54 @@
+# Copyright (C) 2009-2011, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+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=
+
+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
+
+pyconstants.c: ../make_parameters
+	../make_parameters p > $@
+
+../make_parameters: ../make_parameters.c
+	cd .. && ${MAKE} make_parameters
+
+clean-local:
+	rm -rf ${BUILT_SOURCES} *~ 
+
diff --git a/bindings/python/Makefile.in b/bindings/python/Makefile.in
new file mode 100644
index 0000000..6531811
--- /dev/null
+++ b/bindings/python/Makefile.in
@@ -0,0 +1,912 @@
+# 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/python
+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/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/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)$(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 $@
+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 = $(pygetdata_la_SOURCES) $(nodist_pygetdata_la_SOURCES)
+DIST_SOURCES = $(am__pygetdata_la_SOURCES_DIST)
+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_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+GD_FDIRSEP = @GD_FDIRSEP@
+GETDATAXX_VERSION = @GETDATAXX_VERSION@
+GETDATA_DEBUG = @GETDATA_DEBUG@
+GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@
+GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@
+GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@
+GETDATA_MAJOR = @GETDATA_MAJOR@
+GETDATA_MINOR = @GETDATA_MINOR@
+GETDATA_REVISION = @GETDATA_REVISION@
+GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@
+GREP = @GREP@
+GZIP_CPPFLAGS = @GZIP_CPPFLAGS@
+GZIP_LDFLAGS = @GZIP_LDFLAGS@
+GZIP_LIBS = @GZIP_LIBS@
+IDL = @IDL@
+IDL_CFLAGS = @IDL_CFLAGS@
+IDL_LIBS = @IDL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JOT = @JOT@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBLTDL = @LIBLTDL@
+LIBOBJS = @LIBOBJS@
+LIBS = 
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTDLINCL = @LTDLINCL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZMA_CPPFLAGS = @LZMA_CPPFLAGS@
+LZMA_LDFLAGS = @LZMA_LDFLAGS@
+LZMA_LIBS = @LZMA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATLAB = @MATLAB@
+MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@
+MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@
+MEX = @MEX@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2009-2011, 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
+ at CC_WALL_TRUE@WALL = -Wall
+ at GETDATA_DEBUG_TRUE@DEBUG_C = ../../src/debug.c
+SUBDIRS = test
+python_LTLIBRARIES = pygetdata.la
+BUILT_SOURCES = pyconstants.c
+AM_CFLAGS = ${WALL} ${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
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/python/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/python/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-pythonLTLIBRARIES: $(python_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(python_LTLIBRARIES)'; test -n "$(pythondir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(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=; \
+	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
+
+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)$(pythondir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local \
+	clean-pythonLTLIBRARIES mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pythonLTLIBRARIES
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-pythonLTLIBRARIES
+
+.MAKE: $(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 \
+	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
+
+
+pyconstants.c: ../make_parameters
+	../make_parameters p > $@
+
+../make_parameters: ../make_parameters.c
+	cd .. && ${MAKE} make_parameters
+
+clean-local:
+	rm -rf ${BUILT_SOURCES} *~ 
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/python/pydirfile.c b/bindings/python/pydirfile.c
new file mode 100644
index 0000000..2faa928
--- /dev/null
+++ b/bindings/python/pydirfile.c
@@ -0,0 +1,3538 @@
+/* Copyright (C) 2009-2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#define NO_IMPORT_ARRAY
+#include "pygetdata.h"
+
+/* Dirfile */
+static int gdpy_callback_func(gd_parser_data_t *pdata, void *extra)
+{
+  int r = GD_SYNTAX_ABORT;
+  struct gdpy_dirfile_t *self = extra;
+
+  dtrace("%p, %p", pdata, extra);
+
+  if (self->callback != NULL) {
+    char *new_string;
+    PyObject *result, *arglist;
+    char *estring;
+
+    estring = gd_error_string(pdata->dirfile, NULL, 0);
+
+    arglist = Py_BuildValue("({sssisssiss}O)", "error_string", estring,
+        "suberror", pdata->suberror, "line", pdata->line, "linenum",
+        pdata->linenum, "filename", pdata->filename, self->callback_data);
+
+    free(estring);
+
+    /* an exception results in an abort */
+    if (arglist == NULL) {
+      self->callback_exception = 1;
+      dreturn("%i", GD_SYNTAX_ABORT);
+      return GD_SYNTAX_ABORT;
+    }
+
+    result = PyEval_CallObject(self->callback, arglist);
+    Py_DECREF(arglist);
+
+    /* result may be:
+     * - an Int -- the return code; line not changed
+     * - a String - the new line -- GD_SYNTAX_RESCAN is assumed
+     * - a Tuple containing an Int and then, optionally, a String
+     */
+    if (result == NULL)
+      self->callback_exception = 1;
+    else if (PyTuple_Check(result)) {
+      switch (PyTuple_Size(result))
+      {
+        case 0:
+          PyErr_SetString(PyExc_TypeError,
+              "callback must return at least one object");
+          self->callback_exception = 1;
+          break;
+        case 1:
+          r = (int)PyInt_AsLong(PyTuple_GetItem(result, 0));
+
+          if (PyErr_Occurred()) {
+            self->callback_exception = 1;
+            r = GD_SYNTAX_ABORT;
+          }
+          break;
+        default:
+          r = (int)PyInt_AsLong(PyTuple_GetItem(result, 0));
+
+          if (PyErr_Occurred()) {
+            self->callback_exception = 1;
+            r = GD_SYNTAX_ABORT;
+          }
+
+          new_string = PyString_AsString(PyTuple_GetItem(result, 1));
+
+          if (new_string == NULL) {
+            self->callback_exception = 1;
+            r = GD_SYNTAX_ABORT;
+          }
+
+          pdata->line = new_string;
+      }
+
+      if (PyTuple_Size(result) == 1) {
+      }
+    } else if (PyString_Check(result)) {
+      new_string = PyString_AsString(result);
+
+      if (new_string == NULL) {
+        self->callback_exception = 1;
+        r = GD_SYNTAX_ABORT;
+      }
+
+      r = GD_SYNTAX_RESCAN;
+      pdata->line = new_string;
+    } else if (PyInt_Check(result))
+      r = (int)PyInt_AsLong(result);
+    else {
+      PyErr_SetString(PyExc_TypeError,
+          "bad return type from callback function");
+      self->callback_exception = 1;
+    }
+  }
+
+  dreturn("%i", r);
+  return r;
+}
+
+static void gdpy_dirfile_delete(struct gdpy_dirfile_t *self)
+{
+  dtrace("%p", self);
+
+  gd_close(self->D);
+  free(self->verbose_prefix);
+
+  dreturnvoid();
+}
+
+static PyObject *gdpy_dirfile_create(PyTypeObject *type, PyObject *args,
+    PyObject *keys)
+{
+  struct gdpy_dirfile_t *self;
+
+  dtrace("%p, %p, %p", type, args, keys);
+
+  self = (struct gdpy_dirfile_t*)type->tp_alloc(type, 0);
+
+  if (self) {
+    self->D = NULL;
+    self->mplex_lookback = GD_DEFAULT_LOOKBACK;
+    self->verbose_prefix = NULL;
+    self->callback = NULL;
+    self->callback_data = NULL;
+  }
+
+  dreturn("%p", self);
+  return (PyObject*)self;
+}
+
+static int gdpy_dirfile_init(struct gdpy_dirfile_t *self, PyObject *args,
+    PyObject *keys)
+{
+  PyObject *pycallback = NULL;
+  PyObject *pycallback_data = Py_None;
+  char *keywords[] = {"name", "flags", "callback", "extra", NULL};
+  PyObject *name = NULL;
+  unsigned long flags = GD_RDONLY;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "|OkOO:pygetdata.dirfile.__init__", keywords, &name, &flags,
+        &pycallback, &pycallback_data))
+  {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* An invalid dirfile was requested */
+  if (name == NULL || name == Py_None) {
+    self->D = gd_invalid_dirfile();
+
+    PYGD_CHECK_ERROR(self->D, -1);
+
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (!PyString_Check(name)) {
+    PyErr_SetString(PyExc_TypeError, "name must be a string or None");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (pycallback && pycallback != Py_None && !PyCallable_Check(pycallback)) {
+    PyErr_SetString(PyExc_TypeError, "callback function must be callable");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  Py_XINCREF(pycallback);
+  Py_XINCREF(pycallback_data);
+  Py_XDECREF(self->callback);
+  Py_XDECREF(self->callback_data);
+  self->callback = pycallback;
+  self->callback_data = pycallback_data;
+  self->callback_exception = 0;
+
+  self->D = gd_cbopen(PyString_AsString(name), (unsigned int)flags,
+      (pycallback == NULL) ? NULL : gdpy_callback_func, self);
+
+  if (self->callback_exception) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  PYGD_CHECK_ERROR(self->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_dirfile_add(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "entry", NULL };
+  struct gdpy_entry_t *entry = NULL;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "O!:pygetdata.dirfile.add",
+        keywords, &gdpy_entry, &entry))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_add(self->D, entry->E);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_addspec(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "spec", "fragment_index", NULL };
+  const char *spec;
+  int fragment = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s|i:pygetdata.dirfile.add_spec",
+        keywords, &spec, &fragment))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_add_spec(self->D, spec, fragment);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_alter(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", "entry", "recode", NULL };
+  struct gdpy_entry_t *entry = NULL;
+  int recode = 0;
+  char *field_code;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "sO!|i:pygetdata.dirfile.alter",
+        keywords, &field_code, &gdpy_entry, &entry, &recode))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_alter_entry(self->D, field_code, entry->E, recode);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_alterspec(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "spec", "recode", NULL };
+  const char *spec;
+  int recode = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s|i:pygetdata.dirfile.alter_spec", keywords, &spec, &recode))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_alter_spec(self->D, spec, recode);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_close(struct gdpy_dirfile_t *self)
+{
+  dtrace("%p", self);
+
+  if (gd_close(self->D))
+    PYGD_CHECK_ERROR(self->D, NULL);
+
+  self->D = gd_invalid_dirfile();
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_delentry(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"field_code", "flags", NULL};
+  const char *field_code;
+  int flags = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s|i:pygetdata.dirfile.delete", keywords, &field_code, &flags))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_delete(self->D, field_code, flags);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_discard(struct gdpy_dirfile_t *self)
+{
+  dtrace("%p", self);
+
+  if (gd_discard(self->D)) {
+    PYGD_CHECK_ERROR(self->D, NULL);
+  }
+
+  /* Here we replace D with an empty, invalid dirfile object.  */
+  self->D = gd_invalid_dirfile();
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_getcarray(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"field_code", "return_type", "start", "len", "as_list",
+    NULL};
+  const char *field_code;
+  unsigned int start = 0, len = 0;
+  int as_list = 0;
+  gd_type_t return_type;
+  PyObject *pyobj = NULL;
+#ifdef USE_NUMPY
+  npy_intp dims[] = { 0 };
+#endif
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "si|IIi:pygetdata.dirfile.get_carray", keywords, &field_code,
+        &return_type, &start, &len, &as_list))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (len == 0) {
+    len = gd_carray_len(self->D, field_code);
+    if (len > start)
+      len -= start;
+    else
+      len = 0;
+  }
+
+  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
+    {
+      PYGD_CHECK_ERROR2(self->D, NULL, free(data));
+      pyobj = gdpy_convert_to_pylist(data, return_type, len);
+
+      free(data);
+    }
+  }
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getconstant(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"field_code", "return_type", NULL};
+  const char *field_code;
+  gd_type_t return_type;
+  char data[16];
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "si:pygetdata.dirfile.get_constant", keywords, &field_code,
+        &return_type))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_get_constant(self->D, field_code, return_type, data);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = gdpy_convert_to_pyobj(data, return_type);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_carraylen(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  size_t len;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.carray_len",
+        keywords, &field_code)) {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  len = gd_carray_len(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong((long)len);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_carrays(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"return_type", "as_list", NULL};
+  const char **fields;
+  int as_list = 0, i;
+  gd_type_t return_type;
+  const gd_carray_t *carrays;
+  PyObject *pyobj;
+#ifdef USE_NUMPY
+  npy_intp dims[] = { 0 };
+#endif
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "i|i:pygetdata.dirfile.carrays",
+        keywords, &return_type, &as_list))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fields = gd_field_list_by_type(self->D, GD_CARRAY_ENTRY);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  carrays = gd_carrays(self->D, return_type);
+
+  pyobj = PyList_New(0);
+
+  for (i = 0; carrays[i].n != 0; ++i) {
+    PyObject *pydata;
+#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));
+  }
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getconstants(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  int i;
+  char *keywords[] = {"return_type", NULL};
+  const char **fields;
+  const char *values;
+  gd_type_t return_type;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "i:pygetdata.dirfile.constants", keywords, &return_type))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fields = gd_field_list_by_type(self->D, GD_CONST_ENTRY);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  values = gd_constants(self->D, return_type);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyList_New(0);
+
+  for (i = 0; fields[i] != NULL; ++i)
+    gdpylist_append(pyobj, Py_BuildValue("sN", fields[i],
+          gdpy_convert_to_pyobj(values + i * GD_SIZE(return_type),
+            return_type)));
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getdata(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", "return_type", "first_frame",
+    "first_sample", "num_frames", "num_samples", "as_list", NULL };
+  const char *field_code;
+  PY_LONG_LONG first_frame = 0, first_sample = 0;
+  PyObject *num_frames_obj = NULL, *num_samples_obj = NULL;
+  PyObject *return_type_obj = NULL;
+  long int num_frames = 0, num_samples = 0;
+  size_t ns;
+  int as_list = 0, read_to_end = 0;
+  gd_type_t return_type;
+  unsigned int spf = 1;
+  PyObject *pyobj = NULL;
+#ifdef USE_NUMPY
+  npy_intp dims[] = { 0 };
+#endif
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s|OLLOOi:pygetdata.dirfile.getdata", keywords, &field_code,
+        &return_type_obj, &first_frame, &first_sample, &num_frames_obj,
+        &num_samples_obj, &as_list))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* get return type */
+  if (return_type_obj) {
+    return_type = (gd_type_t)PyInt_AsLong(return_type_obj);
+    if (PyErr_Occurred()) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  } else {
+    return_type = gd_native_type(self->D, field_code);
+    PYGD_CHECK_ERROR(self->D, NULL);
+  }
+
+  if (num_frames_obj) {
+    num_frames = PyInt_AsLong(num_frames_obj);
+    if (num_frames == -1 && PyErr_Occurred()) {
+      dreturn("%p", NULL);
+      return NULL;
+    } else if (num_frames < 0) {
+      PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.gd_getdata(): "
+          "num_frames must be non-negative");
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  }
+
+  if (num_samples_obj) {
+    num_samples = PyInt_AsLong(num_samples_obj);
+    if (num_samples == -1 && PyErr_Occurred()) {
+      dreturn("%p", NULL);
+      return NULL;
+    } else if (num_samples < 0) {
+      PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.gd_getdata(): "
+          "num_samples must be non-negative");
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  }
+
+  /* read to end mode */
+  if (num_frames_obj == NULL && num_samples_obj == NULL)
+    read_to_end = 1;
+
+  /* we need the SPF to know how many samples we have to allocate */
+  if (read_to_end || num_frames) {
+    spf = gd_spf(self->D, field_code);
+
+    PYGD_CHECK_ERROR(self->D, NULL);
+
+    if (read_to_end) {
+      num_samples = gd_nframes(self->D) * spf;
+      PYGD_CHECK_ERROR(self->D, NULL);
+
+      /* don't read past the frame indicated by nframes */
+      num_samples -= first_frame * spf - first_sample;
+      if (num_samples < 0)
+        num_samples = 0;
+    } else
+      num_samples += num_frames * spf;
+  }
+
+  if (num_samples == 0) {
+#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);
+
+#ifdef USE_NUMPY
+    if (!as_list) {
+      PYGD_CHECK_ERROR(self->D, NULL);
+      /* resize, if necessary */
+      if (ns < num_samples) {
+        PyObject *check;
+        PyArray_Dims new_dims;
+
+        new_dims.ptr = dims;
+        new_dims.len = 1;
+        dims[0] = (npy_intp)ns;
+        check = PyArray_Resize((PyArrayObject*)pyobj, &new_dims, 0, NPY_ANYORDER);
+
+        if (check == NULL) /* error -- exception already raised */
+          return NULL;
+        Py_DECREF(check); /* Despite the docs, PyArray_Resize returns an INCREF'd Py_None on
+                             success */
+      }
+    } else
+#endif
+    {
+      PYGD_CHECK_ERROR2(self->D, NULL, free(data));
+      pyobj = gdpy_convert_to_pylist(data, return_type, ns);
+
+      free(data);
+    }
+  }
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getentry(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"field_code", NULL};
+  const char *field_code;
+  struct gdpy_entry_t *obj;
+  gd_entry_t *E;
+  int e;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.entry",
+        keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = malloc(sizeof(gd_entry_t));
+
+  if (E == NULL) {
+    PyErr_NoMemory();
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_entry(self->D, field_code, E);
+
+  if ((e = gd_error(self->D))) {
+    PYGD_REPORT_ERROR(self->D,e);
+    free(E);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+
+  obj = (struct gdpy_entry_t*)gdpy_entry.tp_alloc(&gdpy_entry, 0);
+
+  if (obj == NULL) {
+    PyErr_NoMemory();
+    gd_free_entry_strings(E);
+    free(E);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  obj->E = E;
+  Py_INCREF(obj);
+  dreturn("%p", obj);
+  return (PyObject*)obj;
+}
+
+static PyObject *gdpy_dirfile_geterror(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  PyObject *error;
+
+  dtrace("%p, %p", self, closure);
+
+  error = PyInt_FromLong(gd_error(self->D));
+
+  dreturn("%p", error);
+  return error;
+}
+
+static PyObject *gdpy_dirfile_geterrorcount(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  PyObject *count;
+
+  dtrace("%p, %p", self, closure);
+
+  count = PyInt_FromLong(gd_error_count(self->D));
+
+  dreturn("%p", count);
+  return count;
+}
+
+static PyObject *gdpy_dirfile_getfragment(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"fragment_index", NULL};
+  int fragment_index;
+  struct gdpy_fragment_t *obj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "i:pygetdata.dirfile.fragment",
+        keywords, &fragment_index))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  obj = (struct gdpy_fragment_t*)gdpy_fragment.tp_alloc(&gdpy_fragment, 0);
+
+  if (obj == NULL) {
+    PyErr_NoMemory();
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  obj->n = fragment_index;
+  obj->dirfile = self;
+
+  Py_INCREF(obj);
+  dreturn("%p", obj);
+  return (PyObject*)obj;
+}
+
+static PyObject *gdpy_dirfile_getfragmentindex(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"field_code", NULL};
+  const char *field_code;
+  PyObject *pyobj;
+  int index;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.fragment_index", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  index = gd_fragment_index(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong(index);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_geterrorstring(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  char *estring;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  estring = gd_error_string(self->D, NULL, 0);
+  pyobj = PyString_FromString(estring);
+  free(estring);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getvectorlist(struct gdpy_dirfile_t *self)
+{
+  const char **vectors;
+  PyObject *pyobj;
+
+  dtrace("%p", self);
+
+  vectors = gd_vector_list(self->D);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = gdpy_to_pystringlist(vectors);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getfieldlist(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  const char **fields;
+  char *keywords[] = { "type", NULL };
+  int type = (int)GD_NO_ENTRY;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "|i:pygetdata.dirfile.field_list", keywords, &type))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (type == GD_NO_ENTRY)
+    fields = gd_field_list(self->D);
+  else
+    fields = gd_field_list_by_type(self->D, (gd_type_t)type);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = gdpy_to_pystringlist(fields);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_flush(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code = NULL;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.flush",
+        keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_flush(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_sync(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code = NULL;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.sync",
+        keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_sync(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_raw_close(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code = NULL;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.raw_close",
+        keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_raw_close(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_include(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "file", "fragment_index", "flags", "prefix", "suffix",
+    NULL };
+  const char *file = NULL;
+  int fragment_index = 0;
+  unsigned int flags = 0;
+  char *prefix = NULL, *suffix = NULL;
+  long index;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s|iiss:pygetdata.dirfile.include", keywords, &file, &fragment_index,
+        &flags, &prefix, &suffix))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  self->callback_exception = 0;
+
+  index = gd_include_affix(self->D, file, fragment_index, prefix, suffix,
+      flags);
+
+  if (self->callback_exception) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong(index);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_madd(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "entry", "parent", NULL };
+  struct gdpy_entry_t *entry = NULL;
+  const char *parent;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "O!s:pygetdata.dirfile.madd",
+        keywords, &gdpy_entry, &entry, &parent))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_madd(self->D, entry->E, parent);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_maddspec(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "spec", "parent", NULL };
+  const char *spec;
+  const char *parent;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "ss:pygetdata.dirfile.madd_spec",
+        keywords, &spec, &parent))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_madd_spec(self->D, spec, parent);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_malterspec(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "spec", "parent", "recode", NULL };
+  const char *spec, *parent;
+  int recode = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "ss|i:pygetdata.dirfile.malter_spec", keywords, &spec, &parent,
+        &recode))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_malter_spec(self->D, spec, parent, recode);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_mcarrays(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"parent", "return_type", "as_list", NULL};
+  const char **fields;
+  const char *parent;
+  int as_list = 0, i;
+  gd_type_t return_type;
+  const gd_carray_t *carrays;
+  PyObject *pyobj;
+#ifdef USE_NUMPY
+  npy_intp dims[] = { 0 };
+#endif
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "si|i:pygetdata.dirfile.mcarrays", keywords, &parent, &return_type,
+        &as_list))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fields = gd_mfield_list_by_type(self->D, parent, GD_CARRAY_ENTRY);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  carrays = gd_mcarrays(self->D, parent, return_type);
+
+  pyobj = PyList_New(0);
+
+  for (i = 0; carrays[i].n != 0; ++i) {
+    PyObject *pydata;
+#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));
+  }
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getmconstants(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  int i;
+  char *keywords[] = {"parent", "return_type", NULL};
+  const char **fields;
+  const char *values;
+  const char *parent = NULL;
+  gd_type_t return_type;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "si:pygetdata.dirfile.mconstants", keywords, &parent, &return_type))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fields = gd_mfield_list_by_type(self->D, parent, GD_CONST_ENTRY);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  values = gd_mconstants(self->D, parent, return_type);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyList_New(0);
+
+  for (i = 0; fields[i] != NULL; ++i)
+    gdpylist_append(pyobj, Py_BuildValue("sN", fields[i],
+          gdpy_convert_to_pyobj(values + i * GD_SIZE(return_type),
+            return_type)));
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_metaflush(struct gdpy_dirfile_t *self)
+{
+  dtrace("%p", self);
+
+  gd_metaflush(self->D);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_getmfieldlist(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  const char **fields;
+  char *keywords[] = { "parent", "type", NULL };
+  const char *parent = NULL;
+  gd_entype_t type = GD_NO_ENTRY;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s|i:pygetdata.dirfile.field_list_by_type", keywords, &parent, &type))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (type == GD_NO_ENTRY)
+    fields = gd_mfield_list(self->D, parent);
+  else
+    fields = gd_mfield_list_by_type(self->D, parent, (gd_type_t)type);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = gdpy_to_pystringlist(fields);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getname(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  const char *name;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  name = gd_dirfilename(self->D);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyString_FromString(name);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getmstrings(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  int i;
+  char *keywords[] = {"parent", NULL};
+  const char **fields;
+  const char **values;
+  const char *parent = NULL;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.mstrings",
+        keywords, &parent))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fields = gd_mfield_list_by_type(self->D, parent, GD_STRING_ENTRY);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  values = gd_mstrings(self->D, parent);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyList_New(0);
+
+  for (i = 0; fields[i] != NULL; ++i)
+    gdpylist_append(pyobj, Py_BuildValue("ss", fields[i], values[i]));
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getmvectorlist(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"parent", NULL};
+  const char *parent = NULL;
+  const char **fields;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.mvector_list", keywords, &parent))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fields = gd_mvector_list(self->D, parent);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = gdpy_to_pystringlist(fields);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getrawfilename(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  const char *filename;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.raw_filename", keywords, &field_code))
+  {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  filename = gd_raw_filename(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyString_FromString(filename);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getnativetype(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  PyObject *pyobj;
+  gd_type_t ntype;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.native_type", keywords, &field_code))
+  {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  ntype = gd_native_type(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong((long)ntype);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getnativetypename(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  char tbuffer[11];
+  PyObject *pyobj;
+  gd_type_t t;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.native_type_name", keywords, &field_code))
+  {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  t = gd_native_type(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  sprintf(tbuffer, "%s%i", ((t & GD_COMPLEX) ? "COMPLEX" :
+        (t & GD_IEEE754) ? "FLOAT" : (t & GD_SIGNED) ?  "INT" : "UINT"),
+      (int)(8 * GD_SIZE(t)));
+
+  pyobj = PyString_FromString(tbuffer);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getnfields(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  unsigned int nfields;
+  char *keywords[] = { "type", NULL };
+  int type = GD_NO_ENTRY;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "|i:pygetdata.dirfile.nfields",
+        keywords, &type))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (type == GD_NO_ENTRY)
+    nfields = gd_nfields(self->D);
+  else
+    nfields = gd_nfields_by_type(self->D, (gd_entype_t)type);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong((long)nfields);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getnfragments(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  long nfragments;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  nfragments = gd_nfragments(self->D);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong(nfragments);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getnframes(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  off_t nframes;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  nframes = gd_nframes(self->D);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyLong_FromLongLong(nframes);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getnmfields(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "parent", "type", NULL };
+  const char *parent = NULL;
+  int type = GD_NO_ENTRY;
+  unsigned int nmfields;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s|i:pygetdata.dirfile.nmfields",
+        keywords, &parent, &type))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (type == GD_NO_ENTRY)
+    nmfields = gd_nmfields(self->D, parent);
+  else
+    nmfields = gd_nmfields_by_type(self->D, parent, (gd_type_t)type);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong((long)nmfields);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getnmvectors(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "parent", NULL };
+  const char *parent = NULL;
+  PyObject *pyobj;
+  unsigned int nmvectors;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.nmvectors", keywords, &parent))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  nmvectors = gd_nmvectors(self->D, parent);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong((long)nmvectors);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getbof(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  off_t bof;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.bof", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  bof = gd_bof(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyLong_FromLongLong(bof);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_geteof(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  PyObject *pyobj;
+  off_t eof;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.eof", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  eof = gd_eof(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyLong_FromLongLong(eof);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getnvectors(struct gdpy_dirfile_t *self)
+{
+  unsigned int nvectors;
+  PyObject *pyobj;
+
+  dtrace("%p", self);
+
+  nvectors = gd_nvectors(self->D);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong((long)nvectors);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getreference(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  const char *ref;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  ref = gd_reference(self->D, NULL);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  /* Empty dirfile */
+  if (ref == NULL) {
+    Py_INCREF(Py_None);
+    dreturn("%p", Py_None);
+    return Py_None;
+  }
+
+  pyobj = PyString_FromString(ref);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_dirfile_setreference(struct gdpy_dirfile_t *self,
+    PyObject *value, void *closure)
+{
+  const char *ref;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  ref = PyString_AsString(value);
+
+  /* TypeError already raised on error */
+  if (ref == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gd_reference(self->D, ref);
+
+  PYGD_CHECK_ERROR(self->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_dirfile_getstring(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  PyObject *pyobj;
+  size_t len;
+  char *data;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.get_string",
+        keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  len = gd_get_string(self->D, field_code, 0, NULL);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  data = malloc(len);
+  if (data == NULL) {
+    PyErr_NoMemory();
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_get_string(self->D, field_code, len, data);
+
+  PYGD_CHECK_ERROR2(self->D, NULL, free(data));
+
+  pyobj = PyString_FromString(data);
+
+  free(data);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getstrings(struct gdpy_dirfile_t *self)
+{
+  int i;
+  const char **fields;
+  const char **values;
+  PyObject *pyobj;
+
+  dtrace("%p", self);
+
+  fields = gd_field_list_by_type(self->D, GD_STRING_ENTRY);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  values = gd_strings(self->D);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyList_New(0);
+
+  for (i = 0; fields[i] != NULL; ++i)
+    gdpylist_append(pyobj, Py_BuildValue("ss", fields[i], values[i]));
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_putconstant(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = {"field_code", "value", "type", NULL};
+  const char *field_code;
+  PyObject *value;
+  gd_type_t type = GD_UNKNOWN;
+  union gdpy_quadruple_value data;
+  int data_type;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "sO|i:pygetdata.dirfile.put_constant", keywords, &field_code, &value,
+        &type))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  data_type = gdpy_convert_from_pyobj(value, &data, type);
+
+  if (data_type == -1) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if ((data_type & 0xf) == GDPY_SIGNED)
+    gd_put_constant(self->D, field_code, GD_INT64, &data.s);
+  else if ((data_type & 0xf) == GDPY_IEEE754)
+    gd_put_constant(self->D, field_code, GD_FLOAT64, &data.f);
+  else if ((data_type & 0xf) == GDPY_COMPLEX)
+    gd_put_constant(self->D, field_code, GD_COMPLEX128, &data.c);
+  else
+    gd_put_constant(self->D, field_code, GD_UINT64, &data.u);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_putcarray(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", "data", "type", "start", NULL };
+  const char *field_code;
+  unsigned int start = 0, len;
+  gd_type_t type = GD_UNKNOWN;
+  PyObject *pyobj;
+#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,
+        &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,
+          "pygetdata.dirfile.put_carray() argument 2 must be one dimensional");
+      dreturn("%p", NULL);
+      return NULL;
+    }
+    have_ndarray = 1;
+    len = PyArray_DIM(pyobj, 0);
+  } else
+#endif
+  {
+    if (!PyList_Check(pyobj)) {
+      PyErr_SetString(PyExc_TypeError,
+          "pygetdata.dirfile.put_carray() argument 2 must be list"
+#ifdef USE_NUMPY
+          " or NumPy array"
+#endif
+          ".");
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    len = PyList_Size(pyobj);
+  }
+
+  if (len > 0) {
+    void *data;
+
+#ifdef USE_NUMPY
+    if (have_ndarray) {
+      type = gdpy_type_from_npytype(PyArray_TYPE(pyobj));
+
+      if (type == GD_UNKNOWN) {
+        PyErr_SetString(PyExc_ValueError,
+            "pygetdata.dirfile.put_carray() unknown data type for argument 2.");
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+
+      if (!(PyArray_FLAGS(pyobj) & NPY_ALIGNED)) {
+        PyErr_SetString(PyExc_ValueError,
+            "pygetdata.dirfile.put_carray() argument 2 must be aligned.");
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+
+      if (!(PyArray_FLAGS(pyobj) & NPY_C_CONTIGUOUS)) {
+        PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.put_carray()"
+            " argument 2 must be C-style contiguous.");
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+
+      data = PyArray_DATA(pyobj);
+    } else
+#endif
+    {
+      data = malloc(len * 16);
+      type = gdpy_convert_from_pylist(pyobj, data, type, len);
+
+      if (type == GD_UNKNOWN) {
+        PyErr_SetString(PyExc_ValueError,
+            "pygetdata.dirfile.put_carray() unknown data type for argument 2.");
+        free(data);
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+    }
+
+    gd_put_carray_slice(self->D, field_code, start, len, type, data);
+
+#ifdef USE_NUMPY
+    if (have_ndarray)
+      PYGD_CHECK_ERROR(self->D, NULL);
+    else
+#endif
+    {
+      PYGD_CHECK_ERROR2(self->D, NULL, free(data));
+
+      free(data);
+    }
+  }
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_putdata(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", "data", "type", "first_frame",
+    "first_sample", NULL };
+  const char *field_code;
+  off_t first_frame = 0, first_sample = 0;
+  gd_type_t type = GD_UNKNOWN;
+  PyObject *pyobj;
+  size_t ns;
+#ifdef USE_NUMPY
+  int have_ndarray = 0;
+#endif
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "sO|iLL:pygetdata.dirfile.putdata", keywords, &field_code, &pyobj,
+        &type, &first_frame, &first_sample)) {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  /* we only handle list or ndarray data */
+#ifdef USE_NUMPY
+  if (PyArray_Check(pyobj)) {
+    if (PyArray_NDIM(pyobj) != 1) {
+      PyErr_SetString(PyExc_ValueError,
+          "pygetdata.dirfile.putdata() argument 2 must be one dimensional");
+      dreturn("%p", NULL);
+      return NULL;
+    }
+    have_ndarray = 1;
+    ns = PyArray_DIM(pyobj, 0);
+  } else
+#endif
+  {
+    if (!PyList_Check(pyobj)) {
+      PyErr_SetString(PyExc_TypeError,
+          "pygetdata.dirfile.putdata() argument 2 must be list"
+#ifdef USE_NUMPY
+          " or NumPy array"
+#endif
+          ".");
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    ns = PyList_Size(pyobj);
+  }
+
+  if (ns > 0) {
+    void *data;
+
+#ifdef USE_NUMPY
+    if (have_ndarray) {
+      type = gdpy_type_from_npytype(PyArray_TYPE(pyobj));
+
+      if (type == GD_UNKNOWN) {
+        PyErr_SetString(PyExc_ValueError,
+            "pygetdata.dirfile.putdata() unknown data type for argument 2.");
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+
+      if (!(PyArray_FLAGS(pyobj) & NPY_ALIGNED)) {
+        PyErr_SetString(PyExc_ValueError,
+            "pygetdata.dirfile.putdata() argument 2 must be aligned.");
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+
+      if (!(PyArray_FLAGS(pyobj) & NPY_C_CONTIGUOUS)) {
+        PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.putdata()"
+            " argument 2 must be C-style contiguous.");
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+
+      data = PyArray_DATA(pyobj);
+    } else
+#endif
+    {
+      data = malloc(ns * 16);
+      type = gdpy_convert_from_pylist(pyobj, data, type, ns);
+
+      if (type == GD_UNKNOWN) {
+        PyErr_SetString(PyExc_ValueError,
+            "pygetdata.dirfile.putdata() unknown data type for argument 2.");
+        free(data);
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+    }
+
+    ns = gd_putdata(self->D, field_code, first_frame, first_sample, 0, ns, type,
+        data);
+
+#ifdef USE_NUMPY
+    if (have_ndarray)
+      PYGD_CHECK_ERROR(self->D, NULL);
+    else
+#endif
+    {
+      PYGD_CHECK_ERROR2(self->D, NULL, free(data));
+
+      free(data);
+    }
+  }
+
+  pyobj = PyLong_FromLongLong(ns);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_putstring(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", "data", NULL };
+  const char *field_code;
+  const char *data;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "ss:pygetdata.dirfile.put_string", keywords, &field_code, &data))
+  {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  gd_put_string(self->D, field_code, data);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_getspf(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  PyObject *pyobj;
+  unsigned int spf;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.spf",
+        keywords, &field_code)) {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  spf = gd_spf(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong((long)spf);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_validate(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.validate",
+        keywords, &field_code)) {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  gd_validate(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_getframenum(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", "value", "start", "end", NULL };
+  const char *field_code;
+  double value, frame;
+  off_t frame_start = 0;
+  off_t 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,
+        &frame_start, &frame_end))
+  {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+ frame = gd_framenum_subset(self->D, field_code, value, frame_start, frame_end);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyFloat_FromDouble(frame);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_callback(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  PyObject *pycallback = NULL;
+  PyObject *pycallback_data = Py_None;
+  char *keywords[] = {"callback", "extra", NULL};
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "OO:pygetdata.dirfile.set_callback", keywords, &pycallback,
+        &pycallback_data))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (pycallback && pycallback != Py_None && !PyCallable_Check(pycallback)) {
+    PyErr_SetString(PyExc_TypeError, "callback function must be callable");
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  Py_XINCREF(pycallback);
+  Py_XINCREF(pycallback_data);
+  Py_XDECREF(self->callback);
+  Py_XDECREF(self->callback_data);
+  self->callback = pycallback;
+  self->callback_data = pycallback_data;
+
+  gd_parser_callback(self->D, (pycallback == NULL) ? NULL :
+      gdpy_callback_func, self);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_uninclude(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = {"fragment_index", "del", NULL};
+  int fragment_index;
+  int del = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "i|i:pygetdata.dirfile.uninclude", keywords, &fragment_index, &del))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_uninclude(self->D, fragment_index, del);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_move(struct gdpy_dirfile_t *self, PyObject *args,
+    PyObject *keys)
+{
+  char *keywords[] = { "field_code", "new_fragment", "move_data", NULL };
+  const char *field_code;
+  int new_fragment;
+  int move_data = 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)) {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  gd_move(self->D, field_code, new_fragment, move_data);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_rename(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "old_code", "new_name", "flags", NULL };
+  const char *old_code;
+  const char *new_name;
+  unsigned flags = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "ss|I:pygetdata.dirfile.rename",
+        keywords, &old_code, &new_name, &flags)) {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  gd_rename(self->D, old_code, new_name, flags);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_getstandards(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  int vers;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  vers = gd_dirfile_standards(self->D, GD_VERSION_CURRENT);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong(vers);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_dirfile_setstandards(struct gdpy_dirfile_t *self,
+    PyObject *value, void *closure)
+{
+  int vers;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  vers = (int)PyInt_AsLong(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gd_dirfile_standards(self->D, vers);
+
+  PYGD_CHECK_ERROR(self->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_dirfile_seek(struct gdpy_dirfile_t *self, PyObject *args,
+    PyObject *keys)
+{
+  char *keywords[] = { "field_code", "flags", "frame_num", "sample_num", NULL };
+  const char *field_code;
+  PY_LONG_LONG frame_num = 0, sample_num = 0;
+  int flags;
+  off_t pos;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "si|LL:pygetdata.dirfile.seek",
+        keywords, &field_code, &flags, &frame_num, &sample_num))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  pos = gd_seek(self->D, field_code, (off_t)frame_num, (off_t)sample_num,
+      flags);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyLong_FromLongLong((long long)pos);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_tell(struct gdpy_dirfile_t *self, PyObject *args,
+    PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  off_t pos;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.tell",
+        keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  pos = gd_tell(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyLong_FromLongLong((long long)pos);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_hide(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.hide", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_hide(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_unhide(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.unhide", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_unhide(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_naliases(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  PyObject *pyobj;
+  long naliases;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.naliases", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  naliases = gd_naliases(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong(naliases);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_aliastarget(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code, *target;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.alias_target", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  target = gd_alias_target(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyString_FromString(target);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_hidden(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  PyObject *pyobj;
+  long hidden;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.hidden", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  hidden = gd_hidden(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong(hidden);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_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)
+{
+  const char **fields;
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.alias_list", keywords, &field_code))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fields = gd_aliases(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = gdpy_to_pystringlist(fields);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_addalias(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = { "field_code", "target", "fragment_index", NULL };
+  const char *field_code, *target;
+  int fragment_index = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "ss|i:pygetdata.dirfile.add_alias", keywords, &field_code, &target,
+        &fragment_index))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_add_alias(self->D, field_code, target, fragment_index);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_maddalias(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *keywords[] = { "parent", "field_code", "target", NULL };
+  const char *field_code, *target, *parent;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "sss:pygetdata.dirfile.madd_alias", keywords, &parent, &field_code,
+        &target))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_madd_alias(self->D, parent, field_code, target);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_dirfile_strtok(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  char *token;
+  char *keywords[] = { "string", NULL };
+  const char *string = NULL;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.strtok",
+        keywords, &string))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  token = gd_strtok(self->D, string);
+
+  pyobj = PyString_FromString(token);
+  free(token);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_desync(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  int ret;
+  char *keywords[] = { "flags", NULL };
+  unsigned int flags = 0;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "|I:pygetdata.dirfile.desync",
+        keywords, &flags))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  ret = gd_desync(self->D, flags);
+
+  pyobj = PyInt_FromLong((long)ret);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_getflags(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  PyObject *pyobj;
+  unsigned long flags;
+
+  dtrace("%p, %p", self, closure);
+
+  flags = gd_flags(self->D, 0, 0);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyLong_FromUnsignedLong(flags);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_dirfile_setflags(struct gdpy_dirfile_t *self,
+    PyObject *value, void *closure)
+{
+  unsigned long new_flags;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  new_flags = PyLong_AsUnsignedLong(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gd_flags(self->D, new_flags, ~new_flags);
+
+  PYGD_CHECK_ERROR(self->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_dirfile_getverboseprefix(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->verbose_prefix == NULL) {
+    Py_INCREF(Py_None);
+    dreturn("%p", Py_None);
+    return Py_None;
+  }
+
+  pyobj = PyString_FromString(self->verbose_prefix);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_dirfile_setverboseprefix(struct gdpy_dirfile_t *self,
+    PyObject *value, void *closure)
+{
+  dtrace("%p, %p, %p", self, value, closure);
+
+  free(self->verbose_prefix);
+  if (value == Py_None)
+    self->verbose_prefix = NULL;
+  else {
+    char *string = PyString_AsString(value);
+    if (string == NULL) {
+      dreturn("%i", -1);
+      return -1;
+    }
+    self->verbose_prefix = strdup(string);
+  }
+
+  gd_verbose_prefix(self->D, self->verbose_prefix);
+
+  PYGD_CHECK_ERROR(self->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_dirfile_getmplexlookback(struct gdpy_dirfile_t *self,
+    void *closure)
+{
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  pyobj = PyInt_FromLong(self->mplex_lookback);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_dirfile_setmplexlookback(struct gdpy_dirfile_t *self,
+    PyObject *value, void *closure)
+{
+  int lookback;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  lookback = (int)PyInt_AsLong(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->mplex_lookback = lookback;
+
+  gd_mplex_lookback(self->D, lookback);
+
+  PYGD_CHECK_ERROR(self->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_dirfile_nentries(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "parent", "type", "flags", NULL };
+  unsigned int nentries, flags = 0;
+  int type = 0;
+  const char *parent = NULL;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "|siI:pygetdata.dirfile.nentries", keywords, &parent, &type, &flags))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  nentries = gd_nentries(self->D, parent, type, flags);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyInt_FromLong((long)nentries);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_entrylist(struct gdpy_dirfile_t *self,
+    void *args, void *keys)
+{
+  const char **entries;
+  char *keywords[] = { "parent", "type", "flags", NULL };
+  int type = 0;
+  unsigned int flags = 0;
+  const char *parent = NULL;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "|siI:pygetdata.dirfile.entry_list", keywords, &parent, &type, &flags))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  entries = gd_entry_list(self->D, parent, type, flags);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = gdpy_to_pystringlist(entries);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_dirfile_linterptablename(struct gdpy_dirfile_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "field_code", NULL };
+  const char *field_code;
+  char *filename;
+  PyObject *pyobj;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "s:pygetdata.dirfile.linterp_tablename", keywords, &field_code))
+  {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+
+  filename = gd_linterp_tablename(self->D, field_code);
+
+  PYGD_CHECK_ERROR(self->D, NULL);
+
+  pyobj = PyString_FromString(filename);
+  free(filename);
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyGetSetDef gdpy_dirfile_getset[] = {
+  { "error", (getter)gdpy_dirfile_geterror, NULL,
+    "The numerical error code encountered by the last call to the GetData\n"
+      "library for this dirfile.  If the last call was successful, this\n"
+      "will be zero.  Because pygetdata throws exceptions on GetData\n"
+      "errors, it is typically not necessary to check this value; use a\n"
+      "try/except statement instead.  See gd_error(3).",
+    NULL },
+  { "error_count", (getter)gdpy_dirfile_geterrorcount, NULL,
+    "The number of errors encountered by the GetData library for this\n"
+      "dirfile since the last time this member was accessed.  Note:\n"
+      "accessing this member, resets it to zero.  See gd_error_count(3).",
+    NULL },
+  { "error_string", (getter)gdpy_dirfile_geterrorstring, NULL,
+    "A human-readable description of the last error encountered by the\n"
+      "GetData library for this dirfile.  See gd_error_string(3).",
+    NULL },
+  { "flags", (getter)gdpy_dirfile_getflags, (setter)gdpy_dirfile_setflags,
+    "The operational flags of the open dirfile.  This contains a subset\n"
+      "of the dirfile creation flags specified when the object was\n"
+      "instantiated.  See gd_flags(3).", NULL },
+  { "name", (getter)gdpy_dirfile_getname, NULL,
+    "The name of the Dirfile.  See gd_dirfilename(3).",
+    NULL },
+  { "nfragments", (getter)gdpy_dirfile_getnfragments, NULL,
+    "The number of format file fragments in the dirfile.  See\n"
+      "gd_nfragments(3)",
+    NULL },
+  { "nframes", (getter)gdpy_dirfile_getnframes, NULL,
+    "The number of frames in the dirfile.  See gd_nframes(3).", NULL },
+  { "reference", (getter)gdpy_dirfile_getreference,
+    (setter)gdpy_dirfile_setreference,
+    "The reference field for the dirfile, which may be set to any existing\n"
+      "RAW field.  If no RAW fields are defined in the dirfile, this will\n"
+      "be None.  See gd_reference(3).",
+      /* ------- handy ruler ---------------------------------------------| */
+    NULL },
+  { "standards", (getter)gdpy_dirfile_getstandards,
+    (setter)gdpy_dirfile_setstandards,
+    "The current Standards Version of the loaded dirfile.  Setting this\n"
+      "to pygetdata.VERSION_EARLIEST or pygetdata.VERSION_LATEST has the\n"
+      "same effect as passing the corresponding C API symbols to\n"
+      "gd_dirfile_standards(3), q.v.",
+    NULL },
+  {"verbose_prefix", (getter)gdpy_dirfile_getverboseprefix,
+    (setter)gdpy_dirfile_setverboseprefix,
+      "If opened with pygetdata::VERBOSE, a string prefixed to error\n"
+        "messages printed by the library, or None, if no prefix is\n"
+        "defined.  See gd_verbose_prefix(3)."
+  },
+  {"mplex_lookback", (getter)gdpy_dirfile_getmplexlookback,
+    (setter)gdpy_dirfile_setmplexlookback,
+      "The number of MPLEX cycles to search before the requested start of\n"
+        "the returned data when reading data from a MPLEX field.  Set\n"
+        "to zero to disable lookback, or to -1 to make the lookback\n"
+        "unlimited.  See gd_mplex_lookback(3) for the definition of a\n"
+        "\"MPLEX cycle\"."
+  },
+  { NULL }
+};
+
+static PyMethodDef gdpy_dirfile_methods[] = {
+  {"add", (PyCFunction)gdpy_dirfile_add, METH_VARARGS | METH_KEYWORDS,
+    "add(entry)\n\n"
+      "Add a field described by 'entry', which should be a pygetdata.entry\n"
+      "object, to the database.  See gd_add(3)."
+  },
+  {"add_spec", (PyCFunction)gdpy_dirfile_addspec, METH_VARARGS | METH_KEYWORDS,
+    "add_spec(line [, fragment_index])\n\n"
+      "Add a field described by the field specification line 'line' to the\n"
+      "database, by adding it to the format file fragment indexed by\n"
+      "'fragment_index', which defaults to 0, if not given.  See\n"
+      "gd_add_spec(3)."
+  },
+  {"alter", (PyCFunction)gdpy_dirfile_alter, METH_VARARGS | METH_KEYWORDS,
+    "alter(field_code, entry [, recode])\n\n"
+      "Modify the field metadata of the field specified by 'field_code',\n"
+      "as described by 'entry', which should be a pygetdata.entry object.\n"
+      "If recode is given and is non-zero, the data on disk will also be\n"
+      "updated, if relevant, to reflect changes in the field metatdata.\n"
+      "The entry.name and entry.fragment_index data descriptors are ignored\n"
+      "by this function.  To rename or change the fragment of a field\n"
+      "use the rename() or move() methods. See gd_alter_entry(3)."
+  },
+  {"alter_spec", (PyCFunction)gdpy_dirfile_alterspec, METH_VARARGS |
+    METH_KEYWORDS, "alter_spec(line [, recode])\n\n"
+      "Modify the field metadata described by the field specification line\n"
+      "'line'.  If recode is given and is non-zero, the data on disk will\n"
+      "also be updated, if relevant, to reflect changes in the field\n"
+      "metadata.  See gd_alter_spec(3)."
+  },
+  {"close", (PyCFunction)gdpy_dirfile_close, METH_NOARGS,
+    "close()\n\n"
+      "Flush all pending changes to disk (as if flush() were called) and\n"
+      "then close the dirfile.  It is not normally necessary to call this\n"
+      "method explicitly: the dirfile will be closed when the dirfile\n"
+      "object is destroyed.  After successful completion, the dirfile will\n"
+      "be invalidated, prohibiting further use of this object.  See\n"
+      "gd_close(3)."
+  },
+  {"delete", (PyCFunction)gdpy_dirfile_delentry, METH_VARARGS | METH_KEYWORDS,
+    "delete(field_code [, flags])\n\n"
+      "Delete the field 'field_code' from the database.  If 'flags' is\n"
+      "omitted, it is assumed to be zero.  Otherwise, 'flags' should be a\n"
+      "bitwise or'd collection of the pygetdata.DEL_* symbols, whose\n"
+      "meanings are described in the gd_delete manual page.  See\n"
+      "gd_delete(3)."
+  },
+  {"discard", (PyCFunction)gdpy_dirfile_discard, METH_NOARGS,
+    "discard()\n\n"
+      "Discard pending metatdata changes to the dirfile (data changes are\n"
+      "still written) and then close the dirfile.  After this method\n"
+      "successfully returns, the dirfile will be invalidated, prohibiting\n"
+      "further use of this object.  Call this method if you don't want the\n"
+      "object to implicitly call gd_close() when it is deleted.  See\n"
+      "gd_discard(3)."
+  },
+  {"flush", (PyCFunction)gdpy_dirfile_flush, METH_VARARGS | METH_KEYWORDS,
+    "flush([field_code])\n\n"
+      "Equivalent to sync([field_code]) && raw_close([field_code]).\n"
+      "See gd_flush(3)."
+  },
+  {"bof", (PyCFunction)gdpy_dirfile_getbof, METH_VARARGS | METH_KEYWORDS,
+    "bof(field_code)\n\n"
+      "Retrieve the sample number corresponding to the beginning-of-field\n"
+      "marker for the field specified by 'field_code'.  See gd_bof(3)."
+  },
+  {"get_carray", (PyCFunction)gdpy_dirfile_getcarray,
+    METH_VARARGS | METH_KEYWORDS,
+    "get_carray(field_code, return_type [, start, len, as_list])\n\n"
+      "Retrieve the value of the CARRAY field specified by 'field_code'.\n"
+      "The 'return_type' parameter indicates the desired type of the\n"
+      "elements of the array returned, and should be (typically) one of:\n"
+      "pygetdata.INT, pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT,\n"
+      "or pygetdata.COMPLEX, although any GetData data type code is\n"
+      "permitted.  If NumPy support is present in pygetdata, and 'as_list'\n"
+      "is not given or is zero, a NumPy array will be returned.  Otherwise\n"
+      "a list of values will be returned.\n\n"
+      "The first element returned is given by 'start', counting from zero.\n"
+      "If omitted, zero is assumed.  The number of elements returned is\n"
+      "given by 'len'.  If omitted or zero, all elements from 'start' to\n"
+      "the end of the array are returned.  See gd_get_carray_slice(3)."
+  },
+  {"get_constant", (PyCFunction)gdpy_dirfile_getconstant,
+    METH_VARARGS | METH_KEYWORDS,
+    "get_constant(field_code, return_type)\n\n"
+      "Retrieve the value of the CONST field specified by 'field_code'.\n"
+      "The 'return_type' parameter indicates the desired type of the object\n"
+      "returned, and should be (typically) one of: pygetdata.INT,\n"
+      "pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n"
+      "pygetdata.COMPLEX, although any GetData data type code is permitted.\n"
+      "See gd_get_constant(3)."
+  },
+  {"constants", (PyCFunction)gdpy_dirfile_getconstants,
+    METH_VARARGS | METH_KEYWORDS,
+    "constants(return_type)\n\n"
+      "Retrieve all CONST fields, and their values.  A list of tuples\n"
+      "will be returned, each tuple containing the name and value of the\n"
+      "field.  The 'return_type' parameter indicates the desired type of\n"
+      "the values returned, and should be (typically) one of:\n"
+      "pygetdata.INT, pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n"
+      "pygetdata.COMPLEX, although any GetData data type code is permitted.\n"
+      "See gd_constants(3), but note that this method returns both names\n"
+      "and values, unlike the C API counterpart."
+  },
+  {"carray_len", (PyCFunction)gdpy_dirfile_carraylen, METH_VARARGS |
+    METH_KEYWORDS,
+    "carray_len(field_code)\n\n"
+      "Returns the length of the CARRAY specified by 'field_code'.  See\n"
+      "gd_carray_len(3)."
+  },
+  {"carrays", (PyCFunction)gdpy_dirfile_carrays, METH_VARARGS | METH_KEYWORDS,
+    "carrays(return_type [, as_list])\n\n"
+      "Retrieve all CARRAY fields, and their values.  A list of tuples\n"
+      "will be returned, each tuple containing the name and values of the\n"
+      "field.  If NumPy support is present in pygetdata, and 'as_list' is\n"
+      "not given or zero, the values will be returned in NumPy arrays;\n"
+      "otherwise, the values will be returned as lists.\n\n"
+      "The 'return_type' parameter indicates the desired type of the values\n"
+      "returned, and should be (typically) one of: pygetdata.INT,\n"
+      "pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n"
+      "pygetdata.COMPLEX, although any GetData data type code is permitted.\n"
+      "See gd_carrays(3), but note that this method returns both names\n"
+      "and values, unlike the C API counterpart."
+  },
+  {"getdata", (PyCFunction)gdpy_dirfile_getdata, METH_VARARGS | METH_KEYWORDS,
+    "getdata(field_code [, return_type, first_frame, first_sample,\n"
+      "num_frames, num_samples, as_list])\n\n"
+      "Retrieve a data vector from the dirfile.  If NumPy support is\n"
+      "present in pygetdata, and 'as_list' is not given or zero, a NumPy\n"
+      "array will be returned.  Otherwise a list of data values will\n"
+      "be returned.  NumPy arrays should be preferred for large datasets:\n"
+      "they are more efficient both in terms of memory usage and retrieval\n"
+      "time.\n\n"
+      "The 'return_type' parameter indicates the desired type of the values\n"
+      "returned.  For NumPy data, the NumPy array will have the dtype\n"
+      "indicated.  For list data it should be (typically) one of:\n"
+      "pygetdata.INT, pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n"
+      "pygetdata.COMPLEX, although any GetData data type code is permitted.\n"
+      "If omitted, the return type defaults to the native type of the field\n"
+      "(see dirfile.native_type()).\n\n"
+      "The 'first_frame' and 'first_sample' parameters indicate first\n"
+      "datum to read.  If they are both omitted, data is read from the\n"
+      "first sample.  Similarly, 'num_frames' and 'num_samples' indicate\n"
+      "the amount of data.  Omitting both is equivalent to setting\n"
+      "'num_frames' to dirfile.nframes (ie. all available data).  Fewer\n"
+      "samples than requested may be returned without causing an error.\n"
+      "See gd_getdata(3)."
+  },
+  { "entry", (PyCFunction)gdpy_dirfile_getentry,
+    METH_VARARGS | METH_KEYWORDS,
+    "entry(field_code)\n\n"
+      "Retrieve the field metadata for the specified 'field_code'.  A\n"
+      "pygetdata.entry object is returned.  See gd_entry(3).\n"
+  },
+  {"eof", (PyCFunction)gdpy_dirfile_geteof, METH_VARARGS | METH_KEYWORDS,
+    "eof(field_code)\n\n"
+      "Retrieve the sample number corresponding to the end-of-field marker\n"
+      "(ie. the number of samples in the field) for the field specified by\n"
+      "'field_code'.  See gd_eof(3)."
+  },
+  { "field_list", (PyCFunction)gdpy_dirfile_getfieldlist,
+    METH_VARARGS | METH_KEYWORDS,
+    "field_list([entry_type])\n\n"
+      "Return a list of field names.  If 'entry_type' is given, it should\n"
+      "be one of the pygetdata.*_ENTRY symbols.  If 'entry_type' is not\n"
+      "given, or is pygetdata.NO_ENTRY, all fields in the database are\n"
+      "returned.  Otherwise, only the fields of the given type are\n"
+      "returned.  See gd_field_list(3) and gd_field_list_by_type(3)."
+  },
+  { "fragment", (PyCFunction)gdpy_dirfile_getfragment,
+    METH_VARARGS | METH_KEYWORDS,
+    "fragment(fragment_index)\n\n"
+      "Retrieve the metadata associated with the format file fragment\n"
+      "indexed by 'fragment_index'.  A pygetdata.fragment object is\n"
+      "returned."
+  },
+  {"fragment_index", (PyCFunction)gdpy_dirfile_getfragmentindex,
+    METH_VARARGS | METH_KEYWORDS,
+    "fragment_index(field_code)\n\n"
+      "Return the fragment index of the format file fragment which defines\n"
+      "the field specified by 'field_code'.  See gd_fragment_index(3)."
+  },
+  {"framenum", (PyCFunction)gdpy_dirfile_getframenum,
+    METH_VARARGS | METH_KEYWORDS,
+    "framenum(field_code, value [, start, end])\n\n"
+      "Perform a reverse look-up on the field specified by 'field_code'\n"
+      "(which must be monotonic) and returns the fractional frame number\n"
+      "where the field equals 'value'.  The search is performed between\n"
+      "the frame limits 'start' and 'end'.  If 'start' is omitted, the\n"
+      "search begins at the first sample.  If 'end' is omitted, the search\n"
+      "ends at the last sample.  See gd_framenum_subset(3)."
+  },
+  {"hidden", (PyCFunction)gdpy_dirfile_hidden, METH_VARARGS | METH_KEYWORDS,
+    "hidden(field_code)\n\n"
+      "Returns true if field_code (alias or real field) is hidden  See \n"
+      "gd_hidden(3)."
+  },
+  {"hide", (PyCFunction)gdpy_dirfile_hide, METH_VARARGS | METH_KEYWORDS,
+    "hide(field_code)\n\n"
+      "Sets the hidden flag on the specified field.  See gd_hide(3)."
+  },
+  {"linterp_tablename", (PyCFunction)gdpy_dirfile_linterptablename,
+    METH_VARARGS | METH_KEYWORDS,
+    "linterp_tablename(field_code)\n\n"
+      "Return the pathname of the look-up table (LUT) on disk used by the\n"
+      "LINTERP field specified by 'field_code'.  See\n"
+      "gd_linterp_tablename(3)."
+  },
+  {"mcarrays", (PyCFunction)gdpy_dirfile_mcarrays, METH_VARARGS | METH_KEYWORDS,
+    "mcarrays(parent, return_type [, as_list])\n\n"
+      "Retrieve all CARRAY metafields, and their values, for the parent\n"
+      "field 'parent'.  A list of tuples will be returned, each tuple\n"
+      "containing the name and values of the field.  If NumPy support is\n"
+      "present in pygetdata, and 'as_list' is not given or zero, the values\n"
+      "will be returned in NumPy arrays; otherwise, the values will be\n"
+      "returned as lists.\n\n"
+      "The 'return_type' parameter indicates the desired type of the values\n"
+      "returned, and should be (typically) one of: pygetdata.INT,\n"
+      "pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n"
+      "pygetdata.COMPLEX, although any GetData data type code is permitted.\n"
+      "See gd_mcarrays(3), but note that this method returns both names\n"
+      "and values, unlike the C API counterpart."
+  },
+  {"mconstants", (PyCFunction)gdpy_dirfile_getmconstants,
+    METH_VARARGS | METH_KEYWORDS,
+    "mconstants(parent, return_type)\n\n"
+      "Retrieve all CONST metafields defined for the parent field 'parent',\n"
+      "and their values.  A list of tuples will be returned, each tuple\n"
+      "containing the name and value of a field.  The 'return_type'\n"
+      "parameter indicates the desired type of the values returned, and\n"
+      "should be (typically) one of: pygetdata.INT, pygetdata.LONG,\n"
+      "pygetdata.ULONG, pygetdata.FLOAT, or pygetdata.COMPLEX, although any\n"
+      "GetData data type code is permitted.  See gd_mconstants(3), but\n"
+      "note that this method returns both names and values, unlike the\n"
+      "C API counterpart."
+  },
+  { "mfield_list", (PyCFunction)gdpy_dirfile_getmfieldlist,
+    METH_VARARGS | METH_KEYWORDS,
+    "mfield_list(parent [, entry_type])\n\n"
+      "Return a list of metafield names for the parent field 'parent'.  If\n"
+      "'entry_type' is given, it should be one of the pygetdata.*_ENTRY\n"
+      "symbols.  If 'entry_type' is not given, or is pygetdata.NO_ENTRY,\n"
+      "all metafields for the given parent field are returned.  Otherwise,\n"
+      "only the metafields of the given type are returned.  See\n"
+      "gd_mfield_list(3) and gd_mfield_list_by_type(3)."
+  },
+  {"mstrings", (PyCFunction)gdpy_dirfile_getmstrings,
+    METH_VARARGS | METH_KEYWORDS,
+    "mstrings(parent, return_type)\n\n"
+      "Retrieve all STRING metafields defined for the parent field\n"
+      "'parent', and their values.  A list of tuples will be returned, each\n"
+      "tuple containing the name and value of a field.  See\n"
+      "gd_mstrings(3), but note that this method returns both names and\n"
+      "values, unlike the C API counterpart."
+  },
+  { "mvector_list", (PyCFunction)gdpy_dirfile_getmvectorlist,
+    METH_VARARGS | METH_KEYWORDS,
+    "mvector_list(parent)\n\n"
+      "Retrieve a list of all vector type metafields (that is: BIT, DIVIDE,\n"
+      "LINCOM, LINTERP, MPLEX, MULTIPLY, PHASE, POLYNOM, RECIP, SBIT, and\n"
+      "WINDOW metafields) for the parent field 'parent'.  See\n"
+      "gd_mvector_list(3)."
+  },
+  {"native_type", (PyCFunction)gdpy_dirfile_getnativetype,
+    METH_VARARGS | METH_KEYWORDS,
+    "native_type(field_code)\n\n"
+      "Retrieve the native data type of the field specified by\n"
+      "'field_code'.  The return value will be one of the data type codes:\n"
+      "pygetdata.UINT8, pygetdata.INT8, &c.  The native_type_name\n"
+      "method behaves identically, but returns a human-readable string\n"
+      "describing the data type.  See gd_native_type(3)."
+  },
+  {"native_type_name", (PyCFunction)gdpy_dirfile_getnativetypename,
+    METH_VARARGS | METH_KEYWORDS,
+    "native_type_name(field_code)\n\n"
+      "Retrieve the native data type of the field specified by\n"
+      "'field_code'.  The return value will be a string describing the\n"
+      "data type: 'UINT8', 'INT8', &c.  The native_type method behaves\n"
+      "identically, but returns a numeric data type code.  See\n"
+      "gd_native_type(3)."
+  },
+  {"nentries", (PyCFunction)gdpy_dirfile_nentries, METH_VARARGS | METH_KEYWORDS,
+    "nentries([parent, type, flags])\n\n"
+      "Return a count of entries in the database.  If 'parent' is given,\n"
+      "metafields under 'parent' will be considered, otherwise top-level\n"
+      "fields are counted.  If given, 'type' should be either one of the\n"
+      "the pygetdata.*_ENTRY symbols, or else one of the special\n"
+      "pygetdata.*_ENTRIES symbols; if not given, 'type' defaults to\n"
+      "pygetdata.ALL_ENTRIES.  If given 'flags' should be a bitwise or'd\n"
+      "collection of zero or more of the pygetdata.ENTRIES_* flags.\n"
+      "See gd_nentries(3)."
+  },
+  {"nfields", (PyCFunction)gdpy_dirfile_getnfields,
+    METH_VARARGS | METH_KEYWORDS,
+    "nfields([entry_type])\n\n"
+      "Return the number of fields in the database.  If 'entry_type' is\n"
+      "given, it should be one of the pygetdata.*_ENTRY symbols.  If\n"
+      "'entry_type' is not given, or is pygetdata.NO_ENTRY, the total\n"
+      "number of fields in the database is returned.  Otherwise, only\n"
+      "the number of fields of the given type is returned.  See\n"
+      "gd_nfields(3) and gd_nfields_by_type(3)."
+  },
+  {"nmfields", (PyCFunction)gdpy_dirfile_getnmfields,
+    METH_VARARGS | METH_KEYWORDS,
+    "nmfields(parent [, entry_type])\n\n"
+      "Return the number of metafields defined for the parent field\n"
+      "'parent'.  If 'entry_type' is given, it should be one of the\n"
+      "pygetdata.*_ENTRY symbols.  If 'entry_type' is not given, or is\n"
+      "pygetdata.NO_ENTRY, the total number of metafields for this parent\n"
+      "is returned.  Otherwise, only the number of metafields of the given\n"
+      "type is returned.  See gd_nmfields(3) and gd_nmfields_by_type(3)."
+  },
+  {"nmvectors", (PyCFunction)gdpy_dirfile_getnmvectors,
+    METH_VARARGS | METH_KEYWORDS,
+    "nmvectors(parent)\n\n"
+      "Return the number of vector type metafields (that is: BIT, DIVIDE,\n"
+      "LINCOM, LINTERP, MPLEX, MULTIPLY, PHASE, POLYNOM, RECIP, SBIT, and\n"
+      "WINDOW metafields) for the parent field 'parent'.  See\n"
+      "gd_nmvectors(3)."
+  },
+  {"nvectors", (PyCFunction)gdpy_dirfile_getnvectors, METH_NOARGS,
+    "nvectors()\n\n"
+      "Return the number of vector type fields (that is: BIT, DIVIDE,\n"
+      "INDEX, LINCOM, LINTERP, MPLEX, MULTIPLY, PHASE, POLYNOM, RAW, RECIP,\n"
+      "SBIT, and WINDOW fields) defined in the database.  See\n"
+      "gd_nvectors(3)."
+  },
+  {"raw_filename", (PyCFunction)gdpy_dirfile_getrawfilename,
+    METH_VARARGS | METH_KEYWORDS,
+    "raw_filename(field_code)\n\n"
+      "Return the pathname of the data file on disk backing the RAW field\n"
+      "specified by 'field_code'.  See gd_raw_filename(3)."
+  },
+  {"spf", (PyCFunction)gdpy_dirfile_getspf, METH_VARARGS | METH_KEYWORDS,
+    "spf(field_code)\n\n"
+      "Return the number of samples per frame of the field specified by\n"
+      "field code.  See gd_spf(3)."
+  },
+  {"get_string", (PyCFunction)gdpy_dirfile_getstring,
+    METH_VARARGS | METH_KEYWORDS,
+    "get_string(field_code)\n\n"
+      "Retrieve the value of the STRING field specified by 'field_code'.\n"
+      "See gd_get_string(3)."
+  },
+  { "strings", (PyCFunction)gdpy_dirfile_getstrings, METH_NOARGS,
+    "strings()\n\n"
+      "Retrieve all STRING fields defined in the database.  A list of\n"
+      "tuples will be returned, each tuple containing the name and value of\n"
+      "a field.  See gd_strings(3), but note that this method returns both\n"
+      "names and values, unlike the C API counterpart."
+  },
+  { "vector_list", (PyCFunction)gdpy_dirfile_getvectorlist, METH_NOARGS,
+    "vector_list()\n\n"
+      "Retrieve a list of all vector type fields (that is: BIT, DIVIDE,\n"
+      "INDEX, LINCOM, LINTERP, MPLEX, MULTIPLY, PHASE, POLYNOM, RAW, RECIP,\n"
+      "SBIT, and WINDOW metafields) defined in the database.  See\n"
+      "gd_vector_list(3)."
+  },
+  {"include", (PyCFunction)gdpy_dirfile_include, METH_VARARGS | METH_KEYWORDS,
+    "include(filename [, fragment_index, flags, prefix, suffix])\n\n"
+      "Add (and possibly create) a new format file fragment specified by\n"
+      "'filename' to the database, as an include in the existing fragment\n"
+      "indexed by 'fragment_index'.  If 'fragment_index' is not given,\n"
+      "zero is assumed (ie. the primary format file).  If 'flags' is given,\n"
+      "it should be a bitwise or'd collection of flags listed in the\n"
+      "gd_include manual page.  If 'prefix' or 'suffix' are given, they\n"
+      "will be applied to the field codes defined in the file.  See\n"
+      "gd_include_affix(3)."
+  },
+  {"madd", (PyCFunction)gdpy_dirfile_madd, METH_VARARGS | METH_KEYWORDS,
+    "madd(entry, parent)\n\n"
+      "Add a field described by 'entry', which should be a pygetdata.entry\n"
+      "object, to the database as a metafield under the parent field given\n"
+      "by 'parent'.  See gd_madd(3)."
+  },
+  {"madd_spec", (PyCFunction)gdpy_dirfile_maddspec,
+    METH_VARARGS | METH_KEYWORDS,
+    "madd_spec(line, parent)\n\n"
+      "Add a field described by the field specification line 'line' to the\n"
+      "database as a metafield under the parent field given by 'parent'.\n"
+      "See gd_madd_spec(3)."
+  },
+  {"malter_spec", (PyCFunction)gdpy_dirfile_malterspec,
+    METH_VARARGS | METH_KEYWORDS,
+    "malter_spec(line, parent [, recode])\n\n"
+      "Modify the metadata described by the field specification line\n"
+      "'line' for a metafield under the parent field 'parent'.  If recode\n"
+      "is given and is non-zero, the data on disk will also be updated, if\n"
+      "relevant, to reflect changes in the metafield metadata.  See\n"
+      "gd_malter_spec(3)."
+  },
+  {"metaflush", (PyCFunction)gdpy_dirfile_metaflush, METH_NOARGS,
+    "metaflush()\n\n"
+      "Flush all pending metadata changes to disk.  See gd_metaflush(3)."
+  },
+  {"move", (PyCFunction)gdpy_dirfile_move, METH_VARARGS | METH_KEYWORDS,
+    "move(field_code, new_fragment [, move_data])\n\n"
+      "Move the specification of the field given by 'field_code' to the\n"
+      "format file fragment indexed by 'new_fragment'.  If 'move_data' is\n"
+      "given and is non-zero, and 'field_code' specifies a RAW field, the\n"
+      "associated file on disk will also be moved, if necessary.  See\n"
+      "gd_move(3)."
+  },
+  {"put_carray", (PyCFunction)gdpy_dirfile_putcarray,
+    METH_VARARGS | METH_KEYWORDS,
+    "put_carray(field_code, data [, start])\n\n"
+      "Store the data in the list or NumPy array 'data' in the CARRAY given\n"
+      "by 'field_code'.  If a list is provided, all entries must be of the\n"
+      "same type.  The parameter 'start' indicates where the first sample\n"
+      "in which the data will be stored.  Zero is assumed if not given.\n"
+      "See gd_put_carray_slice(3)."
+  },
+  {"put_constant", (PyCFunction)gdpy_dirfile_putconstant,
+    METH_VARARGS | METH_KEYWORDS,
+    "put_constant(field_code, value [, type])\n\n"
+      "Store the value of 'value' in the CONST field given by 'field_code'.\n"
+      "The 'value' parameter must be a simple numeric type.  This method\n"
+      "will use the most appropriate data type when passing the value to\n"
+      "the C API.  However, this behaviour can be overridden by explicitly\n"
+      "specifying a C API type for the data using 'type'.  If specified,\n"
+      "'type' should be one of the data type codes: pygetdata.UINT8,\n"
+      "pygetdata.INT8, &c.  Note that this does not affect the storage type\n"
+      "of the CONST field, merely how the data is transferred to the C API.\n"
+      "See gd_put_constant(3)."
+  },
+  {"putdata", (PyCFunction)gdpy_dirfile_putdata, METH_VARARGS | METH_KEYWORDS,
+    "putdata(field_code, data [, type, first_frame, first_sample])\n\n"
+      "Store the data in the list or NumPy array 'data' in the vector field\n"
+      "given by 'field_code'.  If a list is provided, all entries must be\n"
+      "of the same type.  The parameters 'first_frame' and 'first_sample'\n"
+      "indicate the first sample in which the data will be stored.  If\n"
+      "neither are given, the data will be stored starting from the first\n"
+      "sample in the field.  The number of samples actually written is\n"
+      "returned.\n\n"
+      "This method will use the most appropriate data type when passing the\n"
+      "data to the C API.  However, this behaviour can be overridden by\n"
+      "explicitly specifying a C API type for the data using 'type'.  If\n"
+      "specified, 'type' should be one of the data type codes:\n"
+      "pygetdata.UINT8, pygetdata.INT8, &c.  Note that this does not affect\n"
+      "the storage type of the field, merely how the data is transferred to\n"
+      "the C API.  See gd_putdata(3)."
+  },
+  {"put_string", (PyCFunction)gdpy_dirfile_putstring,
+    METH_VARARGS | METH_KEYWORDS,
+    "put_string(field_code, value)\n\n"
+      "Store the string given by 'value' in the STRING field specified by\n"
+      "'field_code'.  See gd_put_string(3)."
+  },
+  {"rename", (PyCFunction)gdpy_dirfile_rename, METH_VARARGS | METH_KEYWORDS,
+    "rename(old_code, new_name [, flags])\n\n"
+      "Change the name of the field specified by 'old_code' to 'new_name'.\n"
+      "If 'flags' is given and is non-zero, it should be a bitwise or'd\n"
+      "collection of the pygetdat.REN_* symbols.  See gd_rename(3)."
+  },
+  {"seek", (PyCFunction)gdpy_dirfile_seek, METH_VARARGS | METH_KEYWORDS,
+    "seek(field_code, flags [, frame_num, sample_num])\n\n"
+      "Set the field pointer of the field specified by 'field_code'.  The\n"
+      "'frame_num' and 'sample_num' parameters indicate desired position.\n"
+      "If they are both omitted, the field pointer is set to sample zero.\n"
+      "The 'flags' parameter must contain one of pygetdata.SEEK_SET,\n"
+      "pygetdata.SEEK_CUR and pygetdata.SEEK_END, which may be bitwise or'd\n"
+      "with pygetdata.SEEK_PAD.  See gd_seek(3)."
+  },
+  {"set_callback", (PyCFunction)gdpy_dirfile_callback,
+    METH_VARARGS | METH_KEYWORDS,
+    "set_callback(sehandler, extra)\n\n"
+      "Change or remove the parser callback function, and the caller object\n"
+      "passed to it.  If 'sehandler' is None, the current parser callback\n"
+      "(if any) will be removed, otherwise, the current callback will be\n"
+      "replaced by 'sehandler', which must be a callable object.  The\n"
+      "'extra' parameter is any object which will be passed to the callback\n"
+      "handler, or None, if no such object is needed.  See\n"
+      "gd_parser_callback(3)."
+  },
+  {"tell", (PyCFunction)gdpy_dirfile_tell, METH_VARARGS | METH_KEYWORDS,
+    "tell(field_code)\n\n"
+      "Report the current position of the field pointer of 'field_code'.\n"
+      "See gd_tell(3)."
+  },
+  {"unhide", (PyCFunction)gdpy_dirfile_unhide, METH_VARARGS | METH_KEYWORDS,
+    "unhide(field_code)\n\n"
+      "Clears the hidden flag on the specified field.  See gd_unhide(3)."
+  },
+  {"uninclude", (PyCFunction)gdpy_dirfile_uninclude,
+    METH_VARARGS | METH_KEYWORDS,
+    "uninclude(fragment_index [, del])\n\n"
+      "Remove the format file fragment indexed by 'fragment_index' from the\n"
+      "database.  If 'del' is given, and is non-zero, the file will also be\n"
+      "deleted from disk.  This also removes all field defined in the\n"
+      "specified fragment from the database.  See gd_uninclude(3)."
+  },
+  {"validate", (PyCFunction)gdpy_dirfile_validate, METH_VARARGS | METH_KEYWORDS,
+    "validate(field_code)\n\n"
+      "Check whether the field specified by 'field_code' is valid for\n"
+      "reading and writing.  Throws an error if it is not.  See\n"
+      "gd_validate(3)."
+  },
+  {"sync", (PyCFunction)gdpy_dirfile_sync, METH_VARARGS | METH_KEYWORDS,
+    "sync([field_code])\n\n"
+      "Flush pending writes to the specified field to disk.  This does\n"
+      "not flush pending metadata changes.  For that, use metaflush.\n"
+      "However, if field_code is omitted, all data *and* metadata will be\n"
+      "written to disk.  See gd_sync(3)."
+  },
+  {"raw_close", (PyCFunction)gdpy_dirfile_raw_close,
+    METH_VARARGS | METH_KEYWORDS,
+    "raw_close([field_code])\n\n"
+      "Close any open raw data files associated with field_code, freeing\n"
+      "resources which may be used for other purposes.  If field_code is\n"
+      "omitted, all open raw data files are closed.  See gd_raw_close(3)."
+  },
+  {"naliases", (PyCFunction)gdpy_dirfile_naliases, METH_VARARGS | METH_KEYWORDS,
+    "naliases(field_code)\n\n"
+      "This function returns the number of aliases defined for the specified\n"
+      "field.  If field_code is valid, this will be at least one.  See\n"
+      "gd_naliases(3)."
+  },
+  {"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"
+      "Returns the target of the alias specified by 'field_code'.\n"
+      "See gd_alias_target(3)."
+  },
+  {"aliases", (PyCFunction)gdpy_dirfile_aliaslist, METH_VARARGS | METH_KEYWORDS,
+    "aliases(field_code)\n\n"
+      "Returns a list of aliases for 'field_code'.  If successful, the\n"
+      "list returned will always contain at least one entry, field_code\n"
+      "itself.  See gd_alias_list(3)."
+  },
+  {"add_alias", (PyCFunction)gdpy_dirfile_addalias,
+    METH_VARARGS | METH_KEYWORDS,
+    "add_alias(field_code, target [, fragment_index])\n\n"
+      "Adds a new alias called 'field_code' pointing to 'target' to the\n"
+      "fragment indexed by 'fragment_index', which defaults to 0 if not\n"
+      "given.  See gd_add_alias(3)."
+  },
+  {"madd_alias", (PyCFunction)gdpy_dirfile_maddalias,
+    METH_VARARGS | METH_KEYWORDS,
+    "add_alias(parent, field_code, target)\n\n"
+      "Adds a new alias called 'field_code' pointing to 'target' as a\n"
+      "metalias under 'parent'.  See gd_madd_alias(3)."
+  },
+  {"strtok", (PyCFunction)gdpy_dirfile_strtok, METH_VARARGS | METH_KEYWORDS,
+    "strtok([string])\n\n"
+      "If 'string' is given, runs the GetData tokeniser on 'string' and\n"
+      "returns the first token.  If 'string' is not given, returns\n"
+      "subsequent tokens (one per call) of the last string that was\n"
+      "provided.  Note: an error will result if the string being parsed\n"
+      "goes out of scope.  See gd_strtok(3)."
+  },
+  {"desync", (PyCFunction)gdpy_dirfile_desync, METH_VARARGS | METH_KEYWORDS,
+    "desync([flags])\n\n"
+      "Returns non-zero if the metadata on disk has changed since the\n"
+      "dirfile was opened, and optionally automatically reloads it.  If\n"
+      "given, flags should be a bitwise or'd  collection of the\n"
+      "pygetdata.DESYNC_... flags.  See gd_desync(3)."
+  },
+  {"entry_list", (PyCFunction)gdpy_dirfile_entrylist,
+    METH_VARARGS | METH_KEYWORDS,
+    "entry_list([parent, type, flags])\n\n"
+      "Return a list of entry names in the database.  If 'parent' is\n"
+      "given metafields under 'parent' will be considered, otherwise\n"
+      "top-level entries are returned.  If given, 'type' should be either\n"
+      "one of the the pygetdata.*_ENTRY symbols, or else one of the\n"
+      "special pygetdata.*_ENTRIES symbols; if not given, 'type' defaults\n"
+      "to pygetdata.ALL_ENTRIES.  If given 'flags' should be a bitwise\n"
+      "or'd collection of zero or more of the pygetdata.ENTRIES_* flags.\n"
+      "See gd_entry_list(3)."
+  },
+  { NULL, NULL, 0, NULL }
+};
+
+#define DIRFILE_DOC \
+  "dirfile([name [, flags [, sehandler [, extra ]]])\n\n" \
+"If 'name' is omitted or None, returns an invalid dirfile, as if\n" \
+"gd_invalid_dirfile(3) were called.  Othwerwise, if 'name' is a string,\n" \
+"returns a dirfile object representing the dirfile specified by 'name'.\n" \
+"The dirfile is opened by a call to gd_cbopen(3).  See that manual page\n" \
+"for full details on arguments.  If present, 'flags' should be a bitwise\n" \
+"or'd collection of gd_cbopen flags.  If it is omitted, the default,\n" \
+"pygetdata.RDONLY, is used.\n\n" \
+"If a callback handler is desired, 'sehandler' should be a callable\n"\
+"object (ie. a function) which accepts two objects.  The first object is\n"\
+"a dictionary with keys: 'suberror', 'line', 'linenum', and 'filename',\n"\
+"providing the same information as the gd_pdata_t structure in the C API.\n"\
+"The second object is the 'extra' object passed to this constructor, and\n"\
+"may be any object desired by the caller.  If no extra parameter was\n"\
+/* ---------------------------------------------------------------------| */\
+"specified, this will be None.  The sehandler should return either:\n\n"\
+" * an integer, one of the pygetdata.SYNTAX_... symbols; or\n"\
+" * a string containing the corrected line, and pygetdata.SYNTAX_RESCAN\n"\
+"   is assumed; or\n"\
+" * a tuple consisting of an integer, one of the pygetdata.SYNTAX_...\n"\
+"   symbols, and then, optionally, a string containing the corrected\n"\
+"   line.\n"\
+"\n"\
+"The dirfile will be automatically closed when garbage collection is run\n"\
+"on the object.  In general, however, an explicit call to close() or\n"\
+"discard() is preferable on a writeable dirfile, since the implicit close\n"\
+"performed on the dirfile when the object is deleted silently discards\n"\
+"any errors encountered when the dirfile is flushed to disc.  After\n"\
+"explicitly calling close() or discard(), the dirfile will be\n"\
+"invalidated, prohibiting further use of it.\n"
+
+
+PyTypeObject gdpy_dirfile =
+{
+  PyObject_HEAD_INIT(NULL)
+    0,                             /* ob_size */
+  "pygetdata.dirfile",             /* tp_name */
+  sizeof(struct gdpy_dirfile_t),   /* tp_basicsize */
+  0,                               /* tp_itemsize */
+  (destructor)gdpy_dirfile_delete, /* tp_dealloc */
+  0,                               /* tp_print */
+  0,                               /* tp_getattr */
+  0,                               /* tp_setattr */
+  0,                               /* tp_compare */
+  0,                               /* tp_repr */
+  0,                               /* tp_as_number */
+  0,                               /* tp_as_sequence */
+  0,                               /* tp_as_mapping */
+  0,                               /* tp_hash */
+  0,                               /* tp_call */
+  0,                               /* tp_str */
+  0,                               /* tp_getattro */
+  0,                               /* tp_setattro */
+  0,                               /* tp_as_buffer */
+  Py_TPFLAGS_DEFAULT,              /* tp_flags */
+  DIRFILE_DOC,                     /* tp_doc */
+  0,                               /* tp_traverse */
+  0,                               /* tp_clear */
+  0,                               /* tp_richcompare */
+  0,                               /* tp_weaklistoffset */
+  0,                               /* tp_iter */
+  0,                               /* tp_iternext */
+  gdpy_dirfile_methods,            /* tp_methods */
+  0,                               /* tp_members */
+  gdpy_dirfile_getset,             /* tp_getset */
+  0,                               /* tp_base */
+  0,                               /* tp_dict */
+  0,                               /* tp_descr_get */
+  0,                               /* tp_descr_set */
+  0,                               /* tp_dictoffset */
+  (initproc)gdpy_dirfile_init,     /* tp_init */
+  0,                               /* tp_alloc */
+  gdpy_dirfile_create,             /* tp_new */
+};
diff --git a/bindings/python/pyentry.c b/bindings/python/pyentry.c
new file mode 100644
index 0000000..19494bb
--- /dev/null
+++ b/bindings/python/pyentry.c
@@ -0,0 +1,2485 @@
+/* Copyright (C) 2009-2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#define NO_IMPORT_ARRAY
+#include "pygetdata.h"
+
+static const char *gdpy_entry_type_names[] =
+{
+  "NO_ENTRY",       /* 0x00 */
+  "RAW_ENTRY",      /* 0x01 */
+  "LINCOM_ENTRY",   /* 0x02 */
+  "LINTERP_ENTRY",  /* 0x03 */
+  "BIT_ENTRY",      /* 0x04 */
+  "MULTIPLY_ENTRY", /* 0x05 */
+  "PHASE_ENTRY",    /* 0x06 */
+  "INDEX_ENTRY",    /* 0x07 */
+  "POLYNOM_ENTRY",  /* 0x08 */
+  "SBIT_ENTRY",     /* 0x09 */
+  "DIVIDE_ENTRY",   /* 0x0A */
+  "RECIP_ENTRY",    /* 0x0B */
+  "WINDOW_ENTRY",   /* 0x0C */
+  "MPLEX_ENTRY",    /* 0x0D */
+  NULL,             /* 0x0E - unused */
+  NULL,             /* 0x0F - unused */
+  "CONST_ENTRY",    /* 0x10 */
+  "STRING_ENTRY",   /* 0x11 */
+  "CARRAY_ENTRY",   /* 0x12 */
+};
+
+/* Entry */
+static char *gdpy_dup_pystring(PyObject *obj)
+{
+  char *s;
+
+  dtrace("%p", obj);
+
+  s = PyString_AsString(obj);
+
+  if (s != NULL) {
+    s = strdup(s);
+
+    if (s == NULL)
+      PyErr_NoMemory();
+  }
+
+  dreturn("%p", s);
+  return s;
+}
+
+static void gdpy_entry_delete(struct gdpy_entry_t *self)
+{
+  dtrace("%p", self);
+
+  gd_free_entry_strings(self->E);
+  free(self->E);
+
+  dreturnvoid();
+}
+
+static PyObject *gdpy_entry_create(PyTypeObject *type, PyObject *args,
+    PyObject *keys)
+{
+  struct gdpy_entry_t *self;
+
+  dtrace("%p, %p, %p", type, args, keys);
+
+  self = (struct gdpy_entry_t*)type->tp_alloc(type, 0);
+
+  if (self) {
+    self->E = NULL;
+  }
+
+  dreturn("%p", self);
+  return (PyObject*)self;
+}
+
+static void gdpy_set_scalar_from_pyobj(PyObject *pyobj, gd_type_t type,
+    char **scalar, void *data)
+{
+  dtrace("%p, %x, %p, %p", pyobj, type, scalar, data);
+  /* FIXME */
+
+  if (PyString_Check(pyobj))
+    *scalar = gdpy_dup_pystring(pyobj);
+  else {
+    *scalar = NULL;
+    switch (type) {
+      case GD_UINT8:
+        *(uint8_t*)data = (uint8_t)PyInt_AsUnsignedLongMask(pyobj);
+        break;
+      case GD_INT8:
+        *(int8_t*)data = (int8_t)PyInt_AsLong(pyobj);
+        break;
+      case GD_UINT16:
+        *(uint16_t*)data = (uint16_t)PyInt_AsUnsignedLongMask(pyobj);
+        break;
+      case GD_INT16:
+        *(int16_t*)data = (int16_t)PyInt_AsLong(pyobj);
+        break;
+      case GD_UINT32:
+        *(uint32_t*)data = (uint32_t)PyLong_AsUnsignedLong(pyobj);
+        break;
+      case GD_INT32:
+        *(int32_t*)data = (int32_t)PyLong_AsLong(pyobj);
+        break;
+      case GD_UINT64:
+        if (PyLong_Check(pyobj))
+          *(uint64_t*)data = PyLong_AsUnsignedLongLong(pyobj);
+        else
+          *(uint64_t*)data = PyInt_AsUnsignedLongLongMask(pyobj);
+        break;
+      case GD_INT64:
+        *(int64_t*)data = (int64_t)PyLong_AsLongLong(pyobj);
+        break;
+      case GD_FLOAT32:
+        *(float*)data = (float)PyFloat_AsDouble(pyobj);
+        break;
+      case GD_FLOAT64:
+        *(double*)data = PyFloat_AsDouble(pyobj);
+        break;
+      case GD_COMPLEX64:
+        gdpy_as_complex((float*)data, pyobj);
+        break;
+      case GD_COMPLEX128:
+        gdpy_as_complex((double*)data, pyobj);
+        break;
+      default:
+        PyErr_Format(PyExc_RuntimeError,
+              "unexpected field type (%x) inside %s", type, __func__);
+    }
+  }
+
+  dreturnvoid();
+}
+
+static void gdpy_set_entry_from_tuple(gd_entry_t *E, PyObject *tuple,
+    const char *name)
+{
+  PyObject *parm1;
+  PyObject *parm2;
+  PyObject *parm3;
+  PyObject *obj;
+  int i, count, size, min;
+
+  dtrace("%p, %p, \"%s\"", E, tuple, name);
+
+  switch (E->field_type)
+  {
+    case GD_INDEX_ENTRY:
+    case GD_STRING_ENTRY:
+      min = 0;
+      break;
+    case GD_CONST_ENTRY:
+      min = 1;
+      break;
+    case GD_RAW_ENTRY:
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_RECIP_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_CARRAY_ENTRY:
+      min = 2;
+      break;
+    case GD_LINCOM_ENTRY:
+      min = 3;
+      break;
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      min = 4;
+      break;
+    default:
+      PyErr_Format(PyExc_TypeError, "%s: unrecognised field type", name);
+      dreturnvoid();
+      return;
+  }
+
+  if (min == 0) { /* nothing to do */
+    dreturnvoid();
+    return;
+  }
+
+  size = PyTuple_Size(tuple);
+  if (size < min) {
+    PyErr_Format(PyExc_TypeError, "'pygetdata.entry' "
+        "%s: needed %d entry parameters, but got only %d",
+        name, min, size);
+    dreturnvoid();
+    return;
+  }
+
+  switch (E->field_type)
+  {
+    case GD_RAW_ENTRY:
+      E->EN(raw,data_type) = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0));
+      if (GDPY_INVALID_TYPE(E->EN(raw,data_type)))
+        PyErr_SetString(PyExc_ValueError,
+            "'pygetdata.entry' invalid data type");
+
+      gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_UINT_TYPE,
+          &E->scalar[0], &E->EN(raw,spf));
+      break;
+    case GD_LINCOM_ENTRY:
+      parm1 = PyTuple_GetItem(tuple, 0);
+      parm2 = PyTuple_GetItem(tuple, 1);
+      parm3 = PyTuple_GetItem(tuple, 2);
+      if (!PyTuple_Check(parm1) || !PyTuple_Check(parm2) ||
+          !PyTuple_Check(parm3))
+      {
+        PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+            "LINCOM parameters must be tuples");
+        dreturnvoid();
+        return;
+      }
+
+      count = E->EN(lincom,n_fields) = PyTuple_Size(parm1);
+      if (count > GD_MAX_LINCOM)
+        count = GD_MAX_LINCOM;
+
+      if (PyTuple_Size(parm2) < count || PyTuple_Size(parm3) < count) {
+        PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+            "Missing data in LINCOM parameters");
+        dreturnvoid();
+        return;
+      }
+
+      for (i = 0; i < count; ++i) {
+        E->in_fields[i] = gdpy_dup_pystring(PyTuple_GetItem(parm1, i));
+
+        if (PyErr_Occurred()) {
+          dreturnvoid();
+          return;
+        }
+
+        obj = PyTuple_GetItem(parm2, i);
+        if (PyComplex_Check(obj)) {
+          E->comp_scal = 1;
+          gdpy_as_complex(gd_csp_(E->EN(lincom,cm)[i]), obj);
+        } else if (E->comp_scal)
+          gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i],
+              &E->EN(lincom,cm)[i]);
+        else {
+          gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i],
+              &E->EN(lincom,m)[i]);
+          gd_rs2cs_(E->EN(lincom,cm)[i], E->EN(lincom,m)[i]);
+        }
+
+        if (PyErr_Occurred()) {
+          dreturnvoid();
+          return;
+        }
+
+        obj = PyTuple_GetItem(parm3, i);
+        if (PyComplex_Check(obj)) {
+          E->comp_scal = 1;
+          gdpy_as_complex(gd_csp_(E->EN(lincom,cb)[i]), obj);
+        } else if (E->comp_scal)
+          gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128,
+              &E->scalar[i + GD_MAX_LINCOM], &E->EN(lincom,cb)[i]);
+        else {
+          gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64,
+              &E->scalar[i + GD_MAX_LINCOM], &E->EN(lincom,b)[i]);
+          gd_rs2cs_(E->EN(lincom,cb)[i], E->EN(lincom,b)[i]);
+        }
+
+        if (PyErr_Occurred()) {
+          dreturnvoid();
+          return;
+        }
+      }
+      break;
+    case GD_LINTERP_ENTRY:
+      E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      E->EN(linterp,table) = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_INT_TYPE,
+          &E->scalar[0], &E->EN(bit,bitnum));
+      if (size > 2)
+        gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 2), GD_INT_TYPE,
+            &E->scalar[1], &E->EN(bit,numbits));
+      else {
+        E->EN(bit,numbits) = 1;
+        E->scalar[1] = NULL;
+      }
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      E->in_fields[1] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+      break;
+    case GD_RECIP_ENTRY:
+      E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      obj = PyTuple_GetItem(tuple, 1);
+      if (PyComplex_Check(obj)) {
+        E->comp_scal = 1;
+        gdpy_as_complex(gd_csp_(E->EN(recip,cdividend)), obj);
+      } else if (E->comp_scal)
+        gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[0],
+            &E->EN(recip,cdividend));
+      else {
+        gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[0],
+            &E->EN(recip,dividend));
+        gd_rs2cs_(E->EN(recip,cdividend), E->EN(recip,dividend));
+      }
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+      break;
+    case GD_PHASE_ENTRY:
+      E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_INT64,
+          &E->scalar[0], &E->EN(phase,shift));
+      break;
+    case GD_POLYNOM_ENTRY:
+      parm2 = PyTuple_GetItem(tuple, 1);
+      if (!PyTuple_Check(parm2)) {
+        PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+            "POLYNOM requires a tuple of co-efficients");
+        dreturnvoid();
+        return;
+      }
+
+      E->EN(polynom,poly_ord) = count = PyTuple_Size(parm2) - 1;
+      if (count > GD_MAX_POLYORD)
+        count = GD_MAX_POLYORD;
+
+      E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      for (i = 0; i <= count; ++i) {
+        obj = PyTuple_GetItem(parm2, i);
+        if (PyComplex_Check(obj)) {
+          E->comp_scal = 1;
+          gdpy_as_complex(gd_csp_(E->EN(polynom,ca)[i]), obj);
+          E->scalar[i] = NULL;
+        } else if (E->comp_scal)
+          gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i],
+              &E->EN(polynom,ca)[i]);
+        else {
+          gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i],
+              &E->EN(polynom,a)[i]);
+          gd_rs2cs_(E->EN(polynom,ca)[i], E->EN(polynom,a)[i]);
+        }
+
+        if (PyErr_Occurred()) {
+          dreturnvoid();
+          return;
+        }
+      }
+      break;
+    case GD_WINDOW_ENTRY:
+      E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      E->in_fields[1] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      E->EN(window,windop) =
+        (gd_windop_t)PyInt_AsLong(PyTuple_GetItem(tuple, 2));
+      if (GDPY_INVALID_OP(E->EN(window,windop)))
+        PyErr_SetString(PyExc_ValueError,
+            "'pygetdata.entry' invalid window operation");
+
+      obj = PyTuple_GetItem(tuple, 3);
+      switch (E->EN(window,windop)) {
+        case GD_WINDOP_EQ:
+        case GD_WINDOP_NE:
+          gdpy_set_scalar_from_pyobj(obj, GD_INT64, &E->scalar[0],
+              &E->EN(window,threshold).i);
+          break;
+        case GD_WINDOP_SET:
+        case GD_WINDOP_CLR:
+          gdpy_set_scalar_from_pyobj(obj, GD_UINT64, &E->scalar[0],
+              &E->EN(window,threshold).u);
+          break;
+        default:
+          gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[0],
+              &E->EN(window,threshold).r);
+          break;
+      }
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+      break;
+    case GD_MPLEX_ENTRY:
+      E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      E->in_fields[1] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1));
+
+      if (PyErr_Occurred()) {
+        dreturnvoid();
+        return;
+      }
+
+      gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 2), GD_INT_TYPE,
+          &E->scalar[0], &E->EN(mplex,count_val));
+
+      gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 3), GD_INT_TYPE,
+          &E->scalar[1], &E->EN(mplex,period));
+      break;
+    case GD_CARRAY_ENTRY:
+      E->EN(scalar,array_len) =
+        (size_t)PyLong_AsUnsignedLong(PyTuple_GetItem(tuple, 1));
+      /* fallthrough */
+    case GD_CONST_ENTRY:
+      E->EN(scalar,const_type) =
+        (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0));
+      if (GDPY_INVALID_TYPE(E->EN(scalar,const_type)))
+        PyErr_SetString(PyExc_ValueError,
+            "'pygetdata.entry' invalid data type");
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_INDEX_ENTRY:
+      break;
+  }
+
+  dreturnvoid();
+}
+
+static void gdpy_set_entry_from_dict(gd_entry_t *E, PyObject *parms,
+    const char *name)
+{
+  PyObject *tuple = Py_None;
+  const char *key[4];
+  int i, size = 0;
+
+  dtrace("%p, %p, \"%s\"", E, parms, name);
+
+  /* convert the dictionary to a tuple */
+
+  /* variadic objects for entry types:
+   * RAW:      type, spf                   = 2
+   * LINCOM:   in_fields, m, b             = 3
+   * LINTERP:  in_field, table             = 2
+   * (S)BIT:   in_field, bitnum, (numbits) = 2/3
+   * PHASE:    in_field, shift             = 2
+   * MULTIPLY: in_field1, in_field2        = 2
+   * DIVIDE:   in_field1, in_field2        = 2
+   * RECIP:    in_field, dividend          = 2
+   * POLYNOM:  in_field, a                 = 2
+   * WINDOW:   in_field1, in_field2, op, thresh = 4
+   * MPLEX:    in_field1, in_field2, val, max = 4
+   * CONST:    type                        = 1
+   * CARRAY:   type, array_len             = 2
+   * STRING:   (none)                      = 0
+   * INDEX:    (none)                      = 0
+   */
+
+  switch(E->field_type)
+  {
+    case GD_RAW_ENTRY:
+      key[0] = "type";
+      key[1] = "spf";
+      size = 2;
+      break;
+    case GD_LINCOM_ENTRY:
+      key[0] = "in_fields";
+      key[1] = "m";
+      key[2] = "b";
+      size = 3;
+      break;
+    case GD_LINTERP_ENTRY:
+      key[0] = "in_field";
+      key[1] = "table";
+      size = 2;
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      key[0] = "in_field";
+      key[1] = "bitnum";
+      if (PyDict_GetItemString(parms, "numbits")) {
+        key[2] = "numbits";
+        size = 3;
+      } else
+        size = 2;
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      key[0] = "in_field1";
+      key[1] = "in_field2";
+      size = 2;
+      break;
+    case GD_RECIP_ENTRY:
+      key[0] = "in_field";
+      key[1] = "dividend";
+      size = 2;
+      break;
+    case GD_PHASE_ENTRY:
+      key[0] = "in_field";
+      key[1] = "shift";
+      size = 2;
+      break;
+    case GD_POLYNOM_ENTRY:
+      key[0] = "in_field";
+      key[1] = "a";
+      size = 2;
+      break;
+    case GD_WINDOW_ENTRY:
+      key[0] = "in_field1";
+      key[1] = "in_field2";
+      key[2] = "windop";
+      key[3] = "threshold";
+      size = 4;
+      break;
+    case GD_MPLEX_ENTRY:
+      key[0] = "in_field1";
+      key[1] = "in_field2";
+      key[2] = "count_val";
+      key[3] = "period";
+      size = 4;
+      break;
+    case GD_CARRAY_ENTRY:
+      key[0] = "type";
+      key[1] = "array_len";
+      size = 2;
+      break;
+    case GD_CONST_ENTRY:
+      key[0] = "type";
+      size = 1;
+      break;
+    case GD_STRING_ENTRY:
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_INDEX_ENTRY:
+      break;
+  }
+
+  if (size > 0) {
+    tuple = PyTuple_New(size);
+    for (i = 0; i < size; ++i) {
+      PyObject *o = PyDict_GetItemString(parms, key[i]);
+
+      if (o == NULL) {
+        PyErr_Format(PyExc_KeyError, "%s: missing required parameter key %s",
+            name, key[i]);
+        dreturnvoid();
+        return;
+      }
+
+      Py_INCREF(o);
+      PyTuple_SET_ITEM(tuple, i, o);
+    }
+  }
+
+  gdpy_set_entry_from_tuple(E, tuple, name);
+
+  dreturnvoid();
+}
+
+static int gdpy_entry_init(struct gdpy_entry_t *self, PyObject *args,
+    PyObject *keys)
+{
+  gd_entry_t E;
+  char *keywords[] = {"type", "name", "fragment_index", "parameters", NULL};
+  PyObject *parms = NULL;
+  const char *field_name;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  memset(&E, 0, sizeof(gd_entry_t));
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys, "isi|O:pygetdata.entry.__init__",
+        keywords, &E.field_type, &field_name, &E.fragment_index, &parms))
+  {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  E.field = strdup(field_name);
+  if (E.field == NULL) {
+    PyErr_NoMemory();
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check for valid field type */
+  if (E.field_type > 0x12 || E.field_type <= 0 ||
+      gdpy_entry_type_names[E.field_type] == NULL) {
+    PyErr_SetString(PyExc_ValueError,
+        "'pygetdata.entry.__init__' invalid entry type");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (E.field_type == GD_STRING_ENTRY)
+    ; /* no parameters required */
+  else if (parms == NULL)
+    PyErr_Format(PyExc_TypeError, "pygetdata.entry.__init__() initialisation "
+        "of %s require parameter tuple or dictionary",
+        gdpy_entry_type_names[E.field_type]);
+  else if (PyDict_Check(parms))
+    gdpy_set_entry_from_dict(&E, parms, "pygetdata.entry.__init__");
+  else if (PyTuple_Check(parms))
+    gdpy_set_entry_from_tuple(&E, parms, "pygetdata.entry.__init__");
+  else
+    PyErr_SetString(PyExc_TypeError, "pygetdata.dirfile.__init__() argument 3 "
+        "must be a tuple or dictionary");
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (self->E == NULL) {
+    self->E = malloc(sizeof(gd_entry_t));
+
+    if (self->E == NULL) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  } else
+    gd_free_entry_strings(self->E);
+
+  memcpy(self->E, &E, sizeof(gd_entry_t));
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getname(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  pyobj = PyString_FromString(self->E->field);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_entry_setname(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  char *s;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  s = gdpy_dup_pystring(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  free(self->E->field);
+  self->E->field = s;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getfragment(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  pyobj = PyInt_FromLong(self->E->fragment_index);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_entry_setfragment(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int t;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  t = (int)PyInt_AsLong(value);
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->fragment_index = t;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_gettypename(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  pyobj = PyString_FromString(gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_entry_gettype(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  pyobj = PyInt_FromLong(self->E->field_type);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_entry_getinfields(struct gdpy_entry_t *self,
+    void *closure)
+{
+  int i;
+  PyObject *tuple = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  switch (self->E->field_type)
+  {
+    case GD_LINCOM_ENTRY:
+      tuple = PyTuple_New(self->E->EN(lincom,n_fields));
+      for (i = 0; i < self->E->EN(lincom,n_fields); ++i)
+        PyTuple_SetItem(tuple, i, PyString_FromString(self->E->in_fields[i]));
+      break;
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_RECIP_ENTRY:
+      tuple = Py_BuildValue("(s)", self->E->in_fields[0]);
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      tuple = Py_BuildValue("(ss)", self->E->in_fields[0],
+          self->E->in_fields[1]);
+      break;
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_RAW_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+      PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+          "attribute 'in_fields' not available for entry type %s",
+          gdpy_entry_type_names[self->E->field_type]);
+      break;
+  }
+
+  dreturn("%p", tuple);
+  return tuple;
+}
+
+static int gdpy_entry_setinfields(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int i;
+  char *s[GD_MAX_LINCOM];
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  switch (self->E->field_type)
+  {
+    case GD_LINCOM_ENTRY:
+      if (!PyTuple_Check(value)) {
+        PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+            "attribute 'in_fields' must be a tuple");
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      if (PyTuple_Size(value) < self->E->EN(lincom,n_fields)) {
+        PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+            "not enough items in tuple for in_fields");
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      for (i = 0; i < self->E->EN(lincom,n_fields); ++i)
+        s[i] = gdpy_dup_pystring(PyTuple_GetItem(value, i));
+
+      if (PyErr_Occurred()) {
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
+        free(self->E->in_fields[i]);
+        self->E->in_fields[i] = s[i];
+      }
+      break;
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_RECIP_ENTRY:
+      if (!PyTuple_Check(value))
+        s[0] = gdpy_dup_pystring(value);
+      else {
+        if (PyTuple_Size(value) < 1) {
+          PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+              "not enough items in tuple for in_fields");
+          dreturn("%i", -1);
+        }
+
+        s[0] = gdpy_dup_pystring(PyTuple_GetItem(value, 0));
+      }
+
+      if (PyErr_Occurred()) {
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      free(self->E->in_fields[0]);
+      self->E->in_fields[0] = s[0];
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (!PyTuple_Check(value)) {
+        PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+            "attribute 'in_fields' must be a tuple");
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      if (PyTuple_Size(value) < 2) {
+        PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+            "not enough items in tuple for in_fields");
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      for (i = 0; i < 2; ++i)
+        s[i] = gdpy_dup_pystring(PyTuple_GetItem(value, i));
+
+      if (PyErr_Occurred()) {
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      for (i = 0; i < 2; ++i) {
+        free(self->E->in_fields[i]);
+        self->E->in_fields[i] = s[i];
+      }
+      break;
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_RAW_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+      PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+          "attribute 'in_fields' not available for entry type %s",
+          gdpy_entry_type_names[self->E->field_type]);
+      break;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getdatatypename(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *obj = NULL;
+  int t = -1;
+  char buffer[11];
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_RAW_ENTRY)
+    t = self->E->EN(raw,data_type);
+  else if (self->E->field_type == GD_CONST_ENTRY ||
+      self->E->field_type == GD_CARRAY_ENTRY)
+    t = self->E->EN(scalar,const_type);
+  else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'data_type_name' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  if (t != -1) {
+    sprintf(buffer, "%s%i", (t & GD_COMPLEX) ? "COMPLEX" :
+        (t & GD_IEEE754) ? "FLOAT" : (t & GD_SIGNED) ?  "INT" : "UINT",
+        8 * GD_SIZE(t));
+    obj = PyString_FromString(buffer);
+  }
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static PyObject *gdpy_entry_getdatatype(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_RAW_ENTRY)
+    obj = PyInt_FromLong(self->E->EN(raw,data_type));
+  else if (self->E->field_type == GD_CONST_ENTRY ||
+      self->E->field_type == GD_CARRAY_ENTRY)
+    obj = PyInt_FromLong(self->E->EN(scalar,const_type));
+  else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'data_type' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setdatatype(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int t;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_RAW_ENTRY &&
+      self->E->field_type != GD_CONST_ENTRY &&
+      self->E->field_type != GD_CARRAY_ENTRY)
+  {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'data_type' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  t = PyInt_AsLong(value);
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* The C library is significantly more lax about this. (It just checks a few
+   * key bits) */
+  if (GDPY_INVALID_TYPE(t)) {
+    PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' invalid data type");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (self->E->field_type == GD_RAW_ENTRY)
+    self->E->EN(raw,data_type) = (gd_type_t)t;
+  else
+    self->E->EN(scalar,const_type) = (gd_type_t)t;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getspf(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_RAW_ENTRY) {
+    if (self->E->scalar[0] == NULL)
+      obj = PyInt_FromLong(self->E->EN(raw,spf));
+    else
+      obj = PyString_FromString(self->E->scalar[0]);
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'spf' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setspf(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  unsigned int spf;
+  char *scalar;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_RAW_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'spf' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gdpy_set_scalar_from_pyobj(value, GD_UINT_TYPE, &scalar, &spf);
+
+  if (PyErr_Occurred()) {
+    free(scalar);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  free(self->E->scalar[0]);
+  self->E->scalar[0] = scalar;
+  self->E->EN(raw,spf) = spf;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getarraylen(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_CARRAY_ENTRY)
+      obj = PyLong_FromUnsignedLong(self->E->EN(scalar,array_len));
+  else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'array_len' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setarraylen(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  size_t array_len;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_CARRAY_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'array_len' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  array_len = PyLong_AsUnsignedLong(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(scalar,array_len) = array_len;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getnfields(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_LINCOM_ENTRY) {
+    obj = PyInt_FromLong(self->E->EN(lincom,n_fields));
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'n_fields' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setnfields(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int i, n;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_LINCOM_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'n_fields' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  n = (int)PyInt_AsLong(value);
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  } else if (n < 0 || n > GD_MAX_LINCOM) {
+    PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' "
+        "attribute 'n_fields' out of range");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* free extra terms */
+  for (i = n; i < self->E->EN(lincom,n_fields); ++i)
+    free(self->E->in_fields[i]);
+
+  /* initialise new terms */
+  for (i = self->E->EN(lincom,n_fields); i < n; ++i) {
+    self->E->in_fields[i] = strdup("");
+    self->E->EN(lincom,m)[i] = self->E->EN(lincom,b)[i] = 0;
+  }
+
+  self->E->EN(lincom,n_fields) = n;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getm(struct gdpy_entry_t *self, void *closure)
+{
+  int i;
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_LINCOM_ENTRY) {
+    obj = PyTuple_New(self->E->EN(lincom,n_fields));
+    for (i = 0; i < self->E->EN(lincom,n_fields); ++i)
+      PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ?
+          (self->E->comp_scal) ?  gdpy_from_complex(self->E->EN(lincom,cm)[i]) :
+          PyFloat_FromDouble(self->E->EN(lincom,m)[i]) :
+          PyString_FromString(self->E->scalar[i]));
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'm' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setm(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int i;
+  int comp_scal = 0;
+  double m[GD_MAX_LINCOM];
+  GD_DCOMPLEXM(cm[GD_MAX_LINCOM]);
+  char *scalar[GD_MAX_LINCOM];
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_LINCOM_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'm' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (!PyTuple_Check(value)) {
+    PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+        "attribute 'm' must be a tuple");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (PyTuple_Size(value) < self->E->EN(lincom,n_fields)) {
+    PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+        "not enough items in tuple for attribute 'm'");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
+    PyObject *obj = PyTuple_GetItem(value, i);
+    if (PyComplex_Check(obj)) {
+      comp_scal = 1;
+      gdpy_as_complex(gd_csp_(cm[i]), obj);
+      m[i] = creal(cm[i]);
+      scalar[i] = NULL;
+    } else if (comp_scal) {
+      gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, scalar + i, cm + i);
+      m[i] = creal(cm[i]);
+    } else {
+      gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, scalar + i, m + i);
+      gd_rs2cs_(cm[i], m[i]);
+    }
+  }
+
+  if (PyErr_Occurred()) {
+    for (i = 0; i < GD_MAX_LINCOM; ++i)
+      free(scalar[i]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
+    /* check whether the corresponding cb is complex */
+    if (!comp_scal && cimag(self->E->EN(lincom,cb)[i]))
+      comp_scal = 1;
+    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;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getb(struct gdpy_entry_t *self, void *closure)
+{
+  int i;
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_LINCOM_ENTRY) {
+    obj = PyTuple_New(self->E->EN(lincom,n_fields));
+    for (i = 0; i < self->E->EN(lincom,n_fields); ++i)
+      PyTuple_SetItem(obj, i, (self->E->scalar[i + GD_MAX_LINCOM] == NULL) ?
+          (self->E->comp_scal) ?  gdpy_from_complex(self->E->EN(lincom,cb)[i]) :
+          PyFloat_FromDouble(self->E->EN(lincom,b)[i]) :
+          PyString_FromString(self->E->scalar[i + GD_MAX_LINCOM]));
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'b' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setb(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int i;
+  int comp_scal = 0;
+  double b[GD_MAX_LINCOM];
+  GD_DCOMPLEXM(cb[GD_MAX_LINCOM]);
+  char *scalar[GD_MAX_LINCOM];
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_LINCOM_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'b' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (!PyTuple_Check(value)) {
+    PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+        "attribute 'b' must be a tuple");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (PyTuple_Size(value) < self->E->EN(lincom,n_fields)) {
+    PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+        "not enough items in tuple for attribute 'b'");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
+    PyObject *obj = PyTuple_GetItem(value, i);
+    if (PyComplex_Check(obj)) {
+      comp_scal = 1;
+      gdpy_as_complex(gd_csp_(cb[i]), obj);
+      b[i] = creal(cb[i]);
+      scalar[i] = NULL;
+    } else if (comp_scal) {
+      gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, scalar + i, cb + i);
+      b[i] = creal(cb[i]);
+    } else {
+      gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, scalar + i, b + i);
+      gd_rs2cs_(cb[i], b[i]);
+    }
+  }
+
+  if (PyErr_Occurred()) {
+    for (i = 0; i < GD_MAX_LINCOM; ++i)
+      free(scalar[i]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  for (i = 0; i < self->E->EN(lincom,n_fields); ++i) {
+    /* check whether the corresponding cm is complex */
+    if (!comp_scal && cimag(self->E->EN(lincom,cm)[i]))
+      comp_scal = 1;
+    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;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_gettable(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_LINTERP_ENTRY)
+    obj = PyString_FromString(self->E->EN(linterp,table));
+  else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'table' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_settable(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type == GD_LINTERP_ENTRY) {
+    char *s = gdpy_dup_pystring(value);
+
+    if (PyErr_Occurred()) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    free(self->E->EN(linterp,table));
+    self->E->EN(linterp,table) = s;
+  } else {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'table' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getbitnum(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_BIT_ENTRY ||
+      self->E->field_type == GD_SBIT_ENTRY)
+  {
+    if (self->E->scalar[0] == NULL)
+      obj = PyInt_FromLong(self->E->EN(bit,bitnum));
+    else
+      obj = PyString_FromString(self->E->scalar[0]);
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'bitnum' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setbitnum(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int bitnum;
+  char *scalar;
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_BIT_ENTRY &&
+      self->E->field_type != GD_SBIT_ENTRY)
+  {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'bitnum' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gdpy_set_scalar_from_pyobj(value, GD_INT_TYPE, &scalar, &bitnum);
+  if (PyErr_Occurred()) {
+    free(scalar);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(bit,bitnum) = bitnum;
+  free(self->E->scalar[0]);
+  self->E->scalar[0] = scalar;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getnumbits(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_BIT_ENTRY ||
+      self->E->field_type == GD_SBIT_ENTRY)
+  {
+    if (self->E->scalar[1] == NULL)
+      obj = PyInt_FromLong(self->E->EN(bit,numbits));
+    else
+      obj = PyString_FromString(self->E->scalar[1]);
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'numbits' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setnumbits(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int numbits;
+  char *scalar;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_BIT_ENTRY &&
+      self->E->field_type != GD_SBIT_ENTRY)
+  {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'numbits' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gdpy_set_scalar_from_pyobj(value, GD_INT_TYPE, &scalar, &numbits);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(bit,numbits) = numbits;
+  free(self->E->scalar[1]);
+  self->E->scalar[1] = scalar;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getdividend(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_RECIP_ENTRY) {
+    if (self->E->scalar[0])
+      obj = PyString_FromString(self->E->scalar[0]);
+    else if (self->E->comp_scal)
+      obj = gdpy_from_complex(self->E->EN(recip,cdividend));
+    else
+      obj = PyFloat_FromDouble(self->E->EN(recip,dividend));
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'dividend' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setdividend(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int comp_scal = 0;
+  char *scalar;
+  GD_DCOMPLEXA(cdividend);
+  double dividend = 0;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  gd_li2cs_(cdividend, 0, 0);
+
+  if (self->E->field_type != GD_RECIP_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'dividend' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (PyComplex_Check(value) || PyString_Check(value))
+    comp_scal = 1;
+
+  if (comp_scal) {
+    gdpy_set_scalar_from_pyobj(value, GD_COMPLEX128, &scalar, &cdividend);
+    dividend = creal(cdividend);
+  } else {
+    gdpy_set_scalar_from_pyobj(value, GD_FLOAT64, &scalar, &dividend);
+    gd_rs2cs_(cdividend, dividend);
+  }
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->comp_scal = comp_scal;
+  gd_cs2cs_(self->E->EN(recip,cdividend), cdividend);
+  self->E->EN(recip,dividend) = dividend;
+  free(self->E->scalar[0]);
+  self->E->scalar[0] = scalar;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getshift(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_PHASE_ENTRY) {
+    if (self->E->scalar[0] == NULL)
+      obj = PyLong_FromLongLong((PY_LONG_LONG)self->E->EN(phase,shift));
+    else
+      obj = PyString_FromString(self->E->scalar[0]);
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'shift' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setshift(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int64_t shift;
+  char *scalar;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_PHASE_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'shift' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gdpy_set_scalar_from_pyobj(value, GD_INT64, &scalar, &shift);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(phase,shift) = shift;
+  free(self->E->scalar[0]);
+  self->E->scalar[0] = scalar;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getcountval(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_MPLEX_ENTRY) {
+    if (self->E->scalar[0] == NULL)
+      obj = PyInt_FromLong(self->E->EN(mplex,count_val));
+    else
+      obj = PyString_FromString(self->E->scalar[0]);
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'count_val' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setcountval(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int count_val;
+  char *scalar;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_MPLEX_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'count_val' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gdpy_set_scalar_from_pyobj(value, GD_INT_TYPE, &scalar, &count_val);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(mplex,count_val) = count_val;
+  free(self->E->scalar[0]);
+  self->E->scalar[0] = scalar;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getperiod(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_MPLEX_ENTRY) {
+    if (self->E->scalar[0] == NULL)
+      obj = PyInt_FromLong(self->E->EN(mplex,period));
+    else
+      obj = PyString_FromString(self->E->scalar[0]);
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'period' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setperiod(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int period;
+  char *scalar;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_MPLEX_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'period' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gdpy_set_scalar_from_pyobj(value, GD_INT_TYPE, &scalar, &period);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(mplex,period) = period;
+  free(self->E->scalar[1]);
+  self->E->scalar[1] = scalar;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_geta(struct gdpy_entry_t *self, void *closure)
+{
+  int i;
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_POLYNOM_ENTRY) {
+    obj = PyTuple_New(self->E->EN(polynom,poly_ord) + 1);
+    for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i)
+      PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ?
+          (self->E->comp_scal) ? gdpy_from_complex(self->E->EN(polynom,ca)[i]) :
+          PyFloat_FromDouble(self->E->EN(polynom,a)[i]) :
+          PyString_FromString(self->E->scalar[i]));
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'a' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_seta(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int i;
+  int comp_scal = 0;
+  double a[GD_MAX_POLYORD + 1];
+  GD_DCOMPLEXM(ca[GD_MAX_POLYORD + 1]);
+  char *scalar[GD_MAX_POLYORD + 1];
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_POLYNOM_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'a' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (!PyTuple_Check(value)) {
+    PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+        "attribute 'a' must be a tuple");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (PyTuple_Size(value) < self->E->EN(polynom,poly_ord) + 1) {
+    PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+        "not enough items in tuple for attribute 'a'");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i) {
+    PyObject *obj = PyTuple_GetItem(value, i);
+    if (PyComplex_Check(obj)) {
+      comp_scal = 1;
+      gdpy_as_complex(gd_csp_(ca[i]), obj);
+      a[i] = creal(ca[i]);
+      scalar[i] = NULL;
+    } else if (comp_scal) {
+      gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, scalar + i, ca + i);
+      a[i] = creal(ca[i]);
+    } else {
+      gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, scalar + i, a + i);
+      gd_rs2cs_(ca[i], a[i]);
+    }
+  }
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i) {
+    self->E->EN(polynom,a)[i] = a[i];
+    gd_cs2cs_(self->E->EN(polynom,ca)[i], ca[i]);
+    free(self->E->scalar[i]);
+    self->E->scalar[i] = scalar[i];
+  }
+  self->E->comp_scal = comp_scal;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getpolyord(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_POLYNOM_ENTRY)
+    obj = PyInt_FromLong(self->E->EN(polynom,poly_ord));
+  else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'poly_ord' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setpolyord(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int n;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_POLYNOM_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'poly_ord' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  n = (int)PyLong_AsUnsignedLongLong(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  } else if (n < 1 || n > GD_MAX_POLYORD) {
+    PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' "
+        "attribute 'poly_ord' out of range");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(polynom,poly_ord) = n;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getparms(struct gdpy_entry_t *self, void *closure)
+{
+  int i;
+  PyObject *a, *tuple = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  switch (self->E->field_type)
+  {
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_STRING_ENTRY:
+      tuple = Py_BuildValue("()");
+      break;
+    case GD_CONST_ENTRY:
+      tuple = Py_BuildValue("(i)", self->E->EN(scalar,const_type));
+      break;
+    case GD_CARRAY_ENTRY:
+      tuple = Py_BuildValue("(iI)", self->E->EN(scalar,const_type),
+          self->E->EN(scalar,array_len));
+      break;
+    case GD_RAW_ENTRY:
+      tuple = Py_BuildValue("(iI)", self->E->EN(raw,data_type),
+          self->E->EN(raw,spf));
+      break;
+    case GD_LINTERP_ENTRY:
+      tuple = Py_BuildValue("(ss)", self->E->in_fields[0],
+          self->E->EN(linterp,table));
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      tuple = Py_BuildValue("(ss)", self->E->in_fields[0],
+          self->E->in_fields[1]);
+      break;
+    case GD_RECIP_ENTRY:
+      if (self->E->comp_scal)
+        tuple = Py_BuildValue("(sO)", self->E->in_fields[0],
+            gdpy_from_complex(self->E->EN(recip,cdividend)));
+      else
+        tuple = Py_BuildValue("(sd)", self->E->in_fields[0],
+            self->E->EN(recip,dividend));
+      break;
+    case GD_PHASE_ENTRY:
+      tuple = Py_BuildValue("(si)", self->E->in_fields[0],
+          self->E->EN(phase,shift));
+      break;
+    case GD_POLYNOM_ENTRY:
+      a = PyTuple_New(self->E->EN(polynom,poly_ord) + 1);
+      if (self->E->comp_scal)
+        for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i)
+          PyTuple_SetItem(a, i, gdpy_from_complex(self->E->EN(polynom,ca)[i]));
+      else
+        for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i)
+          PyTuple_SetItem(a, i, PyFloat_FromDouble(self->E->EN(polynom,a)[i]));
+      tuple = Py_BuildValue("(sO)", self->E->in_fields[0], a);
+      break;
+    case GD_LINCOM_ENTRY:
+      switch (self->E->EN(lincom,n_fields)) {
+        case 1:
+          if (self->E->comp_scal)
+            tuple = Py_BuildValue("((s)(O)(O))", self->E->in_fields[0],
+                gdpy_from_complex(self->E->EN(lincom,cm)[0]),
+                gdpy_from_complex(self->E->EN(lincom,cb)[0]));
+          else
+            tuple = Py_BuildValue("((s)(d)(d))", self->E->in_fields[0],
+                self->E->EN(lincom,m)[0], self->E->EN(lincom,b)[0]);
+          break;
+        case 2:
+          if (self->E->comp_scal)
+            tuple = Py_BuildValue("((ss)(OO)(OO))", self->E->in_fields[0],
+                self->E->in_fields[1],
+                gdpy_from_complex(self->E->EN(lincom,cm)[0]),
+                gdpy_from_complex(self->E->EN(lincom,cm)[1]),
+                gdpy_from_complex(self->E->EN(lincom,cb)[0]),
+                gdpy_from_complex(self->E->EN(lincom,cb)[1]));
+          else
+            tuple = Py_BuildValue("((ss)(dd)(dd))", self->E->in_fields[0],
+                self->E->in_fields[1], self->E->EN(lincom,m)[0],
+                self->E->EN(lincom,m)[1], self->E->EN(lincom,b)[0],
+                self->E->EN(lincom,b)[1]);
+          break;
+        case 3:
+          if (self->E->comp_scal)
+            tuple = Py_BuildValue("((sss)(OOO)(OOO))", self->E->in_fields[0],
+                self->E->in_fields[1], self->E->in_fields[2],
+                gdpy_from_complex(self->E->EN(lincom,cm)[0]),
+                gdpy_from_complex(self->E->EN(lincom,cm)[1]),
+                gdpy_from_complex(self->E->EN(lincom,cm)[2]),
+                gdpy_from_complex(self->E->EN(lincom,cb)[0]),
+                gdpy_from_complex(self->E->EN(lincom,cb)[1]),
+                gdpy_from_complex(self->E->EN(lincom,cb)[2]));
+          else
+            tuple = Py_BuildValue("((sss)(ddd)(ddd))", self->E->in_fields[0],
+                self->E->in_fields[1], self->E->in_fields[2],
+                self->E->EN(lincom,m)[0], self->E->EN(lincom,m)[1],
+                self->E->EN(lincom,m)[2], self->E->EN(lincom,b)[0],
+                self->E->EN(lincom,b)[1], self->E->EN(lincom,b)[2]);
+          break;
+      }
+      break;
+    case GD_WINDOW_ENTRY:
+      switch (self->E->EN(window,windop)) {
+        case GD_WINDOP_EQ:
+        case GD_WINDOP_NE:
+          tuple = Py_BuildValue("(ssiL)", self->E->in_fields[0],
+              self->E->in_fields[1], self->E->EN(window,windop),
+              (long long)self->E->EN(window,threshold).i);
+          break;
+        case GD_WINDOP_SET:
+        case GD_WINDOP_CLR:
+          tuple = Py_BuildValue("(ssiK)", self->E->in_fields[0],
+              self->E->in_fields[1], self->E->EN(window,windop),
+              (unsigned long long)self->E->EN(window,threshold).u);
+          break;
+        default:
+          tuple = Py_BuildValue("(ssid)", self->E->in_fields[0],
+              self->E->in_fields[1], self->E->EN(window,windop),
+              self->E->EN(window,threshold).r);
+          break;
+      }
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      tuple = Py_BuildValue("(sii)", self->E->in_fields[0],
+          self->E->EN(bit,bitnum), self->E->EN(bit,numbits));
+      break;
+    case GD_MPLEX_ENTRY:
+      tuple = Py_BuildValue("(ssII)", self->E->in_fields[0],
+          self->E->in_fields[1], (unsigned int)self->E->EN(mplex,count_val),
+          (unsigned int)self->E->EN(mplex,period));
+      break;
+  }
+
+  dreturn("%p", tuple);
+  return tuple;
+}
+
+static int gdpy_entry_setparms(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  gd_entry_t E;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  memset(&E, 0, sizeof(gd_entry_t));
+
+  E.field = self->E->field;
+  E.field_type = self->E->field_type;
+  E.fragment_index = self->E->fragment_index;
+
+  if (PyDict_Check(value))
+    gdpy_set_entry_from_dict(&E, value, "pygetdata.entry");
+  else if (PyTuple_Check(value))
+    gdpy_set_entry_from_tuple(&E, value, "pygetdata.entry");
+  else
+    PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
+        "attribute 'parameters' must be a tuple or dictionary");
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->field = NULL;
+
+  gd_free_entry_strings(self->E);
+  memcpy(self->E, &E, sizeof(gd_entry_t));
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getwindop(struct gdpy_entry_t *self, void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_WINDOW_ENTRY)
+    obj = PyInt_FromLong(self->E->EN(window,windop));
+  else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'windop' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setwindop(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  int t;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_WINDOW_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'windop' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  t = PyInt_AsLong(value);
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (GDPY_INVALID_OP(t)) {
+    PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' invalid data type");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(window,windop) = (gd_windop_t)t;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_entry_getthreshold(struct gdpy_entry_t *self,
+    void *closure)
+{
+  PyObject *obj = NULL;
+
+  dtrace("%p, %p", self, closure);
+
+  if (self->E->field_type == GD_WINDOW_ENTRY) {
+    switch (self->E->EN(window,windop)) {
+      case GD_WINDOP_EQ:
+      case GD_WINDOP_NE:
+        obj = PyLong_FromLongLong((long long)self->E->EN(window,threshold).i);
+        break;
+      case GD_WINDOP_SET:
+      case GD_WINDOP_CLR:
+        obj = PyLong_FromUnsignedLongLong(
+            (unsigned long long)self->E->EN(window,threshold).u);
+        break;
+      default:
+        obj = PyFloat_FromDouble(self->E->EN(window,threshold).r);
+        break;
+    }
+  } else
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'threshold' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+
+  dreturn("%p", obj);
+  return obj;
+}
+
+static int gdpy_entry_setthreshold(struct gdpy_entry_t *self, PyObject *value,
+    void *closure)
+{
+  gd_triplet_t t;
+  dtrace("%p, %p, %p", self, value, closure);
+
+  if (self->E->field_type != GD_WINDOW_ENTRY) {
+    PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
+        "attribute 'threshold' not available for entry type %s",
+        gdpy_entry_type_names[self->E->field_type]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  switch (self->E->EN(window,windop)) {
+    case GD_WINDOP_EQ:
+    case GD_WINDOP_NE:
+      t.i = PyLong_AsLongLong(value);
+      break;
+    case GD_WINDOP_SET:
+    case GD_WINDOP_CLR:
+      t.u = PyLong_AsUnsignedLongLong(value);
+      break;
+    default:
+      t.r = PyFloat_AsDouble(value);
+      break;
+  }
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  self->E->EN(window,threshold) = t;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyGetSetDef gdpy_entry_getset[] = {
+  { "a", (getter)gdpy_entry_geta, (setter)gdpy_entry_seta,
+    "The POLYNOM co-efficients.  A tuple of numerical and/or string data.\n"
+      "If a CONST scalar is used as a co-efficient, the corresponding\n"
+      "element of the tuple will be the field code of this scalar field.\n"
+      "Otherwise, the elements will be numerical data.  When assigning to\n"
+      "this attribute, the tuple (which may similarly mix numerical and\n"
+      "string data) must have as many elements as the current polynomial\n"
+      "order dictates: assigning a tuple of different size to this\n"
+      "attribute will not result in a change in the polynomial order.  To\n"
+      "do that, modify the poly_ord attribute directly.\n",
+    NULL },
+  { "array_len", (getter)gdpy_entry_getarraylen, (setter)gdpy_entry_setarraylen,
+    "The length of a CARRAY scalar field.\n",
+    NULL },
+  { "b", (getter)gdpy_entry_getb, (setter)gdpy_entry_setb,
+    "The LINCOM offset terms.  A tuple of numerical and/or string data.\n"
+      "If a CONST scalar is used as an offset, the corresponding element of\n"
+      "the tuple will be the field code of this scalar field.  Otherwise,\n"
+      "the elements will be numerical data.  When assigning to this\n"
+      "attribute, the tuple (which may similarly mix numerical and string\n"
+      "data) must have as many elements as the current number of fields in\n"
+      "the LINCOM: assigning a tuple of different size to this attribute\n"
+      "will not result in a change in the number of fields used.  To do\n"
+      "that, modify the n_fields attribute directly.\n",
+    NULL },
+  { "bitnum", (getter)gdpy_entry_getbitnum, (setter)gdpy_entry_setbitnum,
+    "The starting bit for a BIT field.  If this is specified using a\n"
+      "CONST scalar field, this will be the field code of that field,\n"
+      "otherwise, it will be the number itself.",
+    NULL },
+  { "const_type", (getter)gdpy_entry_getdatatype,
+    (setter)gdpy_entry_setdatatype, "An alias for the data_type attribute.",
+    NULL },
+  { "count_val", (getter)gdpy_entry_getcountval, (setter)gdpy_entry_setcountval,
+    "The target value of the counter of a MPLEX field.  If this is\n"
+      "specified using a CONST scalar field, this will be the field code of\n"
+      "that field, otherwise, it will be the number itself.",
+    NULL },
+  { "data_type", (getter)gdpy_entry_getdatatype, (setter)gdpy_entry_setdatatype,
+    "A numeric code indicating the underlying data type of a CONST or RAW\n"
+      "field.  It should be one of the data type symbols: pygetdata.UINT8,\n"
+      "pygetdata.INT8, &c.  The data_type_name attribute provides a human-\n"
+      "readable version of this data.\n",
+    NULL },
+  { "data_type_name", (getter)gdpy_entry_getdatatypename, NULL,
+    "A human-readable string indicating the underlying data type of a\n"
+      "CONST or RAW field.  This attribute is read-only.  To change the\n"
+      "data type modify the data_type attribute.\n",
+    NULL },
+  { "dividend", (getter)gdpy_entry_getdividend, (setter)gdpy_entry_setdividend,
+    "The dividend of a RECIP field.  If this is specified using a CONST\n"
+      "scalar field, this will be the field code of that field, otherwise,\n"
+      "it will be the number itself.",
+    NULL },
+  { "field_type", (getter)gdpy_entry_gettype, NULL,
+    "A numeric code indicating the field type.  This will be one of the\n"
+      "pygetdata.*_ENTRY symbols.  This attribute is read-only.  An entry's\n"
+      "field type may not be changed after creation.  See also the\n"
+      "field_type_name attribute for a human-readable version of this data.\n",
+    NULL },
+  { "field_type_name", (getter)gdpy_entry_gettypename, NULL,
+    "A human-readable string indicating the field type.  This attribute\n"
+      "is read-only.  An entry's field type may not be changed after\n"
+      "creation.  See also the field_type attribute for a numeric version\n"
+      "of this data.\n",
+    NULL },
+  { "fragment", (getter)gdpy_entry_getfragment, (setter)gdpy_entry_setfragment,
+    "If this entry object was created by a call to dirfile.entry,\n"
+      "this is index number of the format file fragment which defines the\n"
+      "field described by this entry object.  Otherwise, it is the index of\n"
+      "the fragment to which this entry will be added, if this entry is\n"
+      "passed to dirfile.add().  It may be freely modified, but is ignored\n"
+      "by dirfile.alter().  To change the fragment index of an existing\n"
+      "field in a dirfile, use dirfile.move().\n",
+    NULL },
+  { "in_fields", (getter)gdpy_entry_getinfields, (setter)gdpy_entry_setinfields,
+    "A tuple containing the input vector field codes for a derived field.\n"
+      "Except in the case of a LINCOM, this will be a tuple of length one.\n"
+      "When modifying this attribute, the new tuple must contain the same\n"
+      "number of elements as it did previously: assigning a tuple of a\n"
+      "different size will not cause the number of fields used in a LINCOM\n"
+      "to change.  To do that, modify the n_fields attribute directly.",
+    NULL },
+  { "m", (getter)gdpy_entry_getm, (setter)gdpy_entry_setm,
+    "The LINCOM scale factors.  A tuple of numerical and/or string data.\n"
+      "If a CONST scalar is used as a scale factor, the corresponding\n"
+      "element of the tuple will be the field code of this scalar field.\n"
+      "Otherwise, the elements will be numerical data.  When assigning to\n"
+      "this attribute, the tuple (which may similarly mix numerical and\n"
+      "string data) must have as many elements as the current number of\n"
+      "fields in the LINCOM: assigning a tuple of different size to this\n"
+      "attribute will not result in a change in the number of fields used.\n"
+      "To do that, modify the n_fields attribute directly.\n",
+    NULL },
+  { "n_fields", (getter)gdpy_entry_getnfields, (setter)gdpy_entry_setnfields,
+    "The number of fields in a LINCOM.  Modifying this will change the\n"
+      "number of fields used.  If this number is increased, the added\n"
+      "elements in the in_fields, m, and b attributes will contain\n"
+      "nonsensical data, and should be initialised (by assignment) before\n"
+      "the entry object is otherwise used.",
+    NULL },
+  { "name", (getter)gdpy_entry_getname, (setter)gdpy_entry_setname,
+    "The name of this field.  This may be freely modified, but is ignored\n"
+      "by dirfile.alter().  To change the name of an existing field in a\n"
+      "dirfile, use dirfile.rename().",
+    NULL },
+  { "numbits", (getter)gdpy_entry_getnumbits, (setter)gdpy_entry_setnumbits,
+    "The length of a BIT field.  If this is specified using a CONST\n"
+      "scalar field, this will be the field code of that field, otherwise,\n"
+      "it will be the number itself.",
+    NULL },
+  { "parameters", (getter)gdpy_entry_getparms, (setter)gdpy_entry_setparms,
+    "A tuple containing the field specific parameters for this entry.\n"
+      "The format is identical to the 'parameters' tuple passed to the\n"
+      "entry constructor (q.v.).  If modified, this will update all\n"
+      "parameters of the entry.  This attribute may be assigned a\n"
+      "dictionary, in which case it will be converted internally to the\n"
+      "corresponding parameters tuple.",
+    NULL },
+  { "period", (getter)gdpy_entry_getperiod, (setter)gdpy_entry_setperiod,
+    "The number of samples between successive occurrences of the MPLEX\n"
+      "value in the index vector (or zero, if unknown or not constant).  If\n"
+      /* ------ handy ruler ----------------------------------------------| */
+      "this is specified using a CONST scalar field, this will be the field\n"
+      "code of that field, otherwise, it will be the number itself.",
+    NULL },
+  { "poly_ord", (getter)gdpy_entry_getpolyord, (setter)gdpy_entry_setpolyord,
+    "The polynomial order of a POLYNOM field.  Modifying this will change\n"
+      "the number of terms in the polynomial.  If this number is increased,\n"
+      "higher order co-efficients in the 'a' attribute will contain\n"
+      "nonsensical data, and should be initialised (by assignment) before\n"
+      "the entry object is otherwise used.",
+    NULL },
+  { "shift", (getter)gdpy_entry_getshift, (setter)gdpy_entry_setshift,
+    "The shift of a PHASE field.  If this is specified using a CONST\n"
+      "scalar field, this will be the field code of that field, otherwise,\n"
+      "it will be the number itself.",
+    NULL },
+  { "spf", (getter)gdpy_entry_getspf, (setter)gdpy_entry_setspf,
+    "The number of samples per frame of the data on disk for a RAW field.\n"
+      "If this is specified using a CONST scalar field, this will be the\n"
+      "field code of that field, otherwise, it will be the number itself.",
+    NULL },
+  { "table", (getter)gdpy_entry_gettable, (setter)gdpy_entry_settable,
+    "The pathname of the look-up table of a LINTERP field.",
+    NULL },
+  { "windop", (getter)gdpy_entry_getwindop, (setter)gdpy_entry_setwindop,
+    "The operation of a WINDOW field.",
+    NULL },
+  { "threshold", (getter)gdpy_entry_getthreshold,
+    (setter)gdpy_entry_setthreshold,
+    "The threshold of a WINDOW field.  The numerical type depends on the\n"
+      "operation of the field.\n",
+    NULL },
+  { NULL }
+};
+
+#define ENTRY_DOC \
+  "entry(type, name, fragment_index [, parameters])\n\n"\
+"Returns an entry object containing the metadata for one dirfile field.\n"\
+"The field type is specified by 'type', which should be one of the\n"\
+"pygetdata.*_ENTRY symbols.  The field name is specified by 'name', and\n"\
+"'fragment_index' indicates the format file fragment which will contain\n"\
+"the specification line of this field, once the entry is added to a\n"\
+"dirfile.  To add this field to the primary format file, set\n"\
+"'fragment_index' to zero.\n\n"\
+"The 'parameters' parameter is a tuple or dictionary containing field-\n"\
+"specific metadata parameters, and must be present for all field types\n"\
+"except STRING, which has no parameters.  If a tuple, 'parameters' should\n"\
+"contain the following members, based on field type:\n\n"\
+"  BIT or SBIT:  (in_field, bitnum [, numbits])\n"\
+"    'in_field':   a string containing the input field code.\n"\
+"    'bitnum':     a number or CONST field code specifying the first bit\n"\
+"                    to extract.\n"\
+"    'numbits':    an optional number or CONST field code specifying the\n"\
+"                    number of bits to extract.  If not specified, it\n"\
+"                    defaults to 1.\n\n"\
+"  CONST:        (type,)\n"\
+"    'type':       the storage type of the CONST data.  Should be one of\n"\
+"                    the data type symbols: pygetdata.UINT8,\n"\
+"                    pygetdata.INT8 &.c.\n\n"\
+"  LINCOM:       (in_fields, m, b)\n"\
+"    'in_fields':  a tuple of input vector fields for the LINCOM.  The\n"\
+"                    number of elements of the tuple determines the\n"\
+"                    number of input fields for the LINCOM.  If there are\n"\
+"                    more than three elements, the remainder will be\n"\
+"                    ignored.\n"\
+"    'm', 'b':     the scale factors and offset terms of the LINCOM.\n"\
+"                    These are also tuples and should have the same\n"\
+"                    number of elements as 'in_fields'.  Data can be any\n"\
+"                    mix of numeric types and, to specify CONST scalars,\n"\
+"                    string field code.\n\n"\
+"  LINTERP:      (in_field, table)\n"\
+"    'in_field':   a string containing the input field code.\n"\
+"    'table':      the pathname to the look-up table on disk.\n\n"\
+"  MULTIPLY or DIVIDE:\n"\
+"                (in_field1, in_field2)\n"\
+"    'in_field1':   a string containing the first input field code.\n"\
+"    'in_field2':   a string containing the second input field code.\n\n"\
+"  PHASE:        (in_field, shift)\n"\
+"    'in_field':   a string containing the input field code.\n"\
+"    'shift:       a number or CONST field code specifying the number of\n"\
+"                    samples to shift the data.\n\n"\
+"  POLYNOM:      (in_field, a)\n"\
+"    'in_field':   a string containing the input field code.\n"\
+"    'a':          a tuple of the co-efficients of the polynomial.  The\n"\
+"                    order of the polynomial will be determined from the\n"\
+"                    length of the tuple.  If there are more than six\n"\
+"                    elements, the remainder will be ignored.  Data can\n"\
+"                    be any mix of numeric types and, to specify CONST\n"\
+"                    scalars, string field codes.\n\n"\
+"  RAW:          (type, spf)\n"\
+"    'type':       the storage type of the data on disk.  Should be one\n"\
+"                    of the data type symbols: pygetdata.UINT8,\n"\
+"                    pygetdata.INT8 &.c\n"\
+"    'spf':        the number of samples per frame of the data on disk,\n"\
+"                    or a CONST field code specifying the same.\n\n"\
+"  RECIP:        (in_field, dividend)\n"\
+"    'in_field':   a string containing the input field code.\n"\
+"    'dividend':   a number or CONST field code specifying the dividend\n"\
+"                    of the RECIP.\n"\
+"  WINDOW:       (in_field1, in_fields2, windop, threshold)\n"\
+"    'in_field1':  a string containing the input field code.\n"\
+"    'in_field2':  a string containing the check field code.\n"\
+"    'windop':     the window operation.  Should be one of the windop\n"\
+"                    symbols: pygetdata.WINDOP_EQ, pygetdata.WINDOP_NE,\n"\
+"                    &c.\n"\
+"    'threshold':  a scalar containing the threshold value.  The type of\n"\
+"                    this value depends on the window operation used.\n"\
+"\n"\
+/* ---------------------------------------------------------------------| */\
+"If a dictionary, the keys of 'parameters' should be the names of the\n"\
+"tuple parameters listed above (e.g. 'type' and 'spf' for a RAW field),\n"\
+"and the values the same as their tuple counterparts.\n\n"\
+"An entry object provides all these parameters as attributes, which may\n"\
+"be modified by assignment.  Attempting to access an attribute which is\n"\
+"not available for the specified field type will result in AttributeError\n"\
+"being thrown.\n\n"\
+"To add a newly created entry object to a dirfile, use dirfile.add() or\n"\
+"dirfile.madd() as appropriate.  To propagate changes made to an entry\n"\
+"object back to the dirfile, dirfile.alter() is typically used, unless\n"\
+"the name or fragment index is to be changed, in which case\n"\
+"dirfile.rename() or dirfile.move() should be used.\n"
+
+PyTypeObject gdpy_entry = {
+  PyObject_HEAD_INIT(NULL)
+    0,                           /* ob_size */
+  "pygetdata.entry",             /* tp_name */
+  sizeof(struct gdpy_entry_t),   /* tp_basicsize */
+  0,                             /* tp_itemsize */
+  (destructor)gdpy_entry_delete, /* tp_dealloc */
+  0,                             /* tp_print */
+  0,                             /* tp_getattr */
+  0,                             /* tp_setattr */
+  0,                             /* tp_compare */
+  0,                             /* tp_repr */
+  0,                             /* tp_as_number */
+  0,                             /* tp_as_sequence */
+  0,                             /* tp_as_mapping */
+  0,                             /* tp_hash */
+  0,                             /* tp_call */
+  0,                             /* tp_str */
+  0,                             /* tp_getattro */
+  0,                             /* tp_setattro */
+  0,                             /* tp_as_buffer */
+  Py_TPFLAGS_DEFAULT,            /* tp_flags */
+  ENTRY_DOC,                     /* tp_doc */
+  0,                             /* tp_traverse */
+  0,                             /* tp_clear */
+  0,                             /* tp_richcompare */
+  0,                             /* tp_weaklistoffset */
+  0,                             /* tp_iter */
+  0,                             /* tp_iternext */
+  0,                             /* tp_methods */
+  0,                             /* tp_members */
+  gdpy_entry_getset,             /* tp_getset */
+  0,                             /* tp_base */
+  0,                             /* tp_dict */
+  0,                             /* tp_descr_get */
+  0,                             /* tp_descr_set */
+  0,                             /* tp_dictoffset */
+  (initproc)gdpy_entry_init,     /* tp_init */
+  0,                             /* tp_alloc */
+  gdpy_entry_create,             /* tp_new */
+};
diff --git a/bindings/python/pyfragment.c b/bindings/python/pyfragment.c
new file mode 100644
index 0000000..faca1cb
--- /dev/null
+++ b/bindings/python/pyfragment.c
@@ -0,0 +1,540 @@
+/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#define NO_IMPORT_ARRAY
+#include "pygetdata.h"
+
+/* Fragment */
+static void gdpy_fragment_delete(struct gdpy_fragment_t *self)
+{
+  dtrace("%p", self);
+
+  Py_XDECREF(self->dirfile);
+
+  dreturnvoid();
+}
+
+static PyObject *gdpy_fragment_create(PyTypeObject *type, PyObject *args,
+    PyObject *keys)
+{
+  struct gdpy_fragment_t *self;
+
+  dtrace("%p, %p, %p", type, args, keys);
+
+  self = (struct gdpy_fragment_t*)type->tp_alloc(type, 0);
+
+  if (self)
+    self->dirfile = NULL;
+
+  dreturn("%p", self);
+  return (PyObject*)self;
+}
+
+static int gdpy_fragment_init(struct gdpy_fragment_t *self, PyObject *args,
+    PyObject *keys)
+{
+  char *keywords[] = {"dirfile", "index", NULL};
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "O!i:pygetdata.fragment.__init__", keywords, &gdpy_dirfile,
+        &self->dirfile, self->n))
+  {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  Py_INCREF(self->dirfile);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_fragment_getindex(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  pyobj = PyInt_FromLong(self->n);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_fragment_getname(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  const char *name;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  name = gd_fragmentname(self->dirfile->D, self->n);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  pyobj = PyString_FromString(name);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_fragment_getencoding(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  unsigned long enc;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  enc = gd_encoding(self->dirfile->D, self->n);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  pyobj = PyLong_FromUnsignedLong(enc);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_fragment_setencoding(struct gdpy_fragment_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "encoding", "recode", NULL };
+  unsigned long enc;
+  int recode = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "k|i:pygetdata.fragment.alter_encoding", keywords, &enc, &recode))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_alter_encoding(self->dirfile->D, enc, self->n, recode);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_fragment_getendianness(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  unsigned long end;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  end = gd_endianness(self->dirfile->D, self->n);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  pyobj = PyLong_FromUnsignedLong(end);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_fragment_setendianness(struct gdpy_fragment_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "endianness", "recode", NULL };
+  unsigned long end;
+  int recode = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "k|i:pygetdata.fragment.alter_endianness", keywords, &end, &recode))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_alter_endianness(self->dirfile->D, end, self->n, recode);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_fragment_rewrite(struct gdpy_fragment_t *self)
+{
+  dtrace("%p", self);
+
+  gd_rewrite_fragment(self->dirfile->D, self->n);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_fragment_getoffset(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  off_t offset;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  offset = gd_frameoffset(self->dirfile->D, self->n);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  pyobj = PyLong_FromLongLong((long long)offset);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_fragment_setoffset(struct gdpy_fragment_t *self,
+    PyObject *args, PyObject *keys)
+{
+  char *keywords[] = { "frameoffset", "recode", NULL };
+  long long offset;
+  int recode = 0;
+
+  dtrace("%p, %p, %p", self, args, keys);
+
+  if (!PyArg_ParseTupleAndKeywords(args, keys,
+        "L|i:pygetdata.fragment.alter_frameoffset", keywords, &offset, &recode))
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  gd_alter_frameoffset(self->dirfile->D, (off_t)offset, self->n,
+      recode);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  Py_INCREF(Py_None);
+  dreturn("%p", Py_None);
+  return Py_None;
+}
+
+static PyObject *gdpy_fragment_getparent(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  int parent;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  parent = gd_parent_fragment(self->dirfile->D, self->n);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  pyobj = PyInt_FromLong(parent);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static PyObject *gdpy_fragment_getprotection(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  int prot;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  prot = gd_protection(self->dirfile->D, self->n);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  pyobj = PyInt_FromLong(prot);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_fragment_setprotection(struct gdpy_fragment_t *self,
+    PyObject *value, void *closure)
+{
+  int p;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  p = PyInt_AsLong(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gd_alter_protection(self->dirfile->D, p, self->n);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_fragment_getprefix(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  char *prefix, *suffix;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  gd_fragment_affixes(self->dirfile->D, self->n, &prefix, &suffix);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  free(suffix);
+  if (prefix == NULL) {
+    Py_INCREF(Py_None);
+    dreturn("%p", Py_None);
+    return Py_None;
+  }
+
+  pyobj = PyString_FromString(prefix);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_fragment_setprefix(struct gdpy_fragment_t *self,
+    PyObject *value, void *closure)
+{
+  const char *prefix;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  prefix = PyString_AsString(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gd_alter_affixes(self->dirfile->D, self->n, prefix, NULL);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyObject *gdpy_fragment_getsuffix(struct gdpy_fragment_t *self,
+    void *closure)
+{
+  char *prefix, *suffix;
+  PyObject *pyobj;
+
+  dtrace("%p, %p", self, closure);
+
+  gd_fragment_affixes(self->dirfile->D, self->n, &prefix, &suffix);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, NULL);
+
+  free(prefix);
+  if (suffix == NULL) {
+    Py_INCREF(Py_None);
+    dreturn("%p", Py_None);
+    return Py_None;
+  }
+
+  pyobj = PyString_FromString(suffix);
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+static int gdpy_fragment_setsuffix(struct gdpy_fragment_t *self,
+    PyObject *value, void *closure)
+{
+  const char *suffix;
+
+  dtrace("%p, %p, %p", self, value, closure);
+
+  suffix = PyString_AsString(value);
+
+  if (PyErr_Occurred()) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  gd_alter_affixes(self->dirfile->D, self->n, NULL, suffix);
+
+  PYGD_CHECK_ERROR(self->dirfile->D, -1);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static PyGetSetDef gdpy_fragment_getset[] = {
+  { "encoding", (getter)gdpy_fragment_getencoding, NULL,
+    "The encoding scheme of this fragment.  This will be one of the\n"
+      "pygetdata.*_ENCODED symbols.  To change this value, use the\n"
+      "alter_encoding method.",
+    NULL },
+  { "endianness", (getter)gdpy_fragment_getendianness, NULL,
+    "The byte sex of this fragment.  This will be either\n"
+      "pygetdata.BIG_ENDIAN or pygetdata.LITTLE_ENDIAN, bitwise or'd with\n"
+      "pygetdata.ARM_ENDIAN or pygetdata.NOT_ARM_ENDIAN.  To change this\n"
+      "value, use the alter_endianness method.",
+    NULL },
+  { "frameoffset", (getter)gdpy_fragment_getoffset, NULL,
+    "The frame offset of this fragment.  To change this value, use the\n"
+      "alter_frameoffset method.",
+    NULL },
+  { "index", (getter)gdpy_fragment_getindex, NULL,
+    "The index number of this fragment.  This is simply the index value\n"
+      "passed to the constructor.",
+    NULL },
+  { "name", (getter)gdpy_fragment_getname, NULL,
+    "The pathname of this fragment.  This attribute cannot be changed.\n"
+      "See gd_fragmentname(3).",
+    NULL },
+  { "parent", (getter)gdpy_fragment_getparent, NULL,
+    "The fragment index of this fragment's parent.  Since the primary\n"
+      "format file has no parent, an error will occur if an attempt is made\n"
+      "to read this attribute for the primary format file.  This value\n"
+      "cannot be changed.  To move a format file fragment to a different\n"
+      "parent fragment, use dirfile.uninclude() and dirfile.include().",
+    NULL },
+  { "prefix", (getter)gdpy_fragment_getprefix, (setter)gdpy_fragment_setprefix,
+    "The prefix applied to all fields defined in this fragment and\n"
+      "subfragments.  See gd_fragment_affixes(3).",
+    NULL },
+  { "protection", (getter)gdpy_fragment_getprotection,
+    (setter)gdpy_fragment_setprotection,
+    "The (advisory) protection level of this fragment.  This will be one\n"
+      "the pygetdata.PROTECT_* symbols.  The protection level of this\n"
+      "fragment can be changed by assigning to this attribute.  See\n"
+      "gd_protection(3) and gd_alter_protection(3).",
+    NULL },
+  { "suffix", (getter)gdpy_fragment_getsuffix, (setter)gdpy_fragment_setsuffix,
+    "The suffix applied to all fields defined in this fragment and\n"
+      "subfragments.  See gd_fragment_affixes(3).",
+    NULL },
+  { NULL }
+};
+
+static PyMethodDef gdpy_fragment_methods[] = {
+  {"alter_encoding", (PyCFunction)gdpy_fragment_setencoding,
+    METH_VARARGS | METH_KEYWORDS,
+    "alter_encoding(encoding [, recode])\n\n"
+      "Change the encoding scheme of this fragment.  The 'encoding'\n"
+      "parameter should be one of the pygetdata.*_ENCODED symbols\n"
+      "(excluding pygetdata.AUTO_ENCODED).  If 'recode' is given, and is\n"
+      "non-zero, the RAW files affected by this change will be converted\n"
+      "to the new encoding.  See gd_alter_encoding(3)."
+  },
+  {"alter_endianness", (PyCFunction)gdpy_fragment_setendianness,
+    METH_VARARGS | METH_KEYWORDS,
+    "alter_endianness(endianness [, recode])\n\n"
+      "Change the byte sex of this fragment.  The 'endianness' parameter\n"
+      "should be pygetdata.LITTLE_ENDIAN, pygetdata.BIG_ENDIAN, or some\n"
+      "combination of these two as described in the gd_alter_endianness\n"
+      /* -----------------------------------------------------------------| */
+      "manual page, and possibly bitwise or'd with pygetdata.ARM_ENDIAN or\n"
+      "pygetdata.NOT_ARM_ENDIAN.  If 'recode' is given, and is non-zero,\n"
+      "the RAW files affected by this change will be converted to the byte\n"
+      "sex.  See gd_alter_endianness(3)."
+  },
+  {"alter_frameoffset", (PyCFunction)gdpy_fragment_setoffset,
+    METH_VARARGS | METH_KEYWORDS,
+    "alter_frameoffset(frameoffset [, recode])\n\n"
+      "Change the frame offset of this fragment.  The 'frameoffset'\n"
+      "parameter should specify the new frame offset.  If 'recode' is\n"
+      "given, and is non-zero, the RAW files affected bt this change will\n"
+      "be shifted appropriately for the new frame offset.  See\n"
+      "gd_alter_frameoffset(3)."
+  },
+  {"rewrite", (PyCFunction)gdpy_fragment_rewrite, METH_NOARGS,
+    "rewrite()\n\n"
+      "Force re-writing of this fragment on disc, regardless of whether\n"
+      "it has been modified or not.  See gd_rewrite_fragment(3)."
+  },
+  { NULL, NULL, 0, NULL }
+};
+
+#define FRAGMENT_DOC \
+"fragment(dirfile, index)\n\n"\
+"Returns a fragment object which describes the fragment-specific metadata\n"\
+"of one format file fragment in a dirfile.  The 'dirfile' parameter\n"\
+"should be a dirfile object.  Index is the fragment index of the desired\n"\
+"format file fragment.  This constructor is equivalent to calling\n\n"\
+"  dirfile.fragment(index)\n\n"\
+"The fragment object remains connected to its dirfile, and changes made\n"\
+"to the fragment object are propagated back to the dirfile.  This object\n"\
+/* ---------------------------------------------------------------------| */\
+"creates a new reference to the supplied dirfile.  Calling\n"\
+"close() or discard() on the dirfile and then attempting to access a\n"\
+"fragment object previously derived from that dirfile will result in an\n"\
+"error."
+
+PyTypeObject gdpy_fragment = {
+  PyObject_HEAD_INIT(NULL)
+    0,                           /* ob_size */
+  "pygetdata.fragment",          /* tp_name */
+  sizeof(struct gdpy_fragment_t),/* tp_basicsize */
+  0,                             /* tp_itemsize */
+  (destructor)gdpy_fragment_delete, /* tp_dealloc */
+  0,                             /* tp_print */
+  0,                             /* tp_getattr */
+  0,                             /* tp_setattr */
+  0,                             /* tp_compare */
+  0,                             /* tp_repr */
+  0,                             /* tp_as_number */
+  0,                             /* tp_as_sequence */
+  0,                             /* tp_as_mapping */
+  0,                             /* tp_hash */
+  0,                             /* tp_call */
+  0,                             /* tp_str */
+  0,                             /* tp_getattro */
+  0,                             /* tp_setattro */
+  0,                             /* tp_as_buffer */
+  Py_TPFLAGS_DEFAULT,            /* tp_flags */
+  FRAGMENT_DOC,                  /* tp_doc */
+  0,                             /* tp_traverse */
+  0,                             /* tp_clear */
+  0,                             /* tp_richcompare */
+  0,                             /* tp_weaklistoffset */
+  0,                             /* tp_iter */
+  0,                             /* tp_iternext */
+  gdpy_fragment_methods,         /* tp_methods */
+  0,                             /* tp_members */
+  gdpy_fragment_getset,          /* tp_getset */
+  0,                             /* tp_base */
+  0,                             /* tp_dict */
+  0,                             /* tp_descr_get */
+  0,                             /* tp_descr_set */
+  0,                             /* tp_dictoffset */
+  (initproc)gdpy_fragment_init,  /* tp_init */
+  0,                             /* tp_alloc */
+  gdpy_fragment_create,          /* tp_new */
+};
diff --git a/bindings/python/pygetdata.c b/bindings/python/pygetdata.c
new file mode 100644
index 0000000..3f23fef
--- /dev/null
+++ b/bindings/python/pygetdata.c
@@ -0,0 +1,673 @@
+/* Copyright (C) 2009-2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "pygetdata.h"
+
+static PyObject *GdPy_DirfileError;
+static const char *gdpy_exception_list[GD_N_ERROR_CODES] = {
+  NULL,
+  "Open",
+  "Format",
+  "Truncate",
+  "Creation",
+  "BadCode",
+  "BadType",
+  "RawIO",
+  "OpenFragment",
+  "Internal",
+  "Alloc",
+  "Range",
+  "OpenLinfile",
+  "RecurseLevel",
+  "BadDirfile",
+  "BadFieldType",
+  "AccessMode",
+  "Unsupported",
+  "UnknownEncoding",
+  "BadEntry",
+  "Duplicate",
+  "Dimension",
+  "BadIndex",
+  "BadScalar",
+  "BadReference",
+  "Protected",
+  "Deletion",
+  "Argument",
+  "Callback",
+  "Exists",
+  "UncleanDatabase",
+  "Domain",
+  "BadRepr",
+  NULL,
+  "Flush",
+  "Bounds",
+  "LineTooLong"
+};
+PyObject *gdpy_exceptions[GD_N_ERROR_CODES];
+
+/* Like PyList_Append, but steal the object's reference */
+int gdpylist_append(PyObject *list, PyObject *item)
+{
+  dtrace("%p, %p", list, item);
+  int ret;
+
+  ret = PyList_Append(list, item);
+  Py_DECREF(item);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+/* Create an array of strings from a NULL-terminated string list */
+PyObject *gdpy_to_pystringlist(const char **list)
+{
+  PyObject *pyobj;
+  size_t i;
+
+  dtrace("%p", list);
+
+  pyobj = PyList_New(0);
+  if (pyobj)
+    for (i = 0; list[i] != NULL; ++i)
+      if (gdpylist_append(pyobj, PyString_FromString(list[i]))) {
+        Py_DECREF(pyobj);
+        pyobj = NULL;
+        break;
+      }
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+int gdpy_convert_from_pyobj(PyObject *value, union gdpy_quadruple_value *data,
+    gd_type_t type)
+{
+  int data_type;
+
+  dtrace("%p, %p, %02x", value, data, type);
+
+  /* check value type, and figure out autotype, if needed */
+  if (PyInt_Check(value)) {
+    data->s = PyInt_AsLong(value);
+    data_type = GDPY_INT_AS_LONG;
+
+    if (PyErr_Occurred()) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  } else if (PyLong_Check(value)) {
+    if (type == GD_UNKNOWN) {
+      /* try unsigned long long first */
+      data->u = PyLong_AsUnsignedLongLong(value);
+      data_type = GDPY_LONG_AS_ULL;
+
+      if (PyErr_Occurred()) {
+        if (PyErr_ExceptionMatches(PyExc_OverflowError)) { /* too big */
+          data->f = PyLong_AsDouble(value);
+          data_type = GDPY_LONG_AS_DOUBLE;
+
+          if (PyErr_Occurred()) {
+            dreturn("%i", -1);
+            return -1;
+          }
+        } else if (PyErr_ExceptionMatches(PyExc_TypeError)) { /* too small */
+          data->f = PyLong_AsDouble(value);
+          data_type = GDPY_LONG_AS_DOUBLE;
+
+          if (PyErr_Occurred()) {
+            if (PyErr_ExceptionMatches(PyExc_TypeError)) { /* still too small */
+              data->s = PyLong_AsLongLong(value);
+              data_type = GDPY_LONG_AS_SLL;
+
+              if (PyErr_Occurred()) {
+                dreturn("%i", -1);
+                return -1;
+              }
+            } else { /* some other error */
+              dreturn("%i", -1);
+              return -1;
+            }
+          }
+        } else { /* some other error */
+          dreturn("%i", -1);
+          return -1;
+        }
+      }
+    } else if (type & GD_SIGNED) {
+      data->s = PyLong_AsLongLong(value);
+      data_type = GDPY_LONG_AS_SLL;
+
+      if (PyErr_Occurred()) {
+        dreturn("%i", -1);
+        return -1;
+      }
+    } else if (type & GD_IEEE754) {
+      data->f = PyLong_AsDouble(value);
+      data_type = GDPY_LONG_AS_DOUBLE;
+
+      if (PyErr_Occurred()) {
+        dreturn("%i", -1);
+        return -1;
+      }
+    } else {
+      data->u = PyLong_AsLongLong(value);
+      data_type = GDPY_LONG_AS_ULL;
+
+      if (PyErr_Occurred()) {
+        dreturn("%i", -1);
+        return -1;
+      }
+    }
+  } else if (PyFloat_Check(value)) {
+    data->f = PyFloat_AsDouble(value);
+    data_type = GDPY_FLOAT_AS_DOUBLE;
+
+    if (PyErr_Occurred()) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  } else if (PyComplex_Check(value)) {
+    gdpy_as_complex(gd_csp_(data->c), value);
+    data_type = GDPY_COMPLEX_AS_COMPLEX;
+
+    if (PyErr_Occurred()) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  } else { /* a non-numeric type */
+    PyErr_SetString(PyExc_TypeError, "a numeric type was expected");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%02x", data_type);
+  return data_type;
+}
+
+gd_type_t gdpy_convert_from_pylist(PyObject *value, void *data, gd_type_t type,
+    size_t ns)
+{
+  size_t i;
+  int data_type;
+  union gdpy_quadruple_value tmp;
+
+  dtrace("%p, %p, %02x, %zi", value, data, type, ns);
+
+  /* use the first element to determine the data type */
+  data_type = gdpy_convert_from_pyobj(PyList_GetItem(value, 0), &tmp, type);
+
+  if (data_type == -1) {
+    dreturn("%02x", GD_UNKNOWN);
+    return GD_UNKNOWN;
+  }
+
+  switch(data_type) {
+    case GDPY_INT_AS_LONG:
+      type = GD_INT32;
+      *(int32_t*)data = tmp.s;
+      for (i = 1; i < ns; ++i)
+        ((int32_t*)data)[i] = PyInt_AsLong(PyList_GetItem(value, i));
+      break;
+    case GDPY_LONG_AS_ULL: 
+      type = GD_UINT64;
+      *(uint64_t*)data = tmp.u;
+      for (i = 1; i < ns; ++i)
+        ((uint64_t*)data)[i] = PyLong_AsUnsignedLongLong(PyList_GetItem(value,
+            i));
+      break;
+    case GDPY_LONG_AS_SLL: 
+      type = GD_INT64;
+      *(int64_t*)data = tmp.s;
+      for (i = 1; i < ns; ++i)
+        ((int64_t*)data)[i] = PyLong_AsLongLong(PyList_GetItem(value, i));
+      break;
+    case GDPY_LONG_AS_DOUBLE: 
+      type = GD_FLOAT64;
+      *(double*)data = tmp.f;
+      for (i = 1; i < ns; ++i)
+        ((double*)data)[i] = PyLong_AsDouble(PyList_GetItem(value, i));
+      break;
+    case GDPY_FLOAT_AS_DOUBLE:
+      type = GD_FLOAT64;
+      *(double*)data = tmp.f;
+      for (i = 1; i < ns; ++i)
+        ((double*)data)[i] = PyFloat_AsDouble(PyList_GetItem(value, i));
+      break;
+    case GDPY_COMPLEX_AS_COMPLEX:
+      type = GD_COMPLEX128;
+      gd_cs2ca_(data, 0, tmp.c, double);
+      for (i = 1; i < ns; ++i)
+        gdpy_as_complex(((double*)data) + 2 * i, PyList_GetItem(value, i));
+      break;
+  }
+
+  dreturn("%02x", type);
+  return type;
+}
+
+/* generic utitily functions */
+#ifdef USE_NUMPY
+gd_type_t gdpy_type_from_npytype(int npytype)
+{
+  gd_type_t type;
+
+  dtrace("%i", npytype);
+
+  switch(npytype)
+  {
+    case NPY_UBYTE:
+      type = GD_UINT8;
+      break;
+    case NPY_BYTE:
+      type = GD_INT8;
+      break;
+#if NPY_SIZEOF_SHORT <= 8
+    case NPY_SHORT:
+      type = (gd_type_t)(NPY_SIZEOF_SHORT | GD_SIGNED);
+      break;
+    case NPY_USHORT:
+      type = (gd_type_t)NPY_SIZEOF_SHORT;
+      break;
+#endif
+#if NPY_SIZEOF_INT <= 8
+    case NPY_INT:
+      type = (gd_type_t)(NPY_SIZEOF_INT | GD_SIGNED);
+      break;
+    case NPY_UINT:
+      type = (gd_type_t)NPY_SIZEOF_INT;
+      break;
+#endif
+#if NPY_SIZEOF_LONG <= 8
+    case NPY_LONG:
+      type = (gd_type_t)(NPY_SIZEOF_LONG | GD_SIGNED);
+      break;
+    case NPY_ULONG:
+      type = (gd_type_t)NPY_SIZEOF_LONG;
+      break;
+#endif
+#if NPY_SIZEOF_LONGLONG <= 8
+    case NPY_LONGLONG:
+      type = (gd_type_t)(NPY_SIZEOF_LONGLONG | GD_SIGNED);
+      break;
+    case NPY_ULONGLONG:
+      type = (gd_type_t)NPY_SIZEOF_LONGLONG;
+      break;
+#endif
+#if NPY_SIZEOF_FLOAT <= 8
+    case NPY_FLOAT:
+      type = (gd_type_t)NPY_SIZEOF_FLOAT | GD_IEEE754;
+      break;
+    case NPY_CFLOAT:
+      type = (gd_type_t)((2 * NPY_SIZEOF_FLOAT) | GD_COMPLEX);
+      break;
+#endif
+#if NPY_SIZEOF_DOUBLE <= 8
+    case NPY_DOUBLE:
+      type = (gd_type_t)(NPY_SIZEOF_DOUBLE | GD_IEEE754);
+      break;
+    case NPY_CDOUBLE:
+      type = (gd_type_t)((2 * NPY_SIZEOF_DOUBLE) | GD_COMPLEX);
+      break;
+#endif
+    default:
+      type = GD_UNKNOWN;
+      break;
+  }
+
+  dreturn("0x%03x\n", type);
+  return type;
+}
+
+int gdpy_npytype_from_type(gd_type_t type)
+{
+  int npytype;
+
+  dtrace("0x%03x", type);
+
+  switch(type)
+  {
+    case GD_UINT8:
+      npytype = PyArray_UINT8;
+      break;
+    case GD_INT8:
+      npytype = PyArray_INT8;
+      break;
+    case GD_UINT16:
+      npytype = PyArray_UINT16;
+      break;
+    case GD_INT16:
+      npytype = PyArray_INT16;
+      break;
+    case GD_UINT32:
+      npytype = PyArray_UINT32;
+      break;
+    case GD_INT32:
+      npytype = PyArray_INT32;
+      break;
+    case GD_UINT64:
+      npytype = PyArray_UINT64;
+      break;
+    case GD_INT64:
+      npytype = PyArray_INT64;
+      break;
+    case GD_FLOAT32:
+      npytype = PyArray_FLOAT32;
+      break;
+    case GD_FLOAT64:
+      npytype = PyArray_FLOAT64;
+      break;
+    case GD_COMPLEX64:
+      npytype = PyArray_COMPLEX64;
+      break;
+    case GD_COMPLEX128:
+      npytype = PyArray_COMPLEX128;
+      break;
+    default:
+      npytype = NPY_NOTYPE;
+      break;
+  }
+
+  dreturn("%i", npytype);
+  return npytype;
+}
+#endif
+
+PyObject *gdpy_convert_to_pylist(const void *data, gd_type_t type, size_t ns)
+{
+  size_t i;
+  PyObject *pyobj;
+
+  dtrace("%p, %02x, %zi", data, type, ns);
+
+  if (type != GD_NULL)
+    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])))
+          return NULL;
+      break;
+    case GD_INT8:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj, PyInt_FromLong((long)((int8_t*)data)[i])))
+          return NULL;
+      break;
+    case GD_UINT16:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj, PyInt_FromLong((long)((uint16_t*)data)[i])))
+          return NULL;
+      break;
+    case GD_INT16:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj, PyInt_FromLong((long)((int16_t*)data)[i])))
+          return NULL;
+      break;
+    case GD_UINT32:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj,
+              PyLong_FromUnsignedLong((unsigned long)((uint32_t*)data)[i])))
+          return NULL;
+      break;
+    case GD_INT32:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj, PyInt_FromLong((long)((int32_t*)data)[i])))
+          return NULL;
+      break;
+    case GD_UINT64:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj, PyLong_FromUnsignedLongLong(
+                (unsigned long long)((uint64_t*)data)[i])))
+          return NULL;
+      break;
+    case GD_INT64:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj,
+              PyLong_FromLongLong((long long)((int64_t*)data)[i])))
+          return NULL;
+      break;
+    case GD_FLOAT32:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj,
+              PyFloat_FromDouble((double)((float*)data)[i])))
+          return NULL;
+      break;
+    case GD_FLOAT64:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj, PyFloat_FromDouble(((double*)data)[i])))
+          return NULL;
+      break;
+    case GD_COMPLEX64:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj, gdpy_from_complexp(((float*)data) + 2 * i)))
+          return NULL;
+      break;
+    case GD_COMPLEX128:
+      for (i = 0; i < ns; ++i)
+        if (gdpylist_append(pyobj, gdpy_from_complexp(((double*)data) + 2 * i)))
+          return NULL;
+      break;
+    case GD_UNKNOWN: /* prevent compiler warning */
+      break;
+  }
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+PyObject *gdpy_convert_to_pyobj(const void *data, gd_type_t type)
+{
+  PyObject *pyobj = NULL;
+
+  dtrace("%p, %02x", data, type);
+
+  switch(type) {
+    case GD_NULL:
+      Py_INCREF(Py_None);
+      pyobj = Py_None;
+      break;
+    case GD_UINT8:
+      pyobj = PyInt_FromLong((long)*(uint8_t*)data);
+      break;
+    case GD_INT8:
+      pyobj = PyInt_FromLong((long)*(int8_t*)data);
+      break;
+    case GD_UINT16:
+      pyobj = PyInt_FromLong((long)*(uint16_t*)data);
+      break;
+    case GD_INT16:
+      pyobj = PyInt_FromLong((long)*(int16_t*)data);
+      break;
+    case GD_UINT32:
+      pyobj = PyLong_FromUnsignedLong((unsigned long)*(uint32_t*)data);
+      break;
+    case GD_INT32:
+      pyobj = PyInt_FromLong((long)*(int32_t*)data);
+      break;
+    case GD_UINT64:
+      pyobj = PyLong_FromUnsignedLongLong((unsigned long long)*(uint64_t*)data);
+      break;
+    case GD_INT64:
+      pyobj = PyLong_FromLongLong((long long)*(int64_t*)data);
+      break;
+    case GD_FLOAT32:
+      pyobj = PyFloat_FromDouble((double)*(float*)data);
+      break;
+    case GD_FLOAT64:
+      pyobj = PyFloat_FromDouble(*(double*)data);
+      break;
+    case GD_COMPLEX64:
+      pyobj = gdpy_from_complexp((float*)data);
+      break;
+    case GD_COMPLEX128:
+      pyobj = gdpy_from_complexp((double*)data);
+      break;
+    case GD_UNKNOWN: /* prevent compiler warning */
+      break;
+  }
+
+  dreturn("%p", pyobj);
+  return pyobj;
+}
+
+/* GetData */
+static PyMethodDef GetDataMethods[] = {
+  { NULL, NULL, 0, NULL }
+};
+
+PyMODINIT_FUNC initpygetdata(void)
+{
+  int i;
+  PyObject *mod;
+
+  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"
+      "This module provides interfaces to the C GetData library.  It defines "
+      "three\nmain classes:\n\n"
+      "  o dirfile, encapsulating the C API's DIRFILE object,\n"
+      "  o entry, encapsulating the C API's gd_entry_t object, and\n"
+      "  o fragment, containing fragment metadata.\n\n"
+      "Second, it defines various symbolic constants defined by the C API.  "
+      "These\nsymbols are identical to the C API's symbols, except lacking the "
+      "GD_ prefix.\nSo, for example, the C API's GD_INT8 is available in these "
+      "bindings as\npygetdata.INT8.\n\n"
+      "Finally, it defines a number of exceptions corresponding to C API "
+      "dirfile\nerror codes.  These exceptions have similar names to the C "
+      "API's error\nnames, so, for example, pygetdata.BadCodeError corresponds "
+      "to the C API's\nGD_E_BAD_CODE error code.  All these exceptions are "
+      "derived from a common\npygetdata.DirfileError exception class, itself "
+      "derived from RuntimeError.\nExceptions are thrown by the bindings in "
+      "lieu of returning a dirfile error\nvalue.\n\n"
+      "Where possible, pygetdata will, by default, return vector data as "
+      "NumPy\narrays.  If "
+      "pygetdata has been built with NumPy support,\n"
+      "pygetdata.__numpy_supported__ will be non-zero.  If NumPy support is "
+      "not\npresent, vector data will be returned as Python lists.  Vector "
+      "data passed\nto pygetdata may either be a Python list or a NumPy array."
+      "\n\n"
+      "The input data type argument to bindings for functions such as\n"
+      "gd_putdata(3), which is required in the C API, are typically optional,\n"
+      "as pygetdata can determine the input data type by itself, and convert "
+      "it to\nan appropriate type for the C API.  If the data type is supplied,"
+      " pygetdata\nwill coerce the input data to the specified C type as best "
+      "it can.  For\ngd_getdata(3) and similar, the C API types are converted "
+      "to Python types as\nfollows:\n\n"
+      "  o int     -- UINT8, INT8, UINT16, INT16, INT32\n"
+      "  o long    -- UINT32, UINT64, INT64\n"
+      "  o float   -- FLOAT32, FLOAT64\n"
+      "  o complex -- COMPLEX64, COMPLEX128\n\n"
+      "or to NumPy data types, as appropriate.  "
+      "For convenience, the following type\ncode aliases are defined:\n\n"
+      "  o pygetdata.INT     = pygetdata.INT32\n"
+      "  o pygetdata.LONG    = pygetdata.INT64\n"
+      "  o pygetdata.ULONG   = pygetdata.UINT64\n"
+      "  o pygetdata.FLOAT   = pygetdata.FLOAT64\n"
+      "  o pygetdata.COMPLEX = pygetdata.COMPLEX128\n\n"
+      "Note that pygetdata.FLOAT is different than the C API's GD_FLOAT "
+      "alias.\n\n"
+      "All pygetdata functions may be given positional or keyword parameters."
+      );
+
+  if (mod == NULL)
+    return;
+  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");
+
+  /* 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");
+
+  /* add exceptions */
+  GdPy_DirfileError = PyErr_NewException("pygetdata.DirfileError",
+      PyExc_RuntimeError, NULL);
+  Py_INCREF(GdPy_DirfileError);
+  PyModule_AddObject(mod, "DirfileError", GdPy_DirfileError);
+
+  for (i = 1; i < GD_N_ERROR_CODES; ++i) {
+    if (gdpy_exception_list[i]) {
+      char name[40];
+      sprintf(name, "pygetdata.%sError", gdpy_exception_list[i]);
+      gdpy_exceptions[i] = PyErr_NewException(name, GdPy_DirfileError, NULL);
+      Py_INCREF(gdpy_exceptions[i]);
+      PyModule_AddObject(mod, name + 10, gdpy_exceptions[i]);
+    } else
+      gdpy_exceptions[i] = GdPy_DirfileError;
+  }
+  dprintf("Exceptions added");
+
+  dreturnvoid();
+}
diff --git a/bindings/python/pygetdata.h b/bindings/python/pygetdata.h
new file mode 100644
index 0000000..d0cec8b
--- /dev/null
+++ b/bindings/python/pygetdata.h
@@ -0,0 +1,146 @@
+/* Copyright (C) 2009-2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include <Python.h>
+#define NO_GETDATA_LEGACY_API
+
+#define _FILE_OFFSET_BITS 64
+#undef _BSD_SOURCE
+#undef _POSIX_SOURCE
+#undef _SVID_SOURCE
+#undef _POSIX_C_SOURCE
+#undef SIZEOF_OFF_T
+#include "../../src/internal.h"
+
+#ifdef HAVE_NUMPY_ARRAYOBJECT_H
+# define PY_ARRAY_UNIQUE_SYMBOL gdpy_array_api
+# include <numpy/arrayobject.h>
+#endif
+
+#define GDPY_UNSIGNED        0x00
+#define GDPY_SIGNED          0x01
+#define GDPY_IEEE754         0x02
+#define GDPY_COMPLEX         0x03
+
+#define GDPY_INT             0x00
+#define GDPY_LONG            0x10
+#define GDPY_FLOAT           0x20
+#define GDPY_PYCOMPLEX       0x40
+
+#define GDPY_INT_AS_LONG        (GDPY_INT       | GDPY_SIGNED)
+#define GDPY_LONG_AS_ULL        (GDPY_LONG      | GDPY_UNSIGNED)
+#define GDPY_LONG_AS_SLL        (GDPY_LONG      | GDPY_SIGNED)
+#define GDPY_LONG_AS_DOUBLE     (GDPY_LONG      | GDPY_IEEE754)
+#define GDPY_FLOAT_AS_DOUBLE    (GDPY_FLOAT     | GDPY_IEEE754)
+#define GDPY_COMPLEX_AS_COMPLEX (GDPY_PYCOMPLEX | GDPY_COMPLEX)
+
+#define GDPY_INVALID_OP(t) ( \
+    t != GD_WINDOP_EQ && t != GD_WINDOP_NE && \
+    t != GD_WINDOP_GE && t != GD_WINDOP_GT && \
+    t != GD_WINDOP_LE && t != GD_WINDOP_LT && \
+    t != GD_WINDOP_SET && t != GD_WINDOP_CLR )
+
+#define GDPY_INVALID_TYPE(t) ( \
+    t != GD_UINT8     && t != GD_INT8    && \
+    t != GD_UINT16    && t != GD_INT16   && \
+    t != GD_UINT32    && t != GD_INT32   && \
+    t != GD_UINT64    && t != GD_INT64   && \
+    t != GD_FLOAT32   && t != GD_FLOAT64 && \
+    t != GD_COMPLEX64 && t != GD_COMPLEX128 )
+
+#define PYGD_CHECK_ERROR(D,R) PYGD_CHECK_ERROR2(D,R,)
+
+#define PYGD_CHECK_ERROR2(D,R,E) \
+  do { \
+    int e; \
+    if ((e = gd_error(D))) { \
+      PYGD_REPORT_ERROR(D,e); \
+      E; \
+      dreturnvoid(); \
+      return (R); \
+    } \
+  } while(0)
+
+#define PYGD_REPORT_ERROR(D,e) \
+  do { \
+    char *buffer = gd_error_string((D), NULL, 0); \
+    if (buffer) { \
+      PyErr_SetString(gdpy_exceptions[e], buffer); \
+      free(buffer); \
+    } else \
+    PyErr_SetString(gdpy_exceptions[e], "Unspecified error"); \
+  } while (0)
+
+extern PyObject *gdpy_exceptions[GD_N_ERROR_CODES];
+extern PyTypeObject gdpy_dirfile;
+extern PyTypeObject gdpy_entry;
+extern PyTypeObject gdpy_fragment;
+
+extern const struct gdpy_constant_t {
+  char *name;
+  long value;
+} gdpy_constant_list[];
+
+struct gdpy_dirfile_t {
+  PyObject_HEAD
+  DIRFILE *D;
+  int mplex_lookback;
+  char *verbose_prefix;
+  PyObject *callback_data;
+  PyObject *callback;
+  int callback_exception;
+};
+
+struct gdpy_entry_t {
+  PyObject_HEAD
+  gd_entry_t *E;
+};
+
+struct gdpy_fragment_t {
+  PyObject_HEAD
+  int n;
+  struct gdpy_dirfile_t *dirfile;
+};
+
+union gdpy_quadruple_value {
+  uint64_t u;
+  int64_t s;
+  double f;
+  GD_DCOMPLEXA(c);
+};
+
+#define gdpy_as_complex(v,o) do { \
+  Py_complex c = PyComplex_AsCComplex(o); \
+  gd_li2cp_((v), c.real, c.imag); \
+} while(0)
+
+#define gdpy_from_complexp(c) PyComplex_FromDoubles((c)[0], (c)[1])
+#define gdpy_from_complex(c) PyComplex_FromDoubles(creal(c), cimag(c))
+
+extern int gdpylist_append(PyObject *, PyObject *);
+extern int gdpy_convert_from_pyobj(PyObject*, union gdpy_quadruple_value*,
+    gd_type_t);
+extern gd_type_t gdpy_convert_from_pylist(PyObject*, void*, gd_type_t, size_t);
+extern PyObject *gdpy_convert_to_pyobj(const void*, gd_type_t);
+extern PyObject *gdpy_convert_to_pylist(const void*, gd_type_t, size_t);
+extern PyObject *gdpy_to_pystringlist(const char **list);
+extern int gdpy_npytype_from_type(gd_type_t type);
+extern gd_type_t gdpy_type_from_npytype(int npytype);
+PyMODINIT_FUNC initpygetdata(void);
diff --git a/bindings/python/test/Makefile.am b/bindings/python/test/Makefile.am
new file mode 100644
index 0000000..92e69cb
--- /dev/null
+++ b/bindings/python/test/Makefile.am
@@ -0,0 +1,40 @@
+# Copyright (C) 2009-2010, 2015 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign serial-tests
+
+if TEST_PYTHON
+TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} PYTHONPATH=${PYTHONPATH}:../.libs/ ${PYTHON}
+pyTESTS=callback.py big_test.py
+TESTS=$(addprefix ${srcdir}/,$(pyTESTS))
+endif
+
+EXTRA_DIST=${pyTESTS}
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~ 
diff --git a/bindings/python/test/Makefile.in b/bindings/python/test/Makefile.in
new file mode 100644
index 0000000..e257119
--- /dev/null
+++ b/bindings/python/test/Makefile.in
@@ -0,0 +1,673 @@
+# 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/python/test
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/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_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2009-2010, 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_PYTHON_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} PYTHONPATH=${PYTHONPATH}:../.libs/ ${PYTHON}
+ at TEST_PYTHON_TRUE@pyTESTS = callback.py big_test.py
+ at TEST_PYTHON_TRUE@TESTS = $(addprefix ${srcdir}/,$(pyTESTS))
+EXTRA_DIST = ${pyTESTS}
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/python/test/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign bindings/python/test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am check-local clean \
+	clean-generic clean-libtool clean-local cscopelist-am ctags-am \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am
+
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dirs
+
+getdata-clean-dirs:
+	rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dirs
+	rm -rf *~ 
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bindings/python/test/big_test.py b/bindings/python/test/big_test.py
new file mode 100644
index 0000000..35e5b25
--- /dev/null
+++ b/bindings/python/test/big_test.py
@@ -0,0 +1,2045 @@
+# Copyright (C) 2009-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
+
+import sys
+import os
+import re
+import array
+import pygetdata
+
+if (pygetdata.__numpy_supported__):
+  import numpy
+
+def CheckOK(t):
+  global ne
+  ne+=1
+  print "e[", t, "] =", sys.exc_type, sys.exc_value
+
+def CheckOK2(t,m):
+  global ne
+  ne+=1
+  print "e[", t, ",", m, "] =", sys.exc_type, sys.exc_value
+
+def CheckException(t,g):
+  global ne
+  if (sys.exc_type != g):
+    ne+=1
+    print "e[", t, "] =", sys.exc_type, "expected", g
+
+def CheckException2(t,m,g):
+  global ne
+  if (sys.exc_type != g):
+    ne+=1
+    print "e[", t, ",", m, "] =", sys.exc_type, "expected", g
+
+def CheckNumpy(t,v,g):
+  global ne
+  if (numpy.any(v - g)):
+    ne+=1
+    print "a[", t, "] =", v, "expected", g
+
+def CheckNumpy2(t,m,v,g):
+  global ne
+  if (numpy.any(v - g)):
+    ne+=1
+    print "a[", t, ",", m, "] =", v, "expected", g
+
+def CheckSimple(t,v,g):
+  global ne
+  if (v != g):
+    ne+=1
+    print "n[", t, "] =", v, "expected", g
+
+def CheckSimple2(t,m,v,g):
+  global ne
+  if (v != g):
+    ne+=1
+    print "n[", t, ",", m, "] =", v, "expected", g
+
+def CheckEOS(t,v,g):
+  global ne
+  if (re.search(g + "$", v) == None):
+    ne+=1
+    print "n[", t, "] =", v, "expected", g
+
+# create the dirfile first
+data=array.array("B",range(1,81))
+os.system("rm -rf dirfile")
+os.mkdir("dirfile")
+file=open("dirfile/data", 'w')
+data.tofile(file)
+file.close()
+
+ne = 0
+
+fields = ["INDEX", "alias", "bit", "carray", "const", "data", "div", "lincom",
+"linterp", "mplex", "mult", "phase", "polynom", "recip", "sbit", "string",
+"window"]
+
+nfields = 17
+file=open("dirfile/format", 'w')
+file.write(
+    "/ENDIAN little\n"
+    "data RAW INT8 8\n"
+    "lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const\n"
+    "/META data mstr STRING \"This is a string constant.\"\n"
+    "/META data mconst CONST COMPLEX128 3.3;4.4\n"
+    "/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5\n"
+    "/META data mlut LINTERP DATA ./lut\n"
+    "const CONST FLOAT64 5.5\n"
+    "carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6\n"
+    "linterp LINTERP data ./lut\n"
+    "polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const\n"
+    "bit BIT data 3 4\n"
+    "sbit SBIT data 5 6\n"
+    "mplex MPLEX data sbit 1 10\n"
+    "mult MULTIPLY data sbit\n"
+    "div DIVIDE mult bit\n"
+    "recip RECIP div 6.5;4.3\n"
+    "phase PHASE data 11\n"
+    "window WINDOW linterp mult LT 4.1\n"
+    "/ALIAS alias data\n"
+    "string STRING \"Zaphod Beeblebrox\"\n"
+    )
+file.close()
+
+file=open("dirfile/form2", 'w')
+file.write("const2 CONST INT8 -19\n")
+file.close()
+
+# 0: error check
+try:
+  d = pygetdata.dirfile("x", pygetdata.RDONLY)
+except:
+  CheckException(0, pygetdata.OpenError)
+
+# 1: dirfile check
+try:
+  d = pygetdata.dirfile("dirfile", pygetdata.RDWR)
+except:
+  CheckOK(1)
+
+# 2: getdata (int) check
+try:
+  n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1)
+except:
+  CheckOK(2)
+CheckSimple(2,len(n),8)
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(2,n,numpy.arange(41,49))
+else:
+  CheckSimple(2,n,range(41,49))
+
+# 104: getdata (long) check
+try:
+  n = d.getdata("data", pygetdata.LONG, first_frame=5, num_frames=1)
+except:
+  CheckOK(104)
+CheckSimple(104,len(n),8)
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(104,n,numpy.arange(41L,49L))
+else:
+  CheckSimple(104,n,range(41L,49L))
+
+# 106: getdata (float) check
+try:
+  n = d.getdata("data", pygetdata.FLOAT, first_frame=5, num_frames=1)
+except:
+  CheckOK(106)
+CheckSimple(106,len(n),8)
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(106,n,numpy.arange(41.,49.))
+else:
+  CheckSimple(106,n,[41.,42.,43.,44.,45.,46.,47.,48.])
+
+# 108: getdata (complex) check
+try:
+  n = d.getdata("data", pygetdata.COMPLEX, first_frame=5, num_frames=1)
+except:
+  CheckOK(108)
+CheckSimple(108,len(n),8)
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(108,n,numpy.arange(41,49,dtype=numpy.complex128))
+else:
+  CheckSimple(108,n,[41.+0j,42.+0j,43.+0j,44.+0j,45.+0j,46.+0j,47.+0j,48.+0j])
+
+# 3: constant (int) check
+try:
+  n = d.get_constant("const", pygetdata.INT)
+except:
+  CheckOK(3)
+CheckSimple(3,n,5)
+
+# 112: constant (long) check
+try:
+  n = d.get_constant("const", pygetdata.LONG)
+except:
+  CheckOK(112)
+CheckSimple(112,n,5L)
+
+# 114: constant (float) check
+try:
+  n = d.get_constant("const", pygetdata.FLOAT)
+except:
+  CheckOK(114)
+CheckSimple(114,n,5.5)
+
+# 116: constant (float) check
+try:
+  n = d.get_constant("const", pygetdata.COMPLEX)
+except:
+  CheckOK(116)
+CheckSimple(116,n,5.5+0j)
+
+# 6: nfields check
+try:
+  n = d.nfields()
+except:
+  CheckOK(6)
+CheckSimple(6,n,nfields)
+
+# 8: field_list check
+try:
+  n = d.field_list()
+except:
+  CheckOK(8)
+CheckSimple(8,n,fields)
+
+# 9: nmfields check
+try:
+  n = d.nmfields("data")
+except:
+  CheckOK(9)
+CheckSimple(9,n,4)
+
+# 10: mfield_list check
+try:
+  n = d.mfield_list("data")
+except:
+  CheckOK(10)
+CheckSimple(10,n,["mstr", "mconst", "mcarray", "mlut"])
+
+# 11: nframes check
+try:
+  n = d.nframes
+except:
+  CheckOK(11)
+CheckSimple(11,n,10)
+
+# 12: spf check
+try:
+  n = d.spf("data")
+except:
+  CheckOK(12)
+CheckSimple(12,n,8)
+
+# 13: putdata (int) check
+p = [ 13, 14, 15, 16 ]
+try:
+  n = d.putdata("data", p, pygetdata.INT, first_frame=5, first_sample=1)
+except:
+  CheckOK2(13,1)
+CheckSimple2(13,1,n,4)
+
+try:
+  n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+  CheckOK(13,2)
+CheckSimple2(13,2,n,[41, 13, 14, 15, 16, 46, 47, 48])
+
+# 119: putdata (numpy) check
+if (pygetdata.__numpy_supported__):
+  p = numpy.array([ 73, 74, 75, 76 ])
+  try:
+    n = d.putdata("data", p, first_frame=5, first_sample=1)
+  except:
+    CheckOK2(13,1)
+  CheckSimple2(13,1,n,4)
+
+  try:
+    n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1)
+  except:
+    CheckOK(13,2)
+  CheckNumpy2(13,2,n,numpy.array([41, 73, 74, 75, 76, 46, 47, 48]))
+
+# 120: putdata (long) check
+p = [ 23L, 24L, 25L, 26L ]
+try:
+  n = d.putdata("data", p, pygetdata.LONG, first_frame=5, first_sample=1)
+except:
+  CheckOK2(120,1)
+CheckSimple2(120,1,n,4)
+
+try:
+  n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+  CheckOK(120,2)
+CheckSimple2(120,2,n,[41, 23, 24, 25, 26, 46, 47, 48])
+
+# 122: putdata (float) check
+p = [ 33., 34., 35., 36. ]
+try:
+  n = d.putdata("data", p, pygetdata.FLOAT, first_frame=5, first_sample=1)
+except:
+  CheckOK2(122,1)
+CheckSimple2(122,1,n,4)
+
+try:
+  n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+  CheckOK(122,2)
+CheckSimple2(122,2,n,[41, 33, 34, 35, 36, 46, 47, 48])
+
+# 124: putdata (complex) check
+p = [ 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)
+
+try:
+  n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1)
+except:
+  CheckOK2(136,2)
+CheckSimple2(136,2,n,[41, 53, 54, 55, 56, 46, 47, 48])
+
+# 14: error_string check
+try:
+  n = d.getdata("x", pygetdata.INT, first_frame=5, num_frames=1)
+except:
+  CheckException(14,pygetdata.BadCodeError)
+  CheckSimple(14,d.error_string,"Field not found: x")
+
+# 16: entry (raw) check
+try:
+  ent = d.entry("data")
+except:
+  CheckOK(16)
+CheckSimple2(16,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(16,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(16,3,ent.fragment,0)
+CheckSimple2(16,4,ent.data_type,pygetdata.INT8)
+CheckSimple2(16,5,ent.data_type_name,"INT8")
+CheckSimple2(16,6,ent.spf,8)
+
+# 18: entry (lincom) check
+try:
+  ent = d.entry("lincom")
+except:
+  CheckOK(18)
+CheckSimple2(18,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(18,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(18,3,ent.fragment,0)
+CheckSimple2(18,4,ent.n_fields,3)
+CheckSimple2(18,5,ent.in_fields,( "data", "INDEX", "linterp" ))
+CheckSimple2(18,6,ent.m,(1.1, 2.2, "const"))
+CheckSimple2(18,7,ent.b,(2.2, 3.3 + 4.4j, "const"))
+
+# 20: entry (polynom) check
+try:
+  ent = d.entry("polynom")
+except:
+  CheckOK(20)
+CheckSimple2(20,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(20,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(20,3,ent.fragment,0)
+CheckSimple2(20,4,ent.poly_ord,5)
+CheckSimple2(20,5,ent.in_fields,( "data", ))
+CheckSimple2(20,6,ent.a,(1.1, 2.2, 2.2, 3.3 + 4.4j, "const", "const"))
+
+# 21: entry (linterp) check
+try:
+  ent = d.entry("linterp")
+except:
+  CheckOK(21)
+CheckSimple2(21,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(21,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(21,3,ent.fragment,0)
+CheckSimple2(21,4,ent.in_fields,( "data", ))
+CheckSimple2(21,5,ent.table,"./lut")
+
+# 22: entry (bit) check
+try:
+  ent = d.entry("bit")
+except:
+  CheckOK(22)
+CheckSimple2(22,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(22,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(22,3,ent.fragment,0)
+CheckSimple2(22,4,ent.in_fields,( "data", ))
+CheckSimple2(22,5,ent.numbits,4)
+CheckSimple2(22,6,ent.bitnum,3)
+
+# 23: entry (sbit) check
+try:
+  ent = d.entry("sbit")
+except:
+  CheckOK(23)
+CheckSimple2(23,1,ent.field_type,pygetdata.SBIT_ENTRY)
+CheckSimple2(23,2,ent.field_type_name,"SBIT_ENTRY")
+CheckSimple2(23,3,ent.fragment,0)
+CheckSimple2(23,4,ent.in_fields,( "data", ))
+CheckSimple2(23,5,ent.numbits,6)
+CheckSimple2(23,6,ent.bitnum,5)
+
+# 24: entry (mult) check
+try:
+  ent = d.entry("mult")
+except:
+  CheckOK(24)
+CheckSimple2(24,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(24,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(24,3,ent.fragment,0)
+CheckSimple2(24,4,ent.in_fields,( "data", "sbit"))
+
+# 25: entry (phase) check
+try:
+  ent = d.entry("phase")
+except:
+  CheckOK(25)
+CheckSimple2(25,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(25,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(25,3,ent.fragment,0)
+CheckSimple2(25,4,ent.in_fields,( "data", ))
+CheckSimple2(25,5,ent.shift,11)
+
+# 26: entry (const) check
+try:
+  ent = d.entry("const")
+except:
+  CheckOK(26)
+CheckSimple2(26,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(26,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(26,3,ent.fragment,0)
+CheckSimple2(26,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(26,5,ent.data_type_name,"FLOAT64")
+
+# 134: entry (string) check
+try:
+  ent = d.entry("string")
+except:
+  CheckOK(134)
+CheckSimple2(134,1,ent.field_type,pygetdata.STRING_ENTRY)
+CheckSimple2(134,2,ent.field_type_name,"STRING_ENTRY")
+CheckSimple2(134,3,ent.fragment,0)
+
+# 27: fragment_index check
+try:
+  n = d.fragment_index("data")
+except:
+  CheckOK(27)
+CheckSimple(27,n,0)
+
+# 28: add / entry (raw) check
+ent = pygetdata.entry(pygetdata.RAW_ENTRY, "new1", 0, (pygetdata.FLOAT64, 3))
+try:
+  d.add(ent)
+except:
+  CheckOK2(28,1)
+
+try:
+  ent = d.entry("new1")
+except:
+  CheckOK(28,2)
+CheckSimple2(28,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(28,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(28,3,ent.fragment,0)
+CheckSimple2(28,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(28,5,ent.data_type_name,"FLOAT64")
+CheckSimple2(28,6,ent.spf,3)
+
+# 29: add / entry (lincom) check
+ent = pygetdata.entry(pygetdata.LINCOM_ENTRY, "new2", 0,
+    (("in1", "in2"), (9.9, 7.7), (8.8, 6.6)))
+try:
+  d.add(ent)
+except:
+  CheckOK2(29,1)
+
+try:
+  ent = d.entry("new2")
+except:
+  CheckOK(29,2)
+CheckSimple2(29,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(29,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(29,3,ent.fragment,0)
+CheckSimple2(29,4,ent.n_fields,2)
+CheckSimple2(29,5,ent.in_fields,( "in1", "in2" ))
+CheckSimple2(29,6,ent.m,(9.9, 7.7))
+CheckSimple2(29,7,ent.b,(8.8, 6.6))
+
+# 31: add / entry (polynom) check
+ent = pygetdata.entry(pygetdata.POLYNOM_ENTRY, "new4", 0,
+    ("in1", (3.9, 4.8, 5.7, 6.6)))
+try:
+  d.add(ent)
+except:
+  CheckOK2(31,1)
+
+try:
+  ent = d.entry("new4")
+except:
+  CheckOK2(31,2)
+CheckSimple2(31,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(31,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(31,3,ent.fragment,0)
+CheckSimple2(31,4,ent.poly_ord,3)
+CheckSimple2(31,5,ent.in_fields,( "in1", ))
+CheckSimple2(31,6,ent.a,(3.9, 4.8, 5.7, 6.6))
+
+# 33: add / entry (linterp) check
+ent = pygetdata.entry(pygetdata.LINTERP_ENTRY, "new6", 0,
+    ("in", "./some/table"))
+try:
+  d.add(ent)
+except:
+  CheckOK2(33,1)
+
+try:
+  ent = d.entry("new6")
+except:
+  CheckOK2(33,2)
+CheckSimple2(33,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(33,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(33,3,ent.fragment,0)
+CheckSimple2(33,4,ent.in_fields,( "in", ))
+CheckSimple2(33,5,ent.table,"./some/table")
+
+# 34: add / entry (bit) check
+ent = pygetdata.entry(pygetdata.BIT_ENTRY, "new7", 0, ("in", 13, 12))
+try:
+  d.add(ent)
+except:
+  CheckOK2(34,1)
+
+try:
+  ent = d.entry("new7")
+except:
+  CheckOK2(34,1)
+CheckSimple2(34,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(34,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(34,3,ent.fragment,0)
+CheckSimple2(34,4,ent.in_fields,( "in", ))
+CheckSimple2(34,5,ent.numbits,12)
+CheckSimple2(34,6,ent.bitnum,13)
+
+# 35: add / entry (sbit) check
+ent = pygetdata.entry(pygetdata.SBIT_ENTRY, "new8", 0, ("in2", 14, 15))
+try:
+  d.add(ent)
+except:
+  CheckOK2(35,1)
+
+try:
+  ent = d.entry("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
+ent = pygetdata.entry(pygetdata.MULTIPLY_ENTRY, "new9", 0, ("in1", "in2"))
+try:
+  d.add(ent)
+except:
+  CheckOK2(36,1)
+
+try:
+  ent = d.entry("new9")
+except:
+  CheckOK2(36,2)
+CheckSimple2(36,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(36,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(36,3,ent.fragment,0)
+CheckSimple2(36,4,ent.in_fields,( "in1", "in2"))
+
+# 37: add / entry (phase) check
+ent = pygetdata.entry(pygetdata.PHASE_ENTRY, "new10", 0, ("in1", 22))
+try:
+  d.add(ent)
+except:
+  CheckOK2(37,1)
+
+try:
+  ent = d.entry("new10")
+except:
+  CheckOK2(37,2)
+CheckSimple2(37,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(37,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(37,3,ent.fragment,0)
+CheckSimple2(37,4,ent.in_fields,( "in1", ))
+CheckSimple2(37,5,ent.shift,22)
+
+# 38: add / entry (const) check
+ent = pygetdata.entry(pygetdata.CONST_ENTRY, "new11", 0, (pygetdata.FLOAT64,))
+try:
+  d.add(ent)
+except:
+  CheckOK2(38,1)
+
+try:
+  ent = d.entry("new11")
+except:
+  CheckOK2(38,2)
+CheckSimple2(38,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(38,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(38,3,ent.fragment,0)
+CheckSimple2(38,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(38,5,ent.data_type_name,"FLOAT64")
+
+# 39: fragment check
+try:
+  f = d.fragment(0)
+except:
+  CheckOK(39)
+CheckEOS(39,f.name,"dirfile/format")
+
+# 40: nfragments check
+try:
+  n  = d.nfragments
+except:
+  CheckOK(40)
+CheckSimple(40,n,1)
+
+# 41: include check
+try:
+  n = d.include("form2")
+except:
+  CheckOK2(41,1)
+CheckSimple2(41,1,n,1)
+
+try:
+  n = d.get_constant("const2", pygetdata.INT)
+except:
+  CheckOK2(41,2)
+CheckSimple2(41,2,n,-19)
+
+# 42: nfields_by_type check
+try:
+  n = d.nfields(pygetdata.LINCOM_ENTRY)
+except:
+  CheckOK(42)
+CheckSimple(42,n,2)
+
+# 43: field_list_by_type check
+try:
+  n = d.field_list(pygetdata.LINCOM_ENTRY)
+except:
+  CheckOK(43)
+CheckSimple(43,n,["lincom", "new2"])
+
+# 44: nvectors check
+try:
+  n = d.nvectors()
+except:
+  CheckOK(44)
+CheckSimple(44,n,22)
+
+# 45: field_list check
+try:
+  n = d.vector_list()
+except:
+  CheckOK(45)
+CheckSimple(45,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
+ent = pygetdata.entry(pygetdata.LINCOM_ENTRY, "mnew1", 0,
+    {"in_fields": ("in1", "in2"), "m": (9.9, 7.7), "b": (8.8, 6.6)})
+try:
+  d.madd(ent, "data")
+except:
+  CheckOK2(46,1)
+
+try:
+  ent = d.entry("data/mnew1")
+except:
+  CheckOK(46,2)
+CheckSimple2(46,1,ent.field_type,pygetdata.LINCOM_ENTRY)
+CheckSimple2(46,2,ent.field_type_name,"LINCOM_ENTRY")
+CheckSimple2(46,3,ent.fragment,0)
+CheckSimple2(46,4,ent.n_fields,2)
+CheckSimple2(46,5,ent.in_fields,( "in1", "in2" ))
+CheckSimple2(46,6,ent.m,(9.9, 7.7))
+CheckSimple2(46,7,ent.b,(8.8, 6.6))
+
+# 48: add / entry (polynom) check
+ent = pygetdata.entry(pygetdata.POLYNOM_ENTRY, "mnew3", 0,
+    {"in_field": "in1", "a": (3.9, 4.8, 5.7, 6.6)})
+try:
+  d.madd(ent, "data")
+except:
+  CheckOK2(48,1)
+
+try:
+  ent = d.entry("data/mnew3")
+except:
+  CheckOK2(48,2)
+CheckSimple2(48,1,ent.field_type,pygetdata.POLYNOM_ENTRY)
+CheckSimple2(48,2,ent.field_type_name,"POLYNOM_ENTRY")
+CheckSimple2(48,3,ent.fragment,0)
+CheckSimple2(48,4,ent.poly_ord,3)
+CheckSimple2(48,5,ent.in_fields,( "in1", ))
+CheckSimple2(48,6,ent.a,(3.9, 4.8, 5.7, 6.6))
+
+# 50: add / entry (linterp) check
+ent = pygetdata.entry(pygetdata.LINTERP_ENTRY, "mnew6", 0,
+    {"in_field": "in", "table": "./more/table"})
+try:
+  d.madd(ent, "data")
+except:
+  CheckOK2(50,1)
+
+try:
+  ent = d.entry("data/mnew6")
+except:
+  CheckOK2(50,2)
+CheckSimple2(50,1,ent.field_type,pygetdata.LINTERP_ENTRY)
+CheckSimple2(50,2,ent.field_type_name,"LINTERP_ENTRY")
+CheckSimple2(50,3,ent.fragment,0)
+CheckSimple2(50,4,ent.in_fields,( "in", ))
+CheckSimple2(50,5,ent.table,"./more/table")
+
+# 51: add / entry (bit) check
+ent = pygetdata.entry(pygetdata.BIT_ENTRY, "mnew7", 0,
+    {"in_field": "in1", "bitnum": 3, "numbits": 2})
+try:
+  d.madd(ent,"data")
+except:
+  CheckOK2(51,1)
+
+try:
+  ent = d.entry("data/mnew7")
+except:
+  CheckOK2(51,1)
+CheckSimple2(51,1,ent.field_type,pygetdata.BIT_ENTRY)
+CheckSimple2(51,2,ent.field_type_name,"BIT_ENTRY")
+CheckSimple2(51,3,ent.fragment,0)
+CheckSimple2(51,4,ent.in_fields,( "in1", ))
+CheckSimple2(51,5,ent.numbits,2)
+CheckSimple2(51,6,ent.bitnum,3)
+
+# 52: add / entry (sbit) check
+ent = pygetdata.entry(pygetdata.SBIT_ENTRY, "mnew8", 0,
+    {"in_field": "in2", "bitnum": 4, "numbits": 5})
+try:
+  d.madd(ent,"data")
+except:
+  CheckOK2(52,1)
+
+try:
+  ent = d.entry("data/mnew8")
+except:
+  CheckOK2(52,2)
+CheckSimple2(52,1,ent.field_type,pygetdata.SBIT_ENTRY)
+CheckSimple2(52,2,ent.field_type_name,"SBIT_ENTRY")
+CheckSimple2(52,3,ent.fragment,0)
+CheckSimple2(52,4,ent.in_fields,( "in2", ))
+CheckSimple2(52,5,ent.numbits,5)
+CheckSimple2(52,6,ent.bitnum,4)
+
+# 53: add / entry (mult) check
+ent = pygetdata.entry(pygetdata.MULTIPLY_ENTRY, "mnew9", 0,
+    {"in_field1": "in3", "in_field2": "in2"})
+try:
+  d.madd(ent,"data")
+except:
+  CheckOK2(53,1)
+
+try:
+  ent = d.entry("data/mnew9")
+except:
+  CheckOK2(53,2)
+CheckSimple2(53,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(53,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(53,3,ent.fragment,0)
+CheckSimple2(53,4,ent.in_fields,( "in3", "in2"))
+
+# 54: add / entry (phase) check
+ent = pygetdata.entry(pygetdata.PHASE_ENTRY, "mnew10", 0,
+    {"in_field": "in3", "shift": 44})
+try:
+  d.madd(ent,"data")
+except:
+  CheckOK2(54,1)
+
+try:
+  ent = d.entry("data/mnew10")
+except:
+  CheckOK2(54,2)
+CheckSimple2(54,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(54,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(54,3,ent.fragment,0)
+CheckSimple2(54,4,ent.in_fields,( "in3", ))
+CheckSimple2(54,5,ent.shift,44)
+
+# 55: add / entry (const) check
+ent = pygetdata.entry(pygetdata.CONST_ENTRY, "mnew11", 0,
+    {"type": pygetdata.FLOAT64})
+try:
+  d.madd(ent,"data")
+except:
+  CheckOK2(55,1)
+
+try:
+  ent = d.entry("data/mnew11")
+except:
+  CheckOK2(55,2)
+CheckSimple2(55,1,ent.field_type,pygetdata.CONST_ENTRY)
+CheckSimple2(55,2,ent.field_type_name,"CONST_ENTRY")
+CheckSimple2(55,3,ent.fragment,0)
+CheckSimple2(55,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(55,5,ent.data_type_name,"FLOAT64")
+
+#56: string check
+try:
+  n = d.get_string("string")
+except:
+  CheckOK(56)
+CheckSimple(56,n,"Zaphod Beeblebrox")
+
+# 57: entry (string) check
+ent = pygetdata.entry(pygetdata.STRING_ENTRY, "new12", 0)
+try:
+  d.add(ent)
+except:
+  CheckOK2(57,1)
+
+try:
+  ent = d.entry("new12")
+except:
+  CheckOK(57)
+CheckSimple2(57,1,ent.field_type,pygetdata.STRING_ENTRY)
+CheckSimple2(57,2,ent.field_type_name,"STRING_ENTRY")
+CheckSimple2(57,3,ent.fragment,0)
+
+# 59: add_spec check
+try:
+  d.add_spec("lorem STRING \"Lorem ipsum\"", 0)
+except:
+  CheckOK2(58,1)
+
+try:
+  n = d.get_string("lorem")
+except:
+  CheckOK2(59,2)
+CheckSimple(59,n,"Lorem ipsum")
+
+# 60: madd_spec check
+try:
+  d.madd_spec("ipsum STRING \"dolor sit amet.\"", "lorem")
+except:
+  CheckOK2(60,1)
+
+try:
+  n = d.get_string("lorem/ipsum")
+except:
+  CheckOK2(60,2)
+CheckSimple(60,n,"dolor sit amet.")
+
+# 61: put_constant / int check
+try:
+  d.put_constant("const", 61)
+except:
+  CheckOK2(61,1)
+
+try:
+  n = d.get_constant("const",pygetdata.INT)
+except:
+  CheckOK2(61,2)
+CheckSimple(61,n,61)
+
+# 128: put_constant / int check
+try:
+  d.put_constant("const", 128L)
+except:
+  CheckOK2(128,1)
+
+try:
+  n = d.get_constant("const",pygetdata.ULONG)
+except:
+  CheckOK2(128,2)
+CheckSimple(128,n,128L)
+
+# 129: put_constant / int check
+try:
+  d.put_constant("const", 129L)
+except:
+  CheckOK2(129,1)
+
+try:
+  n = d.get_constant("const",pygetdata.LONG)
+except:
+  CheckOK2(129,2)
+CheckSimple(129,n,129L)
+
+# 131: put_constant / float check
+try:
+  d.put_constant("const", 131.)
+except:
+  CheckOK2(131,1)
+
+try:
+  n = d.get_constant("const",pygetdata.FLOAT)
+except:
+  CheckOK2(131,2)
+CheckSimple(131,n,131.)
+
+# 133: put_constant / complex check
+try:
+  d.put_constant("const", 133.+0j)
+except:
+  CheckOK2(133,1)
+
+try:
+  n = d.get_constant("const",pygetdata.COMPLEX)
+except:
+  CheckOK2(133,2)
+CheckSimple(133,n,133.+0j)
+
+# 62: put_string
+try:
+  d.put_string("string", "Arthur Dent")
+except:
+  CheckOK2(62,1)
+
+try:
+  n = d.get_string("string")
+except:
+  CheckOK2(62,2)
+CheckSimple(62,n,"Arthur Dent")
+
+# 63: nmfields_by_type check
+try:
+  n = d.nmfields("data",pygetdata.LINCOM_ENTRY)
+except:
+  CheckOK(63)
+CheckSimple(63,n,1)
+
+# 64: mfield_list_by_type check
+try:
+  n = d.mfield_list("data",pygetdata.LINCOM_ENTRY)
+except:
+  CheckOK(64)
+CheckSimple(64,n,["mnew1"])
+
+# 65: nmvectors check
+try:
+  n = d.nmvectors("data")
+except:
+  CheckOK(65)
+CheckSimple(65,n,8)
+
+# 66: mvector_list check
+try:
+  n = d.mvector_list("data")
+except:
+  CheckOK(66)
+CheckSimple(66,n,['mlut', 'mnew1', 'mnew3', 'mnew6', 'mnew7', 'mnew8', 'mnew9',
+  'mnew10'])
+
+# 67: alter / raw check
+ent = pygetdata.entry(pygetdata.RAW_ENTRY, "new1", 0,
+    {"type": pygetdata.FLOAT32, "spf": 4})
+try:
+  n = d.alter("new1", ent)
+except:
+  CheckOK2(67,1)
+
+try:
+  ent = d.entry("new1")
+except:
+  CheckOK(67,2)
+CheckSimple2(67,1,ent.field_type,pygetdata.RAW_ENTRY)
+CheckSimple2(67,2,ent.field_type_name,"RAW_ENTRY")
+CheckSimple2(67,3,ent.fragment,0)
+CheckSimple2(67,4,ent.data_type,pygetdata.FLOAT32)
+CheckSimple2(67,5,ent.data_type_name,"FLOAT32")
+CheckSimple2(67,6,ent.spf,4)
+
+# 78: encoding check
+try:
+  f = d.fragment(0)
+  CheckSimple(78,f.encoding,pygetdata.UNENCODED)
+except:
+  CheckOK(78)
+
+# 79: endianness check
+try:
+  CheckSimple(79,f.endianness,pygetdata.LITTLE_ENDIAN |
+		  pygetdata.NOT_ARM_ENDIAN)
+except:
+  CheckOK(79)
+
+# 80: dirfilename check
+try:
+  CheckEOS(80,d.name,"dirfile")
+except:
+  CheckOK(80)
+
+# 81: parent_fragment check
+try:
+  f = d.fragment(1)
+  CheckSimple(81,f.parent,0)
+except:
+  CheckOK(81)
+
+# 82: dirfile_protect check
+try:
+  f.protection = pygetdata.PROTECT_DATA
+except:
+  CheckOK(82)
+  
+# 83: protection check
+try:
+  f = d.fragment(1)
+  CheckSimple(83,f.protection,pygetdata.PROTECT_DATA)
+except:
+  CheckOK(83)
+
+# 84: raw_filename check
+try:
+  n = d.raw_filename("data")
+except:
+  CheckOK(84)
+CheckEOS(84,n,"dirfile/data")
+
+# 85: reference check
+try:
+  d.reference = "new1"
+except:
+  CheckOK2(85,1)
+
+try:
+  CheckSimple(85,d.reference,"new1")
+except:
+  CheckOK2(85,2)
+
+# 87: alter_encoding check
+try:
+  f = d.fragment(1)
+  f.alter_encoding(pygetdata.SLIM_ENCODED,0)
+except:
+  CheckOK(87)
+
+# 88: alter_endianness check
+try:
+  f.alter_endianness(pygetdata.BIG_ENDIAN,0)
+except:
+  CheckOK(88)
+
+# 89: alter_spec check
+try:
+  d.alter_spec("new10 PHASE in5 3", 0)
+except:
+  CheckOK2(89,1)
+
+try:
+  ent = d.entry("new10")
+except:
+  CheckOK2(89,2)
+CheckSimple2(89,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(89,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(89,3,ent.fragment,0)
+CheckSimple2(89,4,ent.in_fields,( "in5", ))
+CheckSimple2(89,5,ent.shift,3)
+
+# 90: delete check
+try:
+  d.delete("new10",0)
+except:
+  CheckOK2(90,1)
+
+try:
+  ent = d.entry("new10")
+except:
+  CheckException2(90,2,pygetdata.BadCodeError)
+
+# 91: malter_spec check
+try:
+  d.malter_spec("mnew10 PHASE in4 11", "data", 0)
+except:
+  CheckOK2(91,1)
+
+try:
+  ent = d.entry("data/mnew10")
+except:
+  CheckOK2(91,2)
+CheckSimple2(91,1,ent.field_type,pygetdata.PHASE_ENTRY)
+CheckSimple2(91,2,ent.field_type_name,"PHASE_ENTRY")
+CheckSimple2(91,3,ent.fragment,0)
+CheckSimple2(91,4,ent.in_fields,( "in4", ))
+CheckSimple2(91,5,ent.shift,11)
+
+# 92: move check
+try:
+  d.move("new9", 1, 0)
+except:
+  CheckOK2(92,1)
+
+try:
+  ent = d.entry("new9")
+except:
+  CheckOK2(92,2)
+CheckSimple2(92,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(92,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(92,3,ent.fragment,1)
+CheckSimple2(92,4,ent.in_fields,( "in1", "in2"))
+
+# 93: rename check
+try:
+  d.rename("new9", "newer", 0)
+except:
+  CheckOK2(93,1)
+
+try:
+  ent = d.entry("new9")
+except:
+  CheckException2(93,2,pygetdata.BadCodeError)
+
+try:
+  ent = d.entry("newer")
+except:
+  CheckOK2(93,3)
+CheckSimple2(93,1,ent.field_type,pygetdata.MULTIPLY_ENTRY)
+CheckSimple2(93,2,ent.field_type_name,"MULTIPLY_ENTRY")
+CheckSimple2(93,3,ent.fragment,1)
+CheckSimple2(93,4,ent.in_fields,( "in1", "in2"))
+
+# 94: uninclude check
+try:
+  d.uninclude(1,0)
+except:
+  CheckOK2(94,1)
+
+try:
+  ent = d.entry("newer")
+except:
+  CheckException2(93,2,pygetdata.BadCodeError)
+
+# 95: frameoffset check
+try:
+  f = d.fragment(0)
+  CheckSimple(95,f.frameoffset,0)
+except:
+  CheckOK(95)
+
+# 96: alter_frameoffset check
+try:
+  f.alter_frameoffset(33, 0)
+  CheckSimple(96,f.frameoffset,33)
+except:
+  CheckOK(96)
+
+# 97: native_type check
+try:
+  n = d.native_type("data")
+except:
+  CheckOK(97)
+CheckSimple(97,n,pygetdata.INT8)
+
+# 137: native_type_name check
+try:
+  n = d.native_type_name("data")
+except:
+  CheckOK(137)
+CheckSimple(137,n,"INT8")
+
+# 99: validate check
+try:
+  d.validate("new7")
+except:
+  CheckException(99,pygetdata.BadCodeError)
+
+# 101: framenum check
+try:
+  n = d.framenum("data", 33.3, start=6)
+except:
+  CheckOK(101)
+CheckSimple(101,n,37.0375)
+
+# 86: eof check
+try:
+  n = d.eof("lincom")
+except:
+  CheckOK(86)
+CheckSimple(86,n,344)
+
+# 142: bof check
+try:
+  n = d.bof("lincom")
+except:
+  CheckOK(142)
+CheckSimple(142,n,264)
+
+# 143: entry (div) check
+try:
+  ent = d.entry("div")
+except:
+  CheckOK(143)
+CheckSimple2(143,1,ent.field_type,pygetdata.DIVIDE_ENTRY)
+CheckSimple2(143,2,ent.field_type_name,"DIVIDE_ENTRY")
+CheckSimple2(143,3,ent.fragment,0)
+CheckSimple2(143,4,ent.in_fields,( "mult", "bit"))
+
+# 145: entry (recip) check
+try:
+  ent = d.entry("recip")
+except:
+  CheckOK(145)
+CheckSimple2(145,1,ent.field_type,pygetdata.RECIP_ENTRY)
+CheckSimple2(145,2,ent.field_type_name,"RECIP_ENTRY")
+CheckSimple2(145,3,ent.fragment,0)
+CheckSimple2(145,4,ent.in_fields,( "div",))
+CheckSimple2(145,6,ent.dividend,6.5+4.3j)
+
+# 146: add / entry (divide) check
+ent = pygetdata.entry(pygetdata.DIVIDE_ENTRY, "new14", 0, ("in1", "in2"))
+try:
+  d.add(ent)
+except:
+  CheckOK2(146,1)
+
+try:
+  ent = d.entry("new14")
+except:
+  CheckOK2(146,2)
+CheckSimple2(146,1,ent.field_type,pygetdata.DIVIDE_ENTRY)
+CheckSimple2(146,2,ent.fragment,0)
+CheckSimple2(146,3,ent.in_fields,( "in1", "in2"))
+
+# 148: add / entry (recip) check
+ent = pygetdata.entry(pygetdata.RECIP_ENTRY, "new16", 0, ("in3", 33.3))
+try:
+  d.add(ent)
+except:
+  CheckOK2(148,1)
+
+try:
+  ent = d.entry("new16")
+except:
+  CheckOK2(148,2)
+CheckSimple2(148,1,ent.field_type,pygetdata.RECIP_ENTRY)
+CheckSimple2(148,2,ent.fragment,0)
+CheckSimple2(148,3,ent.in_fields,( "in3",))
+CheckSimple2(148,4,ent.dividend,33.3)
+
+# 149: madd / entry (div) check
+ent = pygetdata.entry(pygetdata.DIVIDE_ENTRY, "mnew14", 0,
+    {"in_field1": "in3", "in_field2": "in2"})
+try:
+  d.madd(ent,"data")
+except:
+  CheckOK2(149,1)
+
+try:
+  ent = d.entry("data/mnew14")
+except:
+  CheckOK2(149,2)
+CheckSimple2(149,1,ent.field_type,pygetdata.DIVIDE_ENTRY)
+CheckSimple2(149,2,ent.fragment,0)
+CheckSimple2(149,3,ent.in_fields,( "in3", "in2"))
+
+# 151: madd / entry (recip) check
+ent = pygetdata.entry(pygetdata.RECIP_ENTRY, "mnew16", 0,
+    {"in_field": "in3", "dividend": "const"})
+try:
+  d.madd(ent,"data")
+except:
+  CheckOK2(151,1)
+
+try:
+  ent = d.entry("data/mnew16")
+except:
+  CheckOK2(151,2)
+CheckSimple2(151,1,ent.field_type,pygetdata.RECIP_ENTRY)
+CheckSimple2(151,2,ent.fragment,0)
+CheckSimple2(151,3,ent.in_fields,( "in3",))
+CheckSimple2(151,4,ent.dividend,"const")
+
+# 155: fragment.rewrite check
+try:
+  f.rewrite()
+except:
+  CheckOK(155)
+
+# 156: invalid dirfile check
+try:
+  m = pygetdata.dirfile(None)
+except:
+  CheckOK2(156,1)
+
+try:
+  n = m.nfragments()
+except:
+  CheckException2(156,2,pygetdata.BadDirfileError)
+
+try:
+  m.discard()
+except:
+  pass
+
+# 157: standards version
+try:
+  n = d.standards
+except:
+  CheckOK2(157,1)
+CheckSimple(157,n,9)
+
+try:
+  d.standards = 0
+except:
+  CheckException2(157,2,pygetdata.ArgumentError)
+
+# 158: gd_get_carray
+try:
+  n = d.get_carray("carray", pygetdata.INT)
+except:
+  CheckOK(158)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(158,n,numpy.arange(1,7))
+else:
+  CheckSimple(158,n,[1, 2, 3, 4, 5, 6])
+
+# 159: gd_get_carray_slice (INT8)
+try:
+  n = d.get_carray("carray", pygetdata.INT, start=2, len=2)
+except:
+  CheckOK(159)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(159,n,numpy.arange(3,5))
+else:
+  CheckSimple(159,n,[3, 4])
+
+# 162: gd_get_carray_slice (INT64)
+try:
+  n = d.get_carray("carray", pygetdata.LONG, start=2, len=2)
+except:
+  CheckOK(162)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(162,n,numpy.arange(3L,5L))
+else:
+  CheckSimple(162,n,[3L, 4L])
+
+# 164: gd_get_carray_slice (FLOAT64)
+try:
+  n = d.get_carray("carray", pygetdata.FLOAT, start=2, len=2)
+except:
+  CheckOK(164)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(164,n,numpy.array([3.3, 4.4]))
+else:
+  CheckSimple(164,n,[3.3, 4.4])
+
+# 166: gd_get_carray_slice (COMPLEX128)
+try:
+  n = d.get_carray("carray", pygetdata.COMPLEX, start=2, len=2)
+except:
+  CheckOK(166)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(166,n,numpy.array([3.3+0j, 4.4+0j]))
+else:
+  CheckSimple(166,n,[3.3+0j, 4.4+0j])
+
+# 167: gd_carrays
+try:
+  n = d.carrays(pygetdata.INT)
+except:
+  CheckOK(167)
+
+CheckSimple2(167,1,len(n),1)
+if (pygetdata.__numpy_supported__):
+  CheckSimple2(167,2,n[0][0],"carray")
+  CheckNumpy2(167,3,n[0][1],numpy.arange(1,7))
+else:
+  CheckSimple(167,n,[("carray", [1,2,3,4,5,6])])
+
+# 168: gd_put_carray
+try:
+  d.put_carray("carray", [9,8,7,6,5,4])
+except:
+  CheckOK2(168,1)
+
+try:
+  n = d.get_carray("carray", pygetdata.INT)
+except:
+  CheckOK2(168,2)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(168,n,numpy.arange(9,3,-1))
+else:
+  CheckSimple(168,n,[9,8,7,6,5,4])
+
+# 169: gd_put_carray_slice (INT8)
+try:
+  d.put_carray("carray", [169,169], start=2)
+except:
+  CheckOK2(169,1)
+
+try:
+  n = d.get_carray("carray", pygetdata.INT)
+except:
+  CheckOK2(169,2)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(169,n,numpy.array([9,8,169,169,5,4]))
+else:
+  CheckSimple(169,n,[9,8,169,169,5,4])
+
+# 172: gd_put_carray_slice (INT64)
+try:
+  d.put_carray("carray", [172L,172L], start=2)
+except:
+  CheckOK2(172,1)
+
+try:
+  n = d.get_carray("carray", pygetdata.INT)
+except:
+  CheckOK2(172,2)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(172,n,numpy.array([9,8,172,172,5,4]))
+else:
+  CheckSimple(172,n,[9,8,172,172,5,4])
+
+# 174: gd_put_carray_slice (FLOAT64)
+try:
+  d.put_carray("carray", [174.,174.], start=2)
+except:
+  CheckOK2(174,1)
+
+try:
+  n = d.get_carray("carray", pygetdata.INT)
+except:
+  CheckOK2(174,2)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(174,n,numpy.array([9,8,174,174,5,4]))
+else:
+  CheckSimple(174,n,[9,8,174,174,5,4])
+
+# 176: gd_put_carray_slice (COMPLEX128)
+try:
+  d.put_carray("carray", [176.+0j,176.+0j], start=2)
+except:
+  CheckOK2(176,1)
+
+try:
+  n = d.get_carray("carray", pygetdata.INT)
+except:
+  CheckOK2(176,2)
+
+if (pygetdata.__numpy_supported__):
+  CheckNumpy(176,n,numpy.array([9,8,176,176,5,4]))
+else:
+  CheckSimple(176,n,[9,8,176,176,5,4])
+
+# 177: gd_carray_len
+try:
+  n = d.carray_len("carray")
+except:
+  CheckOK(177)
+
+CheckSimple(177,n,6)
+
+# 178: gd_entry (CARRAY)
+try:
+  ent = d.entry("carray")
+except:
+  CheckOK(178)
+CheckSimple2(178,1,ent.field_type,pygetdata.CARRAY_ENTRY)
+CheckSimple2(178,2,ent.field_type_name,"CARRAY_ENTRY")
+CheckSimple2(178,3,ent.fragment,0)
+CheckSimple2(178,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(178,5,ent.data_type_name,"FLOAT64")
+CheckSimple2(178,6,ent.array_len,6)
+
+# 179: gd_add_carray
+ent = pygetdata.entry(pygetdata.CARRAY_ENTRY, "new17", 0, (pygetdata.FLOAT64,2))
+try:
+  d.add(ent)
+except:
+  CheckOK2(179,1)
+
+try:
+  ent = d.entry("new17")
+except:
+  CheckOK2(179,2)
+CheckSimple2(179,1,ent.field_type,pygetdata.CARRAY_ENTRY)
+CheckSimple2(179,2,ent.field_type_name,"CARRAY_ENTRY")
+CheckSimple2(179,3,ent.fragment,0)
+CheckSimple2(179,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(179,5,ent.data_type_name,"FLOAT64")
+CheckSimple2(179,6,ent.array_len,2)
+
+# 180: gd_madd_carray
+ent = pygetdata.entry(pygetdata.CARRAY_ENTRY, "mnew17", 0,
+    {"type": pygetdata.FLOAT64, "array_len": 2})
+try:
+  d.madd(ent,"data")
+except:
+  CheckOK2(180,1)
+
+try:
+  ent = d.entry("data/mnew17")
+except:
+  CheckOK2(180,2)
+CheckSimple2(180,1,ent.field_type,pygetdata.CARRAY_ENTRY)
+CheckSimple2(180,2,ent.field_type_name,"CARRAY_ENTRY")
+CheckSimple2(180,3,ent.fragment,0)
+CheckSimple2(180,4,ent.data_type,pygetdata.FLOAT64)
+CheckSimple2(180,5,ent.data_type_name,"FLOAT64")
+CheckSimple2(180,6,ent.array_len,2)
+
+# 183: gd_constants (int)
+try:
+  n = d.constants(pygetdata.INT)
+except:
+  CheckOK(183)
+CheckSimple(183,n,[('const', 133), ('new11', 0)])
+
+# 186: gd_constants (long)
+try:
+  n = d.constants(pygetdata.LONG)
+except:
+  CheckOK(186)
+CheckSimple(186,n,[('const', 133L), ('new11', 0L)])
+
+# 188: gd_constants (float)
+try:
+  n = d.constants(pygetdata.FLOAT)
+except:
+  CheckOK(188)
+CheckSimple(188,n,[('const', 133.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)])
+
+# 191: gd_constants (int)
+try:
+  n = d.mconstants("data", pygetdata.INT)
+except:
+  CheckOK(191)
+CheckSimple(191,n,[('mconst', 3), ('mnew11', 0)])
+
+# 194: gd_constants (long)
+try:
+  n = d.mconstants("data", pygetdata.LONG)
+except:
+  CheckOK(194)
+CheckSimple(194,n,[('mconst', 3L), ('mnew11', 0L)])
+
+# 196: gd_constants (float)
+try:
+  n = d.mconstants("data", pygetdata.FLOAT)
+except:
+  CheckOK(196)
+CheckSimple(196,n,[('mconst', 3.3), ('mnew11', 0.)])
+
+# 198: gd_constants (complex)
+try:
+  n = d.mconstants("data", pygetdata.COMPLEX)
+except:
+  CheckOK(198)
+CheckSimple(198,n,[('mconst', 3.3+4.4j), ('mnew11', 0j)])
+
+# 199: gd_strings
+try:
+  n = d.strings()
+except:
+  CheckOK(199)
+CheckSimple(199,n,[('lorem', 'Lorem ipsum'), ('new12', ''), 
+  ('string', 'Arthur Dent')])
+
+# 200: gd_strings
+try:
+  n = d.mstrings("data")
+except:
+  CheckOK(200)
+CheckSimple(200,n,[('mstr', 'This is a string constant.')])
+
+# 203: gd_seek
+try:
+  n = d.seek("data", pygetdata.SEEK_SET, frame_num=35)
+except:
+  CheckOK2(203,0)
+
+try:
+  m = d.getdata("data", pygetdata.INT, first_frame=pygetdata.HERE, num_frames=1)
+except:
+  CheckOK2(203,1)
+CheckSimple2(203,0,n,280)
+CheckSimple2(203,1,len(m),8)
+if (pygetdata.__numpy_supported__):
+  CheckNumpy2(203,2,m,numpy.arange(17,25))
+else:
+  CheckSimple2(203,2,m,range(17,25))
+
+# 204: gd_tell
+try:
+  n = d.tell("data")
+except:
+  CheckOK(204)
+CheckSimple(204,n,288)
+
+# 205: gd_hide check
+try:
+  d.hide('data')
+except:
+  CheckOK(205)
+
+# 206: gd_hidden check
+try:
+  n = d.hidden('data')
+except:
+  CheckOK2(206, 1)
+CheckSimple2(206, 1, n, 1)
+
+try:
+  n = d.hidden('lincom')
+except:
+  CheckOK2(206, 2)
+CheckSimple2(206, 2, n, 0)
+
+# 207: gd_unhide check
+try:
+  d.unhide('data')
+except:
+  CheckOK2(206, 1)
+
+try:
+  n = d.hidden('data')
+except:
+  CheckOK2(206, 2)
+CheckSimple(206, n, 0)
+
+# 208: gd_sync check
+try:
+  d.sync('data')
+except:
+  CheckOK(208)
+
+# 209: gd_flush check
+try:
+  d.flush('data')
+except:
+  CheckOK(209)
+
+# 210: gd_metaflush check
+try:
+  d.metaflush()
+except:
+  CheckOK(210)
+
+# 211: gd_entry (WINDOW) check
+try:
+  ent = d.entry('window')
+except:
+  CheckOK(211)
+CheckSimple2(211, 1, ent.field_type, pygetdata.WINDOW_ENTRY)
+CheckSimple2(211, 2, ent.fragment, 0)
+CheckSimple2(211, 3, ent.windop, pygetdata.WINDOP_LT)
+CheckSimple2(211, 4, ent.in_fields, ( 'linterp', 'mult' ))
+CheckSimple2(211, 5, ent.threshold, 4.1)
+
+# 212: gd_add_window check
+ent = pygetdata.entry(pygetdata.WINDOW_ENTRY, "new18", 0,
+    ("in1", "in2", pygetdata.WINDOP_NE, 32))
+try:
+  d.add(ent)
+except:
+  CheckOK2(212, 1)
+
+try:
+  ent = d.entry('new18')
+except:
+  CheckOK2(212, 2)
+CheckSimple2(212, 1, ent.field_type, pygetdata.WINDOW_ENTRY)
+CheckSimple2(212, 2, ent.fragment, 0)
+CheckSimple2(212, 3, ent.windop, pygetdata.WINDOP_NE)
+CheckSimple2(212, 4, ent.in_fields, ( 'in1', 'in2' ))
+CheckSimple2(212, 5, ent.threshold, 32)
+
+# 214: gd_madd_window check
+ent = pygetdata.entry(pygetdata.WINDOW_ENTRY, "mnew18", 0,
+    ("in2", "in3", pygetdata.WINDOP_SET, 128))
+try:
+  d.madd(ent, "data")
+except:
+  CheckOK2(214, 1)
+
+try:
+  ent = d.entry('data/mnew18')
+except:
+  CheckOK2(214, 2)
+CheckSimple2(214, 1, ent.field_type, pygetdata.WINDOW_ENTRY)
+CheckSimple2(214, 2, ent.fragment, 0)
+CheckSimple2(214, 3, ent.windop, pygetdata.WINDOP_SET)
+CheckSimple2(214, 4, ent.in_fields, ( 'in2', 'in3' ))
+CheckSimple2(214, 5, ent.threshold, 128)
+
+# 217: gd_alter_window check
+ent = pygetdata.entry(pygetdata.WINDOW_ENTRY, "new18", 0, { "threshold": 32e3,
+  "in_field1": "in3", "in_field2": "in4", "windop": pygetdata.WINDOP_GE })
+try:
+  d.alter('new18', ent)
+except:
+  CheckOK2(217, 1)
+
+try:
+  ent = d.entry('new18')
+except:
+  CheckOK2(217, 2)
+CheckSimple2(217, 1, ent.field_type, pygetdata.WINDOW_ENTRY)
+CheckSimple2(217, 2, ent.fragment, 0)
+CheckSimple2(217, 3, ent.windop, pygetdata.WINDOP_GE)
+CheckSimple2(217, 4, ent.in_fields, ( 'in3', 'in4' ))
+CheckSimple2(217, 5, ent.threshold, 32e3)
+
+# 218: gd_alias_target check
+try:
+  str = d.alias_target('alias')
+except:
+  CheckOK(218)
+CheckSimple(218, str, 'data')
+
+# 219: gd_add_alias check
+try:
+  d.add_alias('new20', 'data', 0)
+except:
+  CheckOK2(219, 1)
+
+try:
+  str = d.alias_target('new20')
+except:
+  CheckOK2(219, 2)
+CheckSimple(219, str, 'data')
+
+# 220: gd_madd_alias check
+try:
+  d.madd_alias('data', 'mnew20', 'data')
+except:
+  CheckOK2(220, 1)
+
+try:
+  str = d.alias_target('data/mnew20')
+except:
+  CheckOK2(220, 2)
+CheckSimple(220, str, 'data')
+
+# 221: gd_naliases check
+try:
+  n = d.naliases('data')
+except:
+  CheckOK(221)
+CheckSimple(221, n, 4)
+
+# 222: gd_aliases check
+try:
+  n = d.aliases('data')
+except:
+  CheckOK(222)
+CheckSimple(222, n, [ 'data', 'alias', 'data/mnew20', 'new20' ])
+
+# 223: gd_include_affix check
+try:
+  d.include('format1', 0, prefix='A', suffix='Z',
+      flags=pygetdata.CREAT | pygetdata.EXCL)
+except:
+  CheckOK(223)
+
+# 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
+  m = d.fragment(1).suffix
+except:
+  CheckOK(226)
+CheckSimple2(226, 1, n, "A")
+CheckSimple2(226, 2, m, "Z")
+
+# 227: gd_alter_affixes check
+try:
+  d.fragment(1).prefix = "B"
+  d.fragment(1).suffix = ""
+except:
+  CheckOK2(227, 1)
+
+try:
+  n = d.fragment(1).prefix
+  m = d.fragment(1).suffix
+except:
+  CheckOK2(227, 2)
+CheckSimple2(227, 1, n, "B")
+CheckSimple2(227, 2, m, "")
+
+# 228: gd_entry (MPLEX) check
+try:
+  ent = d.entry('mplex')
+except:
+  CheckOK(228)
+CheckSimple2(228, 1, ent.field_type, pygetdata.MPLEX_ENTRY)
+CheckSimple2(228, 2, ent.fragment, 0)
+CheckSimple2(228, 3, ent.count_val, 1)
+CheckSimple2(228, 4, ent.in_fields, ( 'data', 'sbit' ))
+CheckSimple2(228, 5, ent.period, 10)
+
+# 229: gd_add_mplex check
+ent = pygetdata.entry(pygetdata.MPLEX_ENTRY, "new21", 0, ("in1", "in2", 5, 6))
+try:
+  d.add(ent)
+except:
+  CheckOK2(229, 1)
+
+try:
+  ent = d.entry('new21')
+except:
+  CheckOK2(229, 2)
+CheckSimple2(229, 1, ent.field_type, pygetdata.MPLEX_ENTRY)
+CheckSimple2(229, 2, ent.fragment, 0)
+CheckSimple2(229, 3, ent.count_val, 5)
+CheckSimple2(229, 4, ent.in_fields, ( 'in1', 'in2' ))
+CheckSimple2(229, 5, ent.period, 6)
+
+# 230: gd_madd_mplex check
+ent = pygetdata.entry(pygetdata.MPLEX_ENTRY, "mnew21", 0, ("in2", "in3", 0, 12))
+try:
+  d.madd(ent, "data")
+except:
+  CheckOK2(230, 1)
+
+try:
+  ent = d.entry('data/mnew21')
+except:
+  CheckOK2(230, 2)
+CheckSimple2(230, 1, ent.field_type, pygetdata.MPLEX_ENTRY)
+CheckSimple2(230, 2, ent.fragment, 0)
+CheckSimple2(230, 3, ent.count_val, 0)
+CheckSimple2(230, 4, ent.in_fields, ( 'in2', 'in3' ))
+CheckSimple2(230, 5, ent.period, 12)
+
+# 231: gd_alter_mplex check
+ent = pygetdata.entry(pygetdata.MPLEX_ENTRY, "new21", 0, { "count_val": 3,
+  "in_field1": "in3", "in_field2": "in4", "period": 7 })
+try:
+  d.alter('new21', ent)
+except:
+  CheckOK2(231, 1)
+
+try:
+  ent = d.entry('new21')
+except:
+  CheckOK2(231, 2)
+CheckSimple2(231, 1, ent.field_type, pygetdata.MPLEX_ENTRY)
+CheckSimple2(231, 2, ent.fragment, 0)
+CheckSimple2(231, 3, ent.count_val, 3)
+CheckSimple2(231, 4, ent.in_fields, ( 'in3', 'in4' ))
+CheckSimple2(231, 5, ent.period, 7)
+
+# 232: gd_strtok check
+try:
+  str = d.strtok("\"test1 test2\" test3\ test4")
+except:
+  CheckOK2(232, 1)
+CheckSimple2(232, 2, str, "test1 test2")
+
+try:
+  str = d.strtok()
+except:
+  CheckOK2(232, 3)
+CheckSimple2(232, 4, str, "test3 test4")
+
+# 233: gd_raw_close check
+try:
+  d.raw_close('data')
+except:
+  CheckOK(233)
+
+# 234: gd_desync check
+try:
+  n = d.desync()
+except:
+  CheckOK(234)
+CheckSimple(234, n, 0)
+
+# 235: gd_flags check
+try:
+  d.flags = pygetdata.PRETTY_PRINT
+except:
+  CheckOK2(235,1)
+
+try:
+  CheckSimple(235, d.flags, pygetdata.PRETTY_PRINT)
+except:
+  CheckOK2(235,2)
+
+# 236: gd_verbose_prefix check
+try:
+  CheckSimple(236, d.verbose_prefix, None)
+except:
+  CheckOK2(236, 1)
+
+try:
+  d.verbose_prefix = "big_test: "
+except:
+  CheckOK2(236, 2)
+CheckSimple(236, d.verbose_prefix, "big_test: ")
+
+# 237: gd_nentries check
+try:
+  n = d.nentries("data", pygetdata.SCALAR_ENTRIES,
+      pygetdata.ENTRIES_HIDDEN | pygetdata.ENTRIES_NOALIAS)
+except:
+  CheckOK2(237, 1)
+CheckSimple2(237, 1, n, 5)
+try:
+  n = d.nentries(type = pygetdata.VECTOR_ENTRIES,
+      flags = pygetdata.ENTRIES_HIDDEN | pygetdata.ENTRIES_NOALIAS)
+except:
+  CheckOK2(237, 2)
+CheckSimple2(237, 2, n, 23)
+
+# 239: gd_entry_list check
+try:
+  n = d.entry_list(type = pygetdata.VECTOR_ENTRIES,
+      flags = pygetdata.ENTRIES_HIDDEN | pygetdata.ENTRIES_NOALIAS)
+except:
+  CheckOK(239)
+CheckSimple(239,n, ['INDEX', 'bit', 'data', 'div', 'lincom', 'linterp',
+  'mplex', 'mult', 'new1', 'new14', 'new16', 'new18', 'new2', 'new21', 'new4',
+  'new6', 'new7', 'new8', 'phase', 'polynom', 'recip', 'sbit', 'window'])
+
+# 240: gd_mplex_lookback check
+try:
+  d.mplex_lookback = pygetdata.LOOKBACK_ALL
+except:
+  CheckOK(240, 1)
+
+try:
+  n = d.mplex_lookback
+except:
+  CheckOK2(240, 2)
+CheckSimple(240, n, pygetdata.LOOKBACK_ALL)
+
+# 241: linterp_tablename check
+try:
+  n = d.linterp_tablename("linterp")
+except:
+  CheckOK(241)
+CheckEOS(241,n,"dirfile/lut")
+
+# 242: mcarrays
+try:
+  n = d.mcarrays("data", pygetdata.FLOAT)
+except:
+  CheckOK(242)
+
+CheckSimple2(242,1,len(n),2)
+if (pygetdata.__numpy_supported__):
+  CheckSimple2(242,2,n[0][0],"mcarray")
+  CheckNumpy2(242,3,n[0][1],1.9 + 0.9 * numpy.arange(0,5))
+  CheckSimple2(242,4,n[1][0],"mnew17")
+  CheckNumpy2(242,5,n[1][1],[0,0])
+else:
+  CheckSimple(242,n,[("mcarray", [1.9, 2.8, 3.7, 4.6, 5.5]), ("mnew17", [0,0])])
+
+# 243: check NULL return from gd_reference
+try:
+  m = pygetdata.dirfile("dirfile/empty",
+      pygetdata.RDWR | pygetdata.CREAT | pygetdata.EXCL)
+except:
+  CheckOK2(243, 1)
+
+try:
+  n = m.reference;
+  CheckSimple(243, n, None);
+except:
+  CheckOK2(243, 2)
+
+
+
+
+
+
+
+
+
+
+# ==========================================================================
+
+d.discard()
+del d
+os.system("rm -rf dirfile")
+
+if (ne > 0):
+  print "ne =", ne
+  print "__numpy_supported__ =", pygetdata.__numpy_supported__
+  sys.exit(1)
diff --git a/bindings/python/test/callback.py b/bindings/python/test/callback.py
new file mode 100644
index 0000000..3aa58ac
--- /dev/null
+++ b/bindings/python/test/callback.py
@@ -0,0 +1,51 @@
+import sys
+import os
+import re
+import array
+import pygetdata
+
+#callback
+def parser_callback(pdata, extra):
+  if (extra != "extra stuff"):
+    print "extra =", extra;
+    sys.exit(1)
+
+  if (pdata["suberror"] != 8):
+    print "suberror =", pdata["suberror"]
+    sys.exit(1);
+
+  if (pdata["line"] != "bad line\n"):
+    print "line =", pdata["line"]
+    sys.exit(1);
+
+  if (pdata["linenum"] != 2):
+    print "linenum =", pdata["linenum"]
+    sys.exit(1);
+
+  if (re.search("dirfile/format$", pdata["filename"]) == None):
+    print "filename =", pdata["filename"]
+    sys.exit(1);
+
+  return pygetdata.SYNTAX_IGNORE;
+
+# create the dirfile first
+data=array.array("H",range(3,7000,7))
+os.system("rm -rf dirfile")
+os.mkdir("dirfile")
+file=open("dirfile/data", 'w')
+data.tofile(file)
+file.close()
+
+file=open("dirfile/format", "w")
+file.write("data RAW UINT16 8\nbad line\n")
+file.close()
+
+d=pygetdata.dirfile("dirfile", pygetdata.RDONLY, callback=parser_callback,
+    extra="extra stuff");
+error=d.error;
+
+os.system("rm -rf dirfile")
+
+if (error != pygetdata.E_OK):
+  print "error = ", error
+  sys.exit(1)
diff --git a/compile b/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..9afd676
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1568 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-11-29'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2013 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep -q __ELF__
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+		os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:Bitrig:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	exitcode=$?
+	trap '' 0
+	exit $exitcode ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+	echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+	echo m68k-milan-mint${UNAME_RELEASE}
+	exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+	echo m68k-hades-mint${UNAME_RELEASE}
+	exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+	echo m68k-unknown-mint${UNAME_RELEASE}
+	exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+	# DG/UX returns AViiON for all architectures
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[4567])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+		    case "${sc_cpu_version}" in
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+		      532)                      # CPU_PA_RISC2_0
+			case "${sc_kernel_bits}" in
+			  32) HP_ARCH="hppa2.0n" ;;
+			  64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+			esac ;;
+		    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^		//' << EOF >$dummy.c
+
+		#define _HPUX_SOURCE
+		#include <stdlib.h>
+		#include <unistd.h>
+
+		int main ()
+		{
+		#if defined(_SC_KERNEL_BITS)
+		    long bits = sysconf(_SC_KERNEL_BITS);
+		#endif
+		    long cpu  = sysconf (_SC_CPU_VERSION);
+
+		    switch (cpu)
+			{
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+			case CPU_PA_RISC2_0:
+		#if defined(_SC_KERNEL_BITS)
+			    switch (bits)
+				{
+				case 64: puts ("hppa2.0w"); break;
+				case 32: puts ("hppa2.0n"); break;
+				default: puts ("hppa2.0"); break;
+				} break;
+		#else  /* !defined(_SC_KERNEL_BITS) */
+			    puts ("hppa2.0"); break;
+		#endif
+			default: puts ("hppa1.0"); break;
+			}
+		    exit (0);
+		}
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep -q __LP64__
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+	exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+	exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+	exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+	exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    5000:UNIX_System_V:4.*:*)
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	case ${UNAME_PROCESSOR} in
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    *:MINGW64*:*)
+	echo ${UNAME_MACHINE}-pc-mingw64
+	exit ;;
+    *:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit ;;
+    i*:windows32*:*)
+	# uname -m includes "-pc" on this system.
+	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    *:Interix*:*)
+	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+	esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	else
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+		| grep -q __ARM_PCS_VFP
+	    then
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+	    else
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+	    fi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    cris:Linux:*:*)
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	exit ;;
+    crisv32:Linux:*:*)
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	exit ;;
+    frv:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    hexagon:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    i*86:Linux:*:*)
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=${UNAME_MACHINE}el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=${UNAME_MACHINE}
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	;;
+    or1k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    or32:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-${LIBC}
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-${LIBC}
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
+	esac
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-${LIBC}
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+	exit ;;
+    sh64*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    tile*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+	exit ;;
+    x86_64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    xtensa*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+	# Unixware is an offshoot of SVR4, but it has its own version
+	# number series starting with 2...
+	# I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+	# Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
+	# the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+	exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+			# says <Richard.M.Bartel at ccMail.Census.GOV>
+	echo i586-unisys-sysv4
+	exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+		echo mips-nec-sysv${UNAME_RELEASE}
+	else
+		echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+	exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
+    x86_64:Haiku:*:*)
+	echo x86_64-unknown-haiku
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		    grep IS_64BIT_ARCH >/dev/null
+		then
+		    case $UNAME_PROCESSOR in
+			i386) UNAME_PROCESSOR=x86_64 ;;
+			powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		    esac
+		fi
+	    fi
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
+	fi
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+	echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-unknown-esx
+	exit ;;
+esac
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+	"4"
+#else
+	""
+#endif
+	); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..61cb4bc
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1793 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-10-01'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2013 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray | -microblaze*)
+		os=
+		basic_machine=$1
+		;;
+	-bluegene*)
+		os=-cnk
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+	-chorusrdb)
+		os=-chorusrdb
+		basic_machine=$1
+		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*178)
+		os=-lynxos178
+		;;
+	-lynx*5)
+		os=-lynxos5
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| aarch64 | aarch64_be \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
+	| bfin \
+	| c4x | c8051 | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| epiphany \
+	| fido | fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| k1om \
+	| le32 | le64 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64octeon | mips64octeonel \
+	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| moxie \
+	| mt \
+	| msp430 \
+	| nds32 | nds32le | nds32be \
+	| nios | nios2 | nios2eb | nios2el \
+	| ns16k | ns32k \
+	| open8 \
+	| or1k | or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
+	| pyramid \
+	| rl78 | rx \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| we32k \
+	| x86 | xc16x | xstormy16 | xtensa \
+	| z8k | z80)
+		basic_machine=$basic_machine-unknown
+		;;
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	strongarm | thumb | xscale)
+		basic_machine=arm-unknown
+		;;
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	xscaleeb)
+		basic_machine=armeb-unknown
+		;;
+
+	xscaleel)
+		basic_machine=armel-unknown
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| aarch64-* | aarch64_be-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| be32-* | be64-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| k1om-* \
+	| le32-* | le64-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64octeon-* | mips64octeonel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nds32-* | nds32le-* | nds32be-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+	| pyramid-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile*-* \
+	| tron-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
+	| xstormy16-* | xtensa*-* \
+	| ymp-* \
+	| z8k-* | z80-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16 | cr16-*)
+		basic_machine=cr16-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	microblaze*)
+		basic_machine=microblaze-xilinx
+		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
+	mingw32)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	msys)
+		basic_machine=i686-pc
+		os=-msys
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	neo-tandem)
+		basic_machine=neo-tandem
+		;;
+	nse-tandem)
+		basic_machine=nse-tandem
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc | ppcbe)	basic_machine=powerpc-unknown
+		;;
+	ppc-* | ppcbe-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	strongarm-* | thumb-*)
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tile*)
+		basic_machine=$basic_machine-unknown
+		os=-linux-gnu
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+	# First match some system type aliases
+	# that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-auroraux)
+		os=-auroraux
+		;;
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* | -aros* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+	-os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+	-tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-dicos*)
+		os=-dicos
+		;;
+	-nacl*)
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	score-*)
+		os=-elf
+		;;
+	spu-*)
+		os=-elf
+		;;
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	c8051-*)
+		os=-elf
+		;;
+	hexagon-*)
+		os=-elf
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+	mep-*)
+		os=-elf
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or1k-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-cnk*|-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..79cb9ce
--- /dev/null
+++ b/configure
@@ -0,0 +1,37261 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for GetData 0.8.9.
+#
+# Report bugs to <getdata-devel at lists.sourceforge.net>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+#
+# Parts of this program are copyright (C) 2008-2015 D. V. Wiebe.
+#
+# These parts may be redistributed and/or modified under the terms of the GNU
+# Lesser General Public License as published by the Free Software Foundation;
+# either version 2.1 of the License, or (at your option) any later version.
+# See the file COPYING for details.
+#
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf at gnu.org and
+$0: getdata-devel at lists.sourceforge.net about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='GetData'
+PACKAGE_TARNAME='getdata'
+PACKAGE_VERSION='0.8.9'
+PACKAGE_STRING='GetData 0.8.9'
+PACKAGE_BUGREPORT='getdata-devel at lists.sourceforge.net'
+PACKAGE_URL='http://getdata.sourceforge.net/'
+
+ac_unique_file="src/getdata.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+GD_EXTERNAL_FALSE
+GD_EXTERNAL_TRUE
+USE_ZZSLIM_FALSE
+USE_ZZSLIM_TRUE
+HAVE_DIFF_FALSE
+HAVE_DIFF_TRUE
+TEST_MATLAB_FALSE
+TEST_MATLAB_TRUE
+TEST_PERL_FALSE
+TEST_PERL_TRUE
+TEST_IDL_FALSE
+TEST_IDL_TRUE
+TEST_PYTHON_FALSE
+TEST_PYTHON_TRUE
+USE_MODULES_FALSE
+USE_MODULES_TRUE
+MAKE_MATLABBINDINGS_FALSE
+MAKE_MATLABBINDINGS_TRUE
+MAKE_PERLBINDINGS_FALSE
+MAKE_PERLBINDINGS_TRUE
+MAKE_IDLBINDINGS_FALSE
+MAKE_IDLBINDINGS_TRUE
+MAKE_PYBINDINGS_FALSE
+MAKE_PYBINDINGS_TRUE
+MAKE_F95BINDINGS_FALSE
+MAKE_F95BINDINGS_TRUE
+MAKE_F77BINDINGS_FALSE
+MAKE_F77BINDINGS_TRUE
+MAKE_CXXBINDINGS_FALSE
+MAKE_CXXBINDINGS_TRUE
+INCLUDE_LEGACY_API_FALSE
+INCLUDE_LEGACY_API_TRUE
+INTEL_FC_COMPILER_FALSE
+INTEL_FC_COMPILER_TRUE
+INTEL_F77_COMPILER_FALSE
+INTEL_F77_COMPILER_TRUE
+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
+GETDATA_DEBUG_FALSE
+GETDATA_DEBUG_TRUE
+absolute_docdir
+PRIVATE_LIBS
+USE_ZZIP_FALSE
+USE_ZZIP_TRUE
+path_unzip
+path_zip
+ZZIP_LIBS
+ZZIP_LDFLAGS
+ZZIP_CPPFLAGS
+USE_SLIM_FALSE
+USE_SLIM_TRUE
+path_unslim
+path_slim
+SLIM_LIBS
+SLIM_LDFLAGS
+SLIM_CPPFLAGS
+USE_LZMA_FALSE
+USE_LZMA_TRUE
+path_xz
+LZMA_LIBS
+LZMA_LDFLAGS
+LZMA_CPPFLAGS
+USE_GZIP_FALSE
+USE_GZIP_TRUE
+path_gunzip
+path_gzip
+GZIP_LIBS
+GZIP_LDFLAGS
+GZIP_CPPFLAGS
+USE_BZIP2_FALSE
+USE_BZIP2_TRUE
+path_bunzip2
+path_bzip2
+BZIP2_LIBS
+BZIP2_LDFLAGS
+BZIP2_CPPFLAGS
+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
+FLIBS
+LTDLINCL
+LIBLTDL
+LIBTOOL_DEPS
+CXXCPP
+LT_SYS_LIBRARY_PATH
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+LIBTOOL
+ac_ct_FC
+FCFLAGS
+FC
+ac_ct_F77
+FFLAGS
+F77
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCCAS_FALSE
+am__fastdepCCAS_TRUE
+CCASDEPMODE
+CCASFLAGS
+CCAS
+DEFINE_GD_NO_C99_API
+EGREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+GD_DIRSEP
+GD_FDIRSEP
+SEQ
+PRINTF
+JOT
+DIFF
+DATE
+SED
+GREP
+LN_S
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+moduledir
+DL_LIBRARY_PATH
+GETDATA_DEBUG
+DEFINE_GD_LEGACY_API
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+MATLABGETDATA_VERSION
+F95GETDATA_VERSION
+FGETDATA_VERSION
+GETDATAXX_VERSION
+GETDATA_IFACE_AGE
+GETDATA_IMPL_REVISION
+GETDATA_IFACE_VERSION
+BUILDCC
+GETDATA_VERSION_SUFFIX
+GETDATA_REVISION
+GETDATA_MINOR
+GETDATA_MAJOR
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_legacy_api
+enable_assert
+enable_debug
+enable_ansi_c
+enable_bindings
+enable_cplusplus
+enable_fortran
+enable_fortran95
+enable_python
+enable_idl
+enable_perl
+enable_matlab
+enable_modules
+with_module_dir
+with_ltdl
+with_external_libraries
+enable_silent_rules
+enable_fast_unaligned
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_aix_soname
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+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_libbz2
+with_libz
+with_liblzma
+with_libslim
+with_libzzip
+enable_zzslim
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+BUILDCC
+DATE
+DIFF
+JOT
+PRINTF
+SEQ
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CCAS
+CCASFLAGS
+CXX
+CXXFLAGS
+CCC
+F77
+FFLAGS
+FC
+FCFLAGS
+LT_SYS_LIBRARY_PATH
+CXXCPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures GetData 0.8.9 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/getdata]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of GetData 0.8.9:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-legacy-api    don't include the legacy API wrapper in the library
+  --enable-assert         enable assertions
+  --enable-debug          enable debugging messages
+  --enable-ansi-c         use ANSI C (C89) work-arounds for C99 code
+  --disable-bindings      don't build any bindings, just build the C library
+  --disable-cplusplus     don't build the C++ bindings (libgetdata++)
+  --disable-fortran       don't build the Fortran 77 bindings (libfgetdata)
+                          nor the Fortran 95 bindings (libf95getdata)
+  --disable-fortran95     don't build the Fortran 95 bindings (libf95getdata)
+  --disable-python        don't build the Python bindings (pygetdata)
+  --disable-idl           don't build the Interactive Data Language (IDL)
+                          bindings (IDL_GetData)
+  --disable-perl          don't build the Perl bindings (GetData)
+  --disable-matlab        don't build the MATLAB bindings
+  --enable-modules        build external encodings in dynamically loaded
+                          modules instead of directly into the core GetData
+                          library
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-fast-unaligned use fast loads and stores with non-aligned data.
+                          WARNING: Enabling this on a platform which does not
+                          support fast unaligned memory access may cause the
+                          library to silently corrupt data. [default:
+                          autodetect]
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --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.
+  --disable-zzslim        disable zzslim encodings support
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-module-dir=DIR   if building modules, install them in DIR. This is
+                          ignored if --enable-modules isn't specified
+                          [default: LIBDIR/getdata]
+  --with-ltdl=PREFIX      if building modules, use the GNU ltdl library
+                          located in PREFIX [default: autodetect]
+  --without-external-libraries
+                          disable all features relying on external libraries
+  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-aix-soname=aix|svr4|both
+                          shared library versioning (aka "SONAME") variant to
+                          provide on AIX, [default=aix].
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
+                          compiler's sysroot if not specified).
+  --with-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-perl=PATH        use the Perl interpreter located in PATH. [default:
+                          autodetect]
+  --with-perl-dir=PATH    Install Perl bindings in PATH. If PATH is the
+                          special word `vendor', install Perl bindings into
+                          the default vendor-specific module directory (if
+                          present). If PATH is the special word `site',
+                          install Perl bindings into the default site-specific
+                          module directory. [default: site]
+  --with-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-libbz2=PREFIX    use the libbz2 installed in PREFIX [default:
+                          autodetect]
+  --without-libbz2        disable encodings supported by libbz2, even if the
+                          library is present
+  --with-libz=PREFIX      use the libz installed in PREFIX [default:
+                          autodetect]
+  --without-libz          disable encodings supported by libz, even if the
+                          library is present
+  --with-liblzma=PREFIX   use the liblzma installed in PREFIX [default:
+                          autodetect]
+  --without-liblzma       disable encodings supported by liblzma, even if the
+                          library is present
+  --with-libslim=PREFIX   use the libslim installed in PREFIX [default:
+                          autodetect]
+  --without-libslim       disable encodings supported by libslim, even if the
+                          library is present
+  --with-libzzip=PREFIX   use the libzzip installed in PREFIX [default:
+                          autodetect]
+  --without-libzzip       disable encodings supported by libzzip, even if the
+                          library is present
+
+Some influential environment variables:
+  BUILDCC     C compiler command on the build system (only needed if
+              cross-compiling)
+  DATE        a date program which supports '+%...' conversion specifiers
+  DIFF        a POSIX-compatible diff
+  JOT         a BSD-style jot; SysV-derived systems (like GNU/Linux) may find
+              it easier to use SEQ (q.v.)
+  PRINTF      a POSIX-compatible printf
+  SEQ         a SysV-style seq; BSD-derived systems (like MacOS X) may find it
+              easier to use JOT (q.v.)
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  CCAS        assembler compiler command (defaults to CC)
+  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  FC          Fortran compiler command
+  FCFLAGS     Fortran compiler flags
+  LT_SYS_LIBRARY_PATH
+              User-defined run-time library search path.
+  CXXCPP      C++ preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <getdata-devel at lists.sourceforge.net>.
+GetData home page: <http://getdata.sourceforge.net/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+GetData configure 0.8.9
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+
+Parts of this program are copyright (C) 2008-2015 D. V. Wiebe.
+
+These parts may be redistributed and/or modified under the terms of the GNU
+Lesser General Public License as published by the Free Software Foundation;
+either version 2.1 of the License, or (at your option) any later version.
+See the file COPYING for details.
+
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## -------------------------------------------------- ##
+## Report this to getdata-devel at lists.sourceforge.net ##
+## -------------------------------------------------- ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_f77_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_f77_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_f77_try_compile
+
+# ac_fn_fc_try_compile LINENO
+# ---------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_fc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_fc_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_f77_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_f77_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_f77_try_link
+
+# ac_fn_fc_try_link LINENO
+# ------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_fc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_fc_try_link
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if test "$cross_compiling" = yes; then
+    # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid; break
+else
+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=$ac_mid; break
+else
+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid
+else
+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (($2) < 0)
+    {
+      long int i = longval ();
+      if (i != ($2))
+	return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ($2))
+	return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+  ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+  fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+	 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  case $ac_type in #(
+  uint$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
+
+# ac_fn_c_find_intX_t LINENO BITS VAR
+# -----------------------------------
+# Finds a signed integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_intX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+$as_echo_n "checking for int$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in int$2_t 'int' 'long int' \
+	 'long long int' 'short int' 'signed char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+	     enum { N = $2 / 2 - 1 };
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+	        enum { N = $2 / 2 - 1 };
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+		 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  case $ac_type in #(
+  int$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_intX_t
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+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
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+$as_echo "#define GETDATA_MAJOR 0" >>confdefs.h
+
+
+$as_echo "#define GETDATA_MINOR 8" >>confdefs.h
+
+
+$as_echo "#define GETDATA_REVISION 9" >>confdefs.h
+
+
+$as_echo "#define GETDATA_VERSION_SUFFIX \"\"" >>confdefs.h
+
+
+GETDATA_MAJOR=0
+
+GETDATA_MINOR=8
+
+GETDATA_REVISION=9
+
+GETDATA_VERSION_SUFFIX=
+
+
+
+
+
+
+
+
+
+GETDATA_IFACE_VERSION=6
+
+GETDATA_IMPL_REVISION=7
+
+GETDATA_IFACE_AGE=1
+
+GETDATAXX_VERSION=5:1:2
+
+FGETDATA_VERSION=4:4:2
+
+F95GETDATA_VERSION=5:3:3
+
+MATLABGETDATA_VERSION=0:1:0
+
+
+
+ac_config_headers="$ac_config_headers src/gd_config.h"
+
+
+BUINDINGS_BUILT=
+BINDINGS_LEFT=
+ENCODINGS_BUILT=" raw ascii sie"
+ENCODINGS_LEFT=
+PRIVATE_LIBS=
+
+echo "*** Checking GetData configuration"
+echo
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+# Check whether --enable-legacy-api was given.
+if test "${enable_legacy_api+set}" = set; then :
+  enableval=$enable_legacy_api;
+               case "${enableval}" in
+                 no) include_legacy_api="no" ;;
+                 *) include_legacy_api="yes" ;;
+               esac
+
+else
+   include_legacy_api="yes"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the legacy API" >&5
+$as_echo_n "checking whether to include the legacy API... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $include_legacy_api" >&5
+$as_echo "$include_legacy_api" >&6; }
+
+if test "x$include_legacy_api" != "xno"; then
+  DEFINE_GD_LEGACY_API="#define GD_LEGACY_API"
+else
+  DEFINE_GD_LEGACY_API="/* #undef GD_LEGACY_API */"
+fi
+
+
+# Check whether --enable-assert was given.
+if test "${enable_assert+set}" = set; then :
+  enableval=$enable_assert;
+               case "${enableval}" in
+                 yes) enable_assert="yes" ;;
+                 *) enable_assert="no" ;;
+               esac
+
+else
+   enable_assert="no"
+fi
+
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug;
+               case "${enableval}" in
+                 yes) enable_debug="yes" ;;
+                 *) enable_debug="no" ;;
+               esac
+
+else
+   enable_debug="no"
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging messages" >&5
+$as_echo_n "checking whether to enable debugging messages... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5
+$as_echo "$enable_debug" >&6; }
+if test "x$enable_debug" = "xyes"; then
+
+$as_echo "#define GETDATA_DEBUG /**/" >>confdefs.h
+
+  enable_assert="yes"
+  GETDATA_DEBUG=1
+else
+  GETDATA_DEBUG=0
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5
+$as_echo_n "checking whether to enable assertions... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5
+$as_echo "$enable_assert" >&6; }
+if test "x$enable_assert" = "xno"; then
+
+$as_echo "#define NDEBUG 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-ansi-c was given.
+if test "${enable_ansi_c+set}" = set; then :
+  enableval=$enable_ansi_c;
+               if test "x${enableval}" != "xno"; then
+                 disable_c99="yes";
+               else
+                 disable_c99="no";
+               fi
+
+else
+  disable_c99="no"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build in ANSI C compliance mode" >&5
+$as_echo_n "checking whether to build in ANSI C compliance mode... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $disable_c99" >&5
+$as_echo "$disable_c99" >&6; }
+
+make_cxxbindings="yes"
+make_f77bindings="yes"
+make_pybindings="yes"
+make_idlbindings="yes"
+make_perlbindings="yes"
+make_matlabbindings="yes"
+# Check whether --enable-bindings was given.
+if test "${enable_bindings+set}" = set; then :
+  enableval=$enable_bindings;
+               if test "x${enableval}" = "xno"; then
+                 make_cxxbindings="no"
+                 make_f77bindings="no"
+                 make_pybindings="no"
+                 make_idlbindings="no"
+                 make_perlbindings="no"
+                 make_matlabbindings="no"
+               fi
+
+fi
+
+
+# Check whether --enable-cplusplus was given.
+if test "${enable_cplusplus+set}" = set; then :
+  enableval=$enable_cplusplus;
+               case "${enableval}" in
+                 no) make_cxxbindings="no" ;;
+                 *) make_cxxbindings="yes" ;;
+               esac
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the C++ bindings" >&5
+$as_echo_n "checking whether to include the C++ bindings... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_cxxbindings" >&5
+$as_echo "$make_cxxbindings" >&6; }
+
+# Check whether --enable-fortran was given.
+if test "${enable_fortran+set}" = set; then :
+  enableval=$enable_fortran;
+               case "${enableval}" in
+                 no) make_f77bindings="no" ;;
+                 *) make_f77bindings="yes" ;;
+               esac
+
+fi
+
+
+# Check whether --enable-fortran95 was given.
+if test "${enable_fortran95+set}" = set; then :
+  enableval=$enable_fortran95;
+               case "${enableval}" in
+                 no) make_f95bindings="no" ;;
+                 *) make_f95bindings="yes" ;;
+               esac
+
+else
+   make_f95bindings="$make_f77bindings"
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Fortran 95 bindings" >&5
+$as_echo_n "checking whether to include the Fortran 95 bindings... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_f95bindings" >&5
+$as_echo "$make_f95bindings" >&6; }
+
+if test "x$make_f77bindings$make_f95bindings" = "xnoyes"; then
+  make_f77bindings="yes (required by Fortran 95 bindings)"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Fortran 77 bindings" >&5
+$as_echo_n "checking whether to include the Fortran 77 bindings... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_f77bindings" >&5
+$as_echo "$make_f77bindings" >&6; }
+
+case "${host}" in
+  *-apple-darwin*) DL_LIBRARY_PATH="DYLD_LIBRARY_PATH" ;;
+  *) DL_LIBRARY_PATH="LD_LIBRARY_PATH" ;;
+esac
+
+
+# Check whether --enable-python was given.
+if test "${enable_python+set}" = set; then :
+  enableval=$enable_python;
+               case "${enableval}" in
+                 no) make_pybindings="no" ;;
+                 *) make_pybindings="yes" ;;
+               esac
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Python bindings" >&5
+$as_echo_n "checking whether to include the Python bindings... " >&6; }
+{ $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;
+               case "${enableval}" in
+                 no) make_idlbindings="no" ;;
+                 *) make_idlbindings="yes" ;;
+               esac
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the IDL bindings" >&5
+$as_echo_n "checking whether to include the IDL bindings... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_idlbindings" >&5
+$as_echo "$make_idlbindings" >&6; }
+
+# Check whether --enable-perl was given.
+if test "${enable_perl+set}" = set; then :
+  enableval=$enable_perl;
+               case "${enableval}" in
+                 no) make_perlbindings="no" ;;
+                 *) make_perlbindings="yes" ;;
+               esac
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Perl bindings" >&5
+$as_echo_n "checking whether to include the Perl bindings... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_perlbindings" >&5
+$as_echo "$make_perlbindings" >&6; }
+
+# Check whether --enable-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-modules was given.
+if test "${enable_modules+set}" = set; then :
+  enableval=$enable_modules;
+                case "${enableval}" in
+                  no) use_modules="no" ;;
+                  *) use_modules="yes" ;;
+                esac
+
+else
+   use_modules="no"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable getdata modules" >&5
+$as_echo_n "checking whether to enable getdata modules... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_modules" >&5
+$as_echo "$use_modules" >&6; }
+if test "x$use_modules" != "xno"; then
+
+$as_echo "#define USE_MODULES /**/" >>confdefs.h
+
+fi
+
+
+# Check whether --with-module-dir was given.
+if test "${with_module_dir+set}" = set; then :
+  withval=$with_module_dir;
+             case "${withval}" in
+               no) moduledir="$libdir/getdata" ;;
+               *) moduledir="${withval}" ;;
+             esac
+
+else
+   moduledir="$libdir/getdata"
+fi
+
+
+
+
+# Check whether --with-ltdl was given.
+if test "${with_ltdl+set}" = set; then :
+  withval=$with_ltdl;
+               case "${withval}" in
+                 no) ltdl_prefix= ;;
+                 *) ltdl_prefix="${withval}" ;;
+               esac
+
+else
+   ltdl_prefix=
+fi
+
+
+
+# Check whether --with-external-libraries was given.
+if test "${with_external_libraries+set}" = set; then :
+  withval=$with_external_libraries;
+             case "${withval}" in
+               no) no_extern="yes";;
+               *) no_extern="no";;
+             esac
+
+else
+   no_extern="no"
+fi
+
+
+echo
+echo "*** Initialising build system"
+echo
+am__api_version='1.14'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='getdata'
+ VERSION='0.8.9'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+for ac_prog in date
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DATE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DATE"; then
+  ac_cv_prog_DATE="$DATE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DATE="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DATE=$ac_cv_prog_DATE
+if test -n "$DATE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DATE" >&5
+$as_echo "$DATE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$DATE" && break
+done
+test -n "$DATE" || DATE="not found"
+
+
+
+for ac_prog in diff
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DIFF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DIFF"; then
+  ac_cv_prog_DIFF="$DIFF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DIFF="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DIFF=$ac_cv_prog_DIFF
+if test -n "$DIFF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIFF" >&5
+$as_echo "$DIFF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$DIFF" && break
+done
+
+
+
+for ac_prog in jot
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_JOT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$JOT"; then
+  ac_cv_prog_JOT="$JOT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_JOT="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+JOT=$ac_cv_prog_JOT
+if test -n "$JOT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JOT" >&5
+$as_echo "$JOT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$JOT" && break
+done
+test -n "$JOT" || JOT="not found"
+
+
+
+for ac_prog in printf
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PRINTF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PRINTF"; then
+  ac_cv_prog_PRINTF="$PRINTF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PRINTF="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+PRINTF=$ac_cv_prog_PRINTF
+if test -n "$PRINTF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRINTF" >&5
+$as_echo "$PRINTF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PRINTF" && break
+done
+test -n "$PRINTF" || PRINTF="not found"
+
+
+
+for ac_prog in seq
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_SEQ+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$SEQ"; then
+  ac_cv_prog_SEQ="$SEQ" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_SEQ="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+SEQ=$ac_cv_prog_SEQ
+if test -n "$SEQ"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SEQ" >&5
+$as_echo "$SEQ" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$SEQ" && break
+done
+test -n "$SEQ" || SEQ="not found"
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we're running under Msys" >&5
+$as_echo_n "checking whether we're running under Msys... " >&6; }
+if test "x`uname -o 2> /dev/null`" = "xMsys"; then
+this_is_msys=yes
+else
+this_is_msys=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $this_is_msys" >&5
+$as_echo "$this_is_msys" >&6; }
+
+if test "$this_is_msys" = "yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Win32 MSYS shell" >&5
+$as_echo_n "checking for the Win32 MSYS shell... " >&6; }
+msys_root=`mount | ${GREP} 'on / ' | awk '{print $1}'`
+msys_shell1="$msys_root`echo $SHELL | ${SED} -e 's/\//\\\\/g'`.exe"
+msys_shell=`echo "$msys_shell1" | ${SED} -e 's/\\\\/\\\\\\\\/g'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $msys_shell1" >&5
+$as_echo "$msys_shell1" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define MSYS_SHELL "$msys_shell"
+_ACEOF
+
+fi
+
+
+echo
+echo "*** Checking host environment"
+echo
+
+# Check whether --enable-fast-unaligned was given.
+if test "${enable_fast_unaligned+set}" = set; then :
+  enableval=$enable_fast_unaligned;
+   case "${enableval}" in
+     yes) gd_unaligned_override="yes" ;;
+     no) gd_unaligned_override="no" ;;
+     *) gd_unaligned_override="check" ;;
+   esac
+
+else
+  gd_unaligned_override="check"
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${host} supports fast unaligned memory access" >&5
+$as_echo_n "checking whether ${host} supports fast unaligned memory access... " >&6; }
+if test "x$gd_unaligned_override" = "xyes"; then
+  gd_unaligned_ok=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (forced)" >&5
+$as_echo "yes (forced)" >&6; }
+elif test "x$gd_unaligned_override" = "xno"; then
+  gd_unaligned_ok=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (forced)" >&5
+$as_echo "no (forced)" >&6; }
+else
+  case "${host}" in
+    i?86-*-*|powerpc*-*-*|x86_64-*-*|armv6789*-*-*) gd_unaligned_ok=yes ;;
+  *) gd_unaligned_ok=no ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_unaligned_ok" >&5
+$as_echo "$gd_unaligned_ok" >&6; }
+fi
+
+if test "x$gd_unaligned_ok" = "xyes"; then
+
+$as_echo "#define UNALIGNED_ACCESS_OK 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the directory separator" >&5
+$as_echo_n "checking the directory separator... " >&6; }
+case "${host}" in
+  *-*-djgpp|*-*-mingw32) GD_FDIRSEP=\\; GD_DIRSEP=\\\\ ;;
+  *) GD_FDIRSEP=/; GD_DIRSEP=/ ;;
+esac
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GD_DIRSEP '$GD_DIRSEP'
+_ACEOF
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GD_FDIRSEP" >&5
+$as_echo "$GD_FDIRSEP" >&6; }
+
+case "${host}" in
+  *-pc-mingw*)
+  NO_UNDEFINED=" -no-undefined"
+  NO_DLOPEN_TESTS=1 ;;
+  *-*-cygwin*)
+  NO_UNDEFINED=" -no-undefined -enable-auto-import"
+  NO_DLOPEN_TESTS=1 ;;
+  *) NO_DLOPEN_TESTS=0 ;;
+esac
+
+echo
+echo "*** Checking C compiler characteristics"
+echo
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+  MINIX=yes
+else
+  MINIX=
+fi
+
+
+  if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+  fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_safe_to_define___extensions__=yes
+else
+  ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+   test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+	 test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+
+if test "x$disable_c99" != "xyes"; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg (args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg (args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = va_arg (args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+	  || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
+  if test "x$ac_cv_prog_cc_c99" = "xno"; then
+    disable_c99="yes"
+  fi
+fi
+if test "x$disable_c99" = "xyes"; then
+  DEFINE_GD_NO_C99_API="#define GD_NO_C99_API"
+else
+  DEFINE_GD_NO_C99_API="/* #undef GD_NO_C99_API */"
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# By default we simply use the C compiler to build assembly code.
+
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+
+
+
+depcc="$CCAS"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CCAS_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CCAS_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CCAS_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
+CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
+  am__fastdepCCAS_TRUE=
+  am__fastdepCCAS_FALSE='#'
+else
+  am__fastdepCCAS_TRUE='#'
+  am__fastdepCCAS_FALSE=
+fi
+
+
+
+echo
+echo "*** Checking C++ compiler characteristics"
+echo
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+else
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX understands -c and -o together" >&5
+$as_echo_n "checking whether $CXX understands -c and -o together... " >&6; }
+if ${ac_cv_prog_cxx_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# We test twice because some compilers refuse to overwrite an existing
+# `.o' file with `-o', although they will create one.
+ac_try='$CXX $CXXFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+     test -f conftest2.$ac_objext &&
+     { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  ac_cv_prog_cxx_c_o=yes
+else
+  ac_cv_prog_cxx_c_o=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_c_o" >&5
+$as_echo "$ac_cv_prog_cxx_c_o" >&6; }
+if test $ac_cv_prog_cxx_c_o = no; then
+
+$as_echo "#define CXX_NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+if test "x$make_f77bindings" != "xno"; then
+  echo
+  echo "*** Checking Fortran 77 compiler characteristics"
+  echo
+  ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if ${ac_cv_f77_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if ${ac_cv_prog_f77_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS=-g
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  ac_cv_prog_f77_g=yes
+else
+  ac_cv_prog_f77_g=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 understands -c and -o together" >&5
+$as_echo_n "checking whether $F77 understands -c and -o together... " >&6; }
+if ${ac_cv_prog_f77_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+# We test twice because some compilers refuse to overwrite an existing
+# `.o' file with `-o', although they will create one.
+ac_try='$F77 $FFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+     test -f conftest2.$ac_objext &&
+     { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  ac_cv_prog_f77_c_o=yes
+else
+  ac_cv_prog_f77_c_o=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_c_o" >&5
+$as_echo "$ac_cv_prog_f77_c_o" >&6; }
+if test $ac_cv_prog_f77_c_o = no; then
+
+$as_echo "#define F77_NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+if test "x$make_f95bindings" != "xno"; then
+  echo
+  echo "*** Checking Fortran 90 compiler characteristics"
+  echo
+  ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$FC"; then
+  ac_cv_prog_FC="$FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+FC=$ac_cv_prog_FC
+if test -n "$FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5
+$as_echo "$FC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$FC" && break
+  done
+fi
+if test -z "$FC"; then
+  ac_ct_FC=$FC
+  for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_FC"; then
+  ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_FC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_FC=$ac_cv_prog_ac_ct_FC
+if test -n "$ac_ct_FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5
+$as_echo "$ac_ct_FC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_FC" && break
+done
+
+  if test "x$ac_ct_FC" = x; then
+    FC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    FC=$ac_ct_FC
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; }
+if ${ac_cv_fc_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_fc_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5
+$as_echo "$ac_cv_fc_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FCFLAGS=${FCFLAGS+set}
+ac_save_FCFLAGS=$FCFLAGS
+FCFLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5
+$as_echo_n "checking whether $FC accepts -g... " >&6; }
+if ${ac_cv_prog_fc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  FCFLAGS=-g
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_cv_prog_fc_g=yes
+else
+  ac_cv_prog_fc_g=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5
+$as_echo "$ac_cv_prog_fc_g" >&6; }
+if test "$ac_test_FCFLAGS" = set; then
+  FCFLAGS=$ac_save_FCFLAGS
+elif test $ac_cv_prog_fc_g = yes; then
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-g -O2"
+  else
+    FCFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-O2"
+  else
+    FCFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  GFC=yes
+else
+  GFC=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC understands -c and -o together" >&5
+$as_echo_n "checking whether $FC understands -c and -o together... " >&6; }
+if ${ac_cv_prog_fc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+# We test twice because some compilers refuse to overwrite an existing
+# `.o' file with `-o', although they will create one.
+ac_try='$FC $FCFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+     test -f conftest2.$ac_objext &&
+     { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  ac_cv_prog_fc_c_o=yes
+else
+  ac_cv_prog_fc_c_o=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_c_o" >&5
+$as_echo "$ac_cv_prog_fc_c_o" >&6; }
+if test $ac_cv_prog_fc_c_o = no; then
+
+$as_echo "#define FC_NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  # does $FC accept fortran code with .f90 extension?
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 90 compiler works" >&5
+$as_echo_n "checking whether the Fortran 90 compiler works... " >&6; }
+  ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+  ac_ext="f90"
+
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }; FC=;
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+if test "x${cross_compiling}" != "xno"; then
+  echo
+  echo "*** Checking the build environment"
+  echo
+  if test -z "$BUILDCC"; then
+    if test -n "$build_alias"; then
+      for ac_prog in ${build_alias}-gcc ${build_alias}-cc ${build_alias}-cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_BUILDCC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$BUILDCC"; then
+  ac_cv_prog_BUILDCC="$BUILDCC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_BUILDCC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+BUILDCC=$ac_cv_prog_BUILDCC
+if test -n "$BUILDCC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDCC" >&5
+$as_echo "$BUILDCC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$BUILDCC" && break
+done
+
+    fi
+  fi
+  if test -z "$BUILDCC"; then
+    for ac_prog in gcc cc cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_BUILDCC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$BUILDCC"; then
+  ac_cv_prog_BUILDCC="$BUILDCC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_BUILDCC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+BUILDCC=$ac_cv_prog_BUILDCC
+if test -n "$BUILDCC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDCC" >&5
+$as_echo "$BUILDCC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$BUILDCC" && break
+done
+
+  fi
+else
+  if test -z "$BUILDCC"; then
+    BUILDCC=$CC
+  fi
+
+fi
+
+echo
+echo "*** Building libtool"
+echo
+case `pwd` in
+  *\ * | *\	*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.6'
+macro_revision='2.4.6'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case $ECHO in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test yes = "$GCC"; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return, which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD=$ac_prog
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test yes = "$with_gnu_ld"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD=$ac_dir/$ac_prog
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </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
+fi
+
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM=$NM
+else
+  lt_nm_to_check=${ac_tool_prefix}nm
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS=$lt_save_ifs
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break 2
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break 2
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS=$lt_save_ifs
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols -headers"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring=ABCD
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test 17 != "$i" # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test yes != "$GCC"; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test 0 -eq "$ac_status"; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	if test 0 -ne "$ac_status"; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test no = "$lt_cv_ar_at_file"; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  bitrig* | openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test ia64 = "$host_cpu"; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
+	  LIBS=conftstm.$ac_objext
+	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+	    pipe_works=yes
+	  fi
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
+	else
+	  echo "cannot find nm_test_func in $nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test yes = "$pipe_works"; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
+else
+  with_sysroot=no
+fi
+
+
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+   if test yes = "$GCC"; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+  ac_path_lt_DD_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in dd; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <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
+      $ac_path_lt_DD_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_lt_DD"; then
+    :
+  fi
+else
+  ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <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"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE=32
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE=64
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
+	    ;;
+	  powerpc64le-*linux*)
+	    LD="${LD-ld} -m elf32lppclinux"
+	    ;;
+	  powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  powerpcle-*linux*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test yes != "$lt_cv_cc_needs_belf"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS=$SAVE_CFLAGS
+  fi
+  ;;
+*-*solaris*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*)
+        case $host in
+        i?86-*-solaris*|x86_64-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD=${LD-ld}_sol2
+        fi
+        ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks=$enable_libtool_lock
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+  fi
+else
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test yes != "$lt_cv_path_mainfest_tool"; then
+  MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "$LT_MULTI_MODULE"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	# If there is a non-empty error log, and "single_module"
+	# appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+	  cat conftest.err >&5
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&5
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+	cat conftest.err >&5
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	10.[012][,.]*)
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+    fi
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+func_stripname_cnf ()
+{
+  case $2 in
+  .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;;
+  esac
+} # func_stripname_cnf
+
+
+
+
+
+
+# Set options
+enable_dlopen=yes
+
+
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+	IFS=$lt_save_ifs
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+	IFS=$lt_save_ifs
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for lt_pkg in $withval; do
+	IFS=$lt_save_ifs
+	if test "X$lt_pkg" = "X$lt_p"; then
+	  pic_mode=yes
+	fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac
+else
+  pic_mode=default
+fi
+
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+	IFS=$lt_save_ifs
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+  shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+  withval=$with_aix_soname; case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname
+else
+  if ${lt_cv_with_aix_soname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_with_aix_soname=aix
+fi
+
+    with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test set != "${COLLECT_NAMES+set}"; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/${ac_tool_prefix}file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
+  ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
+  ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC=$CC
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test yes = "$GCC"; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+  if test yes = "$GCC"; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl='-Wl,-Wl,,'
+        lt_prog_compiler_pic='-PIC'
+        lt_prog_compiler_static='-Bstatic'
+        ;;
+      esac
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='$wl-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64, which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='--shared'
+	lt_prog_compiler_static='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl='-Wl,-Wl,,'
+	lt_prog_compiler_pic='-PIC'
+	lt_prog_compiler_static='-Bstatic'
+	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-qpic'
+	lt_prog_compiler_static='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Qoption ld '
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Wl,'
+	  ;;
+        *Intel*\ [CF]*Compiler*)
+	  lt_prog_compiler_wl='-Wl,'
+	  lt_prog_compiler_pic='-fPIC'
+	  lt_prog_compiler_static='-static'
+	  ;;
+	*Portland\ Group*)
+	  lt_prog_compiler_wl='-Wl,'
+	  lt_prog_compiler_pic='-fpic'
+	  lt_prog_compiler_static='-Bstatic'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms that do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works"; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test yes != "$GCC"; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd* | bitrig*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test yes = "$with_gnu_ld"; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test yes = "$lt_use_gnu_ld_interface"; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='$wl'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec='$wl--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test ia64 != "$host_cpu"; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='$wl--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+      export_dynamic_flag_spec='$wl-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test linux-dietlibc = "$host_os"; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test no = "$tmp_diet"
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec=
+	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  compiler_needs_object=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  compiler_needs_object=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+        if test yes = "$supports_anon_versioning"; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	tcc*)
+	  export_dynamic_flag_spec='-rdynamic'
+	  ;;
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test yes = "$supports_anon_versioning"; then
+	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test no = "$ld_shlibs"; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test ia64 = "$host_cpu"; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	hardcode_direct=no
+	hardcode_direct_absolute=no
+	;;
+      esac
+
+      if test yes = "$GCC"; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`$CC -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
+	fi
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
+      else
+	# not using gcc
+	if test ia64 = "$host_cpu"; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
+	  else
+	    shared_flag='$wl-bM:SRE'
+	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
+	fi
+      fi
+
+      export_dynamic_flag_spec='$wl-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+      else
+	if test ia64 = "$host_cpu"; then
+	  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+	 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag=' $wl-bernotok'
+	  allow_undefined_flag=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec='$convenience'
+	  fi
+	  archive_cmds_need_lc=yes
+	  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) >  [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	always_export_symbols=yes
+	file_list_spec='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=.dll
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+	enable_shared_with_static_runtimes=yes
+	exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds='chmod 644 $oldlib'
+	postlink_cmds='lt_outputfile="@OUTPUT@"~
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=.dll
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec=''
+  fi
+  link_all_deplibs=yes
+  allow_undefined_flag=$_lt_dar_allow_undefined
+  case $cc_basename in
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test yes = "$_lt_dar_can_shared"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test yes = "$GCC"; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='$wl-E'
+      ;;
+
+    hpux10*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+	hardcode_libdir_separator=:
+	hardcode_direct=yes
+	hardcode_direct_absolute=yes
+	export_dynamic_flag_spec='$wl-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test yes = "$lt_cv_prog_compiler__b"; then
+    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+	  ;;
+	esac
+      fi
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+	hardcode_libdir_separator=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	*)
+	  hardcode_direct=yes
+	  hardcode_direct_absolute=yes
+	  export_dynamic_flag_spec='$wl-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS=$save_LDFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+	fi
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	ld_shlibs=yes
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd* | bitrig*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct=yes
+	hardcode_shlibpath_var=no
+	hardcode_direct_absolute=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+	  export_dynamic_flag_spec='$wl-E'
+	else
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    osf3*)
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='$wl'
+	  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test yes = "$GCC"; then
+	  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test sequent = "$host_vendor"; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='$wl-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We CANNOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='$wl-z,text'
+      allow_undefined_flag='$wl-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='$wl-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='$wl-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test sni = "$host_vendor"; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec='$wl-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test no = "$ld_shlibs" && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test yes,yes = "$GCC,$enable_shared"; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl
+	  pic_flag=$lt_prog_compiler_pic
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag
+	  allow_undefined_flag=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc=no
+	  else
+	    lt_cv_archive_cmds_need_lc=yes
+	  fi
+	  allow_undefined_flag=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test yes = "$GCC"; then
+  case $host_os in
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary...
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo = "/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='$libname$release$shared_ext$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test ia64 = "$host_cpu"; then
+    # AIX 5 supports IA64
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
+      # If using run time linking (on AIX 4.2 or later) use lib<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'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec=$LIB
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+    fi
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test yes = "$lt_cv_prog_gnu_ld"; then
+		version_type=linux # correct to gnu/linux during the next big refactor
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec='-L$libdir'
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd* | bitrig*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec=/usr/lib
+  need_lib_prefix=no
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+os2*)
+  libname_spec='$name'
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test yes = "$with_gnu_ld"; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec; then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=sco
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test yes = "$with_gnu_ld"; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test yes = "$hardcode_automatic"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$hardcode_direct" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+     test no != "$hardcode_minus_L"; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test relink = "$hardcode_action" ||
+   test yes = "$inherit_rpath"; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test yes != "$enable_dlopen"; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen=load_add_on
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen=LoadLibrary
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+    # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+
+    lt_cv_dlopen=dyld
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen=shl_load
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen=dlopen
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test no = "$lt_cv_dlopen"; then
+    enable_dlopen=no
+  else
+    enable_dlopen=yes
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS=$LDFLAGS
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS=$LIBS
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test yes = "$cross_compiling"; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <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 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test yes = "$lt_cv_dlopen_self"; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test yes = "$cross_compiling"; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <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 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP"; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report what library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test no = "$can_build_shared" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test yes = "$enable_shared" && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test yes = "$enable_shared" || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+
+      if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if ${ac_cv_prog_CXXCPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+  _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_caught_CXX_error"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  compiler_CXX=$CC
+  func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
+
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test yes = "$GXX"; then
+      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+    else
+      lt_prog_compiler_no_builtin_flag_CXX=
+    fi
+
+    if test yes = "$GXX"; then
+      # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test yes = "$GCC"; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return, which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD=$ac_prog
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test yes = "$with_gnu_ld"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD=$ac_dir/$ac_prog
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </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
+fi
+
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test yes = "$with_gnu_ld"; then
+        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+
+        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+        export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='$wl'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+        else
+          whole_archive_flag_spec_CXX=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+    ld_shlibs_CXX=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+      aix[4-9]*)
+        if test ia64 = "$host_cpu"; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # have runtime linking enabled, and use it for executables.
+          # For shared libraries, we enable/disable runtime linking
+          # depending on the kind of the shared library created -
+          # when "with_aix_soname,aix_use_runtimelinking" is:
+          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "aix,yes"  lib.so          shared, rtl:yes, for executables
+          #            lib.a           static archive
+          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+          #            lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a(lib.so.V) shared, rtl:no
+          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a           static archive
+          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	      # so we don't have lib.a shared libs to link our executables.
+	      # We have to force runtime linking in this case.
+	      aix_use_runtimelinking=yes
+	      LDFLAGS="$LDFLAGS -Wl,-brtl"
+	    fi
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        archive_cmds_CXX=''
+        hardcode_direct_CXX=yes
+        hardcode_direct_absolute_CXX=yes
+        hardcode_libdir_separator_CXX=':'
+        link_all_deplibs_CXX=yes
+        file_list_spec_CXX='$wl-f,'
+        case $with_aix_soname,$aix_use_runtimelinking in
+        aix,*) ;;	# no import file
+        svr4,* | *,yes) # use import file
+          # The Import File defines what to hardcode.
+          hardcode_direct_CXX=no
+          hardcode_direct_absolute_CXX=no
+          ;;
+        esac
+
+        if test yes = "$GXX"; then
+          case $host_os in aix4.[012]|aix4.[012].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`$CC -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    hardcode_direct_CXX=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    hardcode_minus_L_CXX=yes
+	    hardcode_libdir_flag_spec_CXX='-L$libdir'
+	    hardcode_libdir_separator_CXX=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
+	  fi
+	  # Need to ensure runtime linking is disabled for the traditional
+	  # shared library, or the linker may eventually find shared libraries
+	  # /with/ Import File - we do not want to mix them.
+	  shared_flag_aix='-shared'
+	  shared_flag_svr4='-shared $wl-G'
+        else
+          # not using gcc
+          if test ia64 = "$host_cpu"; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
+	    else
+	      shared_flag='$wl-bM:SRE'
+	    fi
+	    shared_flag_aix='$wl-bM:SRE'
+	    shared_flag_svr4='$wl-G'
+          fi
+        fi
+
+        export_dynamic_flag_spec_CXX='$wl-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        always_export_symbols_CXX=yes
+	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          # The "-G" linker flag allows undefined symbols.
+          no_undefined_flag_CXX='-bernotok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+          hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
+
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+        else
+          if test ia64 = "$host_cpu"; then
+	    hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib'
+	    allow_undefined_flag_CXX="-z nodefs"
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+	    hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    no_undefined_flag_CXX=' $wl-bernotok'
+	    allow_undefined_flag_CXX=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      whole_archive_flag_spec_CXX='$convenience'
+	    fi
+	    archive_cmds_need_lc_CXX=yes
+	    archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	    # -brtl affects multiple linker settings, -berok does not and is overridden later
+	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	    if test svr4 != "$with_aix_soname"; then
+	      # This is similar to how AIX traditionally builds its shared
+	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	    fi
+	    if test aix != "$with_aix_soname"; then
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_sy [...]
+	    else
+	      # used by -dlpreopen to get the symbols
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	    fi
+	    archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  allow_undefined_flag_CXX=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX=' '
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=yes
+	  file_list_spec_CXX='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=.dll
+	  # FIXME: Setting linknames here is a bad hack.
+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  archive_expsym_cmds_CXX='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+	  enable_shared_with_static_runtimes_CXX=yes
+	  # Don't use ranlib
+	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
+	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  export_dynamic_flag_spec_CXX='$wl--export-all-symbols'
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=no
+	  enable_shared_with_static_runtimes_CXX=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    archive_expsym_cmds_CXX='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    ld_shlibs_CXX=no
+	  fi
+	  ;;
+	esac
+	;;
+      darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_CXX=no
+  hardcode_direct_CXX=no
+  hardcode_automatic_CXX=yes
+  hardcode_shlibpath_var_CXX=unsupported
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec_CXX=''
+  fi
+  link_all_deplibs_CXX=yes
+  allow_undefined_flag_CXX=$_lt_dar_allow_undefined
+  case $cc_basename in
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test yes = "$_lt_dar_can_shared"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+       if test yes != "$lt_cv_apple_cc_single_mod"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+    fi
+
+  else
+  ld_shlibs_CXX=no
+  fi
+
+	;;
+
+      os2*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+	hardcode_minus_L_CXX=yes
+	allow_undefined_flag_CXX=unsupported
+	shrext_cmds=.dll
+	archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  prefix_cmds="$SED"~
+	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	    prefix_cmds="$prefix_cmds -e 1d";
+	  fi~
+	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+	enable_shared_with_static_runtimes_CXX=yes
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        ld_shlibs_CXX=no
+        ;;
+
+      freebsd-elf*)
+        archive_cmds_need_lc_CXX=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        ld_shlibs_CXX=yes
+        ;;
+
+      haiku*)
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+        link_all_deplibs_CXX=yes
+        ;;
+
+      hpux9*)
+        hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
+        hardcode_libdir_separator_CXX=:
+        export_dynamic_flag_spec_CXX='$wl-E'
+        hardcode_direct_CXX=yes
+        hardcode_minus_L_CXX=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            ld_shlibs_CXX=no
+            ;;
+          aCC*)
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test yes = "$GXX"; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              ld_shlibs_CXX=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test no = "$with_gnu_ld"; then
+	  hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      export_dynamic_flag_spec_CXX='$wl-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct_CXX=no
+            hardcode_shlibpath_var_CXX=no
+            ;;
+          *)
+            hardcode_direct_CXX=yes
+            hardcode_direct_absolute_CXX=yes
+            hardcode_minus_L_CXX=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        case $host_cpu in
+	          hppa*64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[3-9]*)
+	hardcode_direct_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='$wl-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	      else
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+	      fi
+	    fi
+	    link_all_deplibs_CXX=yes
+	    ;;
+        esac
+        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+        hardcode_libdir_separator_CXX=:
+        inherit_rpath_CXX=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    archive_cmds_need_lc_CXX=no
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+	      prelink_cmds_CXX='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      old_archive_cmds_CXX='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
+	      archive_cmds_CXX='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      archive_expsym_cmds_CXX='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
+	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      no_undefined_flag_CXX=' -zdefs'
+	      archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+	      hardcode_libdir_flag_spec_CXX='-R$libdir'
+	      whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	      compiler_needs_object_CXX=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  hardcode_libdir_flag_spec_CXX='-R$libdir'
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        ld_shlibs_CXX=yes
+	;;
+
+      openbsd* | bitrig*)
+	if test -f /usr/libexec/ld.so; then
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	  hardcode_direct_absolute_CXX=yes
+	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    export_dynamic_flag_spec_CXX='$wl-E'
+	    whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
+	        archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+		;;
+	      *)
+	        allow_undefined_flag_CXX=' -expect_unresolved \*'
+	        archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
+	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+		;;
+	    esac
+
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
+	      case $host in
+	        osf3*)
+	          archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+		  ;;
+	        *)
+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+	      hardcode_libdir_separator_CXX=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            archive_cmds_need_lc_CXX=yes
+	    no_undefined_flag_CXX=' -zdefs'
+	    archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    hardcode_libdir_flag_spec_CXX='-R$libdir'
+	    hardcode_shlibpath_var_CXX=no
+	    case $host_os in
+	      solaris2.[0-5] | solaris2.[0-5].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands '-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    link_all_deplibs_CXX=yes
+
+	    output_verbose_link_cmd='func_echo_all'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      no_undefined_flag_CXX=' $wl-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
+	        # platform.
+	        archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
+	      case $host_os in
+		solaris2.[0-5] | solaris2.[0-5].*) ;;
+		*)
+		  whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_CXX='$wl-z,text'
+      archive_cmds_need_lc_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We CANNOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	no_undefined_flag_CXX='$wl-z,text'
+	allow_undefined_flag_CXX='$wl-z,nodefs'
+	archive_cmds_need_lc_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='$wl-R,$libdir'
+	hardcode_libdir_separator_CXX=':'
+	link_all_deplibs_CXX=yes
+	export_dynamic_flag_spec_CXX='$wl-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+              '"$old_archive_cmds_CXX"
+	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+              '"$reload_cmds_CXX"
+	    ;;
+	  *)
+	    archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+    esac
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+    test no = "$ld_shlibs_CXX" && can_build_shared=no
+
+    GCC_CXX=$GXX
+    LD_CXX=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $prev$p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
+	 prev=$p
+	 continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX=$prev$p
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_CXX"; then
+	   postdeps_CXX=$prev$p
+	 else
+	   postdeps_CXX="${postdeps_CXX} $prev$p"
+	 fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test no = "$pre_test_object_deps_done"; then
+	 if test -z "$predep_objects_CXX"; then
+	   predep_objects_CXX=$p
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX=$p
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test yes = "$GXX"; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_CXX='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static_CXX='$wl-static'
+	;;
+      esac
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_CXX=
+      ;;
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_CXX='-fPIC -shared'
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[4-9]*)
+	# All AIX code is PIC.
+	if test ia64 = "$host_cpu"; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64, which still supported -KPIC.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-qpic'
+	    lt_prog_compiler_static_CXX='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      lt_prog_compiler_pic_CXX='-KPIC'
+	      lt_prog_compiler_static_CXX='-Bstatic'
+	      lt_prog_compiler_wl_CXX='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        lt_prog_compiler_pic_CXX='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms that do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_CXX=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_CXX=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  case $host_os in
+  aix[4-9]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+    # Without the "-l" option, or with the "-B" option, AIX nm treats
+    # weak defined symbols like other global defined symbols, whereas
+    # GNU nm marks them as "W".
+    # While the 'weak' keyword is ignored in the Export File, we need
+    # it in the Import File for the 'aix-soname' feature, so we have
+    # to replace the "-B" option with "-P" for AIX nm.
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX=$ltdll_cmds
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*)
+      exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+      ;;
+    esac
+    ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test no = "$ld_shlibs_CXX" && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test yes,yes = "$GCC,$enable_shared"; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_CXX
+	  pic_flag=$lt_prog_compiler_pic_CXX
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+	  allow_undefined_flag_CXX=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_CXX=no
+	  else
+	    lt_cv_archive_cmds_need_lc_CXX=yes
+	  fi
+	  allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='$libname$release$shared_ext$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test ia64 = "$host_cpu"; then
+    # AIX 5 supports IA64
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
+      # If using run time linking (on AIX 4.2 or later) use lib<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'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec=$LIB
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+    fi
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test yes = "$lt_cv_prog_gnu_ld"; then
+		version_type=linux # correct to gnu/linux during the next big refactor
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec_CXX='-L$libdir'
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd* | bitrig*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec=/usr/lib
+  need_lib_prefix=no
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+os2*)
+  libname_spec='$name'
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test yes = "$with_gnu_ld"; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec; then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=sco
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test yes = "$with_gnu_ld"; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test yes = "$hardcode_automatic_CXX"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$hardcode_direct_CXX" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" &&
+     test no != "$hardcode_minus_L_CXX"; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test relink = "$hardcode_action_CXX" ||
+   test yes = "$inherit_rpath_CXX"; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test yes != "$_lt_caught_CXX_error"
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+      ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+if test -z "$F77" || test no = "$F77"; then
+  _lt_disable_F77=yes
+fi
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_direct_absolute_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+inherit_rpath_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+reload_flag_F77=$reload_flag
+reload_cmds_F77=$reload_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_F77"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  compiler_F77=$CC
+  func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
+
+  GCC=$G77
+  if test -n "$compiler"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+    test no = "$can_build_shared" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test yes = "$enable_shared" && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[4-9]*)
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
+	fi
+        ;;
+    esac
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+    # Make sure either enable_shared or enable_static is yes.
+    test yes = "$enable_shared" || enable_static=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+    GCC_F77=$G77
+    LD_F77=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+
+  if test yes = "$GCC"; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_F77='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static_F77='$wl-static'
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_F77=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_F77='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl_F77='-Xlinker '
+      if test -n "$lt_prog_compiler_pic_F77"; then
+        lt_prog_compiler_pic_F77="-Xcompiler $lt_prog_compiler_pic_F77"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl_F77='-Wl,-Wl,,'
+        lt_prog_compiler_pic_F77='-PIC'
+        lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      esac
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static_F77='$wl-static'
+	;;
+      esac
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='$wl-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64, which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='--shared'
+	lt_prog_compiler_static_F77='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl_F77='-Wl,-Wl,,'
+	lt_prog_compiler_pic_F77='-PIC'
+	lt_prog_compiler_static_F77='-Bstatic'
+	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fPIC'
+	lt_prog_compiler_static_F77='-static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fpic'
+	lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-qpic'
+	lt_prog_compiler_static_F77='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic_F77='-KPIC'
+	  lt_prog_compiler_static_F77='-Bstatic'
+	  lt_prog_compiler_wl_F77=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  lt_prog_compiler_pic_F77='-KPIC'
+	  lt_prog_compiler_static_F77='-Bstatic'
+	  lt_prog_compiler_wl_F77='-Qoption ld '
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic_F77='-KPIC'
+	  lt_prog_compiler_static_F77='-Bstatic'
+	  lt_prog_compiler_wl_F77='-Wl,'
+	  ;;
+        *Intel*\ [CF]*Compiler*)
+	  lt_prog_compiler_wl_F77='-Wl,'
+	  lt_prog_compiler_pic_F77='-fPIC'
+	  lt_prog_compiler_static_F77='-static'
+	  ;;
+	*Portland\ Group*)
+	  lt_prog_compiler_wl_F77='-Wl,'
+	  lt_prog_compiler_pic_F77='-fpic'
+	  lt_prog_compiler_static_F77='-Bstatic'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_F77='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms that do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_F77=$lt_prog_compiler_pic_F77
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_F77" >&5
+$as_echo "$lt_cv_prog_compiler_pic_F77" >&6; }
+lt_prog_compiler_pic_F77=$lt_cv_prog_compiler_pic_F77
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_F77=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_F77" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works_F77"; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_F77=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_F77=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_F77=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_F77" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works_F77"; then
+    :
+else
+    lt_prog_compiler_static_F77=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o_F77" && test no != "$need_locks"; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  always_export_symbols_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  compiler_needs_object_F77=no
+  enable_shared_with_static_runtimes_F77=no
+  export_dynamic_flag_spec_F77=
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic_F77=no
+  hardcode_direct_F77=no
+  hardcode_direct_absolute_F77=no
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  inherit_rpath_F77=no
+  link_all_deplibs_F77=unknown
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  old_archive_from_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  thread_safe_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
+  exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test yes != "$GCC"; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd* | bitrig*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test yes = "$with_gnu_ld"; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test yes = "$lt_use_gnu_ld_interface"; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='$wl'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec_F77='$wl--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_F77=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+    else
+      whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test ia64 != "$host_cpu"; then
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_expsym_cmds_F77=''
+        ;;
+      m68k)
+            archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_F77='-L$libdir'
+            hardcode_minus_L_F77=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      export_dynamic_flag_spec_F77='$wl--export-all-symbols'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_F77='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	archive_expsym_cmds_F77='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      link_all_deplibs_F77=yes
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      shrext_cmds=.dll
+      archive_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='$wl-rpath,$libdir'
+      export_dynamic_flag_spec_F77='$wl-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_F77='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test linux-dietlibc = "$host_os"; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test no = "$tmp_diet"
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec_F77=
+	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  compiler_needs_object_F77=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec_F77='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  compiler_needs_object_F77=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+        if test yes = "$supports_anon_versioning"; then
+          archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	tcc*)
+	  export_dynamic_flag_spec_F77='-rdynamic'
+	  ;;
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec_F77='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir'
+	  archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test yes = "$supports_anon_versioning"; then
+	    archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir'
+	    archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs_F77=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test no = "$ld_shlibs_F77"; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_F77=yes
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test ia64 = "$host_cpu"; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_direct_absolute_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+      file_list_spec_F77='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	hardcode_direct_F77=no
+	hardcode_direct_absolute_F77=no
+	;;
+      esac
+
+      if test yes = "$GCC"; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`$CC -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct_F77=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L_F77=yes
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_libdir_separator_F77=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
+	fi
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
+      else
+	# not using gcc
+	if test ia64 = "$host_cpu"; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
+	  else
+	    shared_flag='$wl-bM:SRE'
+	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
+	fi
+      fi
+
+      export_dynamic_flag_spec_F77='$wl-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=yes
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_F77='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__F77=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__F77"; then
+    lt_cv_aix_libpath__F77=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__F77"; then
+    lt_cv_aix_libpath__F77=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__F77
+fi
+
+        hardcode_libdir_flag_spec_F77='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds_F77='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+      else
+	if test ia64 = "$host_cpu"; then
+	  hardcode_libdir_flag_spec_F77='$wl-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__F77=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__F77"; then
+    lt_cv_aix_libpath__F77=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__F77"; then
+    lt_cv_aix_libpath__F77=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__F77
+fi
+
+	 hardcode_libdir_flag_spec_F77='$wl-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_F77=' $wl-bernotok'
+	  allow_undefined_flag_F77=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec_F77='$wl--whole-archive$convenience $wl--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec_F77='$convenience'
+	  fi
+	  archive_cmds_need_lc_F77=yes
+	  archive_expsym_cmds_F77='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symb [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$RM -r $output_objdir/$realname.d'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_expsym_cmds_F77=''
+        ;;
+      m68k)
+            archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_F77='-L$libdir'
+            hardcode_minus_L_F77=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec_F77=' '
+	allow_undefined_flag_F77=unsupported
+	always_export_symbols_F77=yes
+	file_list_spec_F77='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=.dll
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds_F77='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	archive_expsym_cmds_F77='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, F77)='true'
+	enable_shared_with_static_runtimes_F77=yes
+	exclude_expsyms_F77='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds_F77='chmod 644 $oldlib'
+	postlink_cmds_F77='lt_outputfile="@OUTPUT@"~
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec_F77=' '
+	allow_undefined_flag_F77=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=.dll
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds_F77='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes_F77=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_F77=no
+  hardcode_direct_F77=no
+  hardcode_automatic_F77=yes
+  hardcode_shlibpath_var_F77=unsupported
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec_F77='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    compiler_needs_object_F77=yes
+  else
+    whole_archive_flag_spec_F77=''
+  fi
+  link_all_deplibs_F77=yes
+  allow_undefined_flag_F77=$_lt_dar_allow_undefined
+  case $cc_basename in
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test yes = "$_lt_dar_can_shared"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds_F77="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds_F77="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+
+  else
+  ld_shlibs_F77=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test yes = "$GCC"; then
+	archive_cmds_F77='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds_F77='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='$wl+b $wl$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='$wl-E'
+      ;;
+
+    hpux10*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	archive_cmds_F77='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec_F77='$wl+b $wl$libdir'
+	hardcode_libdir_separator_F77=:
+	hardcode_direct_F77=yes
+	hardcode_direct_absolute_F77=yes
+	export_dynamic_flag_spec_F77='$wl-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_F77=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	archive_cmds_F77='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec_F77='$wl+b $wl$libdir'
+	hardcode_libdir_separator_F77=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	*)
+	  hardcode_direct_F77=yes
+	  hardcode_direct_absolute_F77=yes
+	  export_dynamic_flag_spec_F77='$wl-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test yes = "$GCC"; then
+	archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+	   cat > conftest.$ac_ext <<_ACEOF
+
+      subroutine foo
+      end
+_ACEOF
+if ac_fn_f77_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS=$save_LDFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+	fi
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc_F77='no'
+      hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator_F77=:
+      inherit_rpath_F77=yes
+      link_all_deplibs_F77=yes
+      ;;
+
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	ld_shlibs_F77=yes
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd* | bitrig*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct_F77=yes
+	hardcode_shlibpath_var_F77=no
+	hardcode_direct_absolute_F77=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+	  archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec_F77='$wl-rpath,$libdir'
+	  export_dynamic_flag_spec_F77='$wl-E'
+	else
+	  archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  hardcode_libdir_flag_spec_F77='$wl-rpath,$libdir'
+	fi
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      shrext_cmds=.dll
+      archive_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    osf3*)
+      if test yes = "$GCC"; then
+	allow_undefined_flag_F77=' $wl-expect_unresolved $wl\*'
+	archive_cmds_F77='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc_F77='no'
+      hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test yes = "$GCC"; then
+	allow_undefined_flag_F77=' $wl-expect_unresolved $wl\*'
+	archive_cmds_F77='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      archive_cmds_need_lc_F77='no'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z defs'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	archive_cmds_F77='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds_F77='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='$wl'
+	  archive_cmds_F77='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test yes = "$GCC"; then
+	  whole_archive_flag_spec_F77='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs_F77=yes
+      ;;
+
+    sunos4*)
+      if test sequent = "$host_vendor"; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_F77='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_F77='$wl-z,text'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+	archive_cmds_F77='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We CANNOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_F77='$wl-z,text'
+      allow_undefined_flag_F77='$wl-z,nodefs'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='$wl-R,$libdir'
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+      export_dynamic_flag_spec_F77='$wl-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+	archive_cmds_F77='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+
+    if test sni = "$host_vendor"; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec_F77='$wl-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5
+$as_echo "$ld_shlibs_F77" >&6; }
+test no = "$ld_shlibs_F77" && can_build_shared=no
+
+with_gnu_ld_F77=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test yes,yes = "$GCC,$enable_shared"; then
+    case $archive_cmds_F77 in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_F77
+	  pic_flag=$lt_prog_compiler_pic_F77
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+	  allow_undefined_flag_F77=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_F77=no
+	  else
+	    lt_cv_archive_cmds_need_lc_F77=yes
+	  fi
+	  allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_F77" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_F77" >&6; }
+      archive_cmds_need_lc_F77=$lt_cv_archive_cmds_need_lc_F77
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='$libname$release$shared_ext$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test ia64 = "$host_cpu"; then
+    # AIX 5 supports IA64
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
+      # If using run time linking (on AIX 4.2 or later) use lib<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'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec=$LIB
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+    fi
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test yes = "$lt_cv_prog_gnu_ld"; then
+		version_type=linux # correct to gnu/linux during the next big refactor
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec_F77='-L$libdir'
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_F77\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_F77\""
+    cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd* | bitrig*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec=/usr/lib
+  need_lib_prefix=no
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+os2*)
+  libname_spec='$name'
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test yes = "$with_gnu_ld"; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec; then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=sco
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test yes = "$with_gnu_ld"; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" ||
+   test -n "$runpath_var_F77" ||
+   test yes = "$hardcode_automatic_F77"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$hardcode_direct_F77" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" &&
+     test no != "$hardcode_minus_L_F77"; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5
+$as_echo "$hardcode_action_F77" >&6; }
+
+if test relink = "$hardcode_action_F77" ||
+   test yes = "$inherit_rpath_F77"; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+      ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+if test -z "$FC" || test no = "$FC"; then
+  _lt_disable_FC=yes
+fi
+
+archive_cmds_need_lc_FC=no
+allow_undefined_flag_FC=
+always_export_symbols_FC=no
+archive_expsym_cmds_FC=
+export_dynamic_flag_spec_FC=
+hardcode_direct_FC=no
+hardcode_direct_absolute_FC=no
+hardcode_libdir_flag_spec_FC=
+hardcode_libdir_separator_FC=
+hardcode_minus_L_FC=no
+hardcode_automatic_FC=no
+inherit_rpath_FC=no
+module_cmds_FC=
+module_expsym_cmds_FC=
+link_all_deplibs_FC=unknown
+old_archive_cmds_FC=$old_archive_cmds
+reload_flag_FC=$reload_flag
+reload_cmds_FC=$reload_cmds
+no_undefined_flag_FC=
+whole_archive_flag_spec_FC=
+enable_shared_with_static_runtimes_FC=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+objext_FC=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_FC"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  compiler_FC=$CC
+  func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
+
+
+  if test -n "$compiler"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+    test no = "$can_build_shared" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test yes = "$enable_shared" && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[4-9]*)
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
+	fi
+        ;;
+    esac
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+    # Make sure either enable_shared or enable_static is yes.
+    test yes = "$enable_shared" || enable_static=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+    GCC_FC=$ac_cv_fc_compiler_gnu
+    LD_FC=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_FC=
+postdep_objects_FC=
+predeps_FC=
+postdeps_FC=
+compiler_lib_search_path_FC=
+
+cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $prev$p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
+	 prev=$p
+	 continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_FC"; then
+	     compiler_lib_search_path_FC=$prev$p
+	   else
+	     compiler_lib_search_path_FC="${compiler_lib_search_path_FC} $prev$p"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_FC"; then
+	   postdeps_FC=$prev$p
+	 else
+	   postdeps_FC="${postdeps_FC} $prev$p"
+	 fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test no = "$pre_test_object_deps_done"; then
+	 if test -z "$predep_objects_FC"; then
+	   predep_objects_FC=$p
+	 else
+	   predep_objects_FC="$predep_objects_FC $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_FC"; then
+	   postdep_objects_FC=$p
+	 else
+	   postdep_objects_FC="$postdep_objects_FC $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling FC test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+
+
+case " $postdeps_FC " in
+*" -lc "*) archive_cmds_need_lc_FC=no ;;
+esac
+ compiler_lib_search_dirs_FC=
+if test -n "${compiler_lib_search_path_FC}"; then
+ compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_FC=
+lt_prog_compiler_pic_FC=
+lt_prog_compiler_static_FC=
+
+
+  if test yes = "$GCC"; then
+    lt_prog_compiler_wl_FC='-Wl,'
+    lt_prog_compiler_static_FC='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_FC='-Bstatic'
+      fi
+      lt_prog_compiler_pic_FC='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_FC='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            lt_prog_compiler_pic_FC='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static_FC='$wl-static'
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_FC='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_FC=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_FC='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_FC=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_FC='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_FC=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic_FC='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl_FC='-Xlinker '
+      if test -n "$lt_prog_compiler_pic_FC"; then
+        lt_prog_compiler_pic_FC="-Xcompiler $lt_prog_compiler_pic_FC"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      if test ia64 = "$host_cpu"; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_FC='-Bstatic'
+      else
+	lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_FC='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl_FC='-Wl,-Wl,,'
+        lt_prog_compiler_pic_FC='-PIC'
+        lt_prog_compiler_static_FC='-Bstatic'
+        ;;
+      esac
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static_FC='$wl-static'
+	;;
+      esac
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_FC='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_FC='$wl-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64, which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-KPIC'
+	lt_prog_compiler_static_FC='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-fPIC'
+	lt_prog_compiler_static_FC='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='--shared'
+	lt_prog_compiler_static_FC='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl_FC='-Wl,-Wl,,'
+	lt_prog_compiler_pic_FC='-PIC'
+	lt_prog_compiler_static_FC='-Bstatic'
+	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-fPIC'
+	lt_prog_compiler_static_FC='-static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-fpic'
+	lt_prog_compiler_static_FC='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_FC='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_FC='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-qpic'
+	lt_prog_compiler_static_FC='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic_FC='-KPIC'
+	  lt_prog_compiler_static_FC='-Bstatic'
+	  lt_prog_compiler_wl_FC=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  lt_prog_compiler_pic_FC='-KPIC'
+	  lt_prog_compiler_static_FC='-Bstatic'
+	  lt_prog_compiler_wl_FC='-Qoption ld '
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic_FC='-KPIC'
+	  lt_prog_compiler_static_FC='-Bstatic'
+	  lt_prog_compiler_wl_FC='-Wl,'
+	  ;;
+        *Intel*\ [CF]*Compiler*)
+	  lt_prog_compiler_wl_FC='-Wl,'
+	  lt_prog_compiler_pic_FC='-fPIC'
+	  lt_prog_compiler_static_FC='-static'
+	  ;;
+	*Portland\ Group*)
+	  lt_prog_compiler_wl_FC='-Wl,'
+	  lt_prog_compiler_pic_FC='-fpic'
+	  lt_prog_compiler_static_FC='-Bstatic'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_FC='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	lt_prog_compiler_wl_FC='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_FC='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_FC='-Qoption ld '
+      lt_prog_compiler_pic_FC='-PIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_FC='-Kconform_pic'
+	lt_prog_compiler_static_FC='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_can_build_shared_FC=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_FC='-pic'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_FC=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms that do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_FC=
+    ;;
+  *)
+    lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_FC=$lt_prog_compiler_pic_FC
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_FC" >&5
+$as_echo "$lt_cv_prog_compiler_pic_FC" >&6; }
+lt_prog_compiler_pic_FC=$lt_cv_prog_compiler_pic_FC
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_FC=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_FC"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_FC=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works_FC"; then
+    case $lt_prog_compiler_pic_FC in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;;
+     esac
+else
+    lt_prog_compiler_pic_FC=
+     lt_prog_compiler_can_build_shared_FC=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_FC=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_FC=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_FC=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works_FC"; then
+    :
+else
+    lt_prog_compiler_static_FC=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_FC=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_FC=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_FC=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_FC=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o_FC" && test no != "$need_locks"; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag_FC=
+  always_export_symbols_FC=no
+  archive_cmds_FC=
+  archive_expsym_cmds_FC=
+  compiler_needs_object_FC=no
+  enable_shared_with_static_runtimes_FC=no
+  export_dynamic_flag_spec_FC=
+  export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic_FC=no
+  hardcode_direct_FC=no
+  hardcode_direct_absolute_FC=no
+  hardcode_libdir_flag_spec_FC=
+  hardcode_libdir_separator_FC=
+  hardcode_minus_L_FC=no
+  hardcode_shlibpath_var_FC=unsupported
+  inherit_rpath_FC=no
+  link_all_deplibs_FC=unknown
+  module_cmds_FC=
+  module_expsym_cmds_FC=
+  old_archive_from_new_cmds_FC=
+  old_archive_from_expsyms_cmds_FC=
+  thread_safe_flag_spec_FC=
+  whole_archive_flag_spec_FC=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_FC=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
+  exclude_expsyms_FC='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test yes != "$GCC"; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd* | bitrig*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_FC=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test yes = "$with_gnu_ld"; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test yes = "$lt_use_gnu_ld_interface"; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='$wl'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec_FC='$wl--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_FC=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+    else
+      whole_archive_flag_spec_FC=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test ia64 != "$host_cpu"; then
+	ld_shlibs_FC=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_expsym_cmds_FC=''
+        ;;
+      m68k)
+            archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_FC='-L$libdir'
+            hardcode_minus_L_FC=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_FC=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      export_dynamic_flag_spec_FC='$wl--export-all-symbols'
+      allow_undefined_flag_FC=unsupported
+      always_export_symbols_FC=no
+      enable_shared_with_static_runtimes_FC=yes
+      export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_FC='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	archive_expsym_cmds_FC='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      link_all_deplibs_FC=yes
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_minus_L_FC=yes
+      allow_undefined_flag_FC=unsupported
+      shrext_cmds=.dll
+      archive_cmds_FC='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds_FC='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds_FC='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes_FC=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct_FC=no
+      hardcode_shlibpath_var_FC=no
+      hardcode_libdir_flag_spec_FC='$wl-rpath,$libdir'
+      export_dynamic_flag_spec_FC='$wl-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_FC='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test linux-dietlibc = "$host_os"; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test no = "$tmp_diet"
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_FC='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_FC='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec_FC=
+	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec_FC='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  compiler_needs_object_FC=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec_FC='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+	  compiler_needs_object_FC=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+        if test yes = "$supports_anon_versioning"; then
+          archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	tcc*)
+	  export_dynamic_flag_spec_FC='-rdynamic'
+	  ;;
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir'
+	  archive_cmds_FC='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test yes = "$supports_anon_versioning"; then
+	    archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs_FC=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_FC=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_FC=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir'
+	    archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs_FC=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+    esac
+
+    if test no = "$ld_shlibs_FC"; then
+      runpath_var=
+      hardcode_libdir_flag_spec_FC=
+      export_dynamic_flag_spec_FC=
+      whole_archive_flag_spec_FC=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_FC=unsupported
+      always_export_symbols_FC=yes
+      archive_expsym_cmds_FC='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_FC=yes
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_FC=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test ia64 = "$host_cpu"; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_FC='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_FC=''
+      hardcode_direct_FC=yes
+      hardcode_direct_absolute_FC=yes
+      hardcode_libdir_separator_FC=':'
+      link_all_deplibs_FC=yes
+      file_list_spec_FC='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	hardcode_direct_FC=no
+	hardcode_direct_absolute_FC=no
+	;;
+      esac
+
+      if test yes = "$GCC"; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`$CC -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct_FC=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L_FC=yes
+	  hardcode_libdir_flag_spec_FC='-L$libdir'
+	  hardcode_libdir_separator_FC=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
+	fi
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
+      else
+	# not using gcc
+	if test ia64 = "$host_cpu"; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
+	  else
+	    shared_flag='$wl-bM:SRE'
+	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
+	fi
+      fi
+
+      export_dynamic_flag_spec_FC='$wl-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_FC=yes
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_FC='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__FC=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__FC"; then
+    lt_cv_aix_libpath__FC=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__FC"; then
+    lt_cv_aix_libpath__FC=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__FC
+fi
+
+        hardcode_libdir_flag_spec_FC='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+      else
+	if test ia64 = "$host_cpu"; then
+	  hardcode_libdir_flag_spec_FC='$wl-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_FC="-z nodefs"
+	  archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__FC=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__FC"; then
+    lt_cv_aix_libpath__FC=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__FC"; then
+    lt_cv_aix_libpath__FC=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__FC
+fi
+
+	 hardcode_libdir_flag_spec_FC='$wl-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_FC=' $wl-bernotok'
+	  allow_undefined_flag_FC=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec_FC='$wl--whole-archive$convenience $wl--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec_FC='$convenience'
+	  fi
+	  archive_cmds_need_lc_FC=yes
+	  archive_expsym_cmds_FC='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    archive_expsym_cmds_FC="$archive_expsym_cmds_FC"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    archive_expsym_cmds_FC="$archive_expsym_cmds_FC"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbol [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    archive_expsym_cmds_FC="$archive_expsym_cmds_FC"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  archive_expsym_cmds_FC="$archive_expsym_cmds_FC"'~$RM -r $output_objdir/$realname.d'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_expsym_cmds_FC=''
+        ;;
+      m68k)
+            archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_FC='-L$libdir'
+            hardcode_minus_L_FC=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_FC=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec_FC=' '
+	allow_undefined_flag_FC=unsupported
+	always_export_symbols_FC=yes
+	file_list_spec_FC='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=.dll
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds_FC='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	archive_expsym_cmds_FC='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, FC)='true'
+	enable_shared_with_static_runtimes_FC=yes
+	exclude_expsyms_FC='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds_FC='chmod 644 $oldlib'
+	postlink_cmds_FC='lt_outputfile="@OUTPUT@"~
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec_FC=' '
+	allow_undefined_flag_FC=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=.dll
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds_FC='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds_FC='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes_FC=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_FC=no
+  hardcode_direct_FC=no
+  hardcode_automatic_FC=yes
+  hardcode_shlibpath_var_FC=unsupported
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec_FC='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    compiler_needs_object_FC=yes
+  else
+    whole_archive_flag_spec_FC=''
+  fi
+  link_all_deplibs_FC=yes
+  allow_undefined_flag_FC=$_lt_dar_allow_undefined
+  case $cc_basename in
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test yes = "$_lt_dar_can_shared"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds_FC="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds_FC="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+
+  else
+  ld_shlibs_FC=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_FC=yes
+      hardcode_minus_L_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    hpux9*)
+      if test yes = "$GCC"; then
+	archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_FC='$wl+b $wl$libdir'
+      hardcode_libdir_separator_FC=:
+      hardcode_direct_FC=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_FC=yes
+      export_dynamic_flag_spec_FC='$wl-E'
+      ;;
+
+    hpux10*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	archive_cmds_FC='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec_FC='$wl+b $wl$libdir'
+	hardcode_libdir_separator_FC=:
+	hardcode_direct_FC=yes
+	hardcode_direct_absolute_FC=yes
+	export_dynamic_flag_spec_FC='$wl-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_FC=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_FC='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_FC='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_FC='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_FC='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_FC='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	archive_cmds_FC='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec_FC='$wl+b $wl$libdir'
+	hardcode_libdir_separator_FC=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct_FC=no
+	  hardcode_shlibpath_var_FC=no
+	  ;;
+	*)
+	  hardcode_direct_FC=yes
+	  hardcode_direct_absolute_FC=yes
+	  export_dynamic_flag_spec_FC='$wl-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_FC=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test yes = "$GCC"; then
+	archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+	   cat > conftest.$ac_ext <<_ACEOF
+
+      subroutine foo
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS=$save_LDFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+	fi
+      else
+	archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator_FC=:
+      inherit_rpath_FC=yes
+      link_all_deplibs_FC=yes
+      ;;
+
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	ld_shlibs_FC=yes
+	archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    newsos6)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_FC=yes
+      hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator_FC=:
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd* | bitrig*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct_FC=yes
+	hardcode_shlibpath_var_FC=no
+	hardcode_direct_absolute_FC=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+	  archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec_FC='$wl-rpath,$libdir'
+	  export_dynamic_flag_spec_FC='$wl-E'
+	else
+	  archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  hardcode_libdir_flag_spec_FC='$wl-rpath,$libdir'
+	fi
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_minus_L_FC=yes
+      allow_undefined_flag_FC=unsupported
+      shrext_cmds=.dll
+      archive_cmds_FC='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds_FC='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds_FC='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes_FC=yes
+      ;;
+
+    osf3*)
+      if test yes = "$GCC"; then
+	allow_undefined_flag_FC=' $wl-expect_unresolved $wl\*'
+	archive_cmds_FC='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      else
+	allow_undefined_flag_FC=' -expect_unresolved \*'
+	archive_cmds_FC='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator_FC=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test yes = "$GCC"; then
+	allow_undefined_flag_FC=' $wl-expect_unresolved $wl\*'
+	archive_cmds_FC='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir'
+      else
+	allow_undefined_flag_FC=' -expect_unresolved \*'
+	archive_cmds_FC='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds_FC='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_FC='-rpath $libdir'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_separator_FC=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_FC=' -z defs'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	archive_cmds_FC='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds_FC='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='$wl'
+	  archive_cmds_FC='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_shlibpath_var_FC=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test yes = "$GCC"; then
+	  whole_archive_flag_spec_FC='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs_FC=yes
+      ;;
+
+    sunos4*)
+      if test sequent = "$host_vendor"; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_FC='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_direct_FC=yes
+      hardcode_minus_L_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_FC=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_FC='$CC -r -o $output$reload_objs'
+	  hardcode_direct_FC=no
+        ;;
+	motorola)
+	  archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_FC=no
+      export_dynamic_flag_spec_FC='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_FC=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_FC=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_FC='$wl-z,text'
+      archive_cmds_need_lc_FC=no
+      hardcode_shlibpath_var_FC=no
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+	archive_cmds_FC='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_FC='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We CANNOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_FC='$wl-z,text'
+      allow_undefined_flag_FC='$wl-z,nodefs'
+      archive_cmds_need_lc_FC=no
+      hardcode_shlibpath_var_FC=no
+      hardcode_libdir_flag_spec_FC='$wl-R,$libdir'
+      hardcode_libdir_separator_FC=':'
+      link_all_deplibs_FC=yes
+      export_dynamic_flag_spec_FC='$wl-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+	archive_cmds_FC='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_FC='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *)
+      ld_shlibs_FC=no
+      ;;
+    esac
+
+    if test sni = "$host_vendor"; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec_FC='$wl-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_FC" >&5
+$as_echo "$ld_shlibs_FC" >&6; }
+test no = "$ld_shlibs_FC" && can_build_shared=no
+
+with_gnu_ld_FC=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_FC" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_FC=yes
+
+  if test yes,yes = "$GCC,$enable_shared"; then
+    case $archive_cmds_FC in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_FC
+	  pic_flag=$lt_prog_compiler_pic_FC
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_FC
+	  allow_undefined_flag_FC=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_FC=no
+	  else
+	    lt_cv_archive_cmds_need_lc_FC=yes
+	  fi
+	  allow_undefined_flag_FC=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_FC" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_FC" >&6; }
+      archive_cmds_need_lc_FC=$lt_cv_archive_cmds_need_lc_FC
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='$libname$release$shared_ext$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test ia64 = "$host_cpu"; then
+    # AIX 5 supports IA64
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
+      # If using run time linking (on AIX 4.2 or later) use lib<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'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec=$LIB
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+    fi
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test yes = "$lt_cv_prog_gnu_ld"; then
+		version_type=linux # correct to gnu/linux during the next big refactor
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec_FC='-L$libdir'
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_FC\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\""
+    cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd* | bitrig*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec=/usr/lib
+  need_lib_prefix=no
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+os2*)
+  libname_spec='$name'
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test yes = "$with_gnu_ld"; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec; then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=sco
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test yes = "$with_gnu_ld"; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_FC=
+if test -n "$hardcode_libdir_flag_spec_FC" ||
+   test -n "$runpath_var_FC" ||
+   test yes = "$hardcode_automatic_FC"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$hardcode_direct_FC" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" &&
+     test no != "$hardcode_minus_L_FC"; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_FC=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_FC=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_FC=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_FC" >&5
+$as_echo "$hardcode_action_FC" >&6; }
+
+if test relink = "$hardcode_action_FC" ||
+   test yes = "$inherit_rpath_FC"; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_FC"
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+: ${CONFIG_LT=./config.lt}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5
+$as_echo "$as_me: creating $CONFIG_LT" >&6;}
+as_write_fail=0
+cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## --------------------------------- ##
+## Main body of "$CONFIG_LT" script. ##
+## --------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x "$CONFIG_LT"
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+
+lt_cl_help="\
+'$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $0 [OPTIONS]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+GetData config.lt 0.8.9
+configured by $0, generated by GNU Autoconf 2.69.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test 0 != $#
+do
+  case $1 in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) as_fn_error $? "unrecognized option: $1
+Try '$0 --help' for more information." "$LINENO" 5 ;;
+
+    *) as_fn_error $? "unrecognized argument: $1
+Try '$0 --help' for more information." "$LINENO" 5 ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec 6>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+LD_F77='`$ECHO "$LD_F77" | $SED "$delay_single_quote_subst"`'
+LD_FC='`$ECHO "$LD_FC" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_F77='`$ECHO "$reload_flag_F77" | $SED "$delay_single_quote_subst"`'
+reload_flag_FC='`$ECHO "$reload_flag_FC" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_F77='`$ECHO "$reload_cmds_F77" | $SED "$delay_single_quote_subst"`'
+reload_cmds_FC='`$ECHO "$reload_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_F77='`$ECHO "$old_archive_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_FC='`$ECHO "$old_archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_F77='`$ECHO "$compiler_F77" | $SED "$delay_single_quote_subst"`'
+compiler_FC='`$ECHO "$compiler_FC" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_F77='`$ECHO "$GCC_F77" | $SED "$delay_single_quote_subst"`'
+GCC_FC='`$ECHO "$GCC_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_F77='`$ECHO "$lt_prog_compiler_no_builtin_flag_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_FC='`$ECHO "$lt_prog_compiler_no_builtin_flag_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_F77='`$ECHO "$lt_prog_compiler_pic_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_FC='`$ECHO "$lt_prog_compiler_pic_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_F77='`$ECHO "$lt_prog_compiler_wl_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_FC='`$ECHO "$lt_prog_compiler_wl_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_F77='`$ECHO "$lt_prog_compiler_static_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_FC='`$ECHO "$lt_prog_compiler_static_FC" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_F77='`$ECHO "$lt_cv_prog_compiler_c_o_F77" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_FC='`$ECHO "$lt_cv_prog_compiler_c_o_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_F77='`$ECHO "$archive_cmds_need_lc_F77" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_FC='`$ECHO "$archive_cmds_need_lc_FC" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_F77='`$ECHO "$enable_shared_with_static_runtimes_F77" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_FC='`$ECHO "$enable_shared_with_static_runtimes_FC" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_F77='`$ECHO "$export_dynamic_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_FC='`$ECHO "$export_dynamic_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_F77='`$ECHO "$whole_archive_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_FC='`$ECHO "$whole_archive_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_F77='`$ECHO "$compiler_needs_object_F77" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_FC='`$ECHO "$compiler_needs_object_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_F77='`$ECHO "$old_archive_from_new_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_FC='`$ECHO "$old_archive_from_new_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_F77='`$ECHO "$old_archive_from_expsyms_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_FC='`$ECHO "$old_archive_from_expsyms_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_F77='`$ECHO "$archive_cmds_F77" | $SED "$delay_single_quote_subst"`'
+archive_cmds_FC='`$ECHO "$archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_F77='`$ECHO "$archive_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_FC='`$ECHO "$archive_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_F77='`$ECHO "$module_cmds_F77" | $SED "$delay_single_quote_subst"`'
+module_cmds_FC='`$ECHO "$module_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_F77='`$ECHO "$module_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_FC='`$ECHO "$module_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_F77='`$ECHO "$with_gnu_ld_F77" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_FC='`$ECHO "$with_gnu_ld_FC" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_F77='`$ECHO "$allow_undefined_flag_F77" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_FC='`$ECHO "$allow_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_F77='`$ECHO "$no_undefined_flag_F77" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_FC='`$ECHO "$no_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_F77='`$ECHO "$hardcode_libdir_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_FC='`$ECHO "$hardcode_libdir_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_F77='`$ECHO "$hardcode_libdir_separator_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_FC='`$ECHO "$hardcode_libdir_separator_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_F77='`$ECHO "$hardcode_direct_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_FC='`$ECHO "$hardcode_direct_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_F77='`$ECHO "$hardcode_direct_absolute_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_FC='`$ECHO "$hardcode_direct_absolute_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_F77='`$ECHO "$hardcode_minus_L_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_FC='`$ECHO "$hardcode_minus_L_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_F77='`$ECHO "$hardcode_shlibpath_var_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_FC='`$ECHO "$hardcode_shlibpath_var_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_F77='`$ECHO "$hardcode_automatic_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_FC='`$ECHO "$hardcode_automatic_FC" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_F77='`$ECHO "$inherit_rpath_F77" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_FC='`$ECHO "$inherit_rpath_FC" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_F77='`$ECHO "$link_all_deplibs_F77" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_FC='`$ECHO "$link_all_deplibs_FC" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_F77='`$ECHO "$always_export_symbols_F77" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_FC='`$ECHO "$always_export_symbols_FC" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_F77='`$ECHO "$export_symbols_cmds_F77" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_FC='`$ECHO "$export_symbols_cmds_FC" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_F77='`$ECHO "$exclude_expsyms_F77" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_FC='`$ECHO "$exclude_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_F77='`$ECHO "$include_expsyms_F77" | $SED "$delay_single_quote_subst"`'
+include_expsyms_FC='`$ECHO "$include_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_F77='`$ECHO "$prelink_cmds_F77" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_FC='`$ECHO "$prelink_cmds_FC" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_F77='`$ECHO "$postlink_cmds_F77" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_FC='`$ECHO "$postlink_cmds_FC" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_F77='`$ECHO "$file_list_spec_F77" | $SED "$delay_single_quote_subst"`'
+file_list_spec_FC='`$ECHO "$file_list_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_F77='`$ECHO "$hardcode_action_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_action_FC='`$ECHO "$hardcode_action_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_F77='`$ECHO "$compiler_lib_search_dirs_F77" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_FC='`$ECHO "$compiler_lib_search_dirs_FC" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_F77='`$ECHO "$predep_objects_F77" | $SED "$delay_single_quote_subst"`'
+predep_objects_FC='`$ECHO "$predep_objects_FC" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_F77='`$ECHO "$postdep_objects_F77" | $SED "$delay_single_quote_subst"`'
+postdep_objects_FC='`$ECHO "$postdep_objects_FC" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_F77='`$ECHO "$predeps_F77" | $SED "$delay_single_quote_subst"`'
+predeps_FC='`$ECHO "$predeps_FC" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_F77='`$ECHO "$postdeps_F77" | $SED "$delay_single_quote_subst"`'
+postdeps_FC='`$ECHO "$postdeps_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_F77='`$ECHO "$compiler_lib_search_path_F77" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_FC='`$ECHO "$compiler_lib_search_path_FC" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
+nm_file_list_spec \
+lt_cv_truncate_bin \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+LD_F77 \
+LD_FC \
+reload_flag_CXX \
+reload_flag_F77 \
+reload_flag_FC \
+compiler_CXX \
+compiler_F77 \
+compiler_FC \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_no_builtin_flag_F77 \
+lt_prog_compiler_no_builtin_flag_FC \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_pic_F77 \
+lt_prog_compiler_pic_FC \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_wl_F77 \
+lt_prog_compiler_wl_FC \
+lt_prog_compiler_static_CXX \
+lt_prog_compiler_static_F77 \
+lt_prog_compiler_static_FC \
+lt_cv_prog_compiler_c_o_CXX \
+lt_cv_prog_compiler_c_o_F77 \
+lt_cv_prog_compiler_c_o_FC \
+export_dynamic_flag_spec_CXX \
+export_dynamic_flag_spec_F77 \
+export_dynamic_flag_spec_FC \
+whole_archive_flag_spec_CXX \
+whole_archive_flag_spec_F77 \
+whole_archive_flag_spec_FC \
+compiler_needs_object_CXX \
+compiler_needs_object_F77 \
+compiler_needs_object_FC \
+with_gnu_ld_CXX \
+with_gnu_ld_F77 \
+with_gnu_ld_FC \
+allow_undefined_flag_CXX \
+allow_undefined_flag_F77 \
+allow_undefined_flag_FC \
+no_undefined_flag_CXX \
+no_undefined_flag_F77 \
+no_undefined_flag_FC \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_F77 \
+hardcode_libdir_flag_spec_FC \
+hardcode_libdir_separator_CXX \
+hardcode_libdir_separator_F77 \
+hardcode_libdir_separator_FC \
+exclude_expsyms_CXX \
+exclude_expsyms_F77 \
+exclude_expsyms_FC \
+include_expsyms_CXX \
+include_expsyms_F77 \
+include_expsyms_FC \
+file_list_spec_CXX \
+file_list_spec_F77 \
+file_list_spec_FC \
+compiler_lib_search_dirs_CXX \
+compiler_lib_search_dirs_F77 \
+compiler_lib_search_dirs_FC \
+predep_objects_CXX \
+predep_objects_F77 \
+predep_objects_FC \
+postdep_objects_CXX \
+postdep_objects_F77 \
+postdep_objects_FC \
+predeps_CXX \
+predeps_F77 \
+predeps_FC \
+postdeps_CXX \
+postdeps_F77 \
+postdeps_FC \
+compiler_lib_search_path_CXX \
+compiler_lib_search_path_F77 \
+compiler_lib_search_path_FC; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path \
+reload_cmds_CXX \
+reload_cmds_F77 \
+reload_cmds_FC \
+old_archive_cmds_CXX \
+old_archive_cmds_F77 \
+old_archive_cmds_FC \
+old_archive_from_new_cmds_CXX \
+old_archive_from_new_cmds_F77 \
+old_archive_from_new_cmds_FC \
+old_archive_from_expsyms_cmds_CXX \
+old_archive_from_expsyms_cmds_F77 \
+old_archive_from_expsyms_cmds_FC \
+archive_cmds_CXX \
+archive_cmds_F77 \
+archive_cmds_FC \
+archive_expsym_cmds_CXX \
+archive_expsym_cmds_F77 \
+archive_expsym_cmds_FC \
+module_cmds_CXX \
+module_cmds_F77 \
+module_cmds_FC \
+module_expsym_cmds_CXX \
+module_expsym_cmds_F77 \
+module_expsym_cmds_FC \
+export_symbols_cmds_CXX \
+export_symbols_cmds_F77 \
+export_symbols_cmds_FC \
+prelink_cmds_CXX \
+prelink_cmds_F77 \
+prelink_cmds_FC \
+postlink_cmds_CXX \
+postlink_cmds_F77 \
+postlink_cmds_FC; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+
+
+
+
+
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5
+$as_echo "$as_me: creating $ofile" >&6;}
+
+
+    # See if we are running on zsh, and set the options that allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}"; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile=${ofile}T
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags='CXX F77 FC '
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and where our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: F77
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_F77
+reload_cmds=$lt_reload_cmds_F77
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_F77
+
+# A language specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_F77
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_F77
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_F77
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_F77
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_F77
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_F77
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_F77
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_F77
+postdep_objects=$lt_postdep_objects_F77
+predeps=$lt_predeps_F77
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# ### END LIBTOOL TAG CONFIG: F77
+_LT_EOF
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: FC
+
+# The linker used to build libraries.
+LD=$lt_LD_FC
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_FC
+reload_cmds=$lt_reload_cmds_FC
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_FC
+
+# A language specific compiler.
+CC=$lt_compiler_FC
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_FC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_FC
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_FC
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_FC
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_FC
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_FC
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_FC
+archive_expsym_cmds=$lt_archive_expsym_cmds_FC
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_FC
+module_expsym_cmds=$lt_module_expsym_cmds_FC
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_FC
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_FC
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_FC
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_FC
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_FC
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_FC
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_FC
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_FC
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_FC
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_FC
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_FC
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_FC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_FC
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_FC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_FC
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_FC
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_FC
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_FC
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_FC
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_FC
+postdep_objects=$lt_postdep_objects_FC
+predeps=$lt_predeps_FC
+postdeps=$lt_postdeps_FC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_FC
+
+# ### END LIBTOOL TAG CONFIG: FC
+_LT_EOF
+
+
+as_fn_exit 0
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test yes = "$silent" &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec 5>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec 5>>config.log
+$lt_cl_success || as_fn_exit 1
+
+
+
+if test "x${use_modules}" != "xno"; then
+  echo
+  echo "*** Configuring the dynamic loader"
+  echo
+  saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$ltdl_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$ltdl_prefix/lib"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlinit in -lltdl" >&5
+$as_echo_n "checking for lt_dlinit in -lltdl... " >&6; }
+if ${ac_cv_lib_ltdl_lt_dlinit+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lltdl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lt_dlinit ();
+int
+main ()
+{
+return lt_dlinit ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ltdl_lt_dlinit=yes
+else
+  ac_cv_lib_ltdl_lt_dlinit=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dlinit" >&5
+$as_echo "$ac_cv_lib_ltdl_lt_dlinit" >&6; }
+if test "x$ac_cv_lib_ltdl_lt_dlinit" = xyes; then :
+  have_ltdl=yes
+else
+  have_ltdl=no
+fi
+
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+  if test "x$have_ltdl" == "xno"; then
+    as_fn_error $? "libltdl is required to build modules.  Please either specify the location of the libltdl library using --with-ldtl=PREFIX or else disable the building of modules by using --disable-modules." "$LINENO" 5
+  fi
+
+  if test "x$ltdl_prefix" != "x"; then
+    for ac_header in ltdl.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default"
+if test "x$ac_cv_header_ltdl_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LTDL_H 1
+_ACEOF
+
+fi
+
+done
+
+    LIBLTDL="-L${ltdl_prefix}/lib -lltdl"
+    LTDLINC="-I${ltdl_prefix}/include"
+  else
+    for ac_header in ltdl.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default"
+if test "x$ac_cv_header_ltdl_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LTDL_H 1
+_ACEOF
+
+fi
+
+done
+
+    LIBLTDL="-lltdl"
+  fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutex_lock" >&5
+$as_echo_n "checking for library containing pthread_mutex_lock... " >&6; }
+if ${ac_cv_search_pthread_mutex_lock+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_lock ();
+int
+main ()
+{
+return pthread_mutex_lock ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_pthread_mutex_lock=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_pthread_mutex_lock+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_pthread_mutex_lock+:} false; then :
+
+else
+  ac_cv_search_pthread_mutex_lock=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutex_lock" >&5
+$as_echo "$ac_cv_search_pthread_mutex_lock" >&6; }
+ac_res=$ac_cv_search_pthread_mutex_lock
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  use_pthread=yes
+
+$as_echo "#define USE_PTHREAD /**/" >>confdefs.h
+
+
+else
+  use_pthread=no
+fi
+
+  for ac_header in pthread.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+
+
+if test "x$CXX" == "x"; then
+  make_cxxbindings=no
+fi
+
+if test "x$F77" == "x"; then
+  make_f77bindings=no
+  make_f95bindings=no
+fi
+
+if test "x$FC" == "x"; then
+  make_f95bindings=no
+fi
+
+echo
+echo "*** Checking additional compiler characteristics"
+echo
+# 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 :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
+if ${ac_cv_c_restrict+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_restrict=no
+   # The order here caters to the fact that C++ does not require restrict.
+   for ac_kw in __restrict __restrict__ _Restrict restrict; do
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+typedef int * int_ptr;
+	int foo (int_ptr $ac_kw ip) {
+	return ip[0];
+       }
+int
+main ()
+{
+int s[1];
+	int * $ac_kw t = s;
+	t[0] = 0;
+	return foo(t)
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_restrict=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     test "$ac_cv_c_restrict" != no && break
+   done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+$as_echo "$ac_cv_c_restrict" >&6; }
+
+ case $ac_cv_c_restrict in
+   restrict) ;;
+   no) $as_echo "#define restrict /**/" >>confdefs.h
+ ;;
+   *)  cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
+_ACEOF
+ ;;
+ esac
+
+
+if ! test "x$ac_cv_c_restrict" = "xno"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether restrict can be applied to pointer array arguments" >&5
+$as_echo_n "checking whether restrict can be applied to pointer array arguments... " >&6; }
+if ${gd_cv_c_restrict_array+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+    int *foo (int *restrict bar[3]) { return bar[2]; }
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gd_cv_c_restrict_array="yes"
+else
+  gd_cv_c_restrict_array="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_c_restrict_array" >&5
+$as_echo "$gd_cv_c_restrict_array" >&6; }
+fi
+
+if test "x$gd_cv_c_restrict_array" = "xyes"; then
+
+$as_echo "#define GD_RESTRICT_ARRAY_OK 1" >>confdefs.h
+
+fi
+
+gd_saved_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wall" >&5
+$as_echo_n "checking whether $CC accepts -Wall... " >&6; }
+if ${gd_cv_prog_cc_wall+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  CFLAGS="-Wall"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gd_cv_prog_cc_wall=yes
+else
+  gd_cv_prog_cc_wall=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cc_wall" >&5
+$as_echo "$gd_cv_prog_cc_wall" >&6; }
+CFLAGS=$gd_saved_CFLAGS
+gd_saved_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wextra" >&5
+$as_echo_n "checking whether $CC accepts -Wextra... " >&6; }
+if ${gd_cv_prog_cc_wextra+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  CFLAGS="-Wextra"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gd_cv_prog_cc_wextra=yes
+else
+  gd_cv_prog_cc_wextra=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cc_wextra" >&5
+$as_echo "$gd_cv_prog_cc_wextra" >&6; }
+CFLAGS=$gd_saved_CFLAGS
+
+if test "x$make_cxxbindings" != "xno"; then
+  gd_saved_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wall" >&5
+$as_echo_n "checking whether $CXX accepts -Wall... " >&6; }
+if ${gd_cv_prog_cxx_wall+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  CXXFLAGS="-Wall"
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  gd_cv_prog_cxx_wall=yes
+else
+  gd_cv_prog_cxx_wall=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cxx_wall" >&5
+$as_echo "$gd_cv_prog_cxx_wall" >&6; }
+CXXFLAGS=$gd_saved_CXXFLAGS
+  gd_saved_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wextra" >&5
+$as_echo_n "checking whether $CXX accepts -Wextra... " >&6; }
+if ${gd_cv_prog_cxx_wextra+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  CXXFLAGS="-Wextra"
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  gd_cv_prog_cxx_wextra=yes
+else
+  gd_cv_prog_cxx_wextra=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cxx_wextra" >&5
+$as_echo "$gd_cv_prog_cxx_wextra" >&6; }
+CXXFLAGS=$gd_saved_CXXFLAGS
+fi
+
+if test "x$make_f77bindings" != "xno"; then
+  gd_saved_FFLAGS=$FFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -Wall" >&5
+$as_echo_n "checking whether $F77 accepts -Wall... " >&6; }
+if ${gd_cv_prog_f77_wall+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS="-Wall"
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  gd_cv_prog_f77_wall=yes
+else
+  gd_cv_prog_f77_wall=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_f77_wall" >&5
+$as_echo "$gd_cv_prog_f77_wall" >&6; }
+FFLAGS=$gd_saved_FFLAGS
+  gd_saved_FFLAGS=$FFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -Wextra" >&5
+$as_echo_n "checking whether $F77 accepts -Wextra... " >&6; }
+if ${gd_cv_prog_f77_wextra+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS="-Wextra"
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  gd_cv_prog_f77_wextra=yes
+else
+  gd_cv_prog_f77_wextra=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_f77_wextra" >&5
+$as_echo "$gd_cv_prog_f77_wextra" >&6; }
+FFLAGS=$gd_saved_FFLAGS
+  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
+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 :
+  $as_echo_n "(cached) " >&6
+else
+  if $F77 -help 2>/dev/null | grep -q 'Intel.R. Fortran Compiler'; then
+gd_cv_f77_compiler_intel=yes
+else
+gd_cv_f77_compiler_intel=no
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_f77_compiler_intel" >&5
+$as_echo "$gd_cv_f77_compiler_intel" >&6; }
+fi
+
+if test "x$make_f77bindings" != "xno"; then
+  ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $F77" >&5
+$as_echo_n "checking how to get verbose linking output from $F77... " >&6; }
+if ${ac_cv_prog_f77_v+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  ac_cv_prog_f77_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_verb"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  sed '/^Driving:/d; /^Configured with:/d;
+      '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # With xlf replace commas with spaces,
+  # and remove "-link" and closing parenthesis.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output |
+      sed '
+        s/,/ /g
+        s/ -link / /g
+        s/) *$//
+      '
+    ` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+	s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+	s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+	s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using fort77 (the f2c wrapper) then filter output and delete quotes.
+  *fort77*f2c*gcc*)
+    ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n '
+        /:[	 ]\+Running[	 ]\{1,\}"gcc"/{
+          /"-c"/d
+          /[.]c"*/d
+          s/^.*"gcc"/"gcc"/
+          s/"//gp
+        }'` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+  # look for -l* and *.a constructs in the output
+  for ac_arg in $ac_f77_v_output; do
+     case $ac_arg in
+	[\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+	  ac_cv_prog_f77_v=$ac_verb
+	  break 2 ;;
+     esac
+  done
+done
+if test -z "$ac_cv_prog_f77_v"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $F77" >&5
+$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
+fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5
+$as_echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_v" >&5
+$as_echo "$ac_cv_prog_f77_v" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 libraries of $F77" >&5
+$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; }
+if ${ac_cv_f77_libs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$FLIBS" != "x"; then
+  ac_cv_f77_libs="$FLIBS" # Let the user override the test.
+else
+
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FFLAGS
+FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
+eval "set x $ac_link"
+shift
+$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5
+# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
+# LIBRARY_PATH; skip all such settings.
+ac_f77_v_output=`eval $ac_link 5>&1 2>&1 |
+  sed '/^Driving:/d; /^Configured with:/d;
+      '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"`
+$as_echo "$ac_f77_v_output" >&5
+FFLAGS=$ac_save_FFLAGS
+
+rm -rf conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_f77_v_output="`echo $ac_f77_v_output |
+	grep 'LPATH is:' |
+	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output"
+
+# FIXME: we keep getting bitten by quoted arguments; a more general fix
+#        that detects unbalanced quotes in FLIBS should be implemented
+#        and (ugh) tested at some point.
+case $ac_f77_v_output in
+  # With xlf replace commas with spaces,
+  # and remove "-link" and closing parenthesis.
+  *xlfentry*)
+    ac_f77_v_output=`echo $ac_f77_v_output |
+      sed '
+        s/,/ /g
+        s/ -link / /g
+        s/) *$//
+      '
+    ` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;
+
+  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
+  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
+  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
+  *-cmdline\ * | *-ignore\ * | *-def\ *)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed "\
+	s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
+	s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
+	s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
+
+  # If we are using fort77 (the f2c wrapper) then filter output and delete quotes.
+  *fort77*f2c*gcc*)
+    ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n '
+        /:[	 ]\+Running[	 ]\{1,\}"gcc"/{
+          /"-c"/d
+          /[.]c"*/d
+          s/^.*"gcc"/"gcc"/
+          s/"//gp
+        }'` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  *cft90*)
+    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;;
+esac
+
+
+
+ac_cv_f77_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_f77_v_output
+while test $# != 1; do
+  shift
+  ac_arg=$1
+  case $ac_arg in
+	[\\/]*.a | ?:[\\/]*.a)
+	    ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then :
+
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+	  ;;
+	-bI:*)
+	    ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then :
+
+else
+  if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_arg; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+fi
+	  ;;
+	  # Ignore these flags.
+	-lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \
+	  |-LANG:=* | -LIST:* | -LNO:* | -link)
+	  ;;
+	-lkernel32)
+	  case $host_os in
+	  *cygwin*) ;;
+	  *) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+	    ;;
+	  esac
+	  ;;
+	-[LRuYz])
+	  # These flags, when seen by themselves, take an argument.
+	  # We remove the space between option and argument and re-iterate
+	  # unless we find an empty arg or a new option (starting with -)
+	  case $2 in
+	     "" | -*);;
+	     *)
+		ac_arg="$ac_arg$2"
+		shift; shift
+		set X $ac_arg "$@"
+		;;
+	  esac
+	  ;;
+	-YP,*)
+	  for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+	      ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_j" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then :
+
+else
+  ac_arg="$ac_arg $ac_j"
+			       ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
+fi
+	  done
+	  ;;
+	-[lLR]*)
+	    ac_exists=false
+  for ac_i in $ac_cv_f77_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then :
+
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+fi
+	  ;;
+	-zallextract*| -zdefaultextract)
+	  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
+	  ;;
+	  # Ignore everything else.
+  esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+   "SunOS 5"*)
+      ac_ld_run_path=`$as_echo "$ac_f77_v_output" |
+			sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+      test "x$ac_ld_run_path" != x &&
+	if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_ld_run_path; do
+    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
+fi
+      ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_libs" >&5
+$as_echo "$ac_cv_f77_libs" >&6; }
+FLIBS="$ac_cv_f77_libs"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran 77 libraries" >&5
+$as_echo_n "checking for dummy main to link with Fortran 77 libraries... " >&6; }
+if ${ac_cv_f77_dummy_main+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_f77_dm_save_LIBS=$LIBS
+ LIBS="$LIBS $FLIBS"
+ ac_fortran_dm_var=F77_DUMMY_MAIN
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ # First, try linking without a dummy main:
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_fortran_dummy_main=none
+else
+  ac_cv_fortran_dummy_main=unknown
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+ if test $ac_cv_fortran_dummy_main = unknown; then
+   for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define $ac_fortran_dm_var $ac_func
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_fortran_dummy_main=$ac_func; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+   done
+ fi
+ ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+ ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main
+ rm -rf conftest*
+ LIBS=$ac_f77_dm_save_LIBS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_dummy_main" >&5
+$as_echo "$ac_cv_f77_dummy_main" >&6; }
+F77_DUMMY_MAIN=$ac_cv_f77_dummy_main
+if test "$F77_DUMMY_MAIN" != unknown; then :
+  if test $F77_DUMMY_MAIN != none; then
+
+cat >>confdefs.h <<_ACEOF
+#define F77_DUMMY_MAIN $F77_DUMMY_MAIN
+_ACEOF
+
+  if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then
+
+$as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h
+
+  fi
+fi
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "linking to Fortran libraries from C fails
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 name-mangling scheme" >&5
+$as_echo_n "checking for Fortran 77 name-mangling scheme... " >&6; }
+if ${ac_cv_f77_mangling+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      subroutine foobar()
+      return
+      end
+      subroutine foo_bar()
+      return
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  mv conftest.$ac_objext cfortran_test.$ac_objext
+
+  ac_save_LIBS=$LIBS
+  LIBS="cfortran_test.$ac_objext $LIBS $FLIBS"
+
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+  ac_success=no
+  for ac_foobar in foobar FOOBAR; do
+    for ac_underscore in "" "_"; do
+      ac_func="$ac_foobar$ac_underscore"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_success=yes; break 2
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    done
+  done
+  ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+  if test "$ac_success" = "yes"; then
+     case $ac_foobar in
+	foobar)
+	   ac_case=lower
+	   ac_foo_bar=foo_bar
+	   ;;
+	FOOBAR)
+	   ac_case=upper
+	   ac_foo_bar=FOO_BAR
+	   ;;
+     esac
+
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+     ac_success_extra=no
+     for ac_extra in "" "_"; do
+	ac_func="$ac_foo_bar$ac_underscore$ac_extra"
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_success_extra=yes; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     done
+     ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+     if test "$ac_success_extra" = "yes"; then
+	ac_cv_f77_mangling="$ac_case case"
+	if test -z "$ac_underscore"; then
+	   ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore"
+	else
+	   ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore"
+	fi
+	if test -z "$ac_extra"; then
+	   ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore"
+	else
+	   ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore"
+	fi
+      else
+	ac_cv_f77_mangling="unknown"
+      fi
+  else
+     ac_cv_f77_mangling="unknown"
+  fi
+
+  LIBS=$ac_save_LIBS
+  rm -rf conftest*
+  rm -f cfortran_test*
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compile a simple Fortran program
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_mangling" >&5
+$as_echo "$ac_cv_f77_mangling" >&6; }
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+case $ac_cv_f77_mangling in
+  "lower case, no underscore, no extra underscore")
+	  $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h
+
+	  $as_echo "#define F77_FUNC_(name,NAME) name" >>confdefs.h
+ ;;
+  "lower case, no underscore, extra underscore")
+	  $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h
+
+	  $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h
+ ;;
+  "lower case, underscore, no extra underscore")
+	  $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h
+
+	  $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h
+ ;;
+  "lower case, underscore, extra underscore")
+	  $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h
+
+	  $as_echo "#define F77_FUNC_(name,NAME) name ## __" >>confdefs.h
+ ;;
+  "upper case, no underscore, no extra underscore")
+	  $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h
+
+	  $as_echo "#define F77_FUNC_(name,NAME) NAME" >>confdefs.h
+ ;;
+  "upper case, no underscore, extra underscore")
+	  $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h
+
+	  $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h
+ ;;
+  "upper case, underscore, no extra underscore")
+	  $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h
+
+	  $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h
+ ;;
+  "upper case, underscore, extra underscore")
+	  $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h
+
+	  $as_echo "#define F77_FUNC_(name,NAME) NAME ## __" >>confdefs.h
+ ;;
+  *)
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5
+$as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;}
+	  ;;
+esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  if test "x$ac_cv_f77_mangling" == "xunknown"; then
+    make_f77bindings=no
+    make_f95bindings=no
+  fi
+fi
+
+if test "x$make_f95bindings" != "xno"; then
+  gd_saved_FCFLAGS=$FCFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -Wall" >&5
+$as_echo_n "checking whether $FC accepts -Wall... " >&6; }
+if ${gd_cv_prog_fc_wall+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  FCFLAGS="-Wall"
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  gd_cv_prog_fc_wall=yes
+else
+  gd_cv_prog_fc_wall=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_fc_wall" >&5
+$as_echo "$gd_cv_prog_fc_wall" >&6; }
+FCFLAGS=$gd_saved_FCFLAGS
+  gd_saved_FCFLAGS=$FCFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -Wextra" >&5
+$as_echo_n "checking whether $FC accepts -Wextra... " >&6; }
+if ${gd_cv_prog_fc_wextra+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  FCFLAGS="-Wextra"
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  gd_cv_prog_fc_wextra=yes
+else
+  gd_cv_prog_fc_wextra=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_fc_wextra" >&5
+$as_echo "$gd_cv_prog_fc_wextra" >&6; }
+FCFLAGS=$gd_saved_FCFLAGS
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Intel Fortran compiler" >&5
+$as_echo_n "checking whether we are using the Intel Fortran compiler... " >&6; }
+if ${gd_cv_fc_compiler_intel+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $FC -help 2>/dev/null | grep -q 'Intel.R. Fortran Compiler'; then
+gd_cv_fc_compiler_intel=yes
+else
+gd_cv_fc_compiler_intel=no
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_fc_compiler_intel" >&5
+$as_echo "$gd_cv_fc_compiler_intel" >&6; }
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're linking against the Microsoft C Run-Time" >&5
+$as_echo_n "checking if we're linking against the Microsoft C Run-Time... " >&6; } #'
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+#ifndef __MSVCRT__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gd_msvcrt=yes
+else
+  gd_msvcrt=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_msvcrt" >&5
+$as_echo "$gd_msvcrt" >&6; }
+
+if test "$gd_msvcrt" = "yes"; then
+
+$as_echo "#define __MSVCRT_VERSION__ 0x601" >>confdefs.h
+
+fi
+
+echo
+echo "*** Looking for additional libraries"
+echo
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ceil" >&5
+$as_echo_n "checking for library containing ceil... " >&6; }
+if ${ac_cv_search_ceil+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ceil ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return ceil ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_ceil=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_ceil+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_ceil+:} false; then :
+
+else
+  ac_cv_search_ceil=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ceil" >&5
+$as_echo "$ac_cv_search_ceil" >&6; }
+ac_res=$ac_cv_search_ceil
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+echo
+echo "*** Looking for additional header files"
+echo
+for ac_header in asm/unaligned.h Availability.h byteswap.h direct.h fcntl.h \
+                  float.h inttypes.h io.h libgen.h libkern/OSByteOrder.h \
+                  math.h stddef.h stdint.h sys/endian.h sys/file.h sys/param.h \
+                  sys/stat.h sys/types.h sys/wait.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+if test "x$disable_c99" = "xno"; then
+for ac_header in complex.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "complex.h" "ac_cv_header_complex_h" "$ac_includes_default"
+if test "x$ac_cv_header_complex_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_COMPLEX_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if eval \${$as_ac_Header+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_ac_Header=yes"
+else
+  eval "$as_ac_Header=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_ac_Header
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_opendir+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+  ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_opendir+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+  ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+
+echo
+echo "*** Checking data types"
+echo
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this sort of thing.  */
+  typedef int charset[2];
+  const charset cs = { 0, 0 };
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_const=yes
+else
+  ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+	       not a universal capable compiler
+	     #endif
+	     typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+	# Check for potential -arch flags.  It is not universal unless
+	# there are at least two -arch flags with different values.
+	ac_arch=
+	ac_prev=
+	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+	 if test -n "$ac_prev"; then
+	   case $ac_word in
+	     i?86 | x86_64 | ppc | ppc64)
+	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+		 ac_arch=$ac_word
+	       else
+		 ac_cv_c_bigendian=universal
+		 break
+	       fi
+	       ;;
+	   esac
+	   ac_prev=
+	 elif test "x$ac_word" = "x-arch"; then
+	   ac_prev=arch
+	 fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+	     #include <sys/param.h>
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+		     && LITTLE_ENDIAN)
+	      bogus endian macros
+	     #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+		#include <sys/param.h>
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+		 not big endian
+		#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+	      bogus endian macros
+	     #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+		 not big endian
+		#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then :
+  # Try to guess by grepping values from an object file.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+short int ascii_mm[] =
+		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+		short int ascii_ii[] =
+		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+		int use_ascii (int i) {
+		  return ascii_mm[i] + ascii_ii[i];
+		}
+		short int ebcdic_ii[] =
+		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+		short int ebcdic_mm[] =
+		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+		int use_ebcdic (int i) {
+		  return ebcdic_mm[i] + ebcdic_ii[i];
+		}
+		extern int foo;
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+	      ac_cv_c_bigendian=yes
+	    fi
+	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+	      if test "$ac_cv_c_bigendian" = unknown; then
+		ac_cv_c_bigendian=no
+	      else
+		# finding both strings is unlikely to happen, but who knows?
+		ac_cv_c_bigendian=unknown
+	      fi
+	    fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+	     /* Are we little or big endian?  From Harbison&Steele.  */
+	     union
+	     {
+	       long int l;
+	       char c[sizeof (long int)];
+	     } u;
+	     u.l = 1;
+	     return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_c_bigendian=no
+else
+  ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+   no)
+      ;; #(
+   universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+     ;; #(
+   *)
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking floating point endianness" >&5
+$as_echo_n "checking floating point endianness... " >&6; }
+if ${gd_cv_c_floatordering+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  gd_cv_c_floatordering=unknown
+# check for arm middle endianness
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if ! (defined __arm__ && ! (defined __VFP_FP__ || defined __MAVERICK___))
+  not arm middle endian
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gd_cv_c_floatordering=arm
+else
+  # not middle-endian arm, check for __FLOAT_WORD_ORDER
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <endian.h>
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+#ifndef __FLOAT_WORD_ORDER
+  no __FLOAT_WORD_ORDER defined
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # __FLOAT_WORD_ORDER is defined; is it BIG_ENDIAN?
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <endian.h>
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+#if __FLOAT_WORD_ORDER != BIG_ENDIAN
+  not big endian
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gd_cv_c_floatordering="big"
+else
+  gd_cv_c_floatordering="little"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  # no __FLOAT_WORD_ORDER defined; so we just assume it's the same as the
+ # integer ordering
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef WORDS_BIGENDIAN
+  not big endian
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gd_cv_c_floatordering="big"
+else
+  gd_cv_c_floatordering="little"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_c_floatordering" >&5
+$as_echo "$gd_cv_c_floatordering" >&6; }
+
+if test $gd_cv_c_floatordering = "arm"; then
+
+$as_echo "#define ARM_ENDIAN_DOUBLES 1" >>confdefs.h
+
+elif test $gd_cv_c_floatordering = "big"; then
+
+$as_echo "#define FLOATS_BIGENDIAN 1" >>confdefs.h
+
+fi
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
+if ${ac_cv_sizeof_size_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_size_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (size_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_size_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+_ACEOF
+
+
+ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
+if test "x$ac_cv_type_ssize_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SSIZE_T 1
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if ${ac_cv_sizeof_off_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_off_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_off_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
+case $ac_cv_c_uint8_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT8_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t"
+case $ac_cv_c_int8_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int8_t $ac_cv_c_int8_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
+case $ac_cv_c_uint16_t in #(
+  no|yes) ;; #(
+  *)
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint16_t $ac_cv_c_uint16_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t"
+case $ac_cv_c_int16_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int16_t $ac_cv_c_int16_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT32_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT64_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int64_t $ac_cv_c_int64_t
+_ACEOF
+;;
+esac
+
+
+if test "x$disable_c99" = "xno"; then
+ac_fn_c_check_type "$LINENO" "_Complex float" "ac_cv_type__Complex_float" "$ac_includes_default"
+if test "x$ac_cv_type__Complex_float" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__COMPLEX_FLOAT 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "_Complex double" "ac_cv_type__Complex_double" "$ac_includes_default"
+if test "x$ac_cv_type__Complex_double" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__COMPLEX_DOUBLE 1
+_ACEOF
+
+
+fi
+
+fi
+
+ac_fn_c_check_type "$LINENO" "struct stat64" "ac_cv_type_struct_stat64" "$ac_includes_default"
+if test "x$ac_cv_type_struct_stat64" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT64 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct _stat64" "ac_cv_type_struct__stat64" "$ac_includes_default"
+if test "x$ac_cv_type_struct__stat64" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT__STAT64 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct __stat64" "ac_cv_type_struct___stat64" "$ac_includes_default"
+if test "x$ac_cv_type_struct___stat64" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT___STAT64 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "off64_t" "ac_cv_type_off64_t" "$ac_includes_default"
+if test "x$ac_cv_type_off64_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_OFF64_T 1
+_ACEOF
+
+
+fi
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short int" >&5
+$as_echo_n "checking size of short int... " >&6; }
+if ${ac_cv_sizeof_short_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_short_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_short_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short_int" >&5
+$as_echo "$ac_cv_sizeof_short_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5
+$as_echo_n "checking size of long int... " >&6; }
+if ${ac_cv_sizeof_long_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_long_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_long_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5
+$as_echo "$ac_cv_sizeof_long_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5
+$as_echo_n "checking size of long long int... " >&6; }
+if ${ac_cv_sizeof_long_long_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_long_long_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_long_long_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5
+$as_echo "$ac_cv_sizeof_long_long_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short int" >&5
+$as_echo_n "checking size of unsigned short int... " >&6; }
+if ${ac_cv_sizeof_unsigned_short_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short int))" "ac_cv_sizeof_unsigned_short_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_unsigned_short_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (unsigned short int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_unsigned_short_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short_int" >&5
+$as_echo "$ac_cv_sizeof_unsigned_short_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UNSIGNED_SHORT_INT $ac_cv_sizeof_unsigned_short_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5
+$as_echo_n "checking size of unsigned int... " >&6; }
+if ${ac_cv_sizeof_unsigned_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_unsigned_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (unsigned int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_unsigned_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5
+$as_echo "$ac_cv_sizeof_unsigned_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long int" >&5
+$as_echo_n "checking size of unsigned long int... " >&6; }
+if ${ac_cv_sizeof_unsigned_long_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long int))" "ac_cv_sizeof_unsigned_long_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_unsigned_long_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (unsigned long int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_unsigned_long_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_int" >&5
+$as_echo "$ac_cv_sizeof_unsigned_long_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UNSIGNED_LONG_INT $ac_cv_sizeof_unsigned_long_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long int" >&5
+$as_echo_n "checking size of unsigned long long int... " >&6; }
+if ${ac_cv_sizeof_unsigned_long_long_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long int))" "ac_cv_sizeof_unsigned_long_long_int"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_unsigned_long_long_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (unsigned long long int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_unsigned_long_long_int=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_sizeof_unsigned_long_long_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UNSIGNED_LONG_LONG_INT $ac_cv_sizeof_unsigned_long_long_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if ${ac_cv_sizeof_void_p+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_void_p" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_void_p=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+
+if test $ac_cv_sizeof_int -eq 2; then
+  gd_int16_t="int"
+elif test $ac_cv_sizeof_short_int -eq 2; then
+  gd_int16_t="short int"
+elif test $ac_cv_sizeof_long_int -eq 2; then
+  gd_int16_t="long int"
+elif test $ac_cv_sizeof_long_long_int -eq 2; then
+  gd_int16_t="long long int"
+fi
+
+if test $ac_cv_sizeof_unsigned_int -eq 2; then
+  gd_uint16_t="unsigned int"
+elif test $ac_cv_sizeof_unsigned_short_int -eq 2; then
+  gd_uint16_t="unsigned short int"
+elif test $ac_cv_sizeof_unsigned_long_int -eq 2; then
+  gd_uint16_t="unsigned long int"
+elif test $ac_cv_sizeof_unsigned_long_long_int -eq 2; then
+  gd_uint16_t="unsigned long long int"
+fi
+
+if test $ac_cv_sizeof_int -eq 8; then
+  gd_int64_t="int"
+elif test $ac_cv_sizeof_short_int -eq 8; then
+  gd_int64_t="short int"
+elif test $ac_cv_sizeof_long_int -eq 8; then
+  gd_int64_t="long int"
+elif test $ac_cv_sizeof_long_long_int -eq 8; then
+  gd_int64_t="long long int"
+fi
+
+if test $ac_cv_sizeof_unsigned_int -eq 8; then
+  gd_uint64_t="unsigned int"
+elif test $ac_cv_sizeof_unsigned_short_int -eq 8; then
+  gd_uint64_t="unsigned short int"
+elif test $ac_cv_sizeof_unsigned_long_int -eq 8; then
+  gd_uint64_t="unsigned long int"
+elif test $ac_cv_sizeof_unsigned_long_long_int -eq 8; then
+  gd_uint64_t="unsigned long long int"
+fi
+
+if test "x$gd_cv_type_off64_t" = "xyes"; then
+
+$as_echo "#define HAVE_OFF64_T 1" >>confdefs.h
+ fi
+
+DEFINE_gd_int16_t="# define gd_int16_t $gd_int16_t";
+DEFINE_gd_uint16_t="# define gd_uint16_t $gd_uint16_t";
+DEFINE_gd_int64_t="# define gd_int64_t $gd_int64_t";
+DEFINE_gd_uint64_t="# define gd_uint64_t $gd_uint64_t";
+
+
+
+
+
+echo
+echo "*** Looking for additional library functions"
+echo
+for ac_func in basename _chsize _chsize_s _commit fchmod _fdopen fdopendir \
+                _finite fpathconf fseeko fseeko64 _fstat fstat64 _fstat64 \
+                fstatat fstatat64 fsync ftello ftello64 ftruncate ftruncate64 \
+                getcwd _getcwd getdelim gmtime_r isnan _isnan lseek64 \
+                _lseeki64 lstat lstat64 _mkdir mkfifo nan _open openat \
+                pathconf _read readdir_r readlink renameat _rmdir snprintf \
+                _snprintf stat64 _stat64 _strtoi64 strtoll strtoq _strtoui64 \
+                strtoull strtouq symlink _unlink unlinkat _write
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+if test "x$disable_c99" = "xno"; then
+  for ac_func in cabs
+do :
+  ac_fn_c_check_func "$LINENO" "cabs" "ac_cv_func_cabs"
+if test "x$ac_cv_func_cabs" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_CABS 1
+_ACEOF
+
+fi
+done
+
+fi
+ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R $ac_have_decl
+_ACEOF
+
+for ac_func in strerror_r
+do :
+  ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
+if test "x$ac_cv_func_strerror_r" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STRERROR_R 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
+$as_echo_n "checking whether strerror_r returns char *... " >&6; }
+if ${ac_cv_func_strerror_r_char_p+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    ac_cv_func_strerror_r_char_p=no
+    if test $ac_cv_have_decl_strerror_r = yes; then
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+	  char buf[100];
+	  char x = *strerror_r (0, buf, sizeof buf);
+	  char *p = strerror_r (0, buf, sizeof buf);
+	  return !p || x;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    else
+      # strerror_r is not declared.  Choose between
+      # systems that have relatively inaccessible declarations for the
+      # function.  BeOS and DEC UNIX 4.0 fall in this category, but the
+      # former has a strerror_r that returns char*, while the latter
+      # has a strerror_r that returns `int'.
+      # This test should segfault on the DEC system.
+      if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+	extern char *strerror_r ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+char buf[100];
+	  char x = *strerror_r (0, buf, sizeof buf);
+	  return ! isalpha (x);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
+$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
+if test $ac_cv_func_strerror_r_char_p = yes; then
+
+$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+for ac_header in vfork.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
+if test "x$ac_cv_header_vfork_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_VFORK_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in fork vfork
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+if test "x$ac_cv_func_fork" = xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
+$as_echo_n "checking for working fork... " >&6; }
+if ${ac_cv_func_fork_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_fork_works=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+	  /* By Ruediger Kuhlmann. */
+	  return fork () < 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_fork_works=yes
+else
+  ac_cv_func_fork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
+$as_echo "$ac_cv_func_fork_works" >&6; }
+
+else
+  ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+  case $host in
+    *-*-amigaos* | *-*-msdosdjgpp*)
+      # Override, as these systems have only a dummy fork() stub
+      ac_cv_func_fork_works=no
+      ;;
+    *)
+      ac_cv_func_fork_works=yes
+      ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
+$as_echo_n "checking for working vfork... " >&6; }
+if ${ac_cv_func_vfork_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_vfork_works=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Thanks to Paul Eggert for this test.  */
+$ac_includes_default
+#include <sys/wait.h>
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+   argument registers are propagated back to the parent.  The compiler
+   is told about this with #include <vfork.h>, but some compilers
+   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
+   static variable whose address is put into a register that is
+   clobbered by the vfork.  */
+static void
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+  static pid_t child;
+  if (!child) {
+    child = vfork ();
+    if (child < 0) {
+      perror ("vfork");
+      _exit(2);
+    }
+    if (!child) {
+      arg = getpid();
+      write(-1, "", 0);
+      _exit (arg);
+    }
+  }
+}
+
+int
+main ()
+{
+  pid_t parent = getpid ();
+  pid_t child;
+
+  sparc_address_test (0);
+
+  child = vfork ();
+
+  if (child == 0) {
+    /* Here is another test for sparc vfork register problems.  This
+       test uses lots of local variables, at least as many local
+       variables as main has allocated so far including compiler
+       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
+       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
+       reuse the register of parent for one of the local variables,
+       since it will think that parent can't possibly be used any more
+       in this routine.  Assigning to the local variable will thus
+       munge parent in the parent process.  */
+    pid_t
+      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+    /* Convince the compiler that p..p7 are live; otherwise, it might
+       use the same hardware register for all 8 local variables.  */
+    if (p != p1 || p != p2 || p != p3 || p != p4
+	|| p != p5 || p != p6 || p != p7)
+      _exit(1);
+
+    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+       from child file descriptors.  If the child closes a descriptor
+       before it execs or exits, this munges the parent's descriptor
+       as well.  Test for this by closing stdout in the child.  */
+    _exit(close(fileno(stdout)) != 0);
+  } else {
+    int status;
+    struct stat st;
+
+    while (wait(&status) != child)
+      ;
+    return (
+	 /* Was there some problem with vforking?  */
+	 child < 0
+
+	 /* Did the child fail?  (This shouldn't happen.)  */
+	 || status
+
+	 /* Did the vfork/compiler bug occur?  */
+	 || parent != getpid()
+
+	 /* Did the file descriptor bug occur?  */
+	 || fstat(fileno(stdout), &st) != 0
+	 );
+  }
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_vfork_works=yes
+else
+  ac_cv_func_vfork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
+$as_echo "$ac_cv_func_vfork_works" >&6; }
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+  ac_cv_func_vfork_works=$ac_cv_func_vfork
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+
+else
+
+$as_echo "#define vfork fork" >>confdefs.h
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir accepts two arguments" >&5
+$as_echo_n "checking whether mkdir accepts two arguments... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_IO_H
+#include <io.h>
+#endif
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+#ifdef HAVE__MKDIR
+_mkdir("x", 00777);
+#else
+mkdir("x", 00777);
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gd_2arg_mkdir=yes
+else
+  gd_2arg_mkdir=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_2arg_mkdir" >&5
+$as_echo "$gd_2arg_mkdir" >&6; }
+
+if test $gd_2arg_mkdir = "no"; then
+
+$as_echo "#define MKDIR_NO_MODE 1" >>confdefs.h
+
+fi
+ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_isfinite" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISFINITE $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "bswap16" "ac_cv_have_decl_bswap16" "
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+#ifdef HAVE_LIBKERN_OSBYTEORDER_H
+#include <libkern/OSByteOrder.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_bswap16" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_BSWAP16 $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "bswap_16" "ac_cv_have_decl_bswap_16" "
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+#ifdef HAVE_LIBKERN_OSBYTEORDER_H
+#include <libkern/OSByteOrder.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_bswap_16" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_BSWAP_16 $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "OSSwapInt16" "ac_cv_have_decl_OSSwapInt16" "
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+#ifdef HAVE_LIBKERN_OSBYTEORDER_H
+#include <libkern/OSByteOrder.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_OSSwapInt16" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_OSSWAPINT16 $ac_have_decl
+_ACEOF
+
+
+ac_fn_c_check_decl "$LINENO" "get_unaligned" "ac_cv_have_decl_get_unaligned" "
+#ifdef HAVE_ASM_UNALIGNED_H
+#include <asm/unaligned.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_get_unaligned" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GET_UNALIGNED $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "put_unaligned" "ac_cv_have_decl_put_unaligned" "
+#ifdef HAVE_ASM_UNALIGNED_H
+#include <asm/unaligned.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_put_unaligned" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PUT_UNALIGNED $ac_have_decl
+_ACEOF
+
+
+if test "x$make_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"
+  echo
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C99 is supported" >&5
+$as_echo_n "checking whether C99 is supported... " >&6; }
+  if test "x$disable_c99" = "xno"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    make_idlbindings=no
+  fi
+fi
+if test "x$make_idlbindings" = "xyes"; then
+
+idl_min_version=5.5
+
+# Check whether --with-idl was given.
+if test "${with_idl+set}" = set; then :
+  withval=$with_idl;
+              case "${withval}" in
+                no) have_idl="no" ;;
+                yes) user_idl= ; have_idl= ;;
+                *) user_idl="${withval}"; have_idl= ;;
+              esac
+
+else
+   user_idl=; have_idl=
+fi
+
+
+
+
+# Check whether --with-idl-dlm-dir was given.
+if test "${with_idl_dlm_dir+set}" = set; then :
+  withval=$with_idl_dlm_dir;
+        case "${withval}" in
+          no) local_idl_dlm_path= ;;
+          *) local_idl_dlm_path="${withval}"
+        esac
+
+else
+   local_idl_dlm_path=
+fi
+
+
+if test "x${have_idl}" != "xno"; then
+
+if test "x$user_idl" != "x"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $user_idl is an IDL interpreter version >= $idl_min_version" >&5
+$as_echo_n "checking whether $user_idl is an IDL interpreter version >= $idl_min_version... " >&6; }
+
+idl_version_ok="no"
+idl_header=`( echo | $user_idl 2>&1 )` #''
+IDL_VERSION="unknown"
+if echo $idl_header | grep -q "IDL Version"; then
+  IDL_VERSION=`echo $idl_header | grep Version | sed -e 's/IDL Version \([^ ]*\).*/\1/'` #'
+
+
+
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+
+  ax_compare_version_A=`echo "$IDL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+  ax_compare_version_B=`echo "$idl_min_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+    ax_compare_version=`echo "x$ax_compare_version_A
+x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"`
+
+
+
+    if test "$ax_compare_version" = "true" ; then
+    idl_version_ok="yes"
+      fi
+
+fi
+if test "x$idl_version_ok" = "xyes"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  IDL=$user_idl
+  true
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  IDL="not found"
+  true
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an IDL interpreter version >= $idl_min_version" >&5
+$as_echo_n "checking for an IDL interpreter version >= $idl_min_version... " >&6; }
+  IDL="not found"
+  for prog in idl idl7 idl6 idl5; do
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for exec_ext in '' $ac_executable_extensions; do
+    if as_fn_executable_p "$as_dir/$prog$exec_ext"; then
+
+idl_version_ok="no"
+idl_header=`( echo | "$as_dir/$prog$exec_ext" 2>&1 )` #''
+IDL_VERSION="unknown"
+if echo $idl_header | grep -q "IDL Version"; then
+  IDL_VERSION=`echo $idl_header | grep Version | sed -e 's/IDL Version \([^ ]*\).*/\1/'` #'
+
+
+
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+
+  ax_compare_version_A=`echo "$IDL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+  ax_compare_version_B=`echo "$idl_min_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+    ax_compare_version=`echo "x$ax_compare_version_A
+x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"`
+
+
+
+    if test "$ax_compare_version" = "true" ; then
+    idl_version_ok="yes"
+      fi
+
+fi
+if test "x$idl_version_ok" = "xyes"; then
+   IDL="$as_dir/$prog$exec_ext"; break 3
+  true
+else
+
+  true
+fi
+
+    fi
+  done
+  done
+IFS=$as_save_IFS
+
+  done
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IDL" >&5
+$as_echo "$IDL" >&6; }
+fi
+
+if test "x$IDL" = "xnot found"; then
+  have_idl="no"
+  IDL=
+fi
+
+
+fi
+
+if test "x${have_idl}" != "xno"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $IDL version" >&5
+$as_echo_n "checking $IDL version... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $IDL_VERSION" >&5
+$as_echo "$IDL_VERSION" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $IDL DLM directory" >&5
+$as_echo_n "checking for $IDL DLM directory... " >&6; }
+if test "x${local_idl_dlm_path}" = "x"; then
+  idldir=`(echo 'print,"@@@"+!DLM_PATH' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@\([^:]*\)/\1/'`
+else
+  idldir="$local_idl_dlm_path"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $idldir" >&5
+$as_echo "$idldir" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IDL compiler flags" >&5
+$as_echo_n "checking IDL compiler flags... " >&6; }
+IDL_CFLAGS=`(echo 'print,"@@@"+!MAKE_DLL.CC' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@.*%X \(.*\) %C.*/\1/' | sed -e 's/\(.* \)-c\(.*\)/\1\2/' | sed -e 's/"//g'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $IDL_CFLAGS" >&5
+$as_echo "$IDL_CFLAGS" >&6; }
+
+
+
+{ $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; }
+
+
+saved_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} ${IDL_CFLAGS}"
+for ac_header in idl_export.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "idl_export.h" "ac_cv_header_idl_export_h" "$ac_includes_default"
+if test "x$ac_cv_header_idl_export_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_IDL_EXPORT_H 1
+_ACEOF
+
+else
+  have_idl="no"
+fi
+
+done
+
+CPPFLAGS=${saved_CPPFLAGS}
+
+fi
+
+  if test "x$have_idl" = "xno"; then
+    make_idlbindings="no"
+  fi
+fi
+
+if test "x$make_perlbindings" = "xyes"; then
+  echo
+  echo "*** Configuring Perl bindings"
+  echo
+
+first_perl=5.8.0
+perl_prog_list="perl perl5 \
+perl5.14 perl5.12 perl5.10 perl5.8 \
+perl5.14.0 \
+perl5.12.3 perl5.12.2 perl5.12.1 perl5.12.0 \
+perl5.10.1 perl5.10.0 \
+perl5.8.9 perl5.8.8 perl5.8.7 perl5.8.6 perl5.8.5 perl5.8.4 perl5.8.3 \
+perl5.8.2 perl5.8.1 perl5.8.0"
+
+
+# Check whether --with-perl was given.
+if test "${with_perl+set}" = set; then :
+  withval=$with_perl;
+              case "${withval}" in
+                no) have_perl="no" ;;
+                yes) user_perl= ; have_perl= ;;
+                *) user_perl="${withval}"; have_perl= ;;
+              esac
+
+else
+   user_perl=; have_perl=
+fi
+
+
+if test "x${have_perl}" != "xno"; then
+
+    if test "x$user_perl" != "x"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $user_perl version >= $first_perl" >&5
+$as_echo_n "checking whether $user_perl version >= $first_perl... " >&6; }
+
+perl_version_ok="no"
+
+perl_int=$user_perl
+# 3=$user_perl
+PERL_VERSION=`$perl_int -V::version: | sed -e "s/'//g" | sed -e "s/ \t*$//"`
+
+
+
+
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+
+  ax_compare_version_A=`echo "$PERL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+  ax_compare_version_B=`echo "$first_perl" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+    ax_compare_version=`echo "x$ax_compare_version_A
+x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"`
+
+
+
+    if test "$ax_compare_version" = "true" ; then
+    perl_version_ok="yes"
+      fi
+
+if test "x$perl_version_ok" = "xyes"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    PERL=$user_perl
+  true
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    PERL="not found"
+  true
+fi
+
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl interpreter version >= $first_perl" >&5
+$as_echo_n "checking for Perl interpreter version >= $first_perl... " >&6; }
+    PERL="not found"
+    for perl in $perl_prog_list; do
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for exec_ext in '' $ac_executable_extensions; do
+      if as_fn_executable_p "$as_dir/$perl$exec_ext"; then
+
+perl_version_ok="no"
+
+perl_int="$as_dir/$perl$exec_ext"
+# 3="$as_dir/$perl$exec_ext"
+PERL_VERSION=`$perl_int -V::version: | sed -e "s/'//g" | sed -e "s/ \t*$//"`
+
+
+
+
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+
+  ax_compare_version_A=`echo "$PERL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+  ax_compare_version_B=`echo "$first_perl" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
+
+
+    ax_compare_version=`echo "x$ax_compare_version_A
+x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"`
+
+
+
+    if test "$ax_compare_version" = "true" ; then
+    perl_version_ok="yes"
+      fi
+
+if test "x$perl_version_ok" = "xyes"; then
+   PERL="$as_dir/$perl$exec_ext"; break 3
+  true
+else
+
+  true
+fi
+
+      fi
+    done
+  done
+IFS=$as_save_IFS
+
+    done
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
+  fi
+
+  if test "x$PERL" = "xnot found"; then
+    have_perl="no"
+    PERL=
+  fi
+
+
+  fi
+
+  if test "x${have_perl}" != "xno"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking $PERL version" >&5
+$as_echo_n "checking $PERL version... " >&6; }
+
+perl_int=$PERL
+# 3=
+PERL_VERSION=`$perl_int -V::version: | sed -e "s/'//g" | sed -e "s/ \t*$//"`
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_VERSION" >&5
+$as_echo "$PERL_VERSION" >&6; }
+
+fi
+
+
+# Check whether --with-perl-dir was given.
+if test "${with_perl_dir+set}" = set; then :
+  withval=$with_perl_dir;
+    case "${withval}" in
+    vendor|site) perl_inst_type="${withval}" ;;
+    no) perl_inst_type="site" ;;
+    *) perl_inst_type="local"; local_perl_path="${withval}" ;;
+    esac
+
+else
+   perl_inst_type="site"
+fi
+
+
+if test "x${have_perl}" != "xno"; then
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Math::Complex" >&5
+$as_echo_n "checking for Math::Complex... " >&6; }
+if $PERL -MMath::Complex -e 'exit' > /dev/null 2>&1; then
+  HAVE_Math__Complex=yes
+else
+  HAVE_Math__Complex=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${HAVE_Math__Complex}" >&5
+$as_echo "${HAVE_Math__Complex}" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Module::Build" >&5
+$as_echo_n "checking for Module::Build... " >&6; }
+if $PERL -MModule::Build -e 'exit' > /dev/null 2>&1; then
+  HAVE_Module__Build=yes
+else
+  HAVE_Module__Build=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${HAVE_Module__Build}" >&5
+$as_echo "${HAVE_Module__Build}" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Test::Harness" >&5
+$as_echo_n "checking for Test::Harness... " >&6; }
+if $PERL -MTest::Harness -e 'exit' > /dev/null 2>&1; then
+  HAVE_Test__Harness=yes
+else
+  HAVE_Test__Harness=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${HAVE_Test__Harness}" >&5
+$as_echo "${HAVE_Test__Harness}" >&6; }
+
+fi
+
+if test "$HAVE_Math__Complex$HAVE_Module__Build" != "yesyes"; then
+  have_perl=no
+fi
+
+if test "x${have_perl}" != "xno"; then
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Perl module directory" >&5
+$as_echo_n "checking Perl module directory... " >&6; }
+  if test $perl_inst_type = "vendor"; then
+
+perl_int=$PERL
+# 3=
+perldir=`$perl_int -V::vendorarchexp: | sed -e "s/'//g" | sed -e "s/ \t*$//"`
+
+
+perl_int=$PERL
+# 3=
+perlmandir=`$perl_int -V::vendorman3direxp: | sed -e "s/'//g" | sed -e "s/ \t*$//"`
+
+    if test $perldir = "UNKNOWN"; then
+      perl_inst_type = "site";
+    fi
+  fi
+
+  if test $perl_inst_type = "site"; then
+
+perl_int=$PERL
+# 3=
+perldir=`$perl_int -V::sitearchexp: | sed -e "s/'//g" | sed -e "s/ \t*$//"`
+
+
+perl_int=$PERL
+# 3=
+perlmandir=`$perl_int -V::siteman3direxp: | sed -e "s/'//g" | sed -e "s/ \t*$//"`
+
+  elif test $perl_inst_type != "vendor"; then
+    perldir="${local_perl_path}"
+    perlmandir="${man3dir}"
+  fi
+
+  if test "x$perlmandir" = "xUNKNOWN"; then
+    perlmandir="${mandir}"
+  fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perldir" >&5
+$as_echo "$perldir" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking Perl man directory" >&5
+$as_echo_n "checking Perl man directory... " >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perlmandir" >&5
+$as_echo "$perlmandir" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the section 3 manual page extension" >&5
+$as_echo_n "checking for the section 3 manual page extension... " >&6; }
+PERL_MAN3EXT=`$PERL -MModule::Build -e 'print "\n>>GD ", Module::Build->new(module_name=>"conftest",dist_version=>0)->config('man3ext'), " GD<<";' | $AWK '/>>GD .* GD<</ { print $2 }'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: .$PERL_MAN3EXT" >&5
+$as_echo ".$PERL_MAN3EXT" >&6; }
+
+
+fi
+
+  if test "x$have_perl" = "xno"; then
+    make_perlbindings=no
+  fi
+fi
+
+if test "x$make_matlabbindings" = "xyes"; then
+  echo
+  echo "*** Configuring MATLAB bindings"
+  echo
+
+
+# Check whether --with-matlab was given.
+if test "${with_matlab+set}" = set; then :
+  withval=$with_matlab;
+              case "${withval}" in
+                no) have_matlab="no" ;;
+                yes) user_matlab= ; have_matlab= ;;
+                *) user_matlab="${withval}"; have_matlab= ;;
+              esac
+
+else
+   user_matlab=; have_matlab=
+fi
+
+
+if test "x${have_matlab}" != "xno"; then
+
+
+# Check whether --with-mex was given.
+if test "${with_mex+set}" = set; then :
+  withval=$with_mex;
+              case "${withval}" in
+                no) have_matlab="no" ;;
+                yes) user_mex= ;;
+                *) user_mex="${withval}";;
+              esac
+
+else
+   user_mex=
+fi
+
+
+MEX="not found"
+if test "x$user_mex" != "x"; then
+  { $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
+{ $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
+  have_matlab="no"
+  MEX=
+fi
+
+
+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; }
+
+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 }'`
+
+    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
+  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
+    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
+
+
+have_this_header=
+have_this_lib=
+
+
+# Check whether --with-libbz2 was given.
+if test "${with_libbz2+set}" = set; then :
+  withval=$with_libbz2;
+             case "${withval}" in
+               no) use_bzip2="no" ;;
+               yes) use_bzip2="yes"; bzip2_prefix= ;;
+               *) use_bzip2="yes"; bzip2_prefix="${withval}" ;;
+             esac
+
+else
+   use_bzip2="yes"; bzip2_prefix=;
+fi
+
+
+
+echo
+echo "*** Configuring bzip2 support"
+echo
+
+if test "x$no_extern" = "xyes"; then
+  use_bzip2="no";
+fi
+
+if test "x$use_bzip2" = "xyes"; then
+    saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$bzip2_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$bzip2_prefix/lib"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzReadOpen in -lbz2" >&5
+$as_echo_n "checking for BZ2_bzReadOpen in -lbz2... " >&6; }
+if ${ac_cv_lib_bz2_BZ2_bzReadOpen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbz2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char BZ2_bzReadOpen ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return BZ2_bzReadOpen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_bz2_BZ2_bzReadOpen=yes
+else
+  ac_cv_lib_bz2_BZ2_bzReadOpen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzReadOpen" >&5
+$as_echo "$ac_cv_lib_bz2_BZ2_bzReadOpen" >&6; }
+if test "x$ac_cv_lib_bz2_BZ2_bzReadOpen" = xyes; then :
+  have_this_lib=yes
+  LIBS="$LIBS -lbz2"
+
+$as_echo "#define HAVE_LIBBZ2 1" >>confdefs.h
+
+fi
+
+
+
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+  saved_cppflags=$CPPFLAGS
+  if test "x$bzip2_prefix" != "x"; then
+    CPPFLAGS="$CPPFLAGS -I$bzip2_prefix/include"
+  fi
+  for ac_header in bzlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_BZLIB_H 1
+_ACEOF
+ have_this_header=yes
+fi
+
+done
+
+  CPPFLAGS=$saved_cppflags
+fi
+
+BZIP2_CPPFLAGS=
+BZIP2_LDFLAGS=
+BZIP2_LIBS=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+  if test "x$bzip2_prefix" = "x"; then
+    BZIP2_LIBS="-lbz2"
+    BZIP2_SEARCHPATH="$PATH"
+  else
+    BZIP2_CPPFLAGS="-I$bzip2_prefix/include"
+    BZIP2_LDFLAGS="-L$bzip2_prefix/lib"
+    BZIP2_LIBS="-lbz2"
+    BZIP2_SEARCHPATH="$bzip2_prefix/bin:$PATH"
+  fi
+
+$as_echo "#define USE_BZIP2 /**/" >>confdefs.h
+
+else
+  use_bzip2="no";
+  BZIP2_SEARCHPATH="$PATH"
+fi
+
+
+
+
+
+for ac_prog in bzip2
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_bzip2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_bzip2 in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_bzip2="$path_bzip2" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $BZIP2_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_bzip2="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_bzip2=$ac_cv_path_path_bzip2
+if test -n "$path_bzip2"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_bzip2" >&5
+$as_echo "$path_bzip2" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_bzip2" && break
+done
+test -n "$path_bzip2" || path_bzip2="not found"
+
+
+if test "x$path_bzip2" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define BZIP2 "$path_bzip2"
+_ACEOF
+
+fi
+
+
+
+for ac_prog in bunzip2
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_bunzip2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_bunzip2 in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_bunzip2="$path_bunzip2" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $BZIP2_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_bunzip2="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_bunzip2=$ac_cv_path_path_bunzip2
+if test -n "$path_bunzip2"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_bunzip2" >&5
+$as_echo "$path_bunzip2" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_bunzip2" && break
+done
+test -n "$path_bunzip2" || path_bunzip2="not found"
+
+
+if test "x$path_bunzip2" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define BUNZIP2 "$path_bunzip2"
+_ACEOF
+
+fi
+
+ if test "x$use_bzip2" = "xyes"; then
+  USE_BZIP2_TRUE=
+  USE_BZIP2_FALSE='#'
+else
+  USE_BZIP2_TRUE='#'
+  USE_BZIP2_FALSE=
+fi
+
+
+if test "x$path_bzip2" != "xnot found" -a \
+  "x$path_bunzip2" != "xnot found"; then
+
+$as_echo "#define TEST_BZIP2 /**/" >>confdefs.h
+
+fi
+
+if test "x$use_bzip2" != "xno"; then
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} bzip2";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} bzip2";
+    if test -z "$PRIVATE_LIBS"; then
+      PRIVATE_LIBS="$BZIP2_LDFLAGS $BZIP2_LIBS"
+    else
+      PRIVATE_LIBS="$BZIP2_LDFLAGS $PRIVATE_LIBS $BZIP2_LIBS"
+    fi
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} bzip2";
+fi
+
+
+have_this_header=
+have_this_lib=
+
+
+# Check whether --with-libz was given.
+if test "${with_libz+set}" = set; then :
+  withval=$with_libz;
+             case "${withval}" in
+               no) use_gzip="no" ;;
+               yes) use_gzip="yes"; gzip_prefix= ;;
+               *) use_gzip="yes"; gzip_prefix="${withval}" ;;
+             esac
+
+else
+   use_gzip="yes"; gzip_prefix=;
+fi
+
+
+
+echo
+echo "*** Configuring gzip support"
+echo
+
+if test "x$no_extern" = "xyes"; then
+  use_gzip="no";
+fi
+
+if test "x$use_gzip" = "xyes"; then
+    saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$gzip_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$gzip_prefix/lib"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5
+$as_echo_n "checking for gzopen in -lz... " >&6; }
+if ${ac_cv_lib_z_gzopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gzopen ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return gzopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_gzopen=yes
+else
+  ac_cv_lib_z_gzopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5
+$as_echo "$ac_cv_lib_z_gzopen" >&6; }
+if test "x$ac_cv_lib_z_gzopen" = xyes; then :
+  have_this_lib=yes
+  LIBS="$LIBS -lz"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+
+
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+  saved_cppflags=$CPPFLAGS
+  if test "x$gzip_prefix" != "x"; then
+    CPPFLAGS="$CPPFLAGS -I$gzip_prefix/include"
+  fi
+  for ac_header in zlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+ have_this_header=yes
+fi
+
+done
+
+  CPPFLAGS=$saved_cppflags
+fi
+
+GZIP_CPPFLAGS=
+GZIP_LDFLAGS=
+GZIP_LIBS=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+  if test "x$gzip_prefix" = "x"; then
+    GZIP_LIBS="-lz"
+    GZIP_SEARCHPATH="$PATH"
+  else
+    GZIP_CPPFLAGS="-I$gzip_prefix/include"
+    GZIP_LDFLAGS="-L$gzip_prefix/lib"
+    GZIP_LIBS="-lz"
+    GZIP_SEARCHPATH="$gzip_prefix/bin:$PATH"
+  fi
+
+$as_echo "#define USE_GZIP /**/" >>confdefs.h
+
+else
+  use_gzip="no";
+  GZIP_SEARCHPATH="$PATH"
+fi
+
+
+
+
+
+for ac_prog in gzip
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_gzip+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_gzip in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_gzip="$path_gzip" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $GZIP_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_gzip="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_gzip=$ac_cv_path_path_gzip
+if test -n "$path_gzip"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_gzip" >&5
+$as_echo "$path_gzip" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_gzip" && break
+done
+test -n "$path_gzip" || path_gzip="not found"
+
+
+if test "x$path_gzip" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define GZIP "$path_gzip"
+_ACEOF
+
+fi
+
+
+
+for ac_prog in gunzip
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_gunzip+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_gunzip in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_gunzip="$path_gunzip" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $GZIP_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_gunzip="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_gunzip=$ac_cv_path_path_gunzip
+if test -n "$path_gunzip"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_gunzip" >&5
+$as_echo "$path_gunzip" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_gunzip" && break
+done
+test -n "$path_gunzip" || path_gunzip="not found"
+
+
+if test "x$path_gunzip" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define GUNZIP "$path_gunzip"
+_ACEOF
+
+fi
+
+ if test "x$use_gzip" = "xyes"; then
+  USE_GZIP_TRUE=
+  USE_GZIP_FALSE='#'
+else
+  USE_GZIP_TRUE='#'
+  USE_GZIP_FALSE=
+fi
+
+
+if test "x$path_gzip" != "xnot found" -a \
+  "x$path_gunzip" != "xnot found"; then
+
+$as_echo "#define TEST_GZIP /**/" >>confdefs.h
+
+fi
+
+if test "x$use_gzip" != "xno"; then
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} gzip";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} gzip";
+    if test -z "$PRIVATE_LIBS"; then
+      PRIVATE_LIBS="$GZIP_LDFLAGS $GZIP_LIBS"
+    else
+      PRIVATE_LIBS="$GZIP_LDFLAGS $PRIVATE_LIBS $GZIP_LIBS"
+    fi
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} gzip";
+fi
+
+
+have_this_header=
+have_this_lib=
+
+
+# Check whether --with-liblzma was given.
+if test "${with_liblzma+set}" = set; then :
+  withval=$with_liblzma;
+             case "${withval}" in
+               no) use_lzma="no" ;;
+               yes) use_lzma="yes"; lzma_prefix= ;;
+               *) use_lzma="yes"; lzma_prefix="${withval}" ;;
+             esac
+
+else
+   use_lzma="yes"; lzma_prefix=;
+fi
+
+
+
+echo
+echo "*** Configuring lzma support"
+echo
+
+if test "x$no_extern" = "xyes"; then
+  use_lzma="no";
+fi
+
+if test "x$use_lzma" = "xyes"; then
+    saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$lzma_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$lzma_prefix/lib"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_auto_decoder in -llzma" >&5
+$as_echo_n "checking for lzma_auto_decoder in -llzma... " >&6; }
+if ${ac_cv_lib_lzma_lzma_auto_decoder+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzma  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzma_auto_decoder ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return lzma_auto_decoder ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lzma_lzma_auto_decoder=yes
+else
+  ac_cv_lib_lzma_lzma_auto_decoder=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_auto_decoder" >&5
+$as_echo "$ac_cv_lib_lzma_lzma_auto_decoder" >&6; }
+if test "x$ac_cv_lib_lzma_lzma_auto_decoder" = xyes; then :
+  have_this_lib=yes
+  LIBS="$LIBS -llzma"
+
+$as_echo "#define HAVE_LIBLZMA 1" >>confdefs.h
+
+fi
+
+
+
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+  saved_cppflags=$CPPFLAGS
+  if test "x$lzma_prefix" != "x"; then
+    CPPFLAGS="$CPPFLAGS -I$lzma_prefix/include"
+  fi
+  for ac_header in lzma.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
+if test "x$ac_cv_header_lzma_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LZMA_H 1
+_ACEOF
+ have_this_header=yes
+fi
+
+done
+
+  CPPFLAGS=$saved_cppflags
+fi
+
+LZMA_CPPFLAGS=
+LZMA_LDFLAGS=
+LZMA_LIBS=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+  if test "x$lzma_prefix" = "x"; then
+    LZMA_LIBS="-llzma"
+    LZMA_SEARCHPATH="$PATH"
+  else
+    LZMA_CPPFLAGS="-I$lzma_prefix/include"
+    LZMA_LDFLAGS="-L$lzma_prefix/lib"
+    LZMA_LIBS="-llzma"
+    LZMA_SEARCHPATH="$lzma_prefix/bin:$PATH"
+  fi
+
+$as_echo "#define USE_LZMA /**/" >>confdefs.h
+
+else
+  use_lzma="no";
+  LZMA_SEARCHPATH="$PATH"
+fi
+
+
+
+
+
+for ac_prog in xz
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_xz+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_xz in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_xz="$path_xz" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LZMA_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_xz="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_xz=$ac_cv_path_path_xz
+if test -n "$path_xz"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_xz" >&5
+$as_echo "$path_xz" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_xz" && break
+done
+test -n "$path_xz" || path_xz="not found"
+
+
+if test "x$path_xz" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define XZ "$path_xz"
+_ACEOF
+
+fi
+
+
+ if test "x$use_lzma" = "xyes"; then
+  USE_LZMA_TRUE=
+  USE_LZMA_FALSE='#'
+else
+  USE_LZMA_TRUE='#'
+  USE_LZMA_FALSE=
+fi
+
+
+if test "x$path_xz" != "xnot found" -a \
+  "x$path_gunzip" != "xnot found"; then
+
+$as_echo "#define TEST_LZMA /**/" >>confdefs.h
+
+fi
+
+if test "x$use_lzma" != "xno"; then
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} lzma";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} lzma";
+    if test -z "$PRIVATE_LIBS"; then
+      PRIVATE_LIBS="$LZMA_LDFLAGS $LZMA_LIBS"
+    else
+      PRIVATE_LIBS="$LZMA_LDFLAGS $PRIVATE_LIBS $LZMA_LIBS"
+    fi
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} lzma";
+fi
+
+
+have_this_header=
+have_this_lib=
+
+
+# Check whether --with-libslim was given.
+if test "${with_libslim+set}" = set; then :
+  withval=$with_libslim;
+             case "${withval}" in
+               no) use_slim="no" ;;
+               yes) use_slim="yes"; slim_prefix= ;;
+               *) use_slim="yes"; slim_prefix="${withval}" ;;
+             esac
+
+else
+   use_slim="yes"; slim_prefix=;
+fi
+
+
+
+echo
+echo "*** Configuring slim support"
+echo
+
+if test "x$no_extern" = "xyes"; then
+  use_slim="no";
+fi
+
+if test "x$use_slim" = "xyes"; then
+    saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$slim_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$slim_prefix/lib"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for slimopen in -lslim" >&5
+$as_echo_n "checking for slimopen in -lslim... " >&6; }
+if ${ac_cv_lib_slim_slimopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lslim  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char slimopen ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return slimopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_slim_slimopen=yes
+else
+  ac_cv_lib_slim_slimopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_slim_slimopen" >&5
+$as_echo "$ac_cv_lib_slim_slimopen" >&6; }
+if test "x$ac_cv_lib_slim_slimopen" = xyes; then :
+  have_this_lib=yes
+  LIBS="$LIBS -lslim"
+
+$as_echo "#define HAVE_LIBSLIM 1" >>confdefs.h
+
+fi
+
+
+
+  for ac_func in slimdopen
+do :
+  ac_fn_c_check_func "$LINENO" "slimdopen" "ac_cv_func_slimdopen"
+if test "x$ac_cv_func_slimdopen" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SLIMDOPEN 1
+_ACEOF
+
+fi
+done
+
+
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+  saved_cppflags=$CPPFLAGS
+  if test "x$slim_prefix" != "x"; then
+    CPPFLAGS="$CPPFLAGS -I$slim_prefix/include"
+  fi
+  for ac_header in slimlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "slimlib.h" "ac_cv_header_slimlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_slimlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SLIMLIB_H 1
+_ACEOF
+ have_this_header=yes
+fi
+
+done
+
+  CPPFLAGS=$saved_cppflags
+fi
+
+SLIM_CPPFLAGS=
+SLIM_LDFLAGS=
+SLIM_LIBS=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+  if test "x$slim_prefix" = "x"; then
+    SLIM_LIBS="-lslim"
+    SLIM_SEARCHPATH="$PATH"
+  else
+    SLIM_CPPFLAGS="-I$slim_prefix/include"
+    SLIM_LDFLAGS="-L$slim_prefix/lib"
+    SLIM_LIBS="-lslim"
+    SLIM_SEARCHPATH="$slim_prefix/bin:$PATH"
+  fi
+
+$as_echo "#define USE_SLIM /**/" >>confdefs.h
+
+else
+  use_slim="no";
+  SLIM_SEARCHPATH="$PATH"
+fi
+
+
+
+
+
+for ac_prog in slim slimdata
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_slim+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_slim in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_slim="$path_slim" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SLIM_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_slim="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_slim=$ac_cv_path_path_slim
+if test -n "$path_slim"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_slim" >&5
+$as_echo "$path_slim" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_slim" && break
+done
+test -n "$path_slim" || path_slim="not found"
+
+
+if test "x$path_slim" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define SLIM "$path_slim"
+_ACEOF
+
+fi
+
+
+
+for ac_prog in unslim
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_unslim+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_unslim in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_unslim="$path_unslim" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SLIM_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_unslim="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_unslim=$ac_cv_path_path_unslim
+if test -n "$path_unslim"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_unslim" >&5
+$as_echo "$path_unslim" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_unslim" && break
+done
+test -n "$path_unslim" || path_unslim="not found"
+
+
+if test "x$path_unslim" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define UNSLIM "$path_unslim"
+_ACEOF
+
+fi
+
+ if test "x$use_slim" = "xyes"; then
+  USE_SLIM_TRUE=
+  USE_SLIM_FALSE='#'
+else
+  USE_SLIM_TRUE='#'
+  USE_SLIM_FALSE=
+fi
+
+
+if test "x$path_slim" != "xnot found" -a \
+  "x$path_unslim" != "xnot found"; then
+
+$as_echo "#define TEST_SLIM /**/" >>confdefs.h
+
+fi
+
+if test "x$use_slim" != "xno"; then
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} slim";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} slim";
+    if test -z "$PRIVATE_LIBS"; then
+      PRIVATE_LIBS="$SLIM_LDFLAGS $SLIM_LIBS"
+    else
+      PRIVATE_LIBS="$SLIM_LDFLAGS $PRIVATE_LIBS $SLIM_LIBS"
+    fi
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} slim";
+fi
+
+
+have_this_header=
+have_this_lib=
+
+
+# Check whether --with-libzzip was given.
+if test "${with_libzzip+set}" = set; then :
+  withval=$with_libzzip;
+             case "${withval}" in
+               no) use_zzip="no" ;;
+               yes) use_zzip="yes"; zzip_prefix= ;;
+               *) use_zzip="yes"; zzip_prefix="${withval}" ;;
+             esac
+
+else
+   use_zzip="yes"; zzip_prefix=;
+fi
+
+
+
+echo
+echo "*** Configuring zzip support"
+echo
+
+if test "x$no_extern" = "xyes"; then
+  use_zzip="no";
+fi
+
+if test "x$use_zzip" = "xyes"; then
+    saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$zzip_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$zzip_prefix/lib"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzip_open in -lzzip" >&5
+$as_echo_n "checking for zzip_open in -lzzip... " >&6; }
+if ${ac_cv_lib_zzip_zzip_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lzzip  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char zzip_open ();
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+return zzip_open ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_zzip_zzip_open=yes
+else
+  ac_cv_lib_zzip_zzip_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zzip_zzip_open" >&5
+$as_echo "$ac_cv_lib_zzip_zzip_open" >&6; }
+if test "x$ac_cv_lib_zzip_zzip_open" = xyes; then :
+  have_this_lib=yes
+  LIBS="$LIBS -lzzip"
+
+$as_echo "#define HAVE_LIBZZIP 1" >>confdefs.h
+
+fi
+
+
+
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+  saved_cppflags=$CPPFLAGS
+  if test "x$zzip_prefix" != "x"; then
+    CPPFLAGS="$CPPFLAGS -I$zzip_prefix/include"
+  fi
+  for ac_header in zzip/lib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zzip/lib.h" "ac_cv_header_zzip_lib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zzip_lib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZZIP_LIB_H 1
+_ACEOF
+ have_this_header=yes
+fi
+
+done
+
+  CPPFLAGS=$saved_cppflags
+fi
+
+ZZIP_CPPFLAGS=
+ZZIP_LDFLAGS=
+ZZIP_LIBS=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+  if test "x$zzip_prefix" = "x"; then
+    ZZIP_LIBS="-lzzip"
+    ZZIP_SEARCHPATH="$PATH"
+  else
+    ZZIP_CPPFLAGS="-I$zzip_prefix/include"
+    ZZIP_LDFLAGS="-L$zzip_prefix/lib"
+    ZZIP_LIBS="-lzzip"
+    ZZIP_SEARCHPATH="$zzip_prefix/bin:$PATH"
+  fi
+
+$as_echo "#define USE_ZZIP /**/" >>confdefs.h
+
+else
+  use_zzip="no";
+  ZZIP_SEARCHPATH="$PATH"
+fi
+
+
+
+
+
+for ac_prog in zip
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_zip+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_zip in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_zip="$path_zip" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $ZZIP_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_zip="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_zip=$ac_cv_path_path_zip
+if test -n "$path_zip"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_zip" >&5
+$as_echo "$path_zip" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_zip" && break
+done
+test -n "$path_zip" || path_zip="not found"
+
+
+if test "x$path_zip" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define ZIP "$path_zip"
+_ACEOF
+
+fi
+
+
+
+for ac_prog in unzip
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_path_unzip+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $path_unzip in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_path_unzip="$path_unzip" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $ZZIP_SEARCHPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_path_unzip="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+path_unzip=$ac_cv_path_path_unzip
+if test -n "$path_unzip"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_unzip" >&5
+$as_echo "$path_unzip" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$path_unzip" && break
+done
+test -n "$path_unzip" || path_unzip="not found"
+
+
+if test "x$path_unzip" != "xnot found"; then
+
+cat >>confdefs.h <<_ACEOF
+#define UNZIP "$path_unzip"
+_ACEOF
+
+fi
+
+ if test "x$use_zzip" = "xyes"; then
+  USE_ZZIP_TRUE=
+  USE_ZZIP_FALSE='#'
+else
+  USE_ZZIP_TRUE='#'
+  USE_ZZIP_FALSE=
+fi
+
+
+if test "x$path_zip" != "xnot found" -a \
+  "x$path_unzip" != "xnot found"; then
+
+$as_echo "#define TEST_ZZIP /**/" >>confdefs.h
+
+fi
+
+if test "x$use_zzip" != "xno"; then
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} zzip";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} zzip";
+    if test -z "$PRIVATE_LIBS"; then
+      PRIVATE_LIBS="$ZZIP_LDFLAGS $ZZIP_LIBS"
+    else
+      PRIVATE_LIBS="$ZZIP_LDFLAGS $PRIVATE_LIBS $ZZIP_LIBS"
+    fi
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} zzip";
+fi
+
+
+# Check whether --enable-zzslim was given.
+if test "${enable_zzslim+set}" = set; then :
+  enableval=$enable_zzslim;
+               case "${enableval}" in
+                 no) zzslim_override="no" ;;
+                 *) zzslim_override="yes" ;;
+               esac
+
+else
+   zzslim_override="auto"
+fi
+
+
+
+echo
+echo "*** Configuring zzslim support "
+echo
+if test $zzslim_override = "no"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzslim support" >&5
+$as_echo_n "checking for zzslim support... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (forced)" >&5
+$as_echo "no (forced)" >&6; }
+  use_zzslim=no
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for slim support" >&5
+$as_echo_n "checking for slim support... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_slim" >&5
+$as_echo "$use_slim" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzip support" >&5
+$as_echo_n "checking for zzip support... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_zzip" >&5
+$as_echo "$use_zzip" >&6; }
+  if test "$use_slim$use_zzip" == "yesyes"; then
+    if test $zzslim_override = "yes"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzslim support" >&5
+$as_echo_n "checking for zzslim support... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (forced)" >&5
+$as_echo "yes (forced)" >&6; }
+      use_zzslim=yes
+    elif test "x$CXX" = "x"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzslim support" >&5
+$as_echo_n "checking for zzslim support... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (no C++ compiler available for configure test)" >&5
+$as_echo "no (no C++ compiler available for configure test)" >&6; }
+      use_zzslim=no
+    else
+                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lslim contains zzip capability" >&5
+$as_echo_n "checking whether -lslim contains zzip capability... " >&6; }
+      ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+      saved_ldflags=$LDFLAGS
+      saved_libs=$LIBS
+      LDFLAGS="$SLIM_LDFLAGS $LDFLAGS"
+      LIBS="$SLIM_LIBS $LIBS"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                       struct zzip_file;
+                       typedef struct zzip_file ZZIP_FILE;
+                       class ibitstream {
+                       public:
+                       ibitstream(ZZIP_FILE *file, int buffersize);
+                     };
+
+#ifdef F77_DUMMY_MAIN
+
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+
+#endif
+int
+main ()
+{
+
+                      ZZIP_FILE *file;
+                      ibitstream foo(file, 0);
+
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  slim_zzip="yes"
+else
+  slim_zzip="no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $slim_zzip" >&5
+$as_echo "$slim_zzip" >&6; }
+      LDFLAGS=$saved_ldflags
+      LIBS=$saved_libs
+      ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+      use_zzslim=$slim_zzip
+    fi
+  else
+    use_zzslim="no"
+  fi
+fi
+
+if test "x$use_zzslim" != "xno"; then
+
+$as_echo "#define USE_ZZSLIM /**/" >>confdefs.h
+
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} zzslim";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} zzslim";
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} zzslim";
+fi
+
+if test ! -z "${LIBS}"; then
+  PRIVATE_LIBS="${LIBS} ${PRIVATE_LIBS}"
+fi
+
+
+cat <<EOF > conftest.sh
+prefix=$prefix
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=\$prefix
+exec_prefix=$exec_prefix
+datarootdir=$datarootdir
+PACKAGE_TARNAME=$PACKAGE_TARNAME
+echo $docdir
+EOF
+absolute_docdir=`$SHELL conftest.sh`
+
+
+echo
+echo "*** Writing configure output"
+echo
+ac_config_files="$ac_config_files Makefile"
+
+ac_config_files="$ac_config_files bindings/Makefile"
+
+ac_config_files="$ac_config_files bindings/cxx/Makefile"
+
+ac_config_files="$ac_config_files bindings/cxx/test/Makefile"
+
+ac_config_files="$ac_config_files bindings/f77/Makefile"
+
+ac_config_files="$ac_config_files bindings/f77/test/Makefile"
+
+ac_config_files="$ac_config_files bindings/f77/test/test_getdata.f"
+
+ac_config_files="$ac_config_files bindings/idl/Makefile"
+
+ac_config_files="$ac_config_files bindings/idl/makedlm.sh"
+
+ac_config_files="$ac_config_files bindings/idl/test/Makefile"
+
+ac_config_files="$ac_config_files bindings/matlab/Makefile"
+
+ac_config_files="$ac_config_files bindings/matlab/make_contents.sh"
+
+ac_config_files="$ac_config_files bindings/matlab/test/Makefile"
+
+ac_config_files="$ac_config_files bindings/perl/Makefile"
+
+ac_config_files="$ac_config_files bindings/perl/Build.PL"
+
+ac_config_files="$ac_config_files bindings/python/Makefile"
+
+ac_config_files="$ac_config_files bindings/python/test/Makefile"
+
+ac_config_files="$ac_config_files doc/Makefile"
+
+ac_config_files="$ac_config_files man/Makefile"
+
+ac_config_files="$ac_config_files man/gd_alter_encoding.3"
+
+ac_config_files="$ac_config_files man/gd_alter_endianness.3"
+
+ac_config_files="$ac_config_files man/gd_alter_frameoffset.3"
+
+ac_config_files="$ac_config_files src/Makefile"
+
+ac_config_files="$ac_config_files src/getdata.ah:src/getdata.h.in"
+
+ac_config_headers="$ac_config_headers src/getdata.h:src/getdata.ah"
+
+ac_config_files="$ac_config_files src/getdata.pc"
+
+ac_config_files="$ac_config_files test/Makefile"
+
+ac_config_files="$ac_config_files util/Makefile"
+
+
+ if test "x$enable_debug" == "xyes"; then
+  GETDATA_DEBUG_TRUE=
+  GETDATA_DEBUG_FALSE='#'
+else
+  GETDATA_DEBUG_TRUE='#'
+  GETDATA_DEBUG_FALSE=
+fi
+
+ if test "x$gd_cv_prog_cc_wall" == "xyes"; then
+  CC_WALL_TRUE=
+  CC_WALL_FALSE='#'
+else
+  CC_WALL_TRUE='#'
+  CC_WALL_FALSE=
+fi
+
+ if test "x$gd_cv_prog_cxx_wall" == "xyes"; then
+  CXX_WALL_TRUE=
+  CXX_WALL_FALSE='#'
+else
+  CXX_WALL_TRUE='#'
+  CXX_WALL_FALSE=
+fi
+
+ if test "x$gd_cv_prog_f77_wall" == "xyes"; then
+  F77_WALL_TRUE=
+  F77_WALL_FALSE='#'
+else
+  F77_WALL_TRUE='#'
+  F77_WALL_FALSE=
+fi
+
+ if test "x$gd_cv_prog_fc_wall" == "xyes"; then
+  FC_WALL_TRUE=
+  FC_WALL_FALSE='#'
+else
+  FC_WALL_TRUE='#'
+  FC_WALL_FALSE=
+fi
+
+ if test "x$gd_cv_prog_cc_wextra" == "xyes"; then
+  CC_WEXTRA_TRUE=
+  CC_WEXTRA_FALSE='#'
+else
+  CC_WEXTRA_TRUE='#'
+  CC_WEXTRA_FALSE=
+fi
+
+ if test "x$gd_cv_prog_cxx_wextra" == "xyes"; then
+  CXX_WEXTRA_TRUE=
+  CXX_WEXTRA_FALSE='#'
+else
+  CXX_WEXTRA_TRUE='#'
+  CXX_WEXTRA_FALSE=
+fi
+
+ if test "x$gd_cv_prog_f77_wextra" == "xyes"; then
+  F77_WEXTRA_TRUE=
+  F77_WEXTRA_FALSE='#'
+else
+  F77_WEXTRA_TRUE='#'
+  F77_WEXTRA_FALSE=
+fi
+
+ if test "x$gd_cv_prog_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='#'
+else
+  FC_WEXTRA_TRUE='#'
+  FC_WEXTRA_FALSE=
+fi
+
+ if test "x$gd_cv_f77_compiler_intel" == "xyes"; then
+  INTEL_F77_COMPILER_TRUE=
+  INTEL_F77_COMPILER_FALSE='#'
+else
+  INTEL_F77_COMPILER_TRUE='#'
+  INTEL_F77_COMPILER_FALSE=
+fi
+
+ if test "x$gd_cv_fc_compiler_intel" == "xyes"; then
+  INTEL_FC_COMPILER_TRUE=
+  INTEL_FC_COMPILER_FALSE='#'
+else
+  INTEL_FC_COMPILER_TRUE='#'
+  INTEL_FC_COMPILER_FALSE=
+fi
+
+ if test "x$include_legacy_api" != "xno"; then
+  INCLUDE_LEGACY_API_TRUE=
+  INCLUDE_LEGACY_API_FALSE='#'
+else
+  INCLUDE_LEGACY_API_TRUE='#'
+  INCLUDE_LEGACY_API_FALSE=
+fi
+
+ if test "x$make_cxxbindings" = "xyes"; then
+  MAKE_CXXBINDINGS_TRUE=
+  MAKE_CXXBINDINGS_FALSE='#'
+else
+  MAKE_CXXBINDINGS_TRUE='#'
+  MAKE_CXXBINDINGS_FALSE=
+fi
+
+ if test "x$make_f77bindings" != "xno"; then
+  MAKE_F77BINDINGS_TRUE=
+  MAKE_F77BINDINGS_FALSE='#'
+else
+  MAKE_F77BINDINGS_TRUE='#'
+  MAKE_F77BINDINGS_FALSE=
+fi
+
+ if test "x$make_f95bindings" = "xyes"; then
+  MAKE_F95BINDINGS_TRUE=
+  MAKE_F95BINDINGS_FALSE='#'
+else
+  MAKE_F95BINDINGS_TRUE='#'
+  MAKE_F95BINDINGS_FALSE=
+fi
+
+ if test "x$make_pybindings" = "xyes"; then
+  MAKE_PYBINDINGS_TRUE=
+  MAKE_PYBINDINGS_FALSE='#'
+else
+  MAKE_PYBINDINGS_TRUE='#'
+  MAKE_PYBINDINGS_FALSE=
+fi
+
+ if test "x$make_idlbindings" = "xyes"; then
+  MAKE_IDLBINDINGS_TRUE=
+  MAKE_IDLBINDINGS_FALSE='#'
+else
+  MAKE_IDLBINDINGS_TRUE='#'
+  MAKE_IDLBINDINGS_FALSE=
+fi
+
+ if test "x$make_perlbindings" = "xyes"; then
+  MAKE_PERLBINDINGS_TRUE=
+  MAKE_PERLBINDINGS_FALSE='#'
+else
+  MAKE_PERLBINDINGS_TRUE='#'
+  MAKE_PERLBINDINGS_FALSE=
+fi
+
+ if test "x$make_matlabbindings" = "xyes"; then
+  MAKE_MATLABBINDINGS_TRUE=
+  MAKE_MATLABBINDINGS_FALSE='#'
+else
+  MAKE_MATLABBINDINGS_TRUE='#'
+  MAKE_MATLABBINDINGS_FALSE=
+fi
+
+ if test "x$use_modules" != "xno"; then
+  USE_MODULES_TRUE=
+  USE_MODULES_FALSE='#'
+else
+  USE_MODULES_TRUE='#'
+  USE_MODULES_FALSE=
+fi
+
+ if test "x$NO_DLOPEN_TESTS" = "x0"; then
+  TEST_PYTHON_TRUE=
+  TEST_PYTHON_FALSE='#'
+else
+  TEST_PYTHON_TRUE='#'
+  TEST_PYTHON_FALSE=
+fi
+
+ if test "x$NO_DLOPEN_TESTS" = "x0"; then
+  TEST_IDL_TRUE=
+  TEST_IDL_FALSE='#'
+else
+  TEST_IDL_TRUE='#'
+  TEST_IDL_FALSE=
+fi
+
+ if test "x$HAVE_Test__Harness" = "xyes"; then
+  TEST_PERL_TRUE=
+  TEST_PERL_FALSE='#'
+else
+  TEST_PERL_TRUE='#'
+  TEST_PERL_FALSE=
+fi
+
+ if test "x$NO_DLOPEN_TESTS" = "x0"; then
+  TEST_MATLAB_TRUE=
+  TEST_MATLAB_FALSE='#'
+else
+  TEST_MATLAB_TRUE='#'
+  TEST_MATLAB_FALSE=
+fi
+
+ if test "x$DIFF" != "x"; then
+  HAVE_DIFF_TRUE=
+  HAVE_DIFF_FALSE='#'
+else
+  HAVE_DIFF_TRUE='#'
+  HAVE_DIFF_FALSE=
+fi
+
+ if test "x$use_zzslim" = "xyes"; then
+  USE_ZZSLIM_TRUE=
+  USE_ZZSLIM_FALSE='#'
+else
+  USE_ZZSLIM_TRUE='#'
+  USE_ZZSLIM_FALSE=
+fi
+
+ if false; then
+  GD_EXTERNAL_TRUE=
+  GD_EXTERNAL_FALSE='#'
+else
+  GD_EXTERNAL_TRUE='#'
+  GD_EXTERNAL_FALSE=
+fi
+
+
+
+LDFLAGS="${LDFLAGS}${NO_UNDEFINED}"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+if test -z "${USE_BZIP2_TRUE}" && test -z "${USE_BZIP2_FALSE}"; then
+  as_fn_error $? "conditional \"USE_BZIP2\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_GZIP_TRUE}" && test -z "${USE_GZIP_FALSE}"; then
+  as_fn_error $? "conditional \"USE_GZIP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_LZMA_TRUE}" && test -z "${USE_LZMA_FALSE}"; then
+  as_fn_error $? "conditional \"USE_LZMA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_SLIM_TRUE}" && test -z "${USE_SLIM_FALSE}"; then
+  as_fn_error $? "conditional \"USE_SLIM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_ZZIP_TRUE}" && test -z "${USE_ZZIP_FALSE}"; then
+  as_fn_error $? "conditional \"USE_ZZIP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GETDATA_DEBUG_TRUE}" && test -z "${GETDATA_DEBUG_FALSE}"; then
+  as_fn_error $? "conditional \"GETDATA_DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${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.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INTEL_F77_COMPILER_TRUE}" && test -z "${INTEL_F77_COMPILER_FALSE}"; then
+  as_fn_error $? "conditional \"INTEL_F77_COMPILER\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INTEL_FC_COMPILER_TRUE}" && test -z "${INTEL_FC_COMPILER_FALSE}"; then
+  as_fn_error $? "conditional \"INTEL_FC_COMPILER\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INCLUDE_LEGACY_API_TRUE}" && test -z "${INCLUDE_LEGACY_API_FALSE}"; then
+  as_fn_error $? "conditional \"INCLUDE_LEGACY_API\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MAKE_CXXBINDINGS_TRUE}" && test -z "${MAKE_CXXBINDINGS_FALSE}"; then
+  as_fn_error $? "conditional \"MAKE_CXXBINDINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MAKE_F77BINDINGS_TRUE}" && test -z "${MAKE_F77BINDINGS_FALSE}"; then
+  as_fn_error $? "conditional \"MAKE_F77BINDINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MAKE_F95BINDINGS_TRUE}" && test -z "${MAKE_F95BINDINGS_FALSE}"; then
+  as_fn_error $? "conditional \"MAKE_F95BINDINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MAKE_PYBINDINGS_TRUE}" && test -z "${MAKE_PYBINDINGS_FALSE}"; then
+  as_fn_error $? "conditional \"MAKE_PYBINDINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MAKE_IDLBINDINGS_TRUE}" && test -z "${MAKE_IDLBINDINGS_FALSE}"; then
+  as_fn_error $? "conditional \"MAKE_IDLBINDINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MAKE_PERLBINDINGS_TRUE}" && test -z "${MAKE_PERLBINDINGS_FALSE}"; then
+  as_fn_error $? "conditional \"MAKE_PERLBINDINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MAKE_MATLABBINDINGS_TRUE}" && test -z "${MAKE_MATLABBINDINGS_FALSE}"; then
+  as_fn_error $? "conditional \"MAKE_MATLABBINDINGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_MODULES_TRUE}" && test -z "${USE_MODULES_FALSE}"; then
+  as_fn_error $? "conditional \"USE_MODULES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${TEST_PYTHON_TRUE}" && test -z "${TEST_PYTHON_FALSE}"; then
+  as_fn_error $? "conditional \"TEST_PYTHON\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${TEST_IDL_TRUE}" && test -z "${TEST_IDL_FALSE}"; then
+  as_fn_error $? "conditional \"TEST_IDL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${TEST_PERL_TRUE}" && test -z "${TEST_PERL_FALSE}"; then
+  as_fn_error $? "conditional \"TEST_PERL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${TEST_MATLAB_TRUE}" && test -z "${TEST_MATLAB_FALSE}"; then
+  as_fn_error $? "conditional \"TEST_MATLAB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_DIFF_TRUE}" && test -z "${HAVE_DIFF_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_DIFF\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_ZZSLIM_TRUE}" && test -z "${USE_ZZSLIM_FALSE}"; then
+  as_fn_error $? "conditional \"USE_ZZSLIM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GD_EXTERNAL_TRUE}" && test -z "${GD_EXTERNAL_FALSE}"; then
+  as_fn_error $? "conditional \"GD_EXTERNAL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by GetData $as_me 0.8.9, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <getdata-devel at lists.sourceforge.net>.
+GetData home page: <http://getdata.sourceforge.net/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+GetData config.status 0.8.9
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+LD_F77='`$ECHO "$LD_F77" | $SED "$delay_single_quote_subst"`'
+LD_FC='`$ECHO "$LD_FC" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_F77='`$ECHO "$reload_flag_F77" | $SED "$delay_single_quote_subst"`'
+reload_flag_FC='`$ECHO "$reload_flag_FC" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_F77='`$ECHO "$reload_cmds_F77" | $SED "$delay_single_quote_subst"`'
+reload_cmds_FC='`$ECHO "$reload_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_F77='`$ECHO "$old_archive_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_FC='`$ECHO "$old_archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_F77='`$ECHO "$compiler_F77" | $SED "$delay_single_quote_subst"`'
+compiler_FC='`$ECHO "$compiler_FC" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_F77='`$ECHO "$GCC_F77" | $SED "$delay_single_quote_subst"`'
+GCC_FC='`$ECHO "$GCC_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_F77='`$ECHO "$lt_prog_compiler_no_builtin_flag_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_FC='`$ECHO "$lt_prog_compiler_no_builtin_flag_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_F77='`$ECHO "$lt_prog_compiler_pic_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_FC='`$ECHO "$lt_prog_compiler_pic_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_F77='`$ECHO "$lt_prog_compiler_wl_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_FC='`$ECHO "$lt_prog_compiler_wl_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_F77='`$ECHO "$lt_prog_compiler_static_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_FC='`$ECHO "$lt_prog_compiler_static_FC" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_F77='`$ECHO "$lt_cv_prog_compiler_c_o_F77" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_FC='`$ECHO "$lt_cv_prog_compiler_c_o_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_F77='`$ECHO "$archive_cmds_need_lc_F77" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_FC='`$ECHO "$archive_cmds_need_lc_FC" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_F77='`$ECHO "$enable_shared_with_static_runtimes_F77" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_FC='`$ECHO "$enable_shared_with_static_runtimes_FC" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_F77='`$ECHO "$export_dynamic_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_FC='`$ECHO "$export_dynamic_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_F77='`$ECHO "$whole_archive_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_FC='`$ECHO "$whole_archive_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_F77='`$ECHO "$compiler_needs_object_F77" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_FC='`$ECHO "$compiler_needs_object_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_F77='`$ECHO "$old_archive_from_new_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_FC='`$ECHO "$old_archive_from_new_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_F77='`$ECHO "$old_archive_from_expsyms_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_FC='`$ECHO "$old_archive_from_expsyms_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_F77='`$ECHO "$archive_cmds_F77" | $SED "$delay_single_quote_subst"`'
+archive_cmds_FC='`$ECHO "$archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_F77='`$ECHO "$archive_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_FC='`$ECHO "$archive_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_F77='`$ECHO "$module_cmds_F77" | $SED "$delay_single_quote_subst"`'
+module_cmds_FC='`$ECHO "$module_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_F77='`$ECHO "$module_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_FC='`$ECHO "$module_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_F77='`$ECHO "$with_gnu_ld_F77" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_FC='`$ECHO "$with_gnu_ld_FC" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_F77='`$ECHO "$allow_undefined_flag_F77" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_FC='`$ECHO "$allow_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_F77='`$ECHO "$no_undefined_flag_F77" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_FC='`$ECHO "$no_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_F77='`$ECHO "$hardcode_libdir_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_FC='`$ECHO "$hardcode_libdir_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_F77='`$ECHO "$hardcode_libdir_separator_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_FC='`$ECHO "$hardcode_libdir_separator_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_F77='`$ECHO "$hardcode_direct_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_FC='`$ECHO "$hardcode_direct_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_F77='`$ECHO "$hardcode_direct_absolute_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_FC='`$ECHO "$hardcode_direct_absolute_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_F77='`$ECHO "$hardcode_minus_L_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_FC='`$ECHO "$hardcode_minus_L_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_F77='`$ECHO "$hardcode_shlibpath_var_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_FC='`$ECHO "$hardcode_shlibpath_var_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_F77='`$ECHO "$hardcode_automatic_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_FC='`$ECHO "$hardcode_automatic_FC" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_F77='`$ECHO "$inherit_rpath_F77" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_FC='`$ECHO "$inherit_rpath_FC" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_F77='`$ECHO "$link_all_deplibs_F77" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_FC='`$ECHO "$link_all_deplibs_FC" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_F77='`$ECHO "$always_export_symbols_F77" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_FC='`$ECHO "$always_export_symbols_FC" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_F77='`$ECHO "$export_symbols_cmds_F77" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_FC='`$ECHO "$export_symbols_cmds_FC" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_F77='`$ECHO "$exclude_expsyms_F77" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_FC='`$ECHO "$exclude_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_F77='`$ECHO "$include_expsyms_F77" | $SED "$delay_single_quote_subst"`'
+include_expsyms_FC='`$ECHO "$include_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_F77='`$ECHO "$prelink_cmds_F77" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_FC='`$ECHO "$prelink_cmds_FC" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_F77='`$ECHO "$postlink_cmds_F77" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_FC='`$ECHO "$postlink_cmds_FC" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_F77='`$ECHO "$file_list_spec_F77" | $SED "$delay_single_quote_subst"`'
+file_list_spec_FC='`$ECHO "$file_list_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_F77='`$ECHO "$hardcode_action_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_action_FC='`$ECHO "$hardcode_action_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_F77='`$ECHO "$compiler_lib_search_dirs_F77" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_FC='`$ECHO "$compiler_lib_search_dirs_FC" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_F77='`$ECHO "$predep_objects_F77" | $SED "$delay_single_quote_subst"`'
+predep_objects_FC='`$ECHO "$predep_objects_FC" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_F77='`$ECHO "$postdep_objects_F77" | $SED "$delay_single_quote_subst"`'
+postdep_objects_FC='`$ECHO "$postdep_objects_FC" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_F77='`$ECHO "$predeps_F77" | $SED "$delay_single_quote_subst"`'
+predeps_FC='`$ECHO "$predeps_FC" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_F77='`$ECHO "$postdeps_F77" | $SED "$delay_single_quote_subst"`'
+postdeps_FC='`$ECHO "$postdeps_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_F77='`$ECHO "$compiler_lib_search_path_F77" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_FC='`$ECHO "$compiler_lib_search_path_FC" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
+nm_file_list_spec \
+lt_cv_truncate_bin \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+LD_F77 \
+LD_FC \
+reload_flag_CXX \
+reload_flag_F77 \
+reload_flag_FC \
+compiler_CXX \
+compiler_F77 \
+compiler_FC \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_no_builtin_flag_F77 \
+lt_prog_compiler_no_builtin_flag_FC \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_pic_F77 \
+lt_prog_compiler_pic_FC \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_wl_F77 \
+lt_prog_compiler_wl_FC \
+lt_prog_compiler_static_CXX \
+lt_prog_compiler_static_F77 \
+lt_prog_compiler_static_FC \
+lt_cv_prog_compiler_c_o_CXX \
+lt_cv_prog_compiler_c_o_F77 \
+lt_cv_prog_compiler_c_o_FC \
+export_dynamic_flag_spec_CXX \
+export_dynamic_flag_spec_F77 \
+export_dynamic_flag_spec_FC \
+whole_archive_flag_spec_CXX \
+whole_archive_flag_spec_F77 \
+whole_archive_flag_spec_FC \
+compiler_needs_object_CXX \
+compiler_needs_object_F77 \
+compiler_needs_object_FC \
+with_gnu_ld_CXX \
+with_gnu_ld_F77 \
+with_gnu_ld_FC \
+allow_undefined_flag_CXX \
+allow_undefined_flag_F77 \
+allow_undefined_flag_FC \
+no_undefined_flag_CXX \
+no_undefined_flag_F77 \
+no_undefined_flag_FC \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_F77 \
+hardcode_libdir_flag_spec_FC \
+hardcode_libdir_separator_CXX \
+hardcode_libdir_separator_F77 \
+hardcode_libdir_separator_FC \
+exclude_expsyms_CXX \
+exclude_expsyms_F77 \
+exclude_expsyms_FC \
+include_expsyms_CXX \
+include_expsyms_F77 \
+include_expsyms_FC \
+file_list_spec_CXX \
+file_list_spec_F77 \
+file_list_spec_FC \
+compiler_lib_search_dirs_CXX \
+compiler_lib_search_dirs_F77 \
+compiler_lib_search_dirs_FC \
+predep_objects_CXX \
+predep_objects_F77 \
+predep_objects_FC \
+postdep_objects_CXX \
+postdep_objects_F77 \
+postdep_objects_FC \
+predeps_CXX \
+predeps_F77 \
+predeps_FC \
+postdeps_CXX \
+postdeps_F77 \
+postdeps_FC \
+compiler_lib_search_path_CXX \
+compiler_lib_search_path_F77 \
+compiler_lib_search_path_FC; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path \
+reload_cmds_CXX \
+reload_cmds_F77 \
+reload_cmds_FC \
+old_archive_cmds_CXX \
+old_archive_cmds_F77 \
+old_archive_cmds_FC \
+old_archive_from_new_cmds_CXX \
+old_archive_from_new_cmds_F77 \
+old_archive_from_new_cmds_FC \
+old_archive_from_expsyms_cmds_CXX \
+old_archive_from_expsyms_cmds_F77 \
+old_archive_from_expsyms_cmds_FC \
+archive_cmds_CXX \
+archive_cmds_F77 \
+archive_cmds_FC \
+archive_expsym_cmds_CXX \
+archive_expsym_cmds_F77 \
+archive_expsym_cmds_FC \
+module_cmds_CXX \
+module_cmds_F77 \
+module_cmds_FC \
+module_expsym_cmds_CXX \
+module_expsym_cmds_F77 \
+module_expsym_cmds_FC \
+export_symbols_cmds_CXX \
+export_symbols_cmds_F77 \
+export_symbols_cmds_FC \
+prelink_cmds_CXX \
+prelink_cmds_F77 \
+prelink_cmds_FC \
+postlink_cmds_CXX \
+postlink_cmds_F77 \
+postlink_cmds_FC; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+
+
+
+ac_aux_dir='$ac_aux_dir'
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "src/gd_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/gd_config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "bindings/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Makefile" ;;
+    "bindings/cxx/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/cxx/Makefile" ;;
+    "bindings/cxx/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/cxx/test/Makefile" ;;
+    "bindings/f77/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/f77/Makefile" ;;
+    "bindings/f77/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/f77/test/Makefile" ;;
+    "bindings/f77/test/test_getdata.f") CONFIG_FILES="$CONFIG_FILES bindings/f77/test/test_getdata.f" ;;
+    "bindings/idl/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/idl/Makefile" ;;
+    "bindings/idl/makedlm.sh") CONFIG_FILES="$CONFIG_FILES bindings/idl/makedlm.sh" ;;
+    "bindings/idl/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/idl/test/Makefile" ;;
+    "bindings/matlab/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/matlab/Makefile" ;;
+    "bindings/matlab/make_contents.sh") CONFIG_FILES="$CONFIG_FILES bindings/matlab/make_contents.sh" ;;
+    "bindings/matlab/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/matlab/test/Makefile" ;;
+    "bindings/perl/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/perl/Makefile" ;;
+    "bindings/perl/Build.PL") CONFIG_FILES="$CONFIG_FILES bindings/perl/Build.PL" ;;
+    "bindings/python/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/Makefile" ;;
+    "bindings/python/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/test/Makefile" ;;
+    "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+    "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+    "man/gd_alter_encoding.3") CONFIG_FILES="$CONFIG_FILES man/gd_alter_encoding.3" ;;
+    "man/gd_alter_endianness.3") CONFIG_FILES="$CONFIG_FILES man/gd_alter_endianness.3" ;;
+    "man/gd_alter_frameoffset.3") CONFIG_FILES="$CONFIG_FILES man/gd_alter_frameoffset.3" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/getdata.ah") CONFIG_FILES="$CONFIG_FILES src/getdata.ah:src/getdata.h.in" ;;
+    "src/getdata.h") CONFIG_HEADERS="$CONFIG_HEADERS src/getdata.h:src/getdata.ah" ;;
+    "src/getdata.pc") CONFIG_FILES="$CONFIG_FILES src/getdata.pc" ;;
+    "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
+    "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "$am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options that allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}"; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile=${ofile}T
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags='CXX F77 FC '
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and where our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: F77
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_F77
+reload_cmds=$lt_reload_cmds_F77
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_F77
+
+# A language specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_F77
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_F77
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_F77
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_F77
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_F77
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_F77
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_F77
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_F77
+postdep_objects=$lt_postdep_objects_F77
+predeps=$lt_predeps_F77
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# ### END LIBTOOL TAG CONFIG: F77
+_LT_EOF
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: FC
+
+# The linker used to build libraries.
+LD=$lt_LD_FC
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_FC
+reload_cmds=$lt_reload_cmds_FC
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_FC
+
+# A language specific compiler.
+CC=$lt_compiler_FC
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_FC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_FC
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_FC
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_FC
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_FC
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_FC
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_FC
+archive_expsym_cmds=$lt_archive_expsym_cmds_FC
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_FC
+module_expsym_cmds=$lt_module_expsym_cmds_FC
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_FC
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_FC
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_FC
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_FC
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_FC
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_FC
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_FC
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_FC
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_FC
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_FC
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_FC
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_FC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_FC
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_FC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_FC
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_FC
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_FC
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_FC
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_FC
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_FC
+postdep_objects=$lt_postdep_objects_FC
+predeps=$lt_predeps_FC
+postdeps=$lt_postdeps_FC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_FC
+
+# ### END LIBTOOL TAG CONFIG: FC
+_LT_EOF
+
+ ;;
+    "src/getdata.h":H) chmod a-w src/getdata.h ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+if test "x$make_cxxbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} C++"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} C++"
+fi
+
+if test "x$make_f77bindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} Fortran-77"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} Fortran-77"
+fi
+
+if test "x$make_f95bindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} Fortran-95"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} Fortran-95"
+fi
+
+if test "x$make_idlbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} IDL"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} IDL"
+fi
+
+if test "x$make_matlabbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} MATLAB"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} MATLAB"
+fi
+
+if test "x$make_perlbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} Perl"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} Perl"
+fi
+
+if test "x$make_pybindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} Python"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} Python"
+fi
+
+if test "x$BINDINGS_BUILT" = "x"; then
+  BINDINGS_BUILT=" none"
+fi
+
+if test "x$BINDINGS_LEFT" = "x"; then
+  BINDINGS_LEFT=" none"
+fi
+
+if test "x$ENCODINGS_MODS" = "x"; then
+  ENCODINGS_MODS=" none"
+fi
+
+if test "x$ENCODINGS_LEFT" = "x"; then
+  ENCODINGS_LEFT=" none"
+fi
+
+if test "x$enable_debug$enable_assert" = "xnoyes"; then
+  enable_debug="assert only"
+fi
+
+echo
+echo "Configuration summary: "
+echo "  ANSI C compatibility mode:     ${disable_c99}"
+echo "  Legacy API:                    ${include_legacy_api}"
+echo "  Verbose debugging:             ${enable_debug}"
+echo "  Fast unaligned memory access:  ${gd_unaligned_ok}"
+echo "  Use modules:                   ${use_modules}"
+if test "x${use_modules}" != "xno"; then
+  echo "  Thread-safe dynamic loading:   ${use_pthread}"
+fi
+echo
+echo "  Supported internal encodings: ${ENCODINGS_BUILT}"
+if test "x${use_modules}" != "xno"; then
+  echo "  Supported external encodings: ${ENCODINGS_MODS}"
+fi
+echo "  Unsupported encodings:        ${ENCODINGS_LEFT}"
+echo
+echo "  Bindings built:               ${BINDINGS_BUILT}"
+echo "  Bindings not built:           ${BINDINGS_LEFT}"
+if test "x$make_pybindings" != "xno"; then
+  echo "  NumPy support in Python:       ${have_numpy}"
+fi
+echo
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..f3a9ca7
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,1134 @@
+dnl Copyright (C) 2008-2015 D. V. Wiebe
+dnl
+dnllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+dnl
+
+m4_include([m4/version.m4])
+
+AC_INIT([GetData],[getdata_version],[getdata-devel at lists.sourceforge.net],,
+        [http://getdata.sourceforge.net/])
+
+AC_COPYRIGHT(
+[Parts of this program are copyright (C) 2008-2015 D. V. Wiebe.
+
+These parts may be redistributed and/or modified under the terms of the GNU
+Lesser General Public License as published by the Free Software Foundation;
+either version 2.1 of the License, or (at your option) any later version.
+See the file COPYING for details.]
+)
+
+AC_DEFINE([GETDATA_MAJOR], [getdata_major], [ The major version number ])
+AC_DEFINE([GETDATA_MINOR], [getdata_minor], [ The minor version number ])
+AC_DEFINE([GETDATA_REVISION], [getdata_revision], [ The revision number ])
+AC_DEFINE([GETDATA_VERSION_SUFFIX], ["getdata_extra"],
+          [ Other qualifiers on the version number triplet (if any) ])
+
+AC_SUBST([GETDATA_MAJOR], [getdata_major])
+AC_SUBST([GETDATA_MINOR], [getdata_minor])
+AC_SUBST([GETDATA_REVISION], [getdata_revision])
+AC_SUBST([GETDATA_VERSION_SUFFIX], [getdata_extra])
+
+AC_PREREQ([2.65])
+AC_CONFIG_MACRO_DIR([m4])
+
+LT_PREREQ([2.2.6b])
+
+AC_ARG_VAR([BUILDCC],
+           [C compiler command on the build system (only needed if cross-compiling)])
+
+dnl export version information from m4/version.m4
+AC_SUBST(GETDATA_IFACE_VERSION, [getdata_iface_version])
+AC_SUBST(GETDATA_IMPL_REVISION, [getdata_impl_revision])
+AC_SUBST(GETDATA_IFACE_AGE, [getdata_iface_age])
+AC_SUBST(GETDATAXX_VERSION, [getdataxx_version])
+AC_SUBST(FGETDATA_VERSION, [fgetdata_version])
+AC_SUBST(F95GETDATA_VERSION, [f95getdata_version])
+AC_SUBST(MATLABGETDATA_VERSION, [matlabgetdata_version])
+
+AC_CONFIG_SRCDIR([src/getdata.c])
+AC_CONFIG_HEADER([src/gd_config.h])
+
+dnl Features
+BUINDINGS_BUILT=
+BINDINGS_LEFT=
+ENCODINGS_BUILT=" raw ascii sie"
+ENCODINGS_LEFT=
+PRIVATE_LIBS=
+
+echo "*** Checking GetData configuration"
+echo
+
+dnl Build/Host triplets
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+
+dnl Legacy API
+AC_ARG_ENABLE(legacy-api, AS_HELP_STRING([--disable-legacy-api],
+              [don't include the legacy API wrapper in the library]), dnl'
+              [
+               case "${enableval}" in
+                 no) include_legacy_api="no" ;;
+                 *) include_legacy_api="yes" ;;
+               esac
+              ], [ include_legacy_api="yes" ])
+AC_MSG_CHECKING([whether to include the legacy API])
+AC_MSG_RESULT([$include_legacy_api])
+
+if test "x$include_legacy_api" != "xno"; then
+  DEFINE_GD_LEGACY_API="#define GD_LEGACY_API"
+else
+  DEFINE_GD_LEGACY_API="/* #undef GD_LEGACY_API */"
+fi
+AC_SUBST([DEFINE_GD_LEGACY_API])
+
+dnl debugging
+AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert],
+              [enable assertions]),
+              [
+               case "${enableval}" in
+                 yes) enable_assert="yes" ;;
+                 *) enable_assert="no" ;;
+               esac
+              ], [ enable_assert="no" ])
+AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
+              [enable debugging messages]),
+              [
+               case "${enableval}" in
+                 yes) enable_debug="yes" ;;
+                 *) enable_debug="no" ;;
+               esac
+              ], [ enable_debug="no" ])
+
+AC_MSG_CHECKING([whether to enable debugging messages])
+AC_MSG_RESULT([$enable_debug])
+if test "x$enable_debug" = "xyes"; then
+  AC_DEFINE([GETDATA_DEBUG], [],
+            [ Define to enable debugging messages ])
+  enable_assert="yes"
+  GETDATA_DEBUG=1
+else
+  GETDATA_DEBUG=0
+fi
+AC_SUBST([GETDATA_DEBUG])
+
+AC_MSG_CHECKING([whether to enable assertions])
+AC_MSG_RESULT([$enable_assert])
+if test "x$enable_assert" = "xno"; then
+  AC_DEFINE(NDEBUG, 1, [ Define to disable assertions ])
+fi
+
+dnl C99 stuff
+AC_ARG_ENABLE(ansi-c, AS_HELP_STRING([--enable-ansi-c],
+              [use ANSI C (C89) work-arounds for C99 code]),
+              [
+               if test "x${enableval}" != "xno"; then
+                 disable_c99="yes";
+               else
+                 disable_c99="no";
+               fi
+              ], [disable_c99="no"])
+AC_MSG_CHECKING([whether to build in ANSI C compliance mode])
+AC_MSG_RESULT([$disable_c99])
+
+dnl bindings, globally
+make_cxxbindings="yes"
+make_f77bindings="yes"
+make_pybindings="yes"
+make_idlbindings="yes"
+make_perlbindings="yes"
+make_matlabbindings="yes"
+AC_ARG_ENABLE(bindings, AS_HELP_STRING([--disable-bindings],
+              [don't build any bindings, just build the C library]),
+              [
+               if test "x${enableval}" = "xno"; then
+                 make_cxxbindings="no"
+                 make_f77bindings="no"
+                 make_pybindings="no"
+                 make_idlbindings="no"
+                 make_perlbindings="no"
+                 make_matlabbindings="no"
+               fi
+              ])
+
+dnl C++ bindings
+AC_ARG_ENABLE(cplusplus, AS_HELP_STRING([--disable-cplusplus],
+              [don't build the C++ bindings (libgetdata++)]),
+              [
+               case "${enableval}" in
+                 no) make_cxxbindings="no" ;;
+                 *) make_cxxbindings="yes" ;;
+               esac
+              ])
+AC_MSG_CHECKING([whether to include the C++ bindings])
+AC_MSG_RESULT([$make_cxxbindings])
+
+dnl Fortran 77 bindings
+AC_ARG_ENABLE(fortran, AS_HELP_STRING([--disable-fortran],
+              [don't build the Fortran 77 bindings (libfgetdata) nor the
+               Fortran 95 bindings (libf95getdata)]),
+              [
+               case "${enableval}" in
+                 no) make_f77bindings="no" ;;
+                 *) make_f77bindings="yes" ;;
+               esac
+              ])
+
+dnl Fortran 95 bindings
+AC_ARG_ENABLE(fortran95, AS_HELP_STRING([--disable-fortran95],
+              [don't build the Fortran 95 bindings (libf95getdata)]),
+              [
+               case "${enableval}" in
+                 no) make_f95bindings="no" ;;
+                 *) make_f95bindings="yes" ;;
+               esac
+              ], [ make_f95bindings="$make_f77bindings" ])
+
+AC_MSG_CHECKING([whether to include the Fortran 95 bindings])
+AC_MSG_RESULT([$make_f95bindings])
+
+if test "x$make_f77bindings$make_f95bindings" = "xnoyes"; then
+  make_f77bindings="yes (required by Fortran 95 bindings)"
+fi
+
+AC_MSG_CHECKING([whether to include the Fortran 77 bindings])
+AC_MSG_RESULT([$make_f77bindings])
+
+dnl DL library path munging for test suite
+case "${host}" in
+  *-apple-darwin*) DL_LIBRARY_PATH="DYLD_LIBRARY_PATH" ;;
+  *) DL_LIBRARY_PATH="LD_LIBRARY_PATH" ;;
+esac
+AC_SUBST([DL_LIBRARY_PATH])
+
+dnl Python bindings
+AC_ARG_ENABLE(python, AS_HELP_STRING([--disable-python],
+              [don't build the Python bindings (pygetdata)]),
+              [
+               case "${enableval}" in
+                 no) make_pybindings="no" ;;
+                 *) make_pybindings="yes" ;;
+               esac
+              ])
+
+AC_MSG_CHECKING([whether to include the Python bindings])
+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)]),
+              [
+               case "${enableval}" in
+                 no) make_idlbindings="no" ;;
+                 *) make_idlbindings="yes" ;;
+               esac
+              ])
+
+AC_MSG_CHECKING([whether to include the IDL bindings])
+AC_MSG_RESULT([$make_idlbindings])
+
+dnl Perl bindings
+AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl],
+              [don't build the Perl bindings (GetData)]),
+              [
+               case "${enableval}" in
+                 no) make_perlbindings="no" ;;
+                 *) make_perlbindings="yes" ;;
+               esac
+              ])
+
+AC_MSG_CHECKING([whether to include the Perl bindings])
+AC_MSG_RESULT([$make_perlbindings])
+
+dnl MATLAB bindings
+AC_ARG_ENABLE(matlab, AS_HELP_STRING([--disable-matlab],
+              [don't build the MATLAB bindings]),
+              [
+               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 Modules
+AC_ARG_ENABLE(modules, AS_HELP_STRING([--enable-modules],
+              [build external encodings in dynamically loaded modules instead
+               of directly into the core GetData library]),
+               [
+                case "${enableval}" in
+                  no) use_modules="no" ;;
+                  *) use_modules="yes" ;;
+                esac
+                ], [ use_modules="no" ])
+AC_MSG_CHECKING([whether to enable getdata modules])
+AC_MSG_RESULT([$use_modules])
+if test "x$use_modules" != "xno"; then
+AC_DEFINE([USE_MODULES], [], [ Define if building with modules ])
+fi
+
+AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR],
+            [if building modules, install them in DIR.  This is ignored if
+             --enable-modules isn't specified [default: LIBDIR/getdata]]),dnl'
+            [
+             case "${withval}" in
+               no) moduledir="$libdir/getdata" ;;
+               *) moduledir="${withval}" ;;
+             esac
+             ], [ moduledir="$libdir/getdata" ])
+AC_SUBST([moduledir])
+
+dnl LTDL
+AC_ARG_WITH([ltdl], AS_HELP_STRING([--with-ltdl=PREFIX],
+              [if building modules, use the GNU ltdl library located in
+               PREFIX [default: autodetect]]),
+              [
+               case "${withval}" in
+                 no) ltdl_prefix= ;;
+                 *) ltdl_prefix="${withval}" ;;
+               esac
+              ], [ ltdl_prefix= ])
+
+dnl Kill switch for external libraries
+AC_ARG_WITH([external-libraries], AS_HELP_STRING([--without-external-libraries],
+            [disable all features relying on external libraries]),
+            [
+             case "${withval}" in
+               no) no_extern="yes";;
+               *) no_extern="no";;
+             esac
+             ], [ no_extern="no" ])
+
+dnl Programs
+echo
+echo "*** Initialising build system"
+echo
+AM_INIT_AUTOMAKE
+AC_PROG_LN_S
+AC_PROG_AWK
+AC_PROG_GREP
+AC_PROG_SED
+
+AC_ARG_VAR([DATE], \
+           [a date program which supports '+%...' conversion specifiers])
+AC_CHECK_PROGS([DATE], [date], [not found])
+
+AC_ARG_VAR([DIFF], [a POSIX-compatible diff])
+AC_CHECK_PROGS([DIFF], [diff], [])
+
+AC_ARG_VAR([JOT], [a BSD-style jot;]
+[SysV-derived systems (like GNU/Linux) may find it easier to use SEQ (q.v.)])
+AC_CHECK_PROGS([JOT], [jot], [not found])
+
+AC_ARG_VAR([PRINTF], [a POSIX-compatible printf])
+AC_CHECK_PROGS([PRINTF], [printf], [not found])
+
+AC_ARG_VAR([SEQ], [a SysV-style seq;]
+[BSD-derived systems (like MacOS X) may find it easier to use JOT (q.v.)])
+AC_CHECK_PROGS([SEQ], [seq], [not found])
+
+GD_MSYS_SHELL
+
+echo
+echo "*** Checking host environment"
+echo
+
+dnl unaligned memory access
+dnl user knows best
+AC_ARG_ENABLE([fast-unaligned], AS_HELP_STRING([--enable-fast-unaligned],
+  [use fast loads and stores with non-aligned data.  WARNING: Enabling this on ]
+  [a platform which does not support fast unaligned memory access may cause ]
+  [the library to silently corrupt data. [default: autodetect]]),
+  [
+   case "${enableval}" in
+     yes) gd_unaligned_override="yes" ;;
+     no) gd_unaligned_override="no" ;;
+     *) gd_unaligned_override="check" ;;
+   esac
+   ], [gd_unaligned_override="check"])
+
+AC_MSG_CHECKING([whether ${host} supports fast unaligned memory access])
+if test "x$gd_unaligned_override" = "xyes"; then
+  gd_unaligned_ok=yes
+  AC_MSG_RESULT([yes (forced)])
+elif test "x$gd_unaligned_override" = "xno"; then
+  gd_unaligned_ok=no
+  AC_MSG_RESULT([no (forced)])
+else
+  case "${host}" in
+    i?86-*-*|powerpc*-*-*|x86_64-*-*|armv[6789]*-*-*) gd_unaligned_ok=yes ;;
+  *) gd_unaligned_ok=no ;;
+  esac
+  AC_MSG_RESULT([$gd_unaligned_ok])
+fi
+
+if test "x$gd_unaligned_ok" = "xyes"; then
+  AC_DEFINE([UNALIGNED_ACCESS_OK], [1],
+            [Define to 1 if the platform supports fast unaligned memory access])
+fi
+
+dnl FDIRSEP is used in Fortran, where '\' should not be escaped.
+AC_MSG_CHECKING([the directory separator])
+case "${host}" in
+  *-*-djgpp|*-*-mingw32) GD_FDIRSEP=\\; GD_DIRSEP=\\\\ ;;
+  *) GD_FDIRSEP=/; GD_DIRSEP=/ ;;
+esac
+AC_SUBST([GD_FDIRSEP])
+AC_SUBST([GD_DIRSEP])
+AC_DEFINE_UNQUOTED([GD_DIRSEP], ['$GD_DIRSEP'],
+                   [ The directory separator between path elements ])
+AC_MSG_RESULT([$GD_FDIRSEP])
+
+case "${host}" in
+  *-pc-mingw*)
+  NO_UNDEFINED=" -no-undefined"
+  NO_DLOPEN_TESTS=1 ;;
+  *-*-cygwin*)
+  NO_UNDEFINED=" -no-undefined -enable-auto-import"
+  NO_DLOPEN_TESTS=1 ;;
+  *) NO_DLOPEN_TESTS=0 ;;
+esac
+
+echo
+echo "*** Checking C compiler characteristics"
+echo
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_CC
+AC_PROG_CC_C_O
+
+if test "x$disable_c99" != "xyes"; then
+  AC_PROG_CC_C99
+  if test "x$ac_cv_prog_cc_c99" = "xno"; then
+    disable_c99="yes"
+  fi
+fi
+if test "x$disable_c99" = "xyes"; then
+  DEFINE_GD_NO_C99_API="#define GD_NO_C99_API"
+else
+  DEFINE_GD_NO_C99_API="/* #undef GD_NO_C99_API */"
+fi
+AC_SUBST([DEFINE_GD_NO_C99_API])
+
+AC_HEADER_STDC
+AM_PROG_AS
+
+echo
+echo "*** Checking C++ compiler characteristics"
+echo
+AC_PROG_CXX
+AC_PROG_CXX_C_O
+
+if test "x$make_f77bindings" != "xno"; then
+  echo
+  echo "*** Checking Fortran 77 compiler characteristics"
+  echo
+  AC_PROG_F77
+  AC_PROG_F77_C_O
+fi
+if test "x$make_f95bindings" != "xno"; then
+  echo
+  echo "*** Checking Fortran 90 compiler characteristics"
+  echo
+  AC_PROG_FC
+  AC_PROG_FC_C_O
+  # does $FC accept fortran code with .f90 extension?
+  AC_MSG_CHECKING([whether the Fortran 90 compiler works])
+  AC_LANG_PUSH([Fortran])
+  ac_ext="f90"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+  [AC_MSG_RESULT([yes])],
+  [AC_MSG_RESULT([no]); FC=;])
+  AC_LANG_POP
+fi
+if test "x${cross_compiling}" != "xno"; then
+  echo
+  echo "*** Checking the build environment"
+  echo
+  if test -z "$BUILDCC"; then
+    if test -n "$build_alias"; then
+      AC_CHECK_PROGS([BUILDCC],
+                     [${build_alias}-gcc ${build_alias}-cc ${build_alias}-cl])
+    fi
+  fi
+  if test -z "$BUILDCC"; then
+    AC_CHECK_PROGS([BUILDCC], [gcc cc cl])
+  fi
+else
+  if test -z "$BUILDCC"; then
+    BUILDCC=$CC
+  fi
+  AC_SUBST([BUILDCC])
+fi
+
+echo
+echo "*** Building libtool"
+echo
+LT_INIT([dlopen])
+AC_SUBST([LIBTOOL_DEPS])
+LT_OUTPUT
+
+dnl libltdl stuff
+
+if test "x${use_modules}" != "xno"; then
+  echo
+  echo "*** Configuring the dynamic loader"
+  echo
+  saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$ltdl_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$ltdl_prefix/lib"
+  fi
+  AC_CHECK_LIB([ltdl],[lt_dlinit], [have_ltdl=yes], [have_ltdl=no])
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+  if test "x$have_ltdl" == "xno"; then
+    AC_MSG_ERROR([libltdl is required to build modules.  Please either specify the location of the libltdl library using --with-ldtl=PREFIX or else disable the building of modules by using --disable-modules.])
+  fi
+
+  if test "x$ltdl_prefix" != "x"; then
+    AC_CHECK_HEADERS(ltdl.h)
+    LIBLTDL="-L${ltdl_prefix}/lib -lltdl"
+    LTDLINC="-I${ltdl_prefix}/include"
+  else
+    AC_CHECK_HEADERS(ltdl.h)
+    LIBLTDL="-lltdl"
+  fi
+
+  dnl pthread
+  AC_SEARCH_LIBS([pthread_mutex_lock],[pthread],
+                 [use_pthread=yes
+                  AC_DEFINE([USE_PTHREAD], [],
+                            [Define if you have a POSIX compliant thread ]
+                            [library])
+                  ],
+                  [use_pthread=no])
+  AC_CHECK_HEADERS(pthread.h)
+fi
+AC_SUBST([LIBLTDL])
+AC_SUBST([LTDLINCL])
+
+dnl check if we found a C++ compiler
+if test "x$CXX" == "x"; then
+  make_cxxbindings=no
+fi
+
+dnl check if we found a Fortran 77 compiler
+if test "x$F77" == "x"; then
+  make_f77bindings=no
+  make_f95bindings=no
+fi
+
+dnl check if we found a free-form Fortran compiler
+if test "x$FC" == "x"; then
+  make_f95bindings=no
+fi
+
+dnl compiler checks
+echo
+echo "*** Checking additional compiler characteristics"
+echo
+AC_SYS_LARGEFILE
+AC_C_INLINE
+AC_C_RESTRICT
+GD_C_RESTRICT_ARRAY
+GD_PROG_CC_WALL
+GD_PROG_CC_WEXTRA
+
+if test "x$make_cxxbindings" != "xno"; then
+  GD_PROG_CXX_WALL
+  GD_PROG_CXX_WEXTRA
+fi
+
+if test "x$make_f77bindings" != "xno"; then
+  GD_PROG_F77_WALL
+  GD_PROG_F77_WEXTRA
+  GD_PROG_F77_FNO_BACKSLASH
+  GD_LANG_F77_COMPILER_INTEL
+fi
+
+dnl F77 stuff
+if test "x$make_f77bindings" != "xno"; then
+  AC_F77_WRAPPERS
+  if test "x$ac_cv_f77_mangling" == "xunknown"; then
+    make_f77bindings=no
+    make_f95bindings=no
+  fi
+fi
+
+if test "x$make_f95bindings" != "xno"; then
+  GD_PROG_FC_WALL
+  GD_PROG_FC_WEXTRA
+  GD_LANG_FC_COMPILER_INTEL
+fi
+
+AC_MSG_CHECKING([if we're linking against the Microsoft C Run-Time]) #'
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __MSVCRT__
+       choke me
+#endif
+]])],
+[gd_msvcrt=yes],
+[gd_msvcrt=no])
+AC_MSG_RESULT([$gd_msvcrt])
+
+dnl 64-bit stat() requires MSVCRT 6.1 or later.  This may prohibit using
+dnl GetData on Windows95.  Oh no!
+if test "$gd_msvcrt" = "yes"; then
+  AC_DEFINE([__MSVCRT_VERSION__], [0x601],
+            [ If compiling aginst the MSVCRT, define to 0x601 ])
+fi
+
+dnl libraries
+echo
+echo "*** Looking for additional libraries"
+echo
+AC_SEARCH_LIBS([ceil],[m])
+
+dnl headers
+echo
+echo "*** Looking for additional header files"
+echo
+AC_CHECK_HEADERS([asm/unaligned.h Availability.h byteswap.h direct.h fcntl.h \
+                  float.h inttypes.h io.h libgen.h libkern/OSByteOrder.h \
+                  math.h stddef.h stdint.h sys/endian.h sys/file.h sys/param.h \
+                  sys/stat.h sys/types.h sys/wait.h unistd.h])
+if test "x$disable_c99" = "xno"; then
+AC_CHECK_HEADERS([complex.h])
+fi
+AC_HEADER_DIRENT
+
+dnl types
+echo
+echo "*** Checking data types"
+echo
+AC_C_CONST
+AC_C_BIGENDIAN
+GD_C_FLOATORDERING
+AC_TYPE_SIZE_T
+AC_CHECK_SIZEOF([size_t])
+AC_CHECK_TYPES([ssize_t])
+AC_TYPE_OFF_T
+AC_CHECK_SIZEOF([off_t])
+AC_TYPE_UINT8_T
+AC_TYPE_INT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_INT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_INT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_INT64_T
+
+if test "x$disable_c99" = "xno"; then
+AC_CHECK_TYPES([_Complex float, _Complex double])
+fi
+
+AC_CHECK_TYPES([struct stat64, struct _stat64, struct __stat64, off64_t])
+
+dnl integer sizes
+AC_CHECK_SIZEOF([short int])
+AC_CHECK_SIZEOF([int])
+AC_CHECK_SIZEOF([long int])
+AC_CHECK_SIZEOF([long long int])
+AC_CHECK_SIZEOF([unsigned short int])
+AC_CHECK_SIZEOF([unsigned int])
+AC_CHECK_SIZEOF([unsigned long int])
+AC_CHECK_SIZEOF([unsigned long long int])
+AC_CHECK_SIZEOF([void *])
+
+dnl C89 API types
+if test $ac_cv_sizeof_int -eq 2; then
+  gd_int16_t="int"
+elif test $ac_cv_sizeof_short_int -eq 2; then
+  gd_int16_t="short int"
+elif test $ac_cv_sizeof_long_int -eq 2; then
+  gd_int16_t="long int"
+elif test $ac_cv_sizeof_long_long_int -eq 2; then
+  gd_int16_t="long long int"
+fi
+
+if test $ac_cv_sizeof_unsigned_int -eq 2; then
+  gd_uint16_t="unsigned int"
+elif test $ac_cv_sizeof_unsigned_short_int -eq 2; then
+  gd_uint16_t="unsigned short int"
+elif test $ac_cv_sizeof_unsigned_long_int -eq 2; then
+  gd_uint16_t="unsigned long int"
+elif test $ac_cv_sizeof_unsigned_long_long_int -eq 2; then
+  gd_uint16_t="unsigned long long int"
+fi
+
+if test $ac_cv_sizeof_int -eq 8; then
+  gd_int64_t="int"
+elif test $ac_cv_sizeof_short_int -eq 8; then
+  gd_int64_t="short int"
+elif test $ac_cv_sizeof_long_int -eq 8; then
+  gd_int64_t="long int"
+elif test $ac_cv_sizeof_long_long_int -eq 8; then
+  gd_int64_t="long long int"
+fi
+
+if test $ac_cv_sizeof_unsigned_int -eq 8; then
+  gd_uint64_t="unsigned int"
+elif test $ac_cv_sizeof_unsigned_short_int -eq 8; then
+  gd_uint64_t="unsigned short int"
+elif test $ac_cv_sizeof_unsigned_long_int -eq 8; then
+  gd_uint64_t="unsigned long int"
+elif test $ac_cv_sizeof_unsigned_long_long_int -eq 8; then
+  gd_uint64_t="unsigned long long int"
+fi
+
+if test "x$gd_cv_type_off64_t" = "xyes"; then
+  dnl Assume we have the entire LFS defined transitional API
+  AC_DEFINE([HAVE_OFF64_T], [1],
+            [ Define to 1 if the system has the type `off64_t'. ]) dnl `
+fi
+
+DEFINE_gd_int16_t="# define gd_int16_t $gd_int16_t";
+DEFINE_gd_uint16_t="# define gd_uint16_t $gd_uint16_t";
+DEFINE_gd_int64_t="# define gd_int64_t $gd_int64_t";
+DEFINE_gd_uint64_t="# define gd_uint64_t $gd_uint64_t";
+AC_SUBST([DEFINE_gd_int16_t])
+AC_SUBST([DEFINE_gd_uint16_t])
+AC_SUBST([DEFINE_gd_int64_t])
+AC_SUBST([DEFINE_gd_uint64_t])
+
+dnl library functions
+echo
+echo "*** Looking for additional library functions"
+echo
+AC_CHECK_FUNCS([basename _chsize _chsize_s _commit fchmod _fdopen fdopendir \
+                _finite fpathconf fseeko fseeko64 _fstat fstat64 _fstat64 \
+                fstatat fstatat64 fsync ftello ftello64 ftruncate ftruncate64 \
+                getcwd _getcwd getdelim gmtime_r isnan _isnan lseek64 \
+                _lseeki64 lstat lstat64 _mkdir mkfifo nan _open openat \
+                pathconf _read readdir_r readlink renameat _rmdir snprintf \
+                _snprintf stat64 _stat64 _strtoi64 strtoll strtoq _strtoui64 \
+                strtoull strtouq symlink _unlink unlinkat _write])
+if test "x$disable_c99" = "xno"; then
+  AC_CHECK_FUNCS([cabs])
+fi
+AC_FUNC_STRERROR_R
+AC_FUNC_FORK
+
+AC_MSG_CHECKING([whether mkdir accepts two arguments])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_IO_H
+#include <io.h>
+#endif
+], [[
+#ifdef HAVE__MKDIR
+_mkdir("x", 00777);
+#else
+mkdir("x", 00777);
+#endif
+]])],
+[gd_2arg_mkdir=yes],
+[gd_2arg_mkdir=no])
+AC_MSG_RESULT([$gd_2arg_mkdir])
+
+if test $gd_2arg_mkdir = "no"; then
+  AC_DEFINE([MKDIR_NO_MODE], [1],
+            [ Define to 1 if the `mkdir' function takes only one argument.])
+fi dnl`
+
+AC_CHECK_DECLS([isfinite],,,
+               [
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+])
+AC_CHECK_DECLS([bswap16, bswap_16, OSSwapInt16],,,
+              [
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+#ifdef HAVE_LIBKERN_OSBYTEORDER_H
+#include <libkern/OSByteOrder.h>
+#endif
+])
+
+AC_CHECK_DECLS([get_unaligned, put_unaligned],,,
+              [
+#ifdef HAVE_ASM_UNALIGNED_H
+#include <asm/unaligned.h>
+#endif
+])
+
+dnl python
+if test "x$make_pybindings" = "xyes"; then
+  echo
+  echo "*** Configuring python bindings"
+  echo
+  GD_PYTHON([2.3])
+  have_numpy="no"
+  if test "x$have_python" = "xno"; then
+    make_pybindings="no"
+  else
+    AC_MSG_CHECKING([for NumPy])
+    cat > conftest.py << EOF
+import sys
+try:
+  import numpy
+except ImportError:
+  sys.exit(1)
+EOF
+    if $PYTHON conftest.py > /dev/null 2>&1; then
+      have_numpy="yes"
+    fi
+    AC_MSG_RESULT([$have_numpy])
+  fi
+  if test "x$have_numpy" = "xyes"; then
+    AC_MSG_CHECKING([NumPy includes])
+    NUMPY_CPPFLAGS=-I`$PYTHON -c "import numpy; print numpy.get_include()"`
+    AC_MSG_RESULT([$NUMPY_CPPFLAGS])
+    AC_SUBST([NUMPY_CPPFLAGS])
+
+    saved_cppflags=$CPPFLAGS
+    CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS} ${NUMPY_CPPFLAGS}"
+    AC_CHECK_HEADERS([numpy/arrayobject.h],,[have_numpy="no"],[
+#include<Python.h>
+])
+    CPPFLAGS=$saved_cppflags
+  fi
+
+  if test "x$have_numpy" = "xyes"; then
+    AC_DEFINE([USE_NUMPY], [],
+              [ Define to 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
+  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([lzma],[lzma],[lzma_auto_decoder],[lzma.h],[xz],[],[])
+GD_CHECK_ENCODING([slim],[slim],[slimopen],[slimlib.h], [slim slimdata],
+                  [unslim],[slimdopen])
+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.]),
+              [
+               case "${enableval}" in
+                 no) zzslim_override="no" ;;
+                 *) zzslim_override="yes" ;;
+               esac
+              ], [ zzslim_override="auto" ])
+m4_divert_once([HELP_ENABLE], AS_HELP_STRING([--disable-zzslim],
+            [disable zzslim encodings support]))
+
+echo
+echo "*** Configuring zzslim support "
+echo
+if test $zzslim_override = "no"; then
+  AC_MSG_CHECKING([for zzslim support])
+  AC_MSG_RESULT([no (forced)])
+  use_zzslim=no
+else
+  AC_MSG_CHECKING([for slim support])
+  AC_MSG_RESULT([$use_slim])
+  AC_MSG_CHECKING([for zzip support])
+  AC_MSG_RESULT([$use_zzip])
+  if test "$use_slim$use_zzip" == "yesyes"; then
+    if test $zzslim_override = "yes"; then
+      AC_MSG_CHECKING([for zzslim support])
+      AC_MSG_RESULT([yes (forced)])
+      use_zzslim=yes
+    elif test "x$CXX" = "x"; then
+      AC_MSG_CHECKING([for zzslim support])
+      AC_MSG_RESULT([no (no C++ compiler available for configure test)])
+      use_zzslim=no
+    else
+      dnl try linking to the slim library to see if it contains the unprototyped
+      dnl   ibitstream::ibitstream(ZZIP_FILE *file, int buffersize)
+      dnl given that this function isn't public, this is probably easily broken
+      AC_MSG_CHECKING([whether -lslim contains zzip capability])
+      AC_LANG_PUSH([C++])
+      saved_ldflags=$LDFLAGS
+      saved_libs=$LIBS
+      LDFLAGS="$SLIM_LDFLAGS $LDFLAGS"
+      LIBS="$SLIM_LIBS $LIBS"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM(
+                      [[
+                       struct zzip_file;
+                       typedef struct zzip_file ZZIP_FILE;
+                       class ibitstream {
+                       public:
+                       ibitstream(ZZIP_FILE *file, int buffersize);
+                     };
+                     ]],
+                     [[
+                      ZZIP_FILE *file;
+                      ibitstream foo(file, 0);
+                      ]]
+                     )], [slim_zzip="yes"], [slim_zzip="no"])
+      AC_MSG_RESULT([$slim_zzip])
+      LDFLAGS=$saved_ldflags
+      LIBS=$saved_libs
+      AC_LANG_POP
+
+      use_zzslim=$slim_zzip
+    fi
+  else
+    use_zzslim="no"
+  fi
+fi
+
+dnl add to summary and private lib list
+if test "x$use_zzslim" != "xno"; then
+  AC_DEFINE([USE_ZZSLIM], [], [ Define to enable zzslim support ])
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} zzslim";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} zzslim";
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} zzslim";
+fi
+
+if test ! -z "${LIBS}"; then
+  PRIVATE_LIBS="${LIBS} ${PRIVATE_LIBS}"
+fi
+AC_SUBST([PRIVATE_LIBS])
+
+dnl Calculate absolute docdir
+cat <<EOF > conftest.sh
+prefix=$prefix
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=\$prefix
+exec_prefix=$exec_prefix
+datarootdir=$datarootdir
+PACKAGE_TARNAME=$PACKAGE_TARNAME
+echo $docdir
+EOF
+absolute_docdir=`$SHELL conftest.sh`
+AC_SUBST([absolute_docdir])
+
+dnl output
+echo
+echo "*** Writing configure output"
+echo
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([bindings/Makefile])
+AC_CONFIG_FILES([bindings/cxx/Makefile])
+AC_CONFIG_FILES([bindings/cxx/test/Makefile])
+AC_CONFIG_FILES([bindings/f77/Makefile])
+AC_CONFIG_FILES([bindings/f77/test/Makefile])
+AC_CONFIG_FILES([bindings/f77/test/test_getdata.f])
+AC_CONFIG_FILES([bindings/idl/Makefile])
+AC_CONFIG_FILES([bindings/idl/makedlm.sh])
+AC_CONFIG_FILES([bindings/idl/test/Makefile])
+AC_CONFIG_FILES([bindings/matlab/Makefile])
+AC_CONFIG_FILES([bindings/matlab/make_contents.sh])
+AC_CONFIG_FILES([bindings/matlab/test/Makefile])
+AC_CONFIG_FILES([bindings/perl/Makefile])
+AC_CONFIG_FILES([bindings/perl/Build.PL])
+AC_CONFIG_FILES([bindings/python/Makefile])
+AC_CONFIG_FILES([bindings/python/test/Makefile])
+AC_CONFIG_FILES([doc/Makefile])
+AC_CONFIG_FILES([man/Makefile])
+AC_CONFIG_FILES([man/gd_alter_encoding.3])
+AC_CONFIG_FILES([man/gd_alter_endianness.3])
+AC_CONFIG_FILES([man/gd_alter_frameoffset.3])
+AC_CONFIG_FILES([src/Makefile])
+dnl This doubling allows us to build getdata.h as a normal AC_CONFIG_FILE, but
+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.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(INTEL_F77_COMPILER,
+               [test "x$gd_cv_f77_compiler_intel" == "xyes"])
+AM_CONDITIONAL(INTEL_FC_COMPILER, [test "x$gd_cv_fc_compiler_intel" == "xyes"])
+AM_CONDITIONAL(INCLUDE_LEGACY_API, [test "x$include_legacy_api" != "xno"])
+AM_CONDITIONAL(MAKE_CXXBINDINGS, [test "x$make_cxxbindings" = "xyes"])
+AM_CONDITIONAL(MAKE_F77BINDINGS, [test "x$make_f77bindings" != "xno"])
+AM_CONDITIONAL(MAKE_F95BINDINGS, [test "x$make_f95bindings" = "xyes"])
+AM_CONDITIONAL(MAKE_PYBINDINGS, [test "x$make_pybindings" = "xyes"])
+AM_CONDITIONAL(MAKE_IDLBINDINGS, [test "x$make_idlbindings" = "xyes"])
+AM_CONDITIONAL(MAKE_PERLBINDINGS, [test "x$make_perlbindings" = "xyes"])
+AM_CONDITIONAL(MAKE_MATLABBINDINGS, [test "x$make_matlabbindings" = "xyes"])
+AM_CONDITIONAL(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(HAVE_DIFF, [test "x$DIFF" != "x"])
+AM_CONDITIONAL(USE_ZZSLIM, [test "x$use_zzslim" = "xyes"])
+AM_CONDITIONAL(GD_EXTERNAL, [false])
+
+
+dnl we do this here to avoid screwing up other tests
+LDFLAGS="${LDFLAGS}${NO_UNDEFINED}"
+
+AC_OUTPUT
+
+dnl Handy summary
+if test "x$make_cxxbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} C++"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} C++"
+fi
+
+if test "x$make_f77bindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} Fortran-77"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} Fortran-77"
+fi
+
+if test "x$make_f95bindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} Fortran-95"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} Fortran-95"
+fi
+
+if test "x$make_idlbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} IDL"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} IDL"
+fi
+
+if test "x$make_matlabbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} MATLAB"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} MATLAB"
+fi
+
+if test "x$make_perlbindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} Perl"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} Perl"
+fi
+
+if test "x$make_pybindings" != "xno"; then
+  BINDINGS_BUILT="${BINDINGS_BUILT} Python"
+else
+  BINDINGS_LEFT="${BINDINGS_LEFT} Python"
+fi
+
+if test "x$BINDINGS_BUILT" = "x"; then
+  BINDINGS_BUILT=" none"
+fi
+
+if test "x$BINDINGS_LEFT" = "x"; then
+  BINDINGS_LEFT=" none"
+fi
+
+if test "x$ENCODINGS_MODS" = "x"; then
+  ENCODINGS_MODS=" none"
+fi
+
+if test "x$ENCODINGS_LEFT" = "x"; then
+  ENCODINGS_LEFT=" none"
+fi
+
+if test "x$enable_debug$enable_assert" = "xnoyes"; then
+  enable_debug="assert only"
+fi
+
+echo
+echo "Configuration summary: "
+echo "  ANSI C compatibility mode:     ${disable_c99}"
+echo "  Legacy API:                    ${include_legacy_api}"
+echo "  Verbose debugging:             ${enable_debug}"
+echo "  Fast unaligned memory access:  ${gd_unaligned_ok}"
+echo "  Use modules:                   ${use_modules}"
+if test "x${use_modules}" != "xno"; then
+  echo "  Thread-safe dynamic loading:   ${use_pthread}"
+fi
+echo
+echo "  Supported internal encodings: ${ENCODINGS_BUILT}"
+if test "x${use_modules}" != "xno"; then
+  echo "  Supported external encodings: ${ENCODINGS_MODS}"
+fi
+echo "  Unsupported encodings:        ${ENCODINGS_LEFT}"
+echo
+echo "  Bindings built:               ${BINDINGS_BUILT}"
+echo "  Bindings not built:           ${BINDINGS_LEFT}"
+if test "x$make_pybindings" != "xno"; then
+  echo "  NumPy support in Python:       ${have_numpy}"
+fi
+echo
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..4ebd5b3
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+  '')
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputting dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'.  On the theory
+## that the space means something, we add a space to the output as
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like '#:fec' to the end of the
+    # dependency line.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  set_dir_from "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using '\' :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
+
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  set_dir_from  "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for ':'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+  "$@" $dashmflag |
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+        set fnord "$@"
+        shift
+        shift
+        ;;
+    *)
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..aa6e31d
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,56 @@
+# 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
+#
+AUTOMAKE_OPTIONS = foreign
+
+if MAKE_CXXBINDINGS
+READMECXX=README.cxx
+endif
+
+if MAKE_F77BINDINGS
+READMEF77=README.f77
+endif
+
+if MAKE_F95BINDINGS
+READMEF95=README.f95
+endif
+
+if MAKE_IDLBINDINGS
+READMEIDL=README.idl
+endif
+
+if MAKE_MATLABBINDINGS
+READMEMATLAB=README.matlab
+endif
+
+if MAKE_PERLBINDINGS
+READMEPERL=README.perl
+endif
+
+if MAKE_PYBINDINGS
+READMEPYTHON=README.python
+endif
+
+dist_doc_DATA = ${READMECXX} ${READMEF77} ${READMEF95} ${READMEIDL} \
+								${READMEMATLAB} ${READMEPERL} ${READMEPYTHON} \
+								unclean_database_recovery.txt
+
+clean-local:
+	rm -rf *~
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..6964a57
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,614 @@
+# 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 = doc
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(am__dist_doc_DATA_DIST)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/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__dist_doc_DATA_DIST = README.cxx README.f77 README.f95 README.idl \
+	README.matlab README.perl README.python \
+	unclean_database_recovery.txt
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(docdir)"
+DATA = $(dist_doc_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008, 2012 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+ at MAKE_CXXBINDINGS_TRUE@READMECXX = README.cxx
+ at MAKE_F77BINDINGS_TRUE@READMEF77 = README.f77
+ at MAKE_F95BINDINGS_TRUE@READMEF95 = README.f95
+ at MAKE_IDLBINDINGS_TRUE@READMEIDL = README.idl
+ at MAKE_MATLABBINDINGS_TRUE@READMEMATLAB = README.matlab
+ at MAKE_PERLBINDINGS_TRUE@READMEPERL = README.perl
+ at MAKE_PYBINDINGS_TRUE@READMEPYTHON = README.python
+dist_doc_DATA = ${READMECXX} ${READMEF77} ${READMEF95} ${READMEIDL} \
+								${READMEMATLAB} ${READMEPERL} ${READMEPYTHON} \
+								unclean_database_recovery.txt
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign doc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-dist_docDATA: $(dist_doc_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
+	done
+
+uninstall-dist_docDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(docdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_docDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_docDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	clean-local cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am \
+	install-dist_docDATA install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-dist_docDATA
+
+
+clean-local:
+	rm -rf *~
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/README.cxx b/doc/README.cxx
new file mode 100644
index 0000000..a0956ba
--- /dev/null
+++ b/doc/README.cxx
@@ -0,0 +1,852 @@
+C++ BINDINGS FOR GETDATA
+========================
+
+This README describes the C++ bindings for the GetData library.  These bindings
+consist of a several C++ classes in the `GetData' namespace, plus a few
+associated named constants.  Header files defining these data types are
+installed into the ${includedir}/getdata directory.  The classes defined in
+the GetData namespace are: Dirfile, Entry, Fragment, plus an additional Entry
+subclass for each field type (i.e. RawEntry, LincomEntry, &c.)
+
+CONSTANTS
+=========
+
+Because the C++ headers include the C API header getdata.h, all named constants
+defined in the C API may also be used in the C++ API without change in meaning.
+
+In addition to the classes documented below, the C++ bindings define the
+following enumerated constants.  These are re-encapsulations of various C API
+named constants permitting better type safety in C++.  In all cases, the
+corresponding C API constant can be used in place of the C++ named constant,
+with an appropriate type-cast (so that, e.g., (GetData::DataType)GD_NULL can
+be used in place of GetData::Null).
+
+The GetData data types (defined in getdata/entry.h):
+
+  enum DataType {
+    Null      = GD_NULL,      Unknown    = GD_UNKNOWN,
+    UInt8     = GD_UINT8,     Int8       = GD_INT8,
+    UInt16    = GD_UINT16,    Int16      = GD_INT16,
+    UInt32    = GD_UINT32,    Int32      = GD_INT32,
+    UInt64    = GD_UINT64,    Int64      = GD_INT64,
+    Float32   = GD_FLOAT32,   Float64    = GD_FLOAT64,
+    Complex64 = GD_COMPLEX64, Complex128 = GD_COMPLEX128
+  };
+
+The GetData entry types (defined in getdata/entry.h):
+
+  enum EntryType {
+    NoEntryType       = GD_NO_ENTRY,
+    RawEntryType      = GD_RAW_ENTRY,
+    LincomEntryType   = GD_LINCOM_ENTRY,
+    LinterpEntryType  = GD_LINTERP_ENTRY,
+    BitEntryType      = GD_BIT_ENTRY,
+    MultiplyEntryType = GD_MULTIPLY_ENTRY,
+    PhaseEntryType    = GD_PHASE_ENTRY,
+    SBitEntryType     = GD_SBIT_ENTRY,
+    PolynomEntryType  = GD_POLYNOM_ENTRY,
+    ConstEntryType    = GD_CONST_ENTRY,
+    CarrayEntryType   = GD_CARRAY_ENTRY,
+    StringEntryType   = GD_STRING_ENTRY,
+    IndexEntryType    = GD_INDEX_ENTRY,
+    DivideEntryType   = GD_DIVIDE_ENTRY,
+    RecipEntryType    = GD_RECIP_ENTRY,
+    WindowEntryType   = GD_WINDOW_ENTRY,
+    MPlexEntryType    = GD_MPLEX_ENTRY
+  };
+
+The GetData window operations (defined in getdata/entry.h):
+
+  enum WindOpType {
+    WindOpEq = GD_WINDOP_EQ,
+    WindOpNe = GD_WINDOP_NE,
+    WindOpGe = GD_WINDOP_GE,
+    WindOpGt = GD_WINDOP_GT,
+    WindOpLe = GD_WINDOP_LE,
+    WindOpLt = GD_WINDOP_LT,
+    WindOpSet = GD_WINDOP_SET,
+    WindOpClr = GD_WINDOP_CLR
+  };
+
+The GetData encoding schemes (defined in getdata/fragment.h):
+
+  enum EncodingScheme {
+    AutoEncoding  = GD_AUTO_ENCODED, 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
+  };
+
+
+
+DIRFILE CLASS
+=============
+
+Defined in getdata/dirfile.h, the Getdata::Dirfile class encapsulates the
+DIRFILE object, providing a thin wrapper to the C API.  The following methods
+are available:
+
+* Dirfile::Dirfile()
+  
+  The empty constructor creates an invalid dirfile.  Attempting to call any
+  member function will result in a GD_E_BAD_DIRFILE error.
+
+* Dirfile::Dirfile(const char *dirfilename, unsigned int flags = GD_RDONLY,
+    gd_parser_callback_t sehandler = NULL, void *extra = NULL)
+
+  This constructor takes the name of the dirfile, the dirfile flags, and
+  optional pointers to a syntax error callback handler, and a caller pointer
+  passed to that callback.  The constructor will call gd_cbopen(3) on the
+  provided path name.  If flags is omitted, the default GD_RDWR will be used.
+
+* Dirfile::Dirfile(DIRFILE *dirfile)
+  
+  This constructor creates a Dirfile object from the supplied C API's DIRFILE
+  object.  This may be used especially in the supplied parser callback,
+  sehandler, to instantiate a Dirfile object from the supplied DIRFILE pointer.
+
+* ~Dirfile::Dirfile()
+
+  If not done explicitly (see below), the destructor will take care of calling
+  gd_close(3).
+
+* int Dirfile::Close()
+* int Dirfile::Discard()
+  
+  These call gd_close(3) and gd_discard(3) respectively.  If they return
+  successfully (return value zero), the Dirfile should immediately be destroyed,
+  by calling its destructor.  Calling any member function after these functions
+  return successfully will result in a GD_E_BAD_DIRFILE error.
+
+* int Dirfile::Error()
+
+  The Error method calls gd_error(3) to return the error status of the last
+  GetData library call on this Dirfile object.
+
+* int Dirfile::ErrorCount()
+
+  The ErrorCount method calls gd_error_count(3) to return the number of errors
+  encountered by the GetData library on this Dirfile object since this method
+  was last called (or, the first time, since the object was created).
+
+* const char *Dirfile::ErrorString()
+* const char *Dirfile::ErrorString(size_t len)
+
+  The ErrorString method will return a buffer containing a description of the
+  last GetData library error as obtained from gd_error_string(3).  This buffer
+  is local to the object, and subsequent calls to ErrorString() will overwrite
+  the buffer.  The len parameter, if specified, is ignored.
+
+* off_t BoF(const char *field_code)
+  
+  This method will call gd_bof(3) and return the location of the
+  beginning-of-field marker of the specified field.
+
+* GetData::Entry *Dirfile::Entry(const char *field_code)
+
+  This method will return a pointer to a newly allocated object of the
+  appropriate Entry Child class, cast as a plain GetData::Entry, created after
+  calling gd_entry(3) with the supplied field_code.  See below for a
+  description of the Entry classes.
+
+* off_t EoF(const char *field_code)
+  
+  This method will call gd_eof(3) and return the location of the end-of-field
+  marker of the specified field.
+
+* GetData::Fragment *Dirfile::Fragment(int index)
+  
+  This method will return a pointer to a newly allocated GetData::Fragment
+  object corresponding to the fragment with the specified index.
+
+* int Dirfile::FragmentIndex(const char *field_code)
+
+  This method will call gd_fragment_index(3) and return the index number of
+  the fragment defining the specified field.
+
+* double Dirfile::FrameNum(const char *field_code, double value,
+    off_t frame_start = 0, off_t frame_end = 0)
+
+  This method will call gd_framenum_subset(3) to perform a reverse look-up
+  on the specified field.  If frame_start or frame_end are omitted, the start or
+  end of the field will be used as the limit.
+
+* const char *Dirfile::Name()
+  
+  This method returns the name of the dirfile, that is the value of the
+  dirfilename parameter passed to the constructor.
+
+* GetData::RawEntry *Dirfile::Reference(const char *field_code = NULL)
+  
+  This method will call gd_reference(3) to set and/or retrieve the reference
+  field.  It returns a RawEntry object describing the reference field.
+
+* const char *Dirfile::ReferenceFilename()
+
+  This method is equivalent to calling Dirfile::Reference()->FileName() to
+  return the binary file pathname associated with the dirfile reference field,
+  except that it properly check that Dirfile::Reference() hasn't returned NULL,
+  and it does not create a RawEntry object.
+
+* void Dirfile::SetCallback(gd_parser_callback_t sehandler, void *extra = NULL)
+  
+  This method will call gd_parser_callback(3) to change or remove the parser
+  callback function.
+
+* int Dirfile::Standards(int version = GD_VERSION_CURRENT)
+
+  This method will call gd_dirfile_standards(3) to set or report the current
+  Standards Version of the loaded dirfile.
+
+* int Dirfile::UnInclude(int fragment_index, int del = 0)
+
+  This method will call gd_uninclude(3) to remove the indicated fragment from
+  the dirfile.  Because gd_uninclude may re-arrange the order of fragments in
+  the dirfile, the caller should destroy any GetData::Fragment objects it has
+  retained.
+
+* int Dirfile::Add(const Entry &entry)
+* int Dirfile::AddAlias(const char* field_code, const char* target,
+    int fragment_index = 0)
+* int Dirfile::AddSpec(const char *spec, int fragment_index = 0)
+* const char** Dirfile::Aliases(const char* field_code)
+* const char* Dirfile::AliasTarget(const char* field_code)
+* int Dirfile::AlterSpec(const char *line, int recode = 0)
+* const 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)
+* const char **Dirfile::EntryList(const char *parent = NULL, int type = 0,
+    unsigned int flags = 0)
+* const char **Dirfile::FieldList()
+* const char **Dirfile::FieldListByType(GetData::EntryType type)
+* unsigned long Dirfile::Flags(unsigned long set = 0, unsigned long reset = 0)
+* int Dirfile::Flush(const char *field_code = NULL)
+* const char *Dirfile::FormatFilename(int index)
+* int Dirfile::GetCarray(const char *field_code, GetData::DataType type,
+    void *data_out, unsigned int start = 0, size_t len = 0)
+* int Dirfile::GetConstant(const char *field_code, GetData::DataType type,
+    void *data_out)
+* size_t Dirfile::GetData(const char *field_code, off_t first_frame,
+    off_t first_sample, size_t num_frames, size_t num_samples,
+    GetData::DataType type, void *data_out)
+* size_t Dirfile::GetString(const char *field_code, size_t len, char *data_out)
+* int Dirfile::Hidden(const char* field_code)
+* int Dirfile::Hide(const char* field_code)
+* int Dirfile::Include(const char *file, int fragment_index, unsigned int flags)
+* int Dirfile::IncludeAffix(const char *file, int fragment_index = 0,
+    const char* prefix = NULL, const char* suffix = NULL,
+    unsigned long flags = 0)
+* int Dirfile::MAdd(const Entry &entry, const char *parent)
+* int Dirfile::MAddAlias(const char* parent, const char* name,
+    const char* target)
+* int Dirfile::MAddSpec(const char *spec, const char *parent)
+* int Dirfile::MAlterSpec(const char *line, const char *parent)
+* const gd_carray_t *Dirfile::MCarrays(GetData::DataType type = Float64)
+* const void *Dirfile::MConstants(const char *parent, GetData::DataType type)
+* int Dirfile::MetaFlush()
+* const char **Dirfile::MFieldList(const char *parent)
+* const char **Dirfile::MFieldListByType(const char *parent,
+    GetData::EntryType type)
+* void MplexLookback(int lookback)
+* 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)
+* DataType Dirfile::NativeType(const char *field_code)
+* unsigned int Dirfile::NEntries(const char *parent = NULL, int type = 0,
+    unsigned int flags = 0)
+* unsigned int Dirfile::NFields()
+* unsigned int Dirfile::NFieldsByType(GetData::EntryType type)
+* off_t Dirfile::NFrames()
+* int Dirfile::NFormats()
+* unsigned int Dirfile::NMFields(const char *parent)
+* unsigned int Dirfile::NMFieldsByType(const char *parent,
+    GetData::EntryType type)
+* unsigned int Dirfile::NMVectors(const char *parent)
+* int Dirfile::NVectors()
+* int Dirfile::PutCarray(const char *field_code, GetData::DataType type,
+    const void *data_in, unsigned int start = 0, size_t len = 0)
+* int Dirfile::PutConstant(const char *field_code, GetData::DataType type,
+    const void *data_in)
+* size_t Dirfile::PutData(const char *field_code, off_t first_frame,
+    off_t first_sample, size_t num_frames, size_t num_samples,
+    GetData::DataType type, const void *data_in)
+* size_t Dirfile::PutString(const char *field_code, const char *data_in)
+* int RawClose(const char *field_code = NULL)
+* unsigned int Dirfile::SamplesPerFrame(const char *field_code)
+* off_t Dirfile::Seek(const char *field_code, off_t frame_num, off_t sample_num,
+    int whence)
+* const char **Dirfile::Strings()
+* char *StrTok(const char *string = NULL)
+* int Dirfile::Sync(const char* field_code = NULL)
+* off_t Dirfile::Tell(const char *field_code)
+* int Dirfile::UnHide(const char* field_code)
+* int Dirfile::Validate(const char *field_code)
+* const char **Dirfile::VectorList()
+* int VerbosePrefix(const char *prefix = NULL)
+
+  These methods call the corresponding function from the C API on the C DIRFILE
+  object associated with the C++ object.  For allowed values for arguments of
+  type GetData::DataType or GetData::EntryType, see the CONSTANTS section above.
+
+  Note that the arguments to AddSpec are opposite to that of the corresponding
+  function add_spec(3) in the C API.
+
+
+FRAGMENT CLASS
+==============
+
+Define in getdata/fragment.h, the GetData::Fragment class provides information
+about an individual fragment in a dirfile.  This class has no public
+constructor, but may be created by calling Dirfile::Fragment.
+
+Note: The Fragment class caches the format file index for the associated
+fragment.  As a result, if Dirfile::UnInclude is called, these indices will
+be incorrect, and all pre-existing Fragment objects should be destroyed.
+
+* GetData::EncodingScheme Fragment::Encoding()
+* unsigned long Fragment::Endianness()
+* off_t Fragment::FrameOffset()
+* const char *Fragment::Name()
+* int Fragment::Parent()
+* int Fragment::Protection()
+* int Fragment::Index()
+
+  These methods return the specified information on the associated fragment.
+  For allowed values for arguments of type EncodingScheme, see the CONSTANTS
+  section above.
+
+* int SetEncoding(EncodingScheme encoding, int recode = 0)
+* int SetEndianness(unsigned long byte_sex, int recode = 0)
+* int SetFrameOffset(off_t offset, int recode = 0)
+* int SetPrefix(const char *prefix)
+* int SetProtection(int protection_level)
+* int SetSuffix(const char *suffix)
+
+  These methods set the specified information on the associated fragment by
+  calling gd_alter_encoding(3), gd_alter_endianness(3), gd_alter_frameoffset(3),
+  gd_protect(3), or gd_alter_affixes(3) as appropriate.
+
+
+ENTRY CLASS
+===========
+
+Defined in getdata/entry.h, the GetData::Entry class encapsulates the gd_entry_t
+object.  An entry object may be "associated" with a dirfile.  An entry object
+returned by Dirfile::Entry will be associated with that dirfile.  Entry objects
+created by using one of the constructors will not be associated.
+
+Changing the value of one of the data members of an associated entry object will
+result in a call to the C API to update the corresponding entry in the dirfile.
+Changing the value of one of the data members of an unassociated entry has no
+such side effect.
+
+The following methods are available:
+
+* Entry::Entry()
+
+  This will create an empty gd_entry_t object.
+
+* int Entry::Associated()
+  
+  Returns non-zero if this entry object is associated with a dirfile.
+
+* void Entry::Dissociate()
+  
+  Dissociates this entry object.  If the object is already dissociated, this
+  function does nothing.
+
+* EntryType Entry::Type()
+
+  This will return the field type of the Entry's field.  This will be one of the
+  Entry types listed above in the CONSTANTS section.
+
+* int Entry::SetFragmentIndex(int fragment_index)
+* int Entry::Move(int new_fragment, int move_data = 0)
+
+  These will update the fragment index of the entry.  If the entry is
+  associated, these will call gd_move(3) to move the field to a different
+  fragment.  These two functions are equivalent, except Entry::Move allows
+  specifying the move_data flag.  Entry::SetFragmentIndex always calls gd_move
+  with move_data = 0.
+
+* const char *Entry::Name()
+
+  This method returns the name of the field.  
+
+* int Entry::SetName(const char *new_name)
+* int Entry::Rename(const char *new_name, int move_data = 0)
+
+  These will change the name of the field of this entry.  If the entry object
+  is associated, these will also call calling gd_rename(3).  These two functions
+  are equivalent, except Entry::Rename allows specifying the move_data flag
+  explicitly.  Entry::SetName always calls gd_rename with move_data = 0.
+
+* virtual int Entry::ComplexScalars()
+* virtual int Entry::FragmentIndex()
+* virtual int Entry::PolyOrd()
+* virtual unsigned int Entry::SamplesPerFrame()
+* virtual DataType Entry::RawType()
+* virtual int Entry::NFields()
+* virtual int Entry::FirstBit()
+* virtual int Entry::NumBits()
+* virtual int Entry::Shift()
+* virtual DataType Entry::ConstType()
+* virtual size_t Entry::ArrayLen()
+* virtual const char *Entry::Table()
+* virtual WindOpType Entry::WindOp()
+* virtual gd_triplet_t Entry::Threshold()
+* virtual int Entry::CountVal()
+* virtual int Entry::Period()
+
+  These methods will return the corresponding member of the gd_entry_t object.
+  Only methods reasonable to be queried for the given field type will return
+  meaningful results.
+
+* virtual const char *Entry::Input(int index = 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)
+
+  These methods will return an element from the gd_entry_t members in_fields[],
+  m[], or b[], indexed by the supplied parameter.  Attempts to access elements
+  out of range for the field that the Entry class describes will not return
+  meaningful results.
+
+
+ENTRY CHILD CLASSES
+===================
+
+The following classes are provided to create Entry objects of the corresponding
+field type.  They inherit from Entry, and behave in the same way: if they are
+associated, changing field parameters, will result in a call to the C API to
+update the entry in the dirfile.
+
+
+RawEntry Class
+--------------
+
+Defined in getdata/rawentry.h
+
+* RawEntry::RawEntry()
+  
+  This creates a new RAW entry object with default parameters.
+
+* RawEntry::RawEntry(const char *field_code, DataType data_type,
+    unsigned int spf, int fragment_index = 0)
+
+* const char *RawEntry::FileName()
+
+  This calls gd_raw_filename(3) and returns the pathname of the binary file
+  associated with the RAW field.
+
+* virtual unsigned int RawEntry::SamplesPerFrame()
+* virtual DataType RawEntry::RawType()
+* virtual const char *Scalar()
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int RawEntry::SetSamplesPerFrame(unsigned int spf, int recode = 0)
+* int RawEntry::SetSamplesPerFrame(const char *spf, int recode = 0)
+* int RawEntry::SetType(DataType type, int recode = 0)
+
+  These methods will change the specified field parameter by calling
+  gd_alter_raw(3).  If recode is non-zero, the binary file will also be
+  translated.  To use a CONST field code as the sample per frame, pass a string
+  to SetSamplesPerFrame().
+
+
+LincomEntry Class
+-----------------
+
+Defined in getdata/lincomentry.h
+
+* LincomEntry::LincomEntry()
+  
+  This creates a new LINCOM entry object with default parameters.
+
+* LincomEntry::LincomEntry(const char *field_code, int n_fields,
+    const char **in_fields, double *m, double *b, int fragment_index = 0)
+* LincomEntry::LincomEntry(const char *field_code, int n_fields,
+    const char **in_fields, std::complex<double> *m, std::complex<double> *b,
+    int fragment_index = 0)
+
+* virtual const char *LincomEntry::Input(int index = 0)
+* virtual int LincomEntry::ComplexScalars()
+* virtual int LincomEntry::NFields()
+* virtual double LincomEntry::Scale(int index = 0)
+* virtual std::complex<double> LincomEntry::CScale(int index = 0)
+* virtual double LincomEntry::Offset(int index = 0)
+* virtual std::complex<double> LincomEntry::COffset(int index = 0)
+* virtual const char *LincomEntry::Scalar(int index = 0)
+* virtual int LincomEntry::ScalarIndex(int index = 0)
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int LincomEntry::SetInput(const char *field, int index = 0)
+* int LincomEntry::SetScale(double scale, int index = 0)
+* int LincomEntry::SetScale(const char* scale, int index = 0)
+* int LincomEntry::SetScale(std::complex<double> scale, int index = 0)
+* int LincomEntry::SetOffset(double offset, int index = 0)
+* int LincomEntry::SetOffset(const char* scale, int index = 0)
+* int LincomEntry::SetOffset(std::complex<double> offset, int index = 0)
+
+  These functions will change the specified field parameter associated with the
+  input field with the given index, which should be between zero and two.  To
+  use a CONST field code as a parameter, pass a string to the appropriate
+  function.  The complex scalar flag will be updated automatically as
+  appropriate.
+
+* int LincomEntry::SetNFields(int nfields)
+
+  This will set the number of input fields for the LINCOM.  If this is greater
+  than its previous value, the Set methods above should be used to initialise
+  the data.
+
+
+LinterpEntry Class
+------------------
+
+Defined in getdata/linterpentry.h
+
+* LinterpEntry::LinterpEntry()
+  
+  This creates a new LINTERP entry object with default parameters.
+
+* LinterpEntry::LinterpEntry(const char *field_code, const char *in_field,
+    const char *table, int fragment_index = 0)
+
+* virtual const char *Entry::Input()
+* virtual const char *LinterpEntry::Table()
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int LinterpEntry::SetInput(const char *field)
+* int LinterpEntry::SetTable(const char *table, int move_table = 0)
+
+  These methods will change the specified field parameter by calling
+  gd_alter_raw(3).  If move_table is non-zero, the existing look-up table will
+  be renamed to account for the change in name.
+
+
+BitEntry and SBitEntry Classes
+------------------------------
+
+Defined in getdata/bitentry.h and getdata/sbitentry.h
+
+* BitEntry::BitEntry()
+* SBitEntry::SBitEntry()
+  
+  These creates a new BIT or SBIT entry object with default parameters.
+
+* BitEntry::BitEntry(const char *field_code, const char *in_field, int bitnum,
+    int numbits = 1, int fragment_index = 0)
+* SBitEntry::SBitEntry(const char *field_code, const char *in_field, int bitnum,
+    int numbits = 1, int fragment_index = 0)
+
+* virtual const char *Input(int __gd_unused index = 0)
+* virtual int FirstBit()
+* virtual int NumBits()
+* virtual const char *Scalar(int index = 0)
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int (S)BitEntry::SetInput(const char *field)
+* int (S)BitEntry::SetFirstBit(int first_bit)
+* int (S)BitEntry::SetFirstBit(const char *first_bit)
+* int (S)BitEntry::SetNumBits(int num_bits)
+* int (S)BitEntry::SetNumBits(const char *num_bits)
+
+  These methods will change the specified field parameter.  To use a CONST
+  field code as a parameter, pass a string to the appropriate function.
+
+
+MultiplyEntry Class
+-------------------
+
+Defined in getdata/multiplyentry.h
+
+* MultiplyEntry::MultiplyEntry()
+  
+  This creates a new MULTIPLY entry object with default parameters.
+
+* MultiplyEntry::MultiplyEntry(const char *field_code, const char *in_field1,
+    const char *in_field2, int fragment_index = 0)
+
+* virtual const char *MultiplyEntry::Input(int index = 0)
+
+  This method, re-implemented from the Entry class, returns one of the input
+  fields.
+
+* int MultiplyEntry::SetInput(const char *field, int index = 0)
+
+  This function will change the specified input field with the given index,
+  which should be zero or one.
+
+
+PhaseEntry Class
+----------------
+
+Defined in getdata/phaseentry.h
+
+* PhaseEntry::PhaseEntry()
+  
+  This creates a new PHASE entry object with default parameters.
+
+* PhaseEntry::PhaseEntry(const char *field_code, const char *in_field,
+    int shift, int fragment_index = 0)
+
+* virtual const char *PhaseEntry::Input()
+* virtual long int PhaseEntry::Shift()
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int PhaseEntry::SetInput(const char *field)
+* int PhaseEntry::SetShift(long int shift)
+* int PhaseEntry::SetShift(const char *shift)
+
+  These functions will change the specified input field with the given index,
+  which should be between zero or one.
+
+
+PolynomEntry Class
+-------------------
+
+Defined in getdata/lincomentry.h
+
+* PolynomEntry::PolynomEntry()
+  
+  This creates a new LINCOM entry object with default parameters.
+
+* PolynomEntry::PolynomEntry(const char *field_code, int poly_ord,
+    const char *in_field, double *a, int fragment_index = 0)
+* PolynomEntry::PolynomEntry(const char *field_code, int poly_ord,
+    const char *in_field, std::complex<double> *a int fragment_index = 0)
+
+* virtual const char *PolynomEntry::Input(int index = 0)
+* virtual int PolynomEntry::ComplexScalars()
+* virtual int PolynomEntry::PolyOrd()
+* virtual double PolynomEntry::Coefficient(int index = 0)
+* virtual std::complex<double> PolynomEntry::CCoefficient(int index = 0)
+* virtual const char *PolynomEntry::Scalar(int index = 0)
+* virtual int PolynomEntry::ScalarIndex(int index = 0)
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int PolynomEntry::SetInput(const char *field)
+* int PolynomEntry::SetCoefficient(double scale, int index = 0)
+* int PolynomEntry::SetCoefficient(const char* scale, int index = 0)
+* int PolynomEntry::SetCoefficient(std::complex<double> scale, int index = 0)
+
+  These functions will change the specified field parameter associated with the
+  input field with the given index, which should be between zero and two.  To
+  use a CONST field code as a parameter, pass a string to the appropriate
+  function.  The complex scalar flag will be updated automatically as
+  appropriate.
+
+* int PolynomEntry::SetPolyOrd(int nfields)
+
+  This will set the polynomial order for the POLYNOM.  If this is greater than
+  its previous value, the Set methods above should be used to initialise the
+  data.
+
+
+DivideEntry Class
+-------------------
+
+Defined in getdata/divideentry.h
+
+* DivideEntry::DivideEntry()
+  
+  This creates a new DIVIDE entry object with default parameters.
+
+* DivideEntry::DivideEntry(const char *field_code, const char *in_field1,
+    const char *in_field2, int fragment_index = 0)
+
+* virtual const char *DivideEntry::Input(int index = 0)
+
+  This method, re-implemented from the Entry class, returns one of the input
+  fields.
+
+* int DivideEntry::SetInput(const char *field, int index = 0)
+
+  This function will change the specified input field with the given index,
+  which should be zero or one.
+
+
+RecipEntry Class
+-------------------
+
+Defined in getdata/recipentry.h
+
+* RecipEntry::RecipEntry()
+  
+  This creates a new RECIP entry object with default parameters.
+
+* RecipEntry::RecipEntry(const char *field_code, const char *in_field1,
+    const char *in_field2, int fragment_index = 0)
+
+* virtual const char *RecipEntry::Input()
+* virtual int RecipEntry::ComplexScalars()
+* virtual double RecipEntry::Dividend()
+* virtual std::complex<double> RecipEntry::CDividend()
+* virtual const char *RecipEntry::Scalar()
+* virtual int RecipEntry::ScalarIndex()
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int RecipEntry::SetInput(const char *field)
+* int RecipEntry::SetDividend(double coeff)
+* int RecipEntry::SetDividend(const char* coeff)
+* int RecipEntry::SetDividend(std::complex<double> coeff)
+
+  These functions will change the specified input field or the field dividend
+  to the the value or field code supplied.
+
+
+WindowEntry Class
+-------------------
+
+Defined in getdata/windowentry.h
+
+* WindowEntry::WindowEntry()
+  
+  This creates a new WINDOW entry object with default parameters.
+
+* WindowEntry::WindowEntry(const char *field_code, const char *in_field,
+    const char *check_field, int fragment_index = 0)
+
+* virtual const char *WindowEntry::Input(int index = 0)
+* virtual const char *WindowEntry::Scalar()
+* virtual int WindowEntry::ScalarIndex()
+* virtual WindOpType WindowEntry::WindOp()
+* virtual gd_triplet_t WindowEntry::Threshold()
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int WindowEntry::SetInput(const char *field, int index)
+* int WindowEntry::SetWindOp(WindOpType coeff)
+* int WindowEntry::SetThreshold(gd_triplet_t threshold)
+* int WindowEntry::SetThreshold(const char *threhsold)
+
+  These functions will change the specified input field, check field, or the
+  window operation or threshold to the the value or field code supplied.  For
+  allowed values of variables of type WindOpType, see the CONSTANTS section
+  above.
+
+
+MplexEntry Class
+-------------------
+
+Defined in getdata/mplex.h
+
+* Mplex::MplexEntry()
+  
+  This creates a new MPLEX entry object with default parameters.
+
+* MplexEntry::MplexEntry(const char *field_code, const char *in_field,
+    const char *check_field, int fragment_index = 0)
+
+* virtual const char *MplexEntry::Input(int index = 0)
+* virtual const char *MplexEntry::Scalar()
+* virtual int MplexEntry::ScalarIndex()
+* virtual int MplexEntry::CountVal()
+* virtual int MplexEntry::Period()
+
+  These methods, re-implemented from the Entry class, return the corresponding
+  field parameter.
+
+* int MplexEntry::SetInput(const char *field, int index)
+* int MplexEntry::SetWindOp(WindOpType coeff)
+* int MplexEntry::SetCountVal(int count_val)
+* int MplexEntry::SetCountVal(const char *count_val)
+* int MplexEntry::SetPeriod(int period)
+* int MplexEntry::SetPeriod(const char *period)
+
+  These functions will change the specified input field, check field, or the
+  count value or max to the value or field code supplied.
+
+
+CarraytEntry Class
+----------------
+
+Defined in getdata/constentry.h
+
+* CarraytEntry::CarraytEntry()
+  
+  This creates a new CONST entry object with default parameters.
+
+* CarraytEntry::CarraytEntry(const char *field_code, DataType type,
+    int fragment_index = 0)
+
+* virtual DataType CarraytEntry::ConstType()
+* virtual size_t Carray::ArrayLen()
+
+  This method, re-implemented from the Entry class, returns the data type of the
+  CONST field.
+
+* int SetArrayLen(size_t array_len)
+* int SetType(DataType field)
+
+  These method will change the data type or length of the CARRAY field.  They
+  return non-zero on error.
+
+
+ConstEntry Class
+----------------
+
+Defined in getdata/constentry.h
+
+* ConstEntry::ConstEntry()
+  
+  This creates a new CONST entry object with default parameters.
+
+* ConstEntry::ConstEntry(const char *field_code, DataType type,
+    int fragment_index = 0)
+
+* virtual DataType ConstEntry::ConstType()
+
+  This method, re-implemented from the Entry class, returns the data type of the
+  CONST field.
+
+* int SetType(DataType field)
+
+  This method will change the data type of the CONST field.  It returns non-zero
+  on error.
+
+
+StringEntry Class
+-----------------
+
+Defined in getdata/stringentry.h
+
+* StringEntry::StringEntry()
+  
+  This creates a new STRING entry object with default parameters.
+
+* StringEntry::StringEntry(const char *field_code, int fragment_index = 0)
+
+
+IndexEntry Class
+----------------
+
+Defined in getdata/indexentry.h
+
+The IndexEntry has no public constructor, nor any methods other than the ones
+provided by the Entry base class.
diff --git a/doc/README.f77 b/doc/README.f77
new file mode 100644
index 0000000..5fe24f8
--- /dev/null
+++ b/doc/README.f77
@@ -0,0 +1,2202 @@
+FORTRAN 77 BINDINGS FOR GETDATA
+===============================
+
+This README describes the Fortran 77 bindings for the GetData library.  These
+bindings consist of a Fortran compatibility library, 'libfgetdata' (written in
+C) and a Fortran 77 source file, 'getdata.f' which defines useful Fortran
+parameters and declares the external subroutines.
+
+These bindings are designed to comply to the Fortran 77 standards.  As a result,
+identifiers are limited to six characters.   The compatibility library will
+take care of converting Fortran CHARACTER stings to C strings.  However, as a
+result, when strings are passed to the compatibility library as arguments, the
+length of the string must also be passed.
+
+Because Fortran 77 handles neither pointers nor abstract data types, DIRFILE
+pointers are not used to refer to dirfile instances.  Instead, an integer
+dirfile unit number is used.  Space is available in the compatibility library
+for only 1023 dirfile units.  If an application attempts to open more than 1023
+dirfiles simultaneously, the compatibility library will emit an error message
+on standard error and raise SIGABRT.  Passing an invalid dirfile unit number to
+a subroutines which requires one as input (other than GDCLOS, which will simply
+ignore it) will result in the call failing with error code GD_EBD
+(= GD_E_BAD_DIRFILE, see below).
+
+Including getdata.f (which will be installed in the same directory as getdata.h)
+will define several convenient parameters including the DIRFILE flags, the data
+type specifiers, and error codes.  See below for a complete list.  If your
+Fortran 77 compiler supports the MIL STD 1753 (DoD Extension) INCLUDE statement
+(which any remotely modern compiler should), you can include this file in your
+Fortran program to define these constants.
+
+All integer type parameters passed to the compatibility library are of type
+INTEGER (i.e. the native size of the platform).  As a result, largefile support
+are not be available in the Fortran 77 bindings.
+
+All character string arguments require also an integer indicating the size of
+the character buffer.  In cases where the bindings return a string value, the
+value will not be returned if the string length supplied is too short.  In
+these cases, the character string will be left untouched, but the integer
+indicating the string length will be updated to indicate the required string
+length.  The exception to this is GDESTR, which simply truncates the string
+it outputs, as the C API does.
+
+Available Subroutines
+=====================
+
+Subroutines interacting with the database
+-----------------------------------------
+
+* GDOPEN(dirfile_unit, dirfilename, dirfilename_len, flags)
+  
+  Output:
+    INTEGER dirfile_unit
+  Input:
+    INTEGER dirfilename_len, flags
+    CHARACTER*<dirfilename_len> dirfilename
+
+  This wraps gd_open(3), with the same input arguments (dirfilename_len should
+  contain the string length of dirfilename).  It returns the dirfile unit number
+  in dirfile_unit.  The flags should be a bitwise "or"d list of flag parameters
+  (see below).  This behaves analogously to gd_open() itself: it returns a valid
+  dirfile unit even in case of error.
+
+* GDCOPN(dirfile_unit, dirfilename, dirfilename_len, flags, sehandler)
+
+  Output:
+    INTEGER dirfile_unit
+  Input:
+    INTEGER dirfilename_len, flags
+    CHARACTER*<dirfilename_len> dirfilename
+    EXTERNAL sehandler
+
+  This wraps gd_cbopen(3), and behaves identically to GDOPEN, except for
+  requiring the name of the callback subroutine as sehandler.  The callback
+  subroutine should accept the following arguments:
+
+    SUBROUTINE CALBCK(act, dirfile_unit, suberror, line)
+    INTEGER act, dirfile_unit, suberror
+    CHARACTER*(GD_MLL) line
+
+  where GD_MLL is a integer parameter, defined in getdata.f, equal to the value
+  of the C macro GD_MAX_LINE_LENGTH.  The callback subroutine may modify line,
+  and should set act to one of the syntax handler action parameters (see below).
+  If the callback subroutine fails to set act, the default action (GDSX_A =
+  GD_SYNTAX_ABORT) will be assumed.  The possible values of suberror are also
+  listed below.  If GDCOPN is passed zero as sehandler, no callback is set.
+
+  The callback subroutine is wrapped by the Fortran 77 library to properly
+  interface with GetData.  Other than GDCOPN, the only other subroutines which
+  potentially could cause the callback subroutine to be called are GDINCL and
+  GDINCA.  Use GDCLBK to change the callback function before calling GDINCL or
+  GDINCA, if required.
+
+* GDCLBK(dirfile_unit, callback)
+
+  Input:
+    INTEGER dirfile_unit
+    EXTERNAL callback
+
+  This wraps gd_parser_callback(3), setting the registered parser callback to
+  the subroutine given.  The signature of this subroutine is given above under
+  GDCOPN.  Unlike the C interface, this function cannot be used to remove a
+  registered callback; use GDNOCB for that.
+
+* GDNOCB(dirfile_unit)
+
+  Input:
+    INTEGER dirfile_unit
+
+  This calls gd_parser_callback(3) to deregister a previous parser callback
+  associated with the specified dirfile.  If it had none, this procedure does
+  nothing.
+
+* GDINVD(dirfile_unit)
+
+  Output:
+    INTEGER dirfile_unit
+
+  This wraps gd_invalid_dirfile(3), and returns the unit number of a
+  newly-created, invalid dirfile.
+
+* GDCLOS(dirfile_unit)
+
+  Input:
+    INTEGER dirfile_unit
+
+  This wraps gd_close(3).  The argument is the dirfile unit to close.  In
+  addition to closing the dirfile itself, this will also disassociate the
+  supplied dirfile unit number, which may be subsequently returned by a
+  subsequent call to GDOPEN.
+
+* GDDSCD(dirfile_unit)
+
+  Input:
+    INTEGER dirfile_unit
+
+  This wraps gd_discard(3), but otherwise behaves identically to GDCLOS.
+
+* GDFLSH(dirfile_unit, field_code, field_code_len)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_flush(3).  If field_code_len is zero, the entire dirfile will be
+  flushed, and field_code will be ignored.  Otherwise the field named by
+  field_code will be flushed.
+
+* GDSYNC(dirfile_unit, field_code, field_code_len)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_sync(3).  If field_code_len is zero, the entire dirfile will be
+  synced, and field_code will be ignored.  Otherwise the field named by
+  field_code will be synced.
+
+* GDRCLO(dirfile_unit, field_code, field_code_len)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_raw_close(3).  If field_code_len is zero, the entire dirfile
+  will be closed, and field_code will be ignored.  Otherwise the field named by
+  field_code will be closed.
+
+* GDMFLS(dirfile_unit)
+
+  Input:
+    INTEGER dirfile_unit
+
+  This subroutine wraps gd_metaflush(3), and will cause metadata changes to be
+  written to disk.
+
+* GDDSYN(desync, dirfile_unit, flags)
+
+  Output:
+    INTEGER desync
+  Input:
+    INTEGER dirfile_unit, flags
+
+  This wraps gd_desync(3), and sets desync to a non-zero value if the loaded
+  dirfile has become desynchronised from the metadata on disk and will,
+  optionally, reload the dirfile.
+
+* GDFLAG(flags, dirfile_unit, set, reset)
+
+  Output:
+    INTEGER flags
+  Input:
+    INTEGER dirfile_unit, set, reset
+
+  This wraps gd_flags(3).  The value of the flags after modification are
+  returned in flags.
+
+* GDTOKE(token, token_len, dirfile_unit, string, string_len)
+
+  Output:
+    CHARACTER*<token_len> token
+  Input/Output:
+    INTEGER token_len
+  Input:
+    INTEGER dirfile_unit, string_len
+    CHARACTER*<string_len> string
+
+  This wraps gd_strtok(3).  If string_len <= 0, the next token of the previously
+  supplied string is returned in token (ie. NULL is passed to gd_strtok(3)),
+  otherwise, the first token from string is returned, and the string is cached
+  by GetData.  If the output token is longer than the supplied token_len, the
+  actual length of the token is returned in token_len and token is unmodified.
+
+* GDVBPX(dirfile_unit, prefix, prefix_len
+
+  Input:
+    INTEGER dirfile_unit, prefix_len
+    CHARACTER*<prefix_len> prefix
+
+  This wraps gd_verbose_prefix(3).  To remove a prefix, set prefix_len to
+  zero, in which case prefix itself is ignored.
+
+Subroutines interacting with data
+---------------------------------
+
+* GDGETD(n_read, dirfile_unit, field_code, field_code_len, first_frame,
+  first_sample, num_frames, num_samples, return_type, data_out)
+
+  Output:
+    INTEGER n_read
+    <datatype> data_out(n)
+  Input:
+    INTEGER dirfile_unit, field_code_len, first_frame, first_sample
+    INTEGER num_frames, num_samples, return_type
+    CHARACTER*<field_code_len> field_code
+
+  This wraps getdata(3), with the same input arguments (field_code_len should
+  contain the string length of the field_code).  The number of samples actually
+  read is returned in n_read.  The return_type parameter should be one of the
+  parameters defined in getdata.f (see below).  data_out must be of sufficient
+  length and of appropriate data type width for the data returned.
+
+* GDGTCA(dirfile_unit, field_code, field_code_len, return_type, data_out)
+
+  Output:
+    <datatype> data_out(array_len)
+  Input:
+    INTEGER dirfile_unit, field_code_len, return_type
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_get_carray(3), with the same input arguments (field_code_len
+  should contain the string length of the field_code).  The return_type
+  parameter should be one of the parameters defined in getdata.f.  data_out must
+  be of appropriate data type width and length for the data returned.
+
+* GDGCAS(dirfile_unit, field_code, field_code_len, start, n, return_type,
+  data_out)
+
+  Output:
+    <datatype> data_out(array_len)
+  Input:
+    INTEGER dirfile_unit, field_code_len, return_type, start, n
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_get_carray_slice(3), with the same input arguments
+  (field_code_len should contain the string length of the field_code).  The
+  return_type parameter should be one of the parameters defined in getdata.f.
+  data_out must be of appropriate data type width and length for the data
+  returned.
+
+* GDGTCO(dirfile_unit, field_code, field_code_len, return_type, data_out)
+
+  Output:
+    <datatype> data_out
+  Input:
+    INTEGER dirfile_unit, field_code_len, return_type
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_get_constant(3), with the same input arguments (field_code_len
+  should contain the string length of the field_code).  The return_type
+  parameter should be one of the parameters defined in getdata.f.  data_out must
+  be of appropriate data type width for the data returned.
+
+* GDGTST(size, dirfile_unit, field_code, field_code_len, len, data_out)
+
+  Output:
+    INTEGER size
+    CHARACTER*<len> data_out
+  Input:
+    INTEGER dirfile_unit, field_code_len, len
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_get_string(3), with the same input arguments (field_code_len
+  should contain the string length of the field_code).  The number of characters
+  actually read is returned in size.  At most len characters will be returned.
+
+* GDPUTD(n_wrote, dirfile_unit, field_code, field_code_len, first_frame,
+  first_sample, num_frames, num_samples, data_type, data_in)
+
+  Output:
+    INTEGER n_wrote
+  Input:
+    INTEGER dirfile_unit, field_code_len, first_frame, first_sample
+    INTEGER num_frames, num_samples, data_type
+    CHARACTER*<field_code_len> field_code
+    <datatype> data_out(n)
+
+  This wraps gd_putdata(3), with the same input arguments (field_code_len should
+  contain the string length of the field_code).  The number of samples actually
+  written is returned in n_wrote.  The data_type parameter should be one of the
+  parameters defined in getdata.f.  data_in must be of sufficient length and
+  of appropriate data type width for the data input.
+
+* GDPTCA(dirfile_unit, field_code, field_code_len, data_type, data_in)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, data_type
+    CHARACTER*<field_code_len> field_code
+    <datatype> data_in(array_len)
+
+  This wraps gd_put_carray(3), with the same input arguments (field_code_len
+  should contain the string length of the field_code).  The data_type parameter
+  should be one of the parameters defined in getdata.f.
+
+* GDPCAS(dirfile_unit, field_code, field_code_len, start, n, data_type, data_in)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, data_type
+    CHARACTER*<field_code_len> field_code
+    <datatype> data_in(n)
+
+  This wraps gd_put_carray_slice(3), with the same input arguments
+  (field_code_len should contain the string length of the field_code).  The
+  data_type parameter should be one of the parameters defined in getdata.f.
+
+* GDPTCO(dirfile_unit, field_code, field_code_len, data_type, data_in)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, data_type
+    CHARACTER*<field_code_len> field_code
+    <datatype> data_in
+
+  This wraps gd_put_constant(3), with the same input arguments (field_code_len
+  should contain the string length of the field_code).  The data_type parameter
+  should be one of the parameters defined in getdata.f.
+
+* GDPTST(size, dirfile_unit, field_code, field_code_len, len, data_out)
+
+  Output:
+    INTEGER size
+  Input:
+    INTEGER dirfile_unit, field_code_len, len
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<len> data_in
+
+  This wraps gd_put_string(3), with the same input arguments (field_code_len
+  should contain the string length of the field_code, and len should contain the
+  string length of data_in).  The number of characters actually written is
+  returned in size.
+
+* GDVLDT(invalid, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER invalid
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_validate(3), and returns non-zero if there is a
+  problem with the specified field.
+
+* GDFNUM(framenum, dirfile_unit, field_code, field_code_len, value)
+
+  Output:
+    REAL*8 invalid
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    REAL*8 value
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_framenum(3), and performs a reverse look-up on a
+  field.
+
+* GDFNSS(framenum, dirfile_unit, field_code, field_code_len, value, field_start,
+  field_end)
+
+  Output:
+    REAL*8 invalid
+  Input:
+    INTEGER dirfile_unit, field_code_len, field_start, field_end
+    REAL*8 value
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_framenum_subset(3), and performs a reverse
+  look-up on a field.
+
+* GDSEEK(pos, dirfile_unit, field_code, field_code_len, frame_num, sample_num,
+  flags)
+
+  Output:
+    INTEGER pos
+  Input:
+    INTEGER dirfile_unit, field_code_len, frame_num, sample_num, flags
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_seek(3), and repositions the field pointer of the
+  specified field.  It returns the new value of the field pointer.  The
+  'flags' argument should be one of GDSK_S, GDSK_C, or GDSK_E, optionally
+  bitwise or'd with GDSK_E.
+
+* GDTELL(pos, dirfile_unit, field_code)
+
+  Output:
+    INTEGER pos
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_tell(3), and returns the current value of the field
+  pointer for the specified field.
+
+* GDMXLB(dirfile_unit, lookback)
+
+  Input:
+    INTEGER dirfile_unit, lookback
+
+  This wraps gd_mplex_lookback(3).
+
+
+Subroutines interacting with global metadata
+--------------------------------------------
+
+* GDNENT(nentries dirfile_unit, parent, parent_len, type, flags)
+
+  Output:
+    INTEGER nentries
+  Input:
+    INTEGER dirfile_unit, parent_len, type, flags
+    CHARACTER*<parent_len> parent
+ 
+  This wraps gd_nentries(3).  It returns the number of entries in the dirfile
+  satisfying the supplied criteria.  If parent_len is zero, parent itself is
+  ignored, and top-level entries are considered.  Otherwise, meta-entries
+  under parent are considered.
+
+* GDNFLD(nfields, dirfile_unit)
+* GDNFDT(nfields, dirfile_unit, type)
+* GDNVEC(nvectors, dirfile_unit)
+* GDNMFD(nfields, dirfile, parent, parent_l)
+* GDNMFT(nfields, dirfile, parent, parent_l, type)
+* GDNMVE(nvectors, dirfile, parent, parent_l)
+
+  These procedures wrap, respectively, gd_nfields(3), gd_nfields_by_type(3),
+  gd_nvectors(3), gd_nmfields(3), gd_nmfields_by_type(3), and gd_nmvectors(3),
+  and are all special cases of GDNENT.
+
+* GDNALS(nfields, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER nframes
+  Input:
+    INTEGER dirfile_unit
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_naliases(3).  It returns the number of aliases of field_code
+  (including field_code itself).
+
+* GDENTX(entry_max, dirfile_unit, parent, parent_len, type, flags)
+
+  Output:
+    INTEGER entry_max
+  Input:
+    INTEGER dirfile_unit, parent_len, type, flags
+    CHARACTER*<parent_len> parent
+ 
+  This subroutine, which has no direct analogue in the C API, returns the
+  length of the longest entry name defined in the dirfile.  It returns
+  the length (in characters) of the longest entry name in the dirfile in
+  entry_max which satisfies the given criteria.  If parent_len is zero,
+  parent itself is ignored, and top-level entries are considered.
+  Otherwise, meta-entries under parent are considered.
+ 
+* GDFDNX(field_max, dirfile_unit)
+* GDMFNX(field_max, dirfile_unit, parent, parent_len)
+
+  These subroutines are special cases of GDENTX, with type and flags both
+  equal to zero, and, in the case of GDFDNX, parent_len also zero.
+ 
+* GDENTN(name, name_len, dirfile_unit, parent, parent_len, type, flags,
+  entry_num)
+
+  Output:
+    CHARACTER*<name_len> name
+  Input/Output:
+    INTEGER name_len
+  Input:
+    INTEGER dirfile_unit, parent_len, type, flags, entry_num
+    CHARACTER*<parent_len> parent
+
+  This subroutine is the replacement for gd_entry_list(3).  It returns in
+  name a Fortran 77 string containing the entry name of the entry indexed by
+  entry_num (which is should be a number between 1 and the output of GDNENT).
+  If the name of the field is longer than name_len, it will return the actual
+  length of the field in name_len and not modify the name argument.  If
+  entry_num is out of range, name_len will be set to zero, and name will not be
+  modified.
+
+* GDFLDN(name, name_len, dirfile_unit, field_num)
+* GDFDNT(name, name_len, dirfile_unit, type, field_num)
+* GDVECN(name, name_len, dirfile_unit, field_num)
+* GDMFDN(name, name_len, dirfile_unit, parent, parent_len, field_num)
+* GDMFDT(name, name_len, dirfile_unit, parent, parent_len, type, field_num)
+* GDMVEN(name, name_len, dirfile_unit, parent, parent_len, field_num)
+
+  These subroutines are replacements for, respectively, gd_field_list(3),
+  gd_field_list_by_type(3), gd_vector_list(3), gd_mfield_list(3),
+  gd_mfield_list_by_type(3), and gd_mvector_list(3), and are all special cases
+  of GDENTN.
+
+* GDALSS(name, name_len, dirfile_unit, field_code, field_code_len, field_num)
+
+  Output:
+    CHARACTER*<name_len> name
+  Input/Output:
+    INTEGER name_len
+  Input:
+    INTEGER dirfile_unit, field_num, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine is the replacement for gd_aliases(3) and behaves in
+  the same manner as GDFLDN.
+
+* GDSTRX(string_max, dirfile_unit)
+
+  Output:
+    INTEGER string_max
+  Input:
+    INTEGER dirfile_unit
+
+  This subroutine, which has no direct analogue in the C API, returns the length
+  of the longest STRING field defined in the dirfile.  It takes the dirfile unit
+  number as input and returns the length (in characters) of the longest STRING
+  in the dirfile in string_max.
+ 
+* GDMSTX(string_max, dirfile_unit, parent, parent_len)
+
+  Output:
+    INTEGER string_max
+  Input:
+    INTEGER dirfile_unit, parent_len
+    CHARACTER*<parent_len> parent
+
+  This subroutine, which has no direct analogue in the C API, returns the length
+  of the longest STRING defined in the dirfile for META fields of the supplied
+  parent field.  It returns the length (in characters) of the longest STRING
+  META field for the supplied parent in string_max.
+ 
+* GDCONS(value, dirfile_unit, return_type, field_num)
+
+  Output:
+    CHARACTER*<name_len> name
+    <datatype> value
+  Input:
+    INTEGER dirfile_unit, field_num
+
+  This subroutine is the replacement for gd_constants(3) and behaves in the same
+  manner as GDFLDN.
+
+* GDMCOS(value, dirfile_unit, parent, parent_len, return_type, field_num)
+
+  Output:
+    CHARACTER*<name_len> name
+    <datatype> value
+  Input:
+    INTEGER dirfile_unit, field_num, parent_len
+    CHARACTER*<parent_len> parent
+
+  This subroutine is the replacement for gd_mconstants(3) and behaves in the
+  same manner as GDFLDN.
+
+* GDSTRS(value, value_len, dirfile_unit, field_num)
+
+  Output:
+    CHARACTER*<value_len> value
+  Input/Output:
+    INTEGER value_len
+  Input:
+    INTEGER dirfile_unit, field_num
+
+  This subroutine is the replacement for gd_strings(3) and behaves in the same
+  manner as GDSTRS.
+
+* GDMSTS(value, value_len, dirfile_unit, parent, parent_len, field_num)
+
+  Output:
+    CHARACTER*<value_len> value
+  Input/Output:
+    INTEGER value_len
+  Input:
+    INTEGER dirfile_unit, field_num, parent_len
+    CHARACTER*<parent_len> parent
+
+  This subroutine is the replacement for gd_mstrings(3) and behaves in the same
+  manner as GDFLDN.
+
+* GDNFRM(nframes, dirfile_unit)
+
+  Output:
+    INTEGER nframes
+  Input:
+    INTEGER dirfile_unit
+
+  This wraps gd_nframes(3).  It takes the dirfile unit number as input and
+  returns the number of frames in the dirfile in nframes.
+
+* GDALSX(alias_max, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER alias_max
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine, which has no direct analogue in the C API, returns the
+  length of the longest alias defined in the dirfile for field_code.
+ 
+* GDECNT(error_count, dirfile_unit)
+
+  Output:
+    INTEGER error_count
+  Input:
+    INTEGER dirfile_unit
+
+  This subroutine wraps gd_error_count(3).  It takes the dirfile unit number as
+  input and returns the number of errors encountered by GetData since the last
+  call to this subroutine (or since the dirfile was first opened) in
+  error_count.
+
+* GDEROR(error, dirfile_unit)
+
+  Output:
+    INTEGER error
+  Input:
+    INTEGER dirfile_unit
+
+  This subroutine wraps gd_error(3).  It takes the dirfile unit number as input
+  and returns the error value arising from the last library call in error.  The
+  value of error will equal one of the error codes defined in getdata.f.
+
+* GDESTR(dirfile_unit, buffer, buffer_len)
+
+  Output:
+    CHARACTER*<buffer_len> buffer
+  Input:
+    INTEGER dirfile_unit, buffer_len
+
+  This subroutine takes a dirfile unit as input and will write the error
+  string returned by gd_error_string(3) in buffer, which is of length
+  buffer_len.
+
+* GDNFRG(nformats, dirfile_unit)
+
+  Output:
+    INTEGER nformats
+  Input:
+    INTEGER dirfile_unit
+
+  This subroutine returns the number of format file fragments in the specified
+  dirfile.
+
+* GDNAME(name, name_len, dirfile_unit)
+
+  Output:
+    CHARACTER*<name_len> name
+  Input/Output:
+    INTEGER name_len
+  Input:
+    INTEGER dirfile_unit
+
+  This wraps diriflename(3).  The name of the dirfile will be returned in name.
+  If the name of the dirfile is longer than name_len, it will return the actual
+  length of the name in name_len and not modify the name argument.
+
+* GDREFE(name, name_len, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    CHARACTER*<name_len> name
+  Input/Output:
+    INTEGER name_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_reference(3).  The reference field will be set to field_code,
+  unless field_code_len is zero, in which case the reference field will not be
+  changed, and field_code will be ignored.  The name of the reference field will
+  be returned in name.  If the name of the reference field is longer than
+  name_len it will return the actual length of the field in name_len and not
+  modify the name argument.
+
+* GDSTDV(version, dirfile_unit)
+
+  Input/Output:
+    INTEGER version
+  Input:
+    INTEGER dirfile_unit
+
+  This wraps gd_dirfile_standards(3).  It attempts to set the current Standards
+  Version of the loaded dirfile to the value specified by version (which may
+  equal the parameter GDSV_C indicating no change).  It then returns the
+  current Version in version, or -1 on error.
+
+
+Subroutines interacting with fragment metadata
+----------------------------------------------
+
+* GDFRGN(filename, filename_len, dirfile_unit, ind)
+
+  Output:
+    CHARACTER*<infield_len> infield
+  Input/Output:
+    INTEGER infield_len
+  Input:
+    INTEGER ind
+
+  This subroutine returns the name of the format file fragment indexed by ind.
+  If the name of the file is longer than filename_len, it will return the
+  actual length of the filename in filename_len and not modify the filename
+  argument.
+
+* GDINCL(dirfile_unit, file, file_len, fragment_index, flags)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, fragment_index, flags
+    CHARACTER*<file_len> file
+
+  This subroutine wraps gd_include(3), and allows the inclusion of another
+  format file fragment into the current dirfile.  This may call the registered
+  callback subroutine, if any.  See the caveat in the description of GDCOPN
+  above.
+
+* GDINCA(dirfile_unit, file, file_len, fragment_index, prefix, prefix_len,
+  suffix, suffix_len, flags)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, fragment_index, prefix_len,
+    INTEGER suffix_len, flags
+    CHARACTER*<file_len> file
+    CHARACTER*<prefix_len> prefix
+    CHARACTER*<suffix_len> suffix
+
+  This subroutine wraps gd_include_affix(3), and allows the inclusion of another
+  format file fragment into the current dirfile with the specified field code
+  prefix and suffix.  This may call the registered callback subroutine, if any.
+  See the caveat in the description of GDCOPN above.
+
+* GDUINC(dirfile_unit, fragment, del)
+
+  Input:
+    INTEGER dirfile_unit, fragment, del
+
+  This subroutine wraps gd_uninclude(3).  It removes the specified fragment
+  from the dirfile.  If del is non-zero, the fragment file will be deleted.
+
+* GDGENC(encoding, dirfile_unit, fragment_index)
+
+  Output:
+    INTEGER encoding
+  Input:
+    INTEGER dirfile_unit, fragment_index
+
+  This subroutine wraps gd_encoding(3).  It returns the current encoding
+  scheme of the specified fragment, which will be one of the symbols listed
+  below.
+
+* GDAENC(dirfile_unit, encoding, fragment, recode)
+
+  Input:
+    INTEGER dirfile_unit, encoding, fragment, recode
+
+  This subroutine wraps gd_alter_encoding(3).  It sets the encoding scheme of
+  the specified fragment to the value of the encoding parameter, which should
+  be one of the encoding flags listed below.  If recode is non-zero, binary
+  files associated with this fragment will be modified to compensate for the
+  change.
+
+* GDGEND(endianness, dirfile_unit, fragment_index)
+
+  Output:
+    INTEGER endianness
+  Input:
+    INTEGER dirfile_unit, fragment_index
+
+  This subroutine wraps gd_endianness(3).  It returns the current byte sex
+  of the specified fragment, which will be one of the symbols listed below.
+
+* GDAEND(dirfile_unit, endianness, fragment, recode)
+
+  Input:
+    INTEGER dirfile_unit, endianness, fragment, recode
+
+  This subroutine wraps gd_alter_endianness(3).  It sets the byte sex of the
+  specified fragment to the value of the endianness parameter, which should be
+  zero or a combination of GD_BE and GD_LE as described on the
+  gd_alter_endianness manual page.  If recode is non-zero, binary files
+  associated with this fragment will be modified to compensate for the change.
+
+* GDGFOF(frame_offset, dirfile_unit, fragment_index)
+
+  Output:
+    INTEGER frame_offset
+  Input:
+    INTEGER dirfile_unit, fragment_index
+
+  This subroutine wraps gd_frameoffset(3).  It returns the current frame
+  offset of the specified fragment.
+
+* GDAFOF(dirfile_unit, frame_offset, fragment, recode)
+
+  Input:
+    INTEGER dirfile_unit, frame_offset, fragment, recode
+
+  This subroutine wraps gd_alter_frameoffset(3).  It sets the frame offset of
+  the specified fragment to the value of the frame_offset parameter.  If recode
+  is non-zero, binary files associated with this fragment will be modified to
+  compensate for the change.
+
+* GDGPRT(protection_level, dirfile_unit, fragment_index)
+
+  Output:
+    INTEGER protection_level
+  Input:
+    INTEGER dirfile_unit, fragment_index
+
+  This subroutine wraps gd_protection(3).  It returns the current protection
+  level of the specified fragment, which will be one of the symbols listed
+  below.
+
+* GDAPRT(dirfile_unit, protection_level, fragment)
+
+  Input:
+    INTEGER dirfile_unit, protection_level, fragment
+
+  This subroutine wraps gd_protect(3).  It sets the protection level of the
+  specified fragment to the value of the protection_level parameter, which
+  should one of the protection level listed below.
+
+* GDPFRG(parent, dirfile_unit, fragment)
+
+  Output:
+    INTEGER parent
+  Input:
+    INTEGER dirfile_unit, fragment
+
+  This subroutine wraps gd_parent_fragment(3).  It returns the parent
+  fragment of the specified fragment, or -1 on error.
+
+* GDFRAF(prefix, prefix_len, suffix, suffix_len, dirfile_unit, fragment_index)
+  
+  Output:
+    CHARACTER*<prefix_len> prefix
+    CHARACTER*<suffix_len> suffix
+  Input/Output:
+    INTEGER prefix_len, suffix_len
+  Input:
+    INTEGER dirfile_unit, fragment_index
+
+  This subroutine wraps gd_fragment_affixes(3), returning the field code
+  prefix and suffix for the specified fragment.  On error, it sets prefix_len
+  to zero.  In this case the value of the other output parameters in
+  unspecified.
+
+* GDAAFX(dirfile_unit, fragment, prefix, prefix_len, suffix, suffix_len
+
+  Input:
+    INTEGER dirfile_unit, fragment
+    CHARACTER*<prefix_len> prefix
+    CHARACTER*<suffix_len> suffix
+
+  This subroutine wraps gd_alter_affix(3).  It sets the field code prefix and
+  suffix of the specified fragment to the value of the prefix and suffix
+  parameters.
+
+
+Subroutines interacting with field metadata
+-------------------------------------------
+
+* GDGERW(spf, data_type, fragment_index, dirfile_unit, field_code,
+  field_code_len)
+
+  Output: 
+    INTEGER spf, data_type, fragment_index
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a RAW field.  It returns the
+  samples-per-frame, native data type, and the format file index in spf and
+  data_type.  The data_type will be one of the data type parameters listed
+  below.  If field_code is not found, or the field specified is not of RAW type,
+  spf will be set to zero.  In this case the value of the other output
+  parameters is unspecified.
+
+* GDGECL(nfields, infield1, infield1_len, m1, b1, infield2, infield2_len, m2,
+  b2, infield3, infield3_len, m3, b3, fragment_index, dirfile_unit, field_code,
+  field_code_len)
+
+  Output:
+    INTEGER nfields, fragment_index
+    CHARACTER*<infield1_len> infield1
+    CHARACTER*<infield2_len> infield2
+    CHARACTER*<infield3_len> infield3
+    COMPLEX*16 m1, b1, m2, b2, m3, b3
+  Input/Output:
+    INTEGER infield1_len, infield2_len, infield3_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a LINCOM field.  Although three
+  sets of arguments are required, only nfields of them will be updated.  If
+  field_code is not found, or the field specified is not of LINCOM type, nfields
+  will be set to zero.  In this case the value of the remaining data is
+  unspecified.
+
+* GDGELC(nfields, infield1, infield1_len, m1, b1, infield2, infield2_len, m2,
+  b2, infield3, infield3_len, m3, b3, fragment_index, dirfile_unit, field_code,
+  field_code_len)
+
+  Output:
+    INTEGER nfields, fragment_index
+    CHARACTER*<infield1_len> infield1
+    CHARACTER*<infield2_len> infield2
+    CHARACTER*<infield3_len> infield3
+    REAL*8 m1, b1, m2, b2, m3, b3
+  Input/Output:
+    INTEGER infield1_len, infield2_len, infield3_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This is equivalent to GDGELC above, but returns only the real part of the
+  scale factors and offset terms.
+
+* GDGELT(infield, infield_len, table, table_len, fragment_index, dirfile_unit,
+  field_code, field_code_len)
+
+  Output: 
+    CHARACTER*<infield_len> infield
+    CHARACTER*<table_len> table
+    INTEGER fragment_index
+  Input/Output:
+    INTEGER infield_len, table_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a LINTERP field.  If field_code
+  is not found, or the field specified is not of LINTERP type, infield_len will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDGEBT(infield, infield_len, bitnum, numbits, fragment_index, dirfile_unit,
+  field_code, field_code_len)
+
+  Output: 
+    CHARACTER*<infield_len> infield
+    INTEGER bitnum, numbits, fragment_index
+  Input/Output:
+    INTEGER infield_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a BIT field.  If field_code
+  is not found, or the field specified is not of BIT type, infield_len will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDGESB(infield, infield_len, bitnum, numbits, fragment_index, dirfile_unit,
+  field_code, field_code_len)
+
+  Output: 
+    CHARACTER*<infield_len> infield
+    INTEGER bitnum, numbits, fragment_index
+  Input/Output:
+    INTEGER infield_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a SBIT field.  If field_code
+  is not found, or the field specified is not of SBIT type, infield_len will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDGECR(infield, infield_len, dividend, fragment_index, dirfile_unit,
+  field_code, field_code_len)
+
+  Output: 
+    CHARACTER*<infield_len> infield
+    COMPLEX*16 dividend
+    INTEGER fragment_index
+  Input/Output:
+    INTEGER infield_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a RECIP field.  If field_code
+  is not found, or the field specified is not of RECIP type, infield_len will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDGERC(infield, infield_len, dividend, fragment_index, dirfile_unit,
+  field_code, field_code_len)
+
+  Output: 
+    CHARACTER*<infield_len> infield
+    REAL*8 dividend
+    INTEGER fragment_index
+  Input/Output:
+    INTEGER infield_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a RECIP field.  If field_code
+  is not found, or the field specified is not of RECIP type, infield_len will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDGEDV(infield1, infield1_len, infield2, infield2_len, fragment_index,
+  dirfile_unit, field_code, field_code_len)
+
+  Output: 
+    CHARACTER*<infield1_len> infield1
+    CHARACTER*<infield2_len> infield2
+    INTEGER fragment_index
+  Input/Output:
+    INTEGER infield1_len, infield2_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a DIVIDE field.  If field_code
+  is not found, or the field specified is not of DIVIDE type, infield1_len
+  will be set to zero.  In this case the value of the remaining data is
+  unspecified.
+
+* GDGEMT(infield1, infield1_len, infield2, infield2_len, fragment_index,
+  dirfile_unit, field_code, field_code_len)
+
+  Output: 
+    CHARACTER*<infield1_len> infield1
+    CHARACTER*<infield2_len> infield2
+    INTEGER fragment_index
+  Input/Output:
+    INTEGER infield1_len, infield2_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a MULTIPLY field.  If field_code
+  is not found, or the field specified is not of MULTIPLY type, infield1_len
+  will be set to zero.  In this case the value of the remaining data is
+  unspecified.
+
+* GDGEPH(infield, infield_len, shift, fragment_index, dirfile_unit, field_code,
+  field_code_len)
+
+  Output: 
+    CHARACTER*<infield_len> infield
+    INTEGER shift, fragment_index
+  Input/Output:
+    INTEGER infield_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a PHASE field.  If field_code
+  is not found, or the field specified is not of PHASE type, infield_len will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDGEPN(poly_ord, infield, infield_len, a0, a1, a2, a3, a4, a5, fragment_index,
+  dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER poly_ord, fragment_index
+    CHARACTER*<infield_len> infield
+    REAL*8 a0, a1, a2, a3, a4, a5
+  Input/Output:
+    INTEGER infield1_len, infield2_len, infield3_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This is equivalent to GDGECP above, but returns only the real part of the
+  coefficients.
+
+* GDGECP(poly_ord, infield, infield_len, a0, a1, a2, a3, a4, a5, fragment_index,
+  dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER poly_ord, fragment_index
+    CHARACTER*<infield_len> infield
+    COMPLEX*16 a0, a1, a2, a3, a4, a5
+  Input/Output:
+    INTEGER infield1_len, infield2_len, infield3_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a POLYNOM field.  Although six
+  coefficients must be provided, only poly_ord + 1 of them will be updated.  If
+  field_code is not found, or the field specified is not of POLYNOM type,
+  nfields will be set to zero.  In this case the value of the remaining data is
+  unspecified.
+
+* GDGEWD(infield, infield_len, checkfield, checkfield_len, windop, ithreshold,
+  rthreshold, fragment_index, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER windop, ithreshold, fragment_index
+    CHARACTER*<infield_len> infield
+    CHARACTER*<checkfield_len> checkfield
+  Input/Output:
+    INTEGER infield_len, checkfield_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a WINDOW field.  Only one of
+  ithreshold and rthreshold is ever updated.  If the returned windop is one of
+  GDW_EQ, GDW_NE, GDW_ST, or GDW_CL, ithreshold will be updated, otherwise,
+  rthreshold will be updated.  If field_code is not found, or the field
+  specified is not of POLYNOM type, infield_len will be set to zero.  In this
+  case the value of the remaining data is unspecified.
+
+* GDGEMX(infield, infield_len, countfield, countfield_len, countval, period,
+  fragment_index, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER countval, period, fragment_index
+    CHARACTER*<infield_len> infield
+    CHARACTER*<countfield_len> countfield
+  Input/Output:
+    INTEGER infield_len, countfield_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a MPLEX field.  If field_code
+  is not found, or the field specified is not of MPLEX type, infield_len will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDGECA(const_type, array_len, fragment_index, dirfile_unit, field_code,
+  field_code_len)
+
+  Output: 
+    INTEGER const_type, array_len, fragment_index
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a CARRAY field.  If field_code
+  is not found, or the field specified is not of CARRAY type, const_type will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDGECO(const_type, fragment_index, dirfile_unit, field_code, field_code_len)
+
+  Output: 
+    INTEGER const_type, fragment_index
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns metadata describing a CONST field.  If field_code
+  is not found, or the field specified is not of CONST type, const_type will
+  be set to zero.  In this case the value of the remaining data is unspecified.
+
+* GDCALN(array_len, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER array_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_carray_len(3).  The field_code_len parameter should contain the
+  string length of field_code.  The length of the field will be returned in
+  array_len.
+
+* GDGSPF(spf, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER spf
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This wraps gd_spf(3).  The field_code_len parameter should contain the
+  string length of field_code.  The number of samples per frame in field_code
+  will be returned in spf.
+
+* GDENTY(entry_type, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER type
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_entry_type(3), and returns the field type of the
+  specified field_code in entry_type.  The entry_type will be one of the entry
+  type parameters listed below.
+
+* GDFRGI(fragment_index, dirfile_unit, field_code, field_code_len)
+
+  Output: 
+    INTEGER fragment_index
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_fragment_index(3), and returns the format file
+  fragment index for the supplied field.  If the field does not exist, or an
+  error occurred, -1 is returned.
+
+* GDATRG(targ, targ_len, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    CHARACTER*<targ_len> targ
+  Input/Output:
+    INTEGER targ_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_alias_target(3), and returns the target of the
+  alias specified by format_file.
+
+* GDHIDN(result, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER result
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_hidden(3).  It sets result to one if the specified
+  field is hidden, or zero if it is not.  On error, it sets result to -1.
+
+* GDHIDE(dirfile_unit, field_code, field_code_len)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_hide(3).  It hides the specified field.
+
+* GDUHID(dirfile_unit, field_code, field_code_len)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_unhide(3).  It unhides the specified field.
+
+* GDGBOF(bof, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER bof
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_bof(3), and returns the location of the beginning-
+  of-field marker for the specified field.
+
+* GDGEOF(eof, dirfile, field_code, field_code_len)
+
+  Output:
+    INTEGER eof
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_eof(3), and returns the location of the end-of-field
+  marker for the specified field.
+
+* GDALRW(dirfile_unit, field_code, field_code_len, data_type, spf, recode)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, data_type, spf, recode
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_alter_raw(3), and modifies the specified field
+  metadata.  If recode is non-zero, the binary file associated with this field
+  will be modified to account for the changes.
+
+* GDALCL(dirfile_unit, field_code, field_code_len, nfields, in_field1,
+  in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
+  in_field3_len, m3, b3)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, in_field2_len
+    INTEGER in_field3_len
+    COMPLEX*16 m1, b1, m2, b2, m3, b3
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+    CHARACTER*<in_field3_len> in_field3
+
+  This subroutine wraps gd_alter_lincom(3), and modifies the specified field
+  metadata.
+
+* GDALLC(dirfile_unit, field_code, field_code_len, nfields, in_field1,
+  in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
+  in_field3_len, m3, b3)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, in_field2_len
+    INTEGER in_field3_len
+    REAL*8 m1, b1, m2, b2, m3, b3
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+    CHARACTER*<in_field3_len> in_field3
+
+  This is equivalent to GDALCL above, but takes purely real parameters.
+
+* GDALLT(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  table, table_len, move)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, table_len, move
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<table_len> table
+
+  This subroutine wraps gd_alter_linterp(3), and modifies the specified field
+  metadata.  If move is non-zero, the look-up table will be moved to the path
+  specified by table.
+
+* GDALBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  bitnum, numbits)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, bitnum, numbits
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine wraps gd_alter_bit(3), and modifies the specified field
+  metadata.
+
+* GDALDV(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  in_field2, in_field2_len)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len, in_field2_len
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+
+  This subroutine wraps gd_alter_divide(3), and modifies the specified field
+  metadata.
+
+* GDALMT(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  in_field2, in_field2_len)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len, in_field2_len
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+
+  This subroutine wraps gd_alter_multiply(3), and modifies the specified field
+  metadata.
+
+* GDALPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  shift)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len, shift, fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine wraps gd_alter_phase(3), and modifies the specified field
+  metadata.
+
+* GDALCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a1, a2, a3, a4, a5)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field_len
+    COMPLEX*16 a0, a1, a2, a3, a4, a5
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine wraps gd_alter_polynom(3), and modifies the specified field
+  metadata.
+
+* GDALPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a1, a2, a3, a4, a5)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field_len
+    REAL*8 a0, a1, a2, a3, a4, a5
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine is equivalent to GDALCP above, but takes purely real
+  parameters.
+
+* GDALSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  bitnum, numbits)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, bitnum, numbits
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine wraps gd_alter_sbit(3), and modifies the specified field
+  metadata.
+
+* GDALCR(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  dividend)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    COMPLEX*16 dividend
+
+  This subroutine wraps gd_alter_crecip(3), and modifies the specified field
+  metadata.
+
+* GDALRC(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  dividend)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    REAL*8 dividend
+
+  This subroutine wraps gd_alter_recip(3), and modifies the specified field
+  metadata.
+
+* GDALWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  check_field, check_field_len, windop, threshold)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, check_field_len, windop
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<check_field_len> check_field
+    INTEGER threshold
+      or
+    DOUBLE PRECISION 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.
+
+* GDALMX(dirfile_unit, field_code, field_code_len, infield, infield_len,
+  countfield, countfield_len, countval, period)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, infield_len, countfile_len, countval
+    INTEGER period
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<infield_len> infield
+    CHARACTER*<countfield_len> countfield
+
+  This subroutine wraps gd_alter_mplex(3), and modifies the specified field
+  metadata.
+
+* GDALCA(dirfile_unit, field_code, field_code_len, const_type, array_len)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, const_type, array_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_alter_carray(3), and modifies the specified field
+  metadata.
+
+* GDALCO(dirfile_unit, field_code, field_code_len, const_type)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, const_type
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_alter_const(3), and modifies the specified field
+  metadata.
+
+* GDALSP(dirfile_unit, spec, spec_len, move)
+
+  Input:
+    INTEGER dirfile_unit, move, spec_len
+    CHARACTER*<spec_len> spec
+
+  This subroutine wraps gd_alter_spec(3), and modifies the specified field
+  metadata.  If move is non-zero, and the field is a RAW field, the binary
+  file will be modified.  If move is non-zero, and the field is a LINTERP,
+  the look-up table will be moved.  Otherwise, move is ignored.
+
+* GDMLSP(dirfile_unit, spec, spec_len, parent, parent_len, move)
+
+  Input:
+    INTEGER dirfile_unit, spec_len, parent_len, move
+    CHARACTER*<spec_len> spec
+    CHARACTER*<parent_len> parent
+
+  This subroutine wraps gd_malter_spec(3), and behaves similarly to GDALSP, but
+  also requires the name of the metafield's parent.  The spec should contain
+  only the name of the metafield, and not the metafield's full field code.
+
+* GDRWFN(name, name_len, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    CHARACTER*<name_len> name
+  Input/Output:
+    INTEGER name_len
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_raw_filename(3).  It returns in name the name of
+  the binary file associated with the raw field indicated by field_code.  On
+  error, it sets name_len to zero.
+
+* GDMOVE(dirfile_unit, field_code, field_code_len, new_fragment, move_data)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, new_fragment, move_data
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_move(3), and moves the specified field to the new
+  fragment given.  If move_data is non-zero, the binary file, for RAW fields, is
+  also moved, if necessary.
+
+* 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.
+
+* GDRENM(dirfile_unit, field_code, field_code_len, new_name, new_name_len,
+  flags)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, new_name_len, flags
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<new_name_len> new_name
+
+  This subroutine wraps gd_rename(3), and changes the name of a field.  The
+  flags parameter should be zero or more of the GDR_xx parameters, bitwise or'd
+  together.
+
+* GDNTYP(ntype, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER ntype
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine wraps gd_native_type(3), and returns the native type of
+  the specified field.  The return value will be one of the data type symbols
+  listed below.
+
+* GDCSCL(comp_scal, dirfile_unit, field_code, field_code_len)
+
+  Output:
+    INTEGER comp_scal
+  Input:
+    INTEGER dirfile_unit, field_code_len
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns the comp_scal member of the specified field.  If the
+  specified field is not a LINCOM or POLYNOM, the return value will not be
+  meaningful.
+
+* GDGSCA(scalar, scalar_len, scalar_index, dirfile_unit, field_code,
+  field_code_len, index)
+
+  Output:
+    CHARACTER*<scalar_len> scalar
+    INTEGER scalar_index
+  Input/Output:
+    INTEGER scalar_len
+  Input:
+    INTEGER dirfile_unit, field_code_len, index
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine returns the element indexed by index of the scalar array of
+  the gd_entry_t object associated with the specified field code.  If index is
+  too large for the specified field, behaviour is undefined.  The array is
+  indexed starting from one.
+
+* GDGACA(dirfile_unit, field_code, field_code_len, index, scalar, scalar_len,
+  scalar_index, recode)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, scalar_len, index, recode
+    INTEGER scalar_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<scalar_len> scalar
+
+  This subroutine modifies the element indexed by index of the scalar array
+  member of the gd_entry_t object associated with the specified field code.  If
+  index is too large for the specified field, nothing happens.  The array is
+  indexed starting from one.  If scalar indicates a CONST field, scalar_index
+  is ignored.
+
+
+Subroutines which add or delete fields and aliases
+--------------------------------------------------
+
+* GDDELE(dirfile_unit, field_code, field_code_len, flags)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, flags
+    CHARACTER*<field_code_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.
+  The flags parameter should be either zero, or one or more of the delete flags
+  listed below bitwise or'd together.
+
+* GDADAL(dirfile_unit, field_code, field_code_len, targ, targ_len,
+  fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, targ_len, fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<targ_len> targ
+
+  This subroutine wraps gd_add_alias(3).  It adds an alias named field_code
+  pointing to targ in the fragment indexed by fragment_index.
+
+
+* GDADRW(dirfile_unit, field_code, field_code_len, data_type, spf,
+  fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, data_type, spf, fragment_index
+    CHARACTER*<field_code_len> field_code
+
+  This subroutine adds a RAW field with the supplied parameters to the
+  specified format file fragment of the dirfile.
+
+* GDADCL(dirfile_unit, field_code, field_code_len, nfields, in_field1,
+  in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
+  in_field3_len, m3, b3, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, in_field2_len
+    INTEGER in_field3_len, fragment_index
+    COMPLEX*16 m1, b1, m2, b2, m3, b3
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+    CHARACTER*<in_field3_len> in_field3
+
+  This subroutine adds a LINCOM field with the supplied parameters to the
+  specified format file fragment of the dirfile.  All three sets of input
+  parameters are required to be passed to the call, but only the first
+  nfield sets will be examined.
+
+* GDADLC(dirfile_unit, field_code, field_code_len, nfields, in_field1,
+  in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
+  in_field3_len, m3, b3, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, in_field2_len
+    INTEGER in_field3_len, fragment_index
+    REAL*8 m1, b1, m2, b2, m3, b3
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+    CHARACTER*<in_field3_len> in_field3
+
+  This is equivalent to GDADCL above, but takes purely real parameters.
+
+* GDADLT(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  table, table_len, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, table_len
+    INTEGER fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<table_len> table
+
+  This subroutine adds a LINTERP field with the supplied parameters to the
+  specified format file fragment of the dirfile.
+
+* GDADBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  bitnum, numbits, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, bitnum, numbits
+    INTEGER fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine adds a BIT field with the supplied parameters to the
+  specified format file fragment of the dirfile.
+
+* GDADSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  bitnum, numbits, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len, bitnum, numbits
+    INTEGER fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine adds a SBIT field with the supplied parameters to the
+  specified format file fragment of the dirfile.
+
+* GDADCR(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  dividend, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len
+    INTEGER fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    COMPLEX*16 dividend
+
+  This subroutine adds a RECIP field with the supplied parameters to the
+  specified format file fragment of the dirfile.
+
+* GDADRC(dirfile_unit, field_code, field_code_len, in_field, in_field_len,
+  dividend, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field_len
+    INTEGER fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    REAL*8 dividend
+
+  This subroutine adds a RECIP field with the supplied parameters to the
+  specified format file fragment of the dirfile.
+
+* GDADMT(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  in_field2, in_field2_len, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len, in_field2_len
+    INTEGER fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+
+  This subroutine adds a MULTIPLY field with the supplied parameters to the
+  specified format file fragment of the dirfile.
+
+* GDADDV(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  in_field2, in_field2_len, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len, in_field2_len
+    INTEGER fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field1_len> in_field1
+    CHARACTER*<in_field2_len> in_field2
+
+  This subroutine adds a DIVIDE field with the supplied parameters to the
+  specified format file fragment of the dirfile.
+
+* GDADCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a1, a2, a3, a4, a5, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len
+    INTEGER fragment_index
+    COMPLEX*16 a0, a1, a2, a3, a4, a5
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine adds a POLYNOM field with the supplied parameters to the
+  specified format file fragment of the dirfile.  All six coefficients are
+  required to be passed to the call, but only the first poly_ord + 1 will be
+  examined.
+
+* GDADPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field,
+  in_field_len, a0, a1, a2, a3, a4, a5, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len
+    INTEGER fragment_index
+    REAL*8 a0, a1, a2, a3, a4, a5
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine is equivalent the GDADCP, but takes purely real parameters.
+
+* GDADPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len,
+  shift, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, in_field1_len, shift, fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+
+  This subroutine adds a PHASE field with the supplied parameters to the
+  specified fragment of the dirfile.
+
+* 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
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<in_field_len> in_field
+    CHARACTER*<check_field_len> check_field
+    INTEGER threshold
+      or
+    DOUBLE PRECISION threshold
+
+    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.
+
+* GDADMX(dirfile_unit, field_code, field_code_len, infield, infield_len,
+  countfield, countfield_len, countval, period, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, infield_len, countfile_len, countval
+    INTEGER period, fragment_index
+    CHARACTER*<field_code_len> field_code
+    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.
+
+* GDADCA(dirfile_unit, field_code, field_code_len, const_type, array_len,
+  data_type, data, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, const_type, data_type, fragment_index
+    INTEGER array_len
+    CHARACTER*<field_code_len> field_code
+    <data_type> data(array_len)
+
+  This subroutine adds a CARRAY field with the supplied parameters to the
+  specified format file fragment of the dirfile.  const_type is the data type
+  of the field when stored in the dirfile.  data_type is the data type of the
+  supplied data.  These need not be the same.
+
+* GDADCO(dirfile_unit, field_code, field_code_len, const_type, data_type,
+  value, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, const_type, data_type, fragment_index
+    CHARACTER*<field_code_len> field_code
+    <data_type> value
+
+  This subroutine adds a CONST field with the supplied parameters to the
+  specified format file fragment of the dirfile.  const_type is the data type
+  of the field when stored in the dirfile.  data_type is the data type of the
+  supplied value.  These need not be the same.
+
+* GDADST(dirfile_unit, field_code, field_code_len, value, value_len,
+  fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, field_code_len, value_len, fragment_index
+    CHARACTER*<field_code_len> field_code
+    CHARACTER*<value_len> value
+
+  This subroutine adds a STRING field with the supplied parameters to the
+  specified format file fragment of the dirfile
+
+* GDADSP(dirfile_unit, spec, spec_len, fragment_index)
+
+  Input:
+    INTEGER dirfile_unit, fragment_index, spec_len
+    CHARACTER*<spec_len> spec
+
+  This subroutine wraps gd_add_spec(3), and allows adding a field to a dirfile
+  given a field specification line.
+
+* GDMDSP(dirfile_unit, spec, spec_len, parent, parent_len)
+
+  Input:
+    INTEGER dirfile_unit, spec_len, parent_len
+    CHARACTER*<spec_len> spec
+    CHARACTER*<parent_len> parent
+
+  This subroutine wraps gd_madd_spec(3), and allows adding a metafield to a
+  dirfile given a field specification line.
+
+* GDMDAL(dirfile_unit, parent, parent_len, field_code, field_code_len, targ,
+  targ_len)
+* GDMDBT(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field,
+  in_field_len, bitnum, numbits)
+* GDMDCL(dirfile_unit, parent, parent_len, field_code, field_code_len, nfields,
+  in_field1, in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
+  in_field3_len, m3, b3)
+* GDFACO(dirfile_unit, parent, parent_len, field_code, field_code_len,
+  const_type, data_type, value)
+* GDMDCP(dirfile_unit, parent, parent_len, field_code, field_code_len, poly_ord,
+  int_field, in_field_len, a0, a1, a2, a3, a4, a5)
+* GDMDCR(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field,
+  in_field_len, dividend)
+* GDMDDV(dirfile_unit, parent, parent_len, field_code, field_code_len,
+  in_field1, in_field1_len, in_field2, in_field2_len)
+* GDMDLC(dirfile_unit, parent, parent_len, field_code, field_code_len, nfields,
+  in_field1, in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3,
+  in_field3_len, m3, b3)
+* GDMDLT(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field,
+  in_field_len, table, table_len)
+* GDMDMT(dirfile_unit, parent, parent_len, field_code, field_code_len,
+  in_field1, in_field1_len, in_field2, in_field2_len)
+* GDMDPH(dirfile_unit, parent, parent_len, field_code, field_code_len,
+  in_field, in_field_len, shift)
+* GDMDPN(dirfile_unit, parent, parent_len, field_code, field_code_len, poly_ord,
+  int_field, in_field_len, a0, a1, a2, a3, a4, a5)
+* GDMDRC(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field,
+  in_field_len, dividend)
+* GDMDSB(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field,
+  in_field_len, bitnum, numbits)
+* GDMDWD(dirfile_unit, parent, field_code, field_code_len, in_field,
+  in_field_len, check_field, check_field_len, windop, threshold)
+* GDMDMX(dirfile_unit, parent, field_code, field_code_len, in_field,
+  in_field_len, count_field, count_field_len, count_val, period)
+* GDMDCA(dirfile_unit, parent, parent_len, field_code, field_code_len,
+  const_type, array_len, data_type, data)
+* GDMDCO(dirfile_unit, parent, parent_len, field_code, field_code_len,
+  const_type, data_type, value)
+* GDMDST(dirfile_unit, parent, parent_len, field_code, field_code_len, value,
+  value_len)
+
+  These functions are the corresponding META field functions for the GDADxx
+  functions above. They add META fields to the parent field indicated.
+
+Defined Parameters
+==================
+
+The following parameters, listed here with their C library analogues, are
+defined in getdata.f which may be included in any Fortran program using the
+Fortran 77 bindings.
+
+Error codes (returned by GDEROR):
+
+  F77 symbol      C symbol             Notes
+  ----------      -------------------  ---------------------------------------
+  GD_EOK          GD_E_OK              This is guaranteed to be equal to zero.
+  GD_EAC          GD_E_ACCMODE
+  GD_EAL          GD_E_ALLOC
+  GD_EAR          GD_E_ARGUMENT
+  GD_EBC          GD_E_BAD_CODE
+  GD_EBD          GD_E_BAD_DIRFILE
+  GD_EBE          GD_E_BAD_ENTRY
+  GD_EBF          GD_E_BAD_FIELD_TYPE
+  GD_EBI          GD_E_BAD_INDEX
+  GD_EBO          GD_E_BOUNDS
+  GD_EBP          GD_E_BAD_PROTECTION  Deprecated; kept as an alias for GD_EAR.
+  GD_EBR          GD_E_BAD_REFERENCE
+  GD_EBS          GD_E_BAD_SCALAR
+  GD_EBT          GD_E_BAD_TYPE
+  GD_ECB          GD_E_CALLBACK
+  GD_ECR          GD_E_CREAT
+  GD_EDL          GD_E_DELETE
+  GD_EDM          GD_E_DIMENSION
+  GD_EDO          GD_E_DOMAIN
+  GD_EDU          GD_E_DUPLICATE
+  GD_EEN          GD_E_BAD_ENDIANNESS  Deprecated; kept as an alias for GD_EAR.
+  GD_EEX          GD_E_EXISTS
+  GD_EFL          GD_E_FLUSH
+  GD_EFO          GD_E_FORMAT
+  GD_EIE          GD_E_INTERNAL_ERROR
+  GD_EOF          GD_E_OPEN_FRAGMENT
+  GD_EOI          GD_E_OPEN_INCLUDE    Deprecated; kept as an alias for GD_EOF.
+  GD_EOL          GD_E_OPEN_LINFILE
+  GD_EOP          GD_E_OPEN
+  GD_EPT          GD_E_PROTECTED
+  GD_ERA          GD_E_RANGE
+  GD_ERL          GD_E_RECURSE_LEVEL
+  GD_ERP          GD_E_BAD_REPR
+  GD_ERW          GD_E_RAW_IO
+  GD_ETL          GD_E_LINE_TOO_LONG
+  GD_ETR          GD_E_TRUNC
+  GD_EUE          GD_E_UNKNOWN_ENCODING
+  GD_EVR          GD_E_BAD_VERSION    Deprecated; kept as an alias for GD_EAR.
+  GD_UCL          GD_E_UNCLEAN_DB
+  GD_UNS          GD_E_UNSUPPORTED
+
+Dirfile flags (required by GDOPEN, GDCOPN, GDINCL, GDINCA, and GDFLAG):
+
+  F77 symbol      C symbol          Notes
+  ----------      ----------------- --------------------------------------
+  GD_RO           GD_RDONLY         The flags argument passed to GDOPEN
+  GD_RW           GD_RDWR           must contain at least GD_RO or GD_RW
+
+  GD_AE           GD_ARM_ENDIAN
+  GD_BE           GD_BIG_ENDIAN
+  GD_CR           GD_CREAT
+  GD_EX           GD_EXCL
+  GD_FC           GD_FORCE_ENCODING
+  GD_FE           GD_FORCE_ENDIAN
+  GD_ID           GD_IGNORE_DUPS
+  GD_IR           GD_IGNORE_REFS
+  GD_LE           GD_LITTLE_ENDIAN
+  GD_NA           GD_NOT_ARM_ENDIAN
+  GD_PE           GD_PEDANTIC
+  GD_PM           GD_PERMISSIVE
+  GD_PP           GD_PRETTY_PRINT
+  GD_TR           GD_TRUNC
+  GD_TS           GD_TRUNCSUB
+  GD_VB           GD_VERBOSE
+
+Encoding types:
+
+  F77 symbol      C symbol          Notes
+  ----------      ----------------- --------------------------------------
+  GDE_AU          GD_AUTO_ENCODED
+  GDE_BZ          GD_BZIP2_ENCODED
+  GDE_GZ          GD_GZIP_ENCODED
+  GDE_LZ          GD_LZMA_ENCODED
+  GDE_SL          GD_SLIM_ENCODED
+  GDE_SI          GD_SIE_ENCODED
+  GDE_TX          GD_TEXT_ENCODED
+  GDE_UN          GD_UNENCODED
+  GDE_ZS          GD_ZZSLIM_ENCODED
+  GDE_ZZ          GD_ZZIP_ENCODED
+
+Entry types (required by GDFLDT):
+
+  F77 symbol      C symbol          Notes
+  ----------      ----------------- --------------------------------------
+  GD_NOE          GD_NO_ENTRY       Indicating an invalid field type
+  GD_RWE          GD_RAW_ENTRY
+  GD_LCE          GD_LINCOM_ENTRY
+  GD_LTE          GD_LINTERP_ENTRY
+  GD_BTE          GD_BIT_ENTRY
+  GD_MTE          GD_MULTIPLY_ENTRY
+  GD_PHE          GD_PHASE_ENTRY
+  GD_IXE          GD_INDEX_ENTRY
+  GD_PNE          GD_POLYNOM_ENTRY
+  GD_SBE          GD_SBIT_ENTRY
+  GD_DVE          GD_DIVIDE_ENTRY
+  GD_RCE          GD_RECIP_ENTRY
+  GD_WDE          GD_WINDOW_ENTRY
+  GD_MXE          GD_MPLEX_ENTRY
+  GD_COE          GD_CONST_ENTRY
+  GD_CAE          GD_CARRAY_ENTRY
+  GD_STE          GD_STRING_ENTRY
+
+Data types.  Note, Fortran does not support unsigned data types, but GDGERW may
+still return an unsigned type, so all types are defined here.  The unsigned data
+type specifiers will be accepted by the other subroutines, but the data returned
+may not be properly interpretable by Fortran 77.
+
+  F77 symbol      C symbol          Notes
+  ----------      ----------------- --------------------------------------
+  GD_NUL          GD_NULL           Not suitable to be passed to GDPUTD
+  GD_U8           GD_UINT8
+  GD_I8           GD_INT8
+  GD_U16          GD_UINT16
+  GD_I16          GD_INT16
+  GD_U32          GD_UINT32
+  GD_I32          GD_INT32
+  GD_U64          GD_UINT64
+  GD_I64          GD_INT64
+  GD_F32          GD_FLOAT32
+  GD_F64          GD_FLOAT64
+  GD_C64          GD_COMPLEX64
+  GDC128          GD_COMPLEX128
+
+Delete flags (required by GDDELE):
+
+  F77 symbol      C symbol
+  ----------      -----------------
+  GDD_MT          GD_DEL_META
+  GDD_DT          GD_DEL_DATA
+  GDD_DR          GD_DEL_DEREF
+  GDD_FO          GD_DEL_FORCE
+
+Rename flags (requred by GDRENM):
+
+  F77 symbol      C symbol
+  ----------      -----------------
+  GDR_DT          GD_REN_DATA
+  GDR_UP          GD_REN_UPDB
+
+Protection levels (returned by GDGPRT and required by GDAPRT):
+
+  F77 symbol      C symbol          Notes
+  ----------      ----------------- --------------------------------------
+  GDPR_N          GD_PROTECT_NONE
+  GDPR_F          GD_PROTECT_FORMAT
+  GDPR_D          GD_PROTECT_DATA
+  GDPR_A          GD_PROTECT_ALL    This is the bitwise or of GDPR_D and GDPR_A
+
+Syntax error handler actions (returned by the registered callback function, see
+GDCOPN)
+
+  F77 symbol      C symbol
+  ----------      -------------------
+  GDSX_A          GD_PROTECT_ABORT
+  GDSX_S          GD_PROTECT_RESCAN
+  GDSX_I          GD_PROTECT_IGNORE
+  GDSX_C          GD_PROTECT_CONTINUE
+
+Syntax suberrors (provided to the registered callback function, see GDCOPN):
+
+  F77 symbol      C symbol
+  ----------      ---------------------
+  GDF_AL          GD_E_FORMAT_ALIAS
+  GDF_BN          GD_E_FORMAT_BITNUM
+  GDF_CH          GD_E_FORMAT_CHARACTER
+  GDF_DU          GD_E_FORMAT_DUPLICATE
+  GDF_EN          GD_E_FORMAT_ENDIAN
+  GDF_LI          GD_E_FORMAT_BAD_LINE
+  GDF_LO          GD_E_FORMAT_LOCATION
+  GDF_LT          GD_E_FORMAT_LITERAL
+  GDF_MM          GD_E_FORMAT_META_META
+  GDF_MR          GD_E_FORMAT_METARAW
+  GDF_MV          GD_E_FORMAT_MPLEXVAL
+  GDF_NA          GD_E_FORMAT_BAD_NAME
+  GDF_NB          GD_E_FORMAT_NUMBITS
+  GDF_NF          GD_E_FORMAT_N_FIELDS
+  GDF_NT          GD_E_FORMAT_N_TOK
+  GDF_PA          GD_E_FORMAT_NO_PARENT
+  GDF_PR          GD_E_FORMAT_PROTECT
+  GDF_RN          GD_E_FORMAT_RES_NAME
+  GDF_SF          GD_E_FORMAT_BAD_SPF
+  GDF_SZ          GD_E_FORMAT_BITSIZE
+  GDF_TY          GD_E_FORMAT_BAD_TYPE
+  GDF_UM          GD_E_FORMAT_UNTERM
+  GDF_WO          GD_E_FORMAT_WINDOP
+
+Special version symbols:
+
+  F77 symbol      C symbol
+  ----------      ---------------------
+  GDSV_C          GD_VERSION_CURRENT
+  GDSV_L          GD_VERSION_LATEST
+  GDSV_E          GD_VERSION_EARLIEST
+
+Seek flags:
+
+  F77 symbol      C symbol
+  ----------      ---------------------
+  GDSK_C          GD_SEEK_CUR
+  GDSK_E          GD_SEEK_END
+  GDSK_P          GD_SEEK_PAD
+  GDSK_S          GD_SEEK_SET
+
+WINDOW entry operations:
+
+  F77 symbol      C symbol
+  ----------      ---------------------
+  GDW_CL          GD_WINDOP_CLR
+  GDW_EQ          GD_WINDOP_EQ
+  GDW_GE          GD_WINDOP_GE
+  GDW_GT          GD_WINDOP_GT
+  GDW_LE          GD_WINDOP_LE
+  GDW_LT          GD_WINDOP_LT
+  GDW_NE          GD_WINDOP_NE
+  GDW_ST          GD_WINDOP_SET
+  GDW_UN          GD_WINDOP_UNK
+
+Desync flags:
+
+  F77 symbol      C symbol
+  ----------      ---------------------
+  GDDS_P          GD_DESYNC_PATHCHECK
+  GDDS_O          GD_DESYNC_REOPEN
+
+MPLEX lookback parameters:
+
+  F77 symbol      C symbol
+  ----------      ---------------------
+  GDLB_A          GD_LOOKBACK_ALL
+  GDLB_D          GD_DEFAULT_LOOKBACK
+
+Miscellaneous parameters:
+
+  F77 symbol      C symbol
+  ----------      -------------------------
+  GD_ALL          GD_ALL_FRAGMENTS
+  GD_DSV          GD_DIRFILE_STANDARDS_VERSION
+  GD_HER          GD_HERE
+  GD_MLL          GD_MAX_LINE_LENGTH
diff --git a/doc/README.f95 b/doc/README.f95
new file mode 100644
index 0000000..11d2735
--- /dev/null
+++ b/doc/README.f95
@@ -0,0 +1,931 @@
+FORTRAN 95 BINDINGS FOR GETDATA
+===============================
+
+This README describes the Fortran 95 bindings for the GetData library.  These
+bindings consist of a Fortran 95 compatibility library `libf95getdata' (written
+in Fortran 95) and a Fortran 95 module file `getdata.mod' which defines the
+interface.  The Fortran 95 bindings require the Fortran 77 compatibility
+library `libfgetdata' for operation.
+
+For programs which can use Fortran 95 modules, these bindings should be
+preferred over the Fortran 77 bindings, since these bindings provide type
+safety and more legible symbols.
+
+As in the Fortran 77 bindings, dirfiles are referred to by "dirfile unit"
+numbers, which are internally converted to the C API DIRFILE pointers.
+Space is available in the compatibility library for only 1023 dirfile units.  If
+an application attempts to open more than 1023 dirfiles simultaneously, the
+compatibility library will emit an error message on standard error and raise
+SIGABRT.  Passing an invalid dirfile unit number to a procedure which requires
+one as input (other than fgd_close, which will simply ignore it) will
+result in the call failing with error code GD_E_BAD_DIRFILE.
+
+The "getdata" module, which these bindings define, is described in
+`getdata.mod', which will be installed in the same directory as getdata.h.  The
+getdata module defines the same error codes (GD_E_OK, GD_E_OPEN, &c.), the same
+open flags (GD_RDONLY, GD_CREAT, &c.) and the same data type specifiers
+(GD_INT8, GD_FLOAT32, &c.), and other symbolic parameters as the C API.
+
+Available Procedures
+====================
+
+Notably, unlike the Fortran 77 bindings, the Fortran 95 bindings do not
+require passing character string lengths along with the string itself to
+procedures.  The downside to this convenience is that strings with trailing
+whitespace cannot be used.
+
+Procedures which are essentially equivalent to their C API counterparts, with
+the exception of including an initial `f' in their names, and using dirfile
+unit numbers in place of C's DIRFILE pointers are:
+
+* integer function fgd_open(dirfilename, flags)
+  character (len=*), intent(in) :: dirfilename
+  integer, intent(in) :: flags
+
+* integer function fgd_cbopen (dirfilename, flags, sehandler)
+  character (len=*), intent (in) :: dirfilename
+  integer, intent (in) :: flags
+  interface
+    subroutine sehandler(act, dirfile_unit, suberror, line)
+      integer, intent (out) :: act
+      integer, intent (in) :: dirfile_unit, suberror
+      character (len=GD_MAX_LINE_LENGTH), intent (inout) :: line
+    end subroutine
+  end interface
+
+* subroutine fgd_close (dirfile_unit)
+  integer, intent(in) :: dirfile
+
+* subroutine fgd_desync (dirfile_unit, flags)
+  integer :: fgd_desync
+  integer, intent(in) :: dirfile, flags
+
+* subroutine fgd_discard (dirfile_unit)
+  integer, intent(in) :: dirfile
+
+* subroutine fgd_verbose_prefix(dirfile, prefix)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: prefix
+
+* subroutine fgd_mplex_lookback(dirfile, lookback)
+  integer, intent(in) :: dirfile, lookback
+
+* subroutine fgd_flush (dirfile_unit, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_sync (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_raw_close (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+  (For fgd_flush, fgd_sync and fgd_raw_close, if field_code is the empty string,
+  the operation will be performed on the entire dirfile.)
+
+* subroutine fgd_metaflush (dirfile_unit)
+  integer, intent(in) :: dirfile
+
+* character (len=GD_MAX_LINE_LENGTH) function fgd_fragmentname(dirfile_unit,
+  ind)
+  integer, intent(in) :: dirfile_unit, ind
+
+* function fgd_nentries (dirfile, parent, entype, flags)
+  integer :: fgd_nentries
+  integer, intent(in) :: dirfile, entype, flags
+  character (len=*), intent(in) :: parent
+  integer :: parent_l
+
+* integer function fgd_nfields (dirfile_unit)
+  integer, intent(in) :: dirfile_unit
+
+* integer function fgd_nfields_by_type (dirfile_unit, type)
+  integer, intent(in) :: dirfile_unit, type
+
+* integer function fgd_nvectors (dirfile_unit)
+  integer, intent(in) :: dirfile_unit
+
+* integer function fgd_nmetafields (dirfile_unit, parent)
+  integer, intent(in) :: dirfile_unit
+  character, intent(in) :: parent
+
+* integer function fgd_nmetafields_by_type (dirfile_unit, parent, type)
+  integer, intent(in) :: dirfile_unit, type
+  character, intent(in) :: parent
+
+* integer function fgd_nmetavectors (dirfile_unit, parent)
+  integer, intent(in) :: dirfile_unit
+  character, intent(in) :: parent
+
+* integer function fgd_nformats (dirfile_unit)
+  integer, intent(in) :: dirfile_unit
+
+* integer function fgd_nframes (dirfile_unit)
+  integer, intent(in) :: dirfile_unit
+
+* integer function fgd_spf (dirfile_unit, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* integer function fgd_error (dirfile_unit)
+  integer, intent(in) :: dirfile_unit
+ 
+* integer function fgd_error_count (dirfile_unit)
+  integer, intent(in) :: dirfile_unit
+ 
+* integer function fgd_error_string (dirfile, buffer, len)
+  integer, intent(in) :: dirfile, len
+  character (len=<len>), intent(out) :: buffer
+
+* integer function fgd_get_string (dirfile, field_code, length, data_out)
+  integer, intent(in) :: dirfile, length
+  character (len=*), intent(in) :: field_code
+  character (len=*), intent(out) :: data_out
+
+* integer function fgd_put_string (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code, data_in
+
+* subroutine fgd_add_spec (dirfile, spec, fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: spec
+
+* subroutine fgd_madd_spec (dirfile, spec, parent)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: parent, spec
+
+* subroutine fgd_include (dirfile, inc_file, flags)
+  integer, intent(in) :: dirfile, fragment_index, flags
+  character (len=*), intent(in) :: inc_file
+
+* subroutine fgd_include_affix (dirfile, fragmentname, fragment_index, prefix,
+  suffix, flags)
+  integer, intent(in) :: dirfile, fragment_index, flags
+  character (len=*), intent(in) :: fragmentname, prefix, suffix
+
+* integer function fgd_carray_len (dirfile_unit, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_add_alias (dirfile, field_code, targ, fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character(len=*), intent(in) :: field_code, targ
+
+* subroutine fgd_add_bit (dirfile, field_name, in_field, bitnum, numbits,
+  fragment_index)
+  integer, intent(in) :: dirfile, bitnum, numbits, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+
+* subroutine fgd_add_clincom (dirfile, field_name, n_fields, in_field1, m1,
+  b1, in_field2, m2, b2, in_field3, m3, b3, fragment_index)
+  integer, intent(in) :: dirfile, n_fields, fragment_index
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double complex, intent(in) :: m1, b1, m2, b2, m3, b3
+
+* subroutine fgd_add_carray (dirfile, field_name, const_type, array_len,
+  fragment_index)
+  integer, intent(in) :: dirfile, const_type, array_len, fragment_index
+  character (len=*), intent(in) :: field_name
+
+  (Unlike the C counterpart, this version cannot be used to simultaneously set
+  the value of the field.  Use one of the fgd_put_carray procedures after
+  creating the field).
+
+* subroutine fgd_add_const (dirfile, field_name, const_type,
+  fragment_index)
+  integer, intent(in) :: dirfile, const_type, fragment_index
+  character (len=*), intent(in) :: field_name
+
+  (Unlike the C counterpart, this version cannot be used to simultaneously set
+  the value of the constant.  Use one of the fgd_put_constant procedures after
+  creating the field).
+
+* subroutine fgd_add_cpolynom (dirfile, field_name, poly_ord, in_field, a0,
+  a1, a2, a3, a4, a5, fragment_index)
+  integer, intent(in) :: dirfile, poly_ord, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+  double complex, intent(in) :: a0, a1, a2, a3, a4, a5
+
+* subroutine fgd_add_crecip (dirfile, field_name, in_field, cdividend,
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+  double complex, intent(in) :: cdividend
+
+* subroutine fgd_add_divide (dirfile, field_name, in_field1, in_field2,
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_name, in_field1, in_field2
+
+* subroutine fgd_add_lincom (dirfile, field_name, n_fields, in_field1, m1,
+  b1, in_field2, m2, b2, in_field3, m3, b3, fragment_index)
+  integer, intent(in) :: dirfile, n_fields, fragment_index
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double precision, intent(in) :: m1, b1, m2, b2, m3, b3
+
+* subroutine fgd_add_linterp (dirfile, field_name, in_field, table,
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_name, in_field, table
+
+* subroutine fgd_add_mplex (dirfile, field_code, in_field, count_field,
+  count_val, period, fragment_index)
+  character(len=*), intent(in) :: field_code, in_field, count_field
+  integer, intent(in) :: dirfile, count_val, period, fragment_index
+
+* subroutine fgd_add_multiply (dirfile, field_name, in_field1, in_field2,
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_name, in_field1, in_field2
+
+* subroutine fgd_add_phase (dirfile, field_name, in_field, phase,
+  fragment_index)
+  integer, intent(in) :: dirfile, phase, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+
+* subroutine fgd_add_polynom (dirfile, field_name, poly_ord, in_field, a0,
+  a1, a2, a3, a4, a5, fragment_index)
+  integer, intent(in) :: dirfile, poly_ord, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+  double precision, intent(in) :: a0, a1, a2, a3, a4, a5
+
+* subroutine fgd_add_raw (dirfile, field_code, data_type, spf,
+  fragment_index)
+  integer, intent(in) :: dirfile, data_type, spf, fragment_index
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_add_recip (dirfile, field_name, in_field, dividend,
+  fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+  double precision, intent(in) :: dividend
+
+* subroutine fgd_add_sbit (dirfile, field_name, in_field, bitnum, numbits,
+  fragment_index)
+  integer, intent(in) :: dirfile, bitnum, numbits, fragment_index
+  character (len=*), intent(in) :: field_name, in_field
+
+* subroutine fgd_add_string (dirfile, field_code, fragment_index)
+  integer, intent(in) :: dirfile, fragment_index
+  character (len=*), intent(in) :: field_code
+
+  (Unlike the C counterpart, this version cannot be used to simultaneously set
+  the value of the string.  Use the gd_put_string procedures after creating the
+  field).
+
+* subroutine fgd_add_window_i (dirfile, field_code, in_field, check_field,
+  windop, threshold, fragment_index)
+  character(len=*), intent(in) :: field_code, in_field, check_field
+  integer, intent(in) :: dirfile, windop, threshold, fragment_index
+
+* subroutine fgd_add_window_r (dirfile, field_code, in_field, check_field, &
+  windop, threshold, fragment_index)
+  character(len=*), intent(in) :: field_code, in_field, check_field
+  integer, intent(in) :: dirfile, windop, fragment_index
+  double precision, intent(in) :: threshold
+
+* subroutine fgd_madd_alias (dirfile, parent, field_code, targ)
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: parent, field_code, targ
+
+* subroutine fgd_madd_bit (dirfile, parent, field_name, in_field, bitnum,
+  numbits)
+  integer, intent(in) :: dirfile, bitnum, numbits
+  character (len=*), intent(in) :: field_name, in_field, parent
+
+* subroutine fgd_madd_clincom (dirfile, parent, field_name, n_fields,
+  in_field1, m1, b1, in_field2, m2, b2, in_field3, m3, b3)
+  integer, intent(in) :: dirfile, n_fields
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  character (len=*), intent(in) :: parent
+  double complex, intent(in) :: m1, b1, m2, b2, m3, b3
+
+* subroutine fgd_madd_carray (dirfile, parent, field_name, const_type,
+  array_len)
+  integer, intent(in) :: dirfile, const_type, array_len
+  character (len=*), intent(in) :: field_name, parent
+
+  (Unlike the C counterpart, this version cannot be used to simultaneously set
+  the value of the field.  Use one of the fgd_put_carray procedures after
+  creating the field).
+
+* subroutine fgd_madd_const (dirfile, parent, field_name, const_type)
+  integer, intent(in) :: dirfile, const_type
+  character (len=*), intent(in) :: field_name, parent
+
+  (Unlike the C counterpart, this version cannot be used to simultaneously set
+  the value of the constant.  Use one of the gd_put_constant procedures after
+  creating the field).
+
+* subroutine fgd_madd_cpolynom (dirfile, parent, field_name, poly_ord,
+  in_field, a0, a1, a2, a3, a4, a5)
+  integer, intent(in) :: dirfile, poly_ord
+  character (len=*), intent(in) :: field_name, in_field, parent
+  double precision, intent(in) :: a0, a1, a2, a3, a4, a5
+
+* subroutine fgd_madd_crecip (dirfile, parent, field_name, in_field, cdividend)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field, parent
+  double complex, intent(in) :: cdividend
+
+* subroutine fgd_madd_divide (dirfile, parent, field_name, in_field1,
+  in_field2)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, parent
+
+* subroutine fgd_madd_lincom (dirfile, parent, field_name, n_fields,
+  in_field1, m1, b1, in_field2, m2, b2, in_field3, m3, b3)
+  integer, intent(in) :: dirfile, n_fields
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  character (len=*), intent(in) :: parent
+  double precision, intent(in) :: m1, b1, m2, b2, m3, b3
+
+* subroutine fgd_madd_divide (dirfile, parent, field_name, in_field1,
+  in_field2)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, parent
+
+* subroutine fgd_madd_linterp (dirfile, parent, field_name, in_field,
+  table)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field, table, parent
+
+* subroutine fgd_madd_mplex (dirfile, parent, field_code, in_field, count_field,
+  count_val, period)
+  character(len=*), intent(in) :: parent, field_code, in_field, count_field
+  integer, intent(in) :: dirfile, count_val, period
+
+* subroutine fgd_madd_phase (dirfile, parent, field_name, in_field, phase)
+  integer, intent(in) :: dirfile, phase
+  character (len=*), intent(in) :: field_name, in_field, parent
+
+* subroutine fgd_madd_polynom (dirfile, parent, field_name, poly_ord,
+  in_field, a0, a1, a2, a3, a4, a5)
+  integer, intent(in) :: dirfile, poly_ord
+  character (len=*), intent(in) :: field_name, in_field, parent
+  double precision, intent(in) :: a0, a1, a2, a3, a4, a5
+
+* subroutine fgd_madd_recip (dirfile, parent, field_name, in_field, dividend)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field, parent
+  double precision, intent(in) :: dividend
+
+* subroutine fgd_madd_sbit (dirfile, parent, field_name, in_field, bitnum,
+  numbits)
+  integer, intent(in) :: dirfile, bitnum, numbits
+  character (len=*), intent(in) :: field_name, in_field, parent
+
+* subroutine fgd_madd_string (dirfile, parent, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code, parent
+
+  (Unlike the C counterpart, this version cannot be used to simultaneously
+  set the value of the string.  Use the gd_put_string procedures after creating
+  the field).
+
+* subroutine fgd_madd_window_i (dirfile, parent, field_code, in_field,
+  check_field, windop, threshold)
+  character(len=*), intent(in) :: parent, field_code, in_field, check_field
+  integer, intent(in) :: dirfile, windop, threshold
+
+* subroutine fgd_madd_window_r (dirfile, parent, field_code, in_field,
+  check_field, windop, threshold)
+  character(len=*), intent(in) :: parent, field_code, in_field, check_field
+  integer, intent(in) :: dirfile, windop
+  double precision, intent(in) :: threshold
+
+* character (len=GD_FIELD_LEN) function fgd_reference (dirfile)
+  integer, intent(in) :: dirfile
+
+* character (len=GD_FIELD_LEN)  function fgd_reference (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_parser_callback (dirfile, sehandler)
+  integer, intent(in) :: dirfile
+  interface
+    subroutine sehandler(act, dirfile_unit, suberror, line)
+      integer, intent (out) :: act
+      integer, intent (in) :: dirfile_unit, suberror
+      character (len=GD_MAX_LINE_LENGTH), intent (inout) :: line
+    end subroutine
+  end interface
+
+* integer function fgd_encoding (dirfile, fragment)
+  integer, intent(in) :: dirfile, fragment
+
+* subroutine fgd_alter_encoding (dirfile, encoding, fragment, recode)
+  integer, intent(in) :: dirfile, encoding, fragment, recode
+
+* integer function fgd_endianness (dirfile, fragment)
+  integer, intent(in) :: dirfile, fragment
+
+* subroutine fgd_alter_endianness (dirfile, endianness, fragment, recode)
+  integer, intent(in) :: dirfile, endianness, fragment, recode
+
+* integer function fgd_frameoffset (dirfile, fragment)
+  integer, intent(in) :: dirfile, fragment
+
+* subroutine fgd_alter_frameoffset (dirfile, frameoffset, fragment, recode)
+  integer, intent(in) :: dirfile, frameoffset, fragment, recode
+
+* integer function fgd_protection (dirfile, fragment)
+  integer, intent(in) :: dirfile, fragment
+
+* subroutine fgd_alter_protection (dirfile, protection_level, fragment)
+  integer, intent(in) :: dirfile, protection_level, fragment
+
+* subroutine fgd_fragment_affixes (prefix, suffix, dirfile, fragment_index)
+  character(len=*), intent(out) :: prefix, suffix
+  integer, intent(in) :: dirfile, fragment_index
+
+* subroutine fgd_alter_affixes (dirfile, fragment_index, prefix, suffix)
+  integer, intent(in) :: dirfile, fragment_index
+  character(len=*), intent(in) :: prefix, suffix
+
+* integer function fgd_native_type (dirfile, field_code)
+  integer integer(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* integer function fgd_parent_fragment (dirfile, fragment)
+  integer, intent(in) :: dirfile, fragment
+
+* subroutine fgd_uninclude (dirfile, fragment, del)
+  integer, intent(in) :: dirfile, fragment, del
+
+* character (len=GD_MAX_LINE_LENGTH) function fgd_raw_filename (dirfile,
+  field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_move (dirfile, field_code, new_fragment, 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
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_alter_bit (dirfile, field_name, in_field, bitnum, numbits)
+  integer, intent(in) :: dirfile, bitnum, numbits
+  character (len=*), intent(in) :: field_name, in_field
+
+* subroutine fgd_alter_clincom (dirfile, field_name, n_fields, in_field1,
+  cm1, cb1, in_field2, cm2, cb2, in_field3, cm3, cb3)
+  integer, intent(in) :: dirfile, n_fields
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double complex, intent(in) :: cm1, cb1, cm2, cb2, cm3, cb3
+
+* subroutine fgd_alter_carray (dirfile, field_name, const_type, array_len)
+  integer, intent(in) :: dirfile, const_type, array_len
+  character (len=*), intent(in) :: field_name
+
+* subroutine fgd_alter_const (dirfile, field_name, const_type)
+  integer, intent(in) :: dirfile, const_type
+  character (len=*), intent(in) :: field_name
+
+* subroutine fgd_alter_cpolynom (dirfile, field_name, poly_ord, in_field, ca0,
+  ca1, ca2, ca3, ca4, ca5)
+  integer, intent(in) :: dirfile, poly_ord
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double complex, intent(in) :: ca0, ca1, ca2, ca3, ca4, ca5
+
+* subroutine fgd_alter_crecip (dirfile, field_name, in_field, dividend)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field
+  double complex, intent(in) :: cdividend
+
+* subroutine fgd_alter_divide (dirfile, field_name, in_field1, in_field2)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field1, in_field2
+
+* subroutine fgd_alter_lincom (dirfile, field_name, n_fields, in_field1,
+  m1, b1, in_field2, m2, b2, in_field3, m3, b3)
+  integer, intent(in) :: dirfile, n_fields
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double precision, intent(in) :: m1, b1, m2, b2, m3, b3
+
+* subroutine fgd_alter_linterp (dirfile, field_name, in_field, table, move)
+  integer, intent(in) :: dirfile, move
+  character (len=*), intent(in) :: field_name, in_field, table
+
+* subroutine fgd_alter_mplex (dirfile, field_name, in_field, count_field,
+  count_val, period)
+  integer, intent(in) :: dirfile, count_val, period
+  character (len=*), intent(in) :: field_name, in_field, count_field
+
+* subroutine fgd_alter_multiply (dirfile, field_name, in_field1, in_field2)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field1, in_field2
+
+* subroutine fgd_alter_phase (dirfile, field_name, in_field, phase)
+  integer, intent(in) :: dirfile, phase
+  character (len=*), intent(in) :: field_name, in_field
+
+* subroutine fgd_alter_polynom (dirfile, field_name, poly_ord, in_field, a0,
+  a1, a2, a3, a4, a5)
+  integer, intent(in) :: dirfile, poly_ord
+  character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3
+  double precision, intent(in) :: a0, a1, a2, a3, a4, a5
+
+* subroutine fgd_alter_raw (dirfile, field_code, data_type, spf, move)
+  integer, intent(in) :: dirfile, data_type, spf, move
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_alter_recip (dirfile, field_name, in_field, dividend)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_name, in_field
+  double precision, intent(in) :: dividend
+
+* subroutine fgd_alter_sbit (dirfile, field_name, in_field, bitnum, numbits)
+  integer, intent(in) :: dirfile, bitnum, numbits
+  character (len=*), intent(in) :: field_name, in_field
+
+* subroutine fgd_alter_window_i (dirfile, field_name, in_field, check_field,
+  windop, threshold)
+  integer, intent(in) :: dirfile, windop, threshold
+  character (len=*), intent(in) :: field_name, in_field, check_field
+
+* subroutine fgd_alter_window_r (dirfile, field_name, in_field, check_field,
+  windop, threshold)
+  integer, intent(in) :: dirfile, windop
+  character (len=*), intent(in) :: field_name, in_field, check_field
+  double precision, intent(in) :: threshold
+
+* subroutine fgd_alter_spec (dirfile, spec, recode)
+  integer, intent(in) :: dirfile, recode
+  character (len=*), intent(in) :: spec
+
+* subroutine fgd_malter_spec (dirfile, spec, parent, recode)
+  integer, intent(in) :: dirfile, recode
+  character (len=*), intent(in) :: parent, spec
+
+* subroutine fgd_rename (dirfile, field_code, new_name, flags)
+  integer, intent(in) :: dirfile, flags
+  character (len=*), intent(in) :: field_code, new_name
+
+* subroutine fgd_delete (dirfile, field_code, flags)
+  integer, intent(in) :: dirfile, flags
+  character (len=*), intent(in) :: field_code
+
+* 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
+
+* integer function fgd_fragment_index (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* integer function fgd_validate (dirfile, field_code)
+  integer integer(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* double precision function fgd_framenum (dirfile, field_code, value)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+  double precision, intent(in) :: value
+
+* double precision function fgd_framenum_subset (dirfile, field_code, value,
+  frame_start, frame_end)
+  integer, intent(in) :: dirfile, frame_start, frame_end
+  character (len=*), intent(in) :: field_code
+  double precision, intent(in) :: value 
+
+* subroutine fgd_dirfilename (dirfilename, dirfilename_l, dirfile,
+  fragment_index)
+  character (len=*), intent(out) :: dirfilename
+  integer, intent(in) :: dirfile, fragment_index
+  integer, intent(inout) :: dirfilename_l
+
+* integer function fgd_bof (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* integer function fgd_eof (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* integer function fgd_dirfile_standards (dirfile, version)
+  integer, intent(in) :: dirfile, version
+
+* integer function fgd_invalid_dirfile ()
+
+* integer function fgd_seek (dirfile, field_code, frame_num, sample_num, flags)
+  integer, intent(in) :: dirfile, frame_num, sample_num, flags
+  character (len=*), intent(in): field_code
+
+* subroutine fgd_strtok (token, token_len, dirfile, string)
+  character (len=*), intent(out) :: token
+  integer, intent(inout) :: token_len
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: string
+
+  (If passed the empty string, the next token of the previous string is
+  returned.)
+
+* integer function fgd_tell (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in): field_code
+
+* character (len=GD_MAX_LINE_LENGTH) function fgd_alias_target (dirfile,
+  field_code)
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: field_code
+
+* integer function fgd_naliases (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: field_code
+
+* integer function fgd_hidden (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_hide (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+* subroutine fgd_unhide (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character (len=*), intent(in) :: field_code
+
+
+In order to respect type safety, the gd_getdata and gd_putdata analogues encode
+the data type of their array in their function name, rather than as a parameter.
+Otherwise, they behave the same as their C counterparts.
+
+* integer function fgd_getdata_n (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples)
+  integer, intent(in) :: dirfile_unit
+  integer, intent(in) :: first_frame, first_sample, num_frames, num_samples
+  character (len=*), intent(in) :: field_code
+
+  This calls getdata(3) with return_type = GD_NULL (i.e. return no data).  As a
+  result, no data_out parameter is required.
+
+* integer function fgd_getdata_i1 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+* integer function fgd_getdata_i2 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+* integer function fgd_getdata_i4 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+* integer function fgd_getdata_i8 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+* integer function fgd_getdata_r4 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+* integer function fgd_getdata_r8 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+* integer function fgd_getdata_c8 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+* integer function fgd_getdata_c16 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+  integer, intent(in) :: dirfile_unit
+  integer, intent(in) :: first_frame, first_sample, num_frames, num_samples
+  character (len=*), intent(in) :: field_code
+  <datatype>, dimension(:), intent(out) :: data_out
+
+  These call getdata(3) with return_type = GD_INT8, GD_INT16, GD_INT32,
+  GD_INT64, GD_FLOAT32, GD_FLOAT64, GD_COMPLEX64, and GD_COMPLEX128
+  respectively.  Here <datatype> is an integer or real type of the appropriate
+  width.
+
+  Analogously, for putdata:
+
+* integer function fgd_putdata_i1 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_in)
+* integer function fgd_putdata_i2 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_in)
+* integer function fgd_putdata_i4 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_in)
+* integer function fgd_putdata_i8 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_in)
+* integer function fgd_putdata_r4 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_in)
+* integer function fgd_putdata_r8 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_in)
+* integer function fgd_putdata_c8 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+* integer function fgd_putdata_c16 (dirfile_unit, field_code, first_frame,
+  first_sample, num_frames, num_samples, data_out)
+  integer, intent(in) :: dirfile_unit
+  integer, intent(in) :: first_frame, first_sample, num_frames, num_samples
+  character (len=*), intent(in) :: field_code
+  <datatype>, dimension(:), intent(in) :: data_in
+
+  No corresponding fgd_putdata_n function exists, since GD_NULL is not an
+  acceptable input data_type for gd_putdata(3).
+
+  Analogously for gd_constants, gd_get_carray_slice, gd_get_constant,
+  gd_mconstants, gd_put_carray_slice, and gd_put_constant, for which only the
+  _i1 versions are shown here:
+
+* subroutine fgd_constants_i1(values, dirfile)
+  integer(1), dimension(:), intent(out) :: values
+* subroutine fgd_get_carray_i1 (dirfile, field_code, data_out, start, array_len)
+  integer, intent(in) :: dirfile_unit, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer(1), intent(out) :: data_out
+* subroutine fgd_get_constant_i1 (dirfile, field_code, data_out)
+  integer, intent(in) :: dirfile_unit
+  character (len=*), intent(in) :: field_code
+  integer(1), intent(out) :: data_out
+* subroutine fgd_mconstants_i1(values, dirfile, parent)
+  integer(1), dimension(:), intent(out) :: values
+  character (len=*), intent(in) :: parent
+* subroutine fgd_put_carray_i1 (dirfile, field_code, data_in, start, array_len)
+  integer, intent(in) :: dirfile_unit, start, array_len
+  character (len=*), intent(in) :: field_code
+  integer(1), intent(in) :: data_in
+* subroutine fgd_put_constant_i1 (dirfile, field_code, data_in)
+  integer, intent(in) :: dirfile_unit
+  character (len=*), intent(in) :: field_code
+  integer(1), intent(in) :: data_in
+
+  For the carray functions, if len is zero, gd_get_carray(3) or gd_put_carray(3)
+  will be called to read or write the whole array.  Otherwise these subroutines
+  will call gd_get_carray_slice(3) or gd_put_carray_slice(3).
+
+Other procedures in the Fortran 95 bindings are:
+
+function fgd_entry_name_max (dirfile, parent, entype, flags)
+  integer :: fgd_entry_name_max
+  integer, intent(in) :: dirfile, entype, flags
+  character (len=*), intent(in) :: parent
+  integer :: parent_l
+
+  This function returns the length of the longest entry name defined in the
+  dirfile satisfying the given criteria.  The parameters are the same as they
+  are for fgd_nentries.
+
+* integer fgd_field_name_max (dirfile_unit)
+  integer, intent(in) :: dirfile_unit
+
+  This function returns the length of the longest field name defined in the
+  dirfile.
+
+* integer fgd_mfield_name_max (dirfile_unit, parent)
+  integer, intent(in) :: dirfile_unit
+  character (len=*), intent(in) :: parent
+
+  This function returns the length of the longest field name defined in the
+  dirfile for META fields of the supplied parent field.
+
+* integer fgd_string_value_max (dirfile_unit)
+  integer, intent(in) :: dirfile_unit
+
+  This function returns the length of the longest STRING field (excluding /META
+  fields) in the database.
+
+* integer fgd_mstring_value_max (dirfile_unit, parent)
+  integer, intent(in) :: dirfile_unit
+  character (len=*), intent(in) :: parent
+
+  This function returns the length of the longest STRING metafield for the given
+  parent field.
+
+* integer fgd_alias_max (dirfile, field_code)
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: field_code
+
+  This function returns the length of the longest alias for the given
+  field_code.
+
+* subroutine fgd_entry_list (entry_list, dirfile, parent, entype, flags,
+  entry_len)
+  character(len=*), dimension(:), intent(out) :: entry_list
+  integer, intent(in) :: dirfile, entype, flags
+  integer, intent(inout) :: entry_len
+  character (len=*), intent(in) :: parent
+  integer :: max_len, nentries, i, parent_l
+
+  This subroutine behaves analogously to gd_entry_list(3), except that it
+  requires an additional argument, entry_len, which is the longest entry name
+  which will fit in the supplied entry_list array.  If the longest entry name in
+  the dirfile is longer than entry_len, entry_len will be set to this value
+  (which is equivalent to the return value of fgd_entry_name_max) and entry_list
+  will remain untouched.
+
+  Analogously:
+
+* subroutine fgd_field_list (field_list, dirfile, field_len)
+  character (len=<field_len>) dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile_unit
+  integer, intent(inout) :: field_len
+* subroutine fgd_field_list_by_type (field_list, dirfile, entype, field_len)
+  character (len=<field_len>) dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile_unit, entype
+  integer, intent(inout) :: field_len
+* subroutine fgd_vector_list (field_list, dirfile, field_len)
+  character (len=<field_len>) dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile_unit
+  integer, intent(inout) :: field_len
+* subroutine fgd_strings (strings, dirfile, string_len)
+  character (len=<string_len>) dimension(:), intent(out) :: string_list
+  integer, intent(in) :: dirfile_unit
+  integer, intent(inout) :: string_len
+* subroutine fgd_aliases (aliases, dirfile, field_code, alias_len)
+  character(len=<alias_len> dimension(:), intent(out) :: aliases
+  integer, intent(in) :: dirfile
+  character(len=*), intent(in) :: field_code
+  integer, intent(inout) :: alias_len
+
+  Also analogously, except that field_len will be equivalent to the return
+  value of fgd_mfield_name_max or fgd_string_value_max, if too small:
+
+* subroutine fgd_mfield_list (field_list, dirfile, parent, field_len)
+  character (len=<field_len>) dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile_unit
+  integer, intent(inout) :: field_len
+  character (len=*), intent(in) :: parent
+* subroutine fgd_mfield_list_by_type (field_list, dirfile, entype,
+  parent, field_len)
+  character (len=<field_len>) dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile_unit, entype
+  integer, intent(inout) :: field_len
+  character (len=*), intent(in) :: parent
+* subroutine fgd_mvector_list (field_list, dirfile, parent, field_len)
+  character (len=<field_len>) dimension(:), intent(out) :: field_list
+  integer, intent(in) :: dirfile_unit
+  integer, intent(inout) :: field_len
+  character (len=*), intent(in) :: parent
+* subroutine fgd_mstrings (string_list, dirfile, parent, string_len)
+  character (len=<string_len>) dimension(:), intent(out) :: string_list
+  integer, intent(in) :: dirfile_unit
+  integer, intent(inout) :: string_len
+  character (len=*), intent(in) :: parent
+
+* integer function fgd_entry (dirfile_unit, field_code, ent)
+  integer, intent(in) :: dirfile_unit
+  character (len=*), intent(in) :: field_code
+  type(gd_entry), intent(out) :: ent
+
+  This fills ent with the metadata for field_code obtained by calling
+  gd_entry(3).  It returns the field type, or GD_NO_ENTRY if an error
+  occurred in the gd_entry() call.  The gd_entry type is defined in the
+  getdata module to be:
+
+  type gd_entry
+    integer :: field_type, n_fields, spf, data_type, bitnum, numbits, shift
+    integer :: fragment_index, comp_scal, poly_ord, array_len, windop
+    integer :: ithreshold, count_val, period
+    character (len=GD_FIELD_LEN), dimension(3) :: field
+    character (len=GD_FIELD_LEN), dimension(6) :: scalar
+    integer, dimension(6) :: scalar_ind
+    double precision, dimension(3) :: m, b
+    double precision, dimension(6) :: a
+    double precision :: dividend, rthreshold
+    double complex, dimension(3) :: cm, cb
+    double complex, dimension(6) :: ca
+    double complex :: cdividend
+  end type
+
+  where GD_FIELD_LEN is a constant parameter equal to 4096.  Character strings
+  are all stored in field(:) according to the following table:
+
+    TYPES               FIELD(1)    FIELD(2)    FIELD(3)
+    ------------------  ----------  ----------  ----------
+    RAW                  --          --          --
+
+    LINCOM              infield[0]  infield[1]  infield[2]
+
+    LINTERP             infield[0]  table        --
+
+    BIT / SBIT /
+    PHASE / RECIP /     infield[0]   --          --
+    POLYNOM
+
+    MULTIPLY / DIVIDE / infield[0]  infield[1]   --
+    WINDOW
+
+
+  Furthermore, data_type does double duty as the data_type parameter for RAW
+  fields, and the const_type parameter for CONST and CARRAY fields.  For WINDOW
+  fields, only one of ithreshold and rthreshold will be set, according to the
+  windop parameter.
+
+* subroutine fgd_add (dirfile_unit, field_code, ent)
+  integer, intent(in) :: dirfile_unit
+  character (len=*), intent(in) :: field_code
+  type(gd_entry), intent(in) :: ent
+
+  This subroutine adds the field indicated by field_code and described by ent
+  into specified dirfile.
+
+  Analogously, for adding meta fields:
+
+* subroutine fgd_madd (dirfile_unit, parent, field_code, ent)
+  integer, intent(in) :: dirfile_unit
+  character (len=*), intent(in) :: parent, field_code
+  type(gd_entry), intent(in) :: ent
+
+* subroutine fgd_alter_entry (dirfile, field_code, ent, recode)
+  integer, intent(in) :: dirfile, recode
+  character (len=*), intent(in) :: field_code
+  type(gd_entry), intent(in) :: ent
+
+  This subroutine alters the field or metafield specified.
diff --git a/doc/README.idl b/doc/README.idl
new file mode 100644
index 0000000..7e89b0d
--- /dev/null
+++ b/doc/README.idl
@@ -0,0 +1,954 @@
+IDL BINDINGS FOR GETDATA
+========================
+
+The IDL bindings for GetData provide bindings to the GetData library for the
+Interactive Data Language developed by Research Systems, Incorporated.  They
+provide a dynamically loaded module (DLM) `idl_getdata.so', described by
+`idl_getdata.dlm', written in C, which will be installed in IDL's DLM search
+path.  The bindings should work with any version of IDL from version 5.5
+onwards, but are not compatible with earlier versions.
+
+Using DLMs
+----------
+
+If the DLM is installed in the correct place and found by the interpreter, no
+work should be needed to have the GetData functions available in the
+interpreter.  To check if the GetData bindings have been found, execute:
+
+  IDL> HELP, /DLM
+ 
+If the GetData IDL bindings have been found, you should see among the output
+something similar to:
+
+  *** GETDATA - IDL GetData bindings (not loaded)
+      Version: 0.8.0, Build Date: Thu Apr 12 00:00:00 UTC 2012, Source: The GetData Project <getdata-devel at lists.sourceforge.net>
+      Path: /usr/local/rsi/idl/bin/bin.linux.x86/idl_getdata.so
+
+The DLM will be automatically loaded by the interpreter the first time a IDL
+GetData function or procedure is referenced.  If no GETDATA entry is present,
+in the list returned by the above command, check that these bindings have been
+installed in the correct place.  The current DLM search path can be printed
+with:
+
+  IDL> PRINT, !DLM_PATH
+
+If you find that the install process has installed idl_getdata.so in the wrong
+place you can either:
+
+* change the installed location by passing --with-idl-dlm-dir=PATH to GetData's
+  ./configure script, and rebuild GetData, or
+
+* change IDL's DLM search path by setting or modifying the environmental
+  variable IDL_DLM_PATH before starting the IDL interpreter.  See Appendix D
+  of the IDL Reference Guide for further details.
+
+This situation should be unlikely, since the DLM install directory is determined
+by ./configure by running the IDL interpreter to read the value of !DLM_PATH
+explicitly.
+
+NB: Third-party DLMs, such as these bindings, cannot be used in timed demo mode.
+To use the IDL GetData bindings, a fully licensed version of IDL is required.
+An unlicensed version of IDL will never find these bindings.
+
+
+IDL GetData Preliminaries
+-------------------------
+
+Because the GetData library relies on a large number of symbolic constants, a
+convenience function, GETDATA_CONSTANTS() is provided.  This function will
+create a structure of constants, with member names identical to the GetData
+C API's symbolic constants, but without the initial GD_ (eg. E_OK, INT8, &c.).
+This is a structure of type `GD_CONSTANTS', which is defined in the bindings.
+The typical use of this function is to define a new system variable, called
+`!GD' which can then be used to reference these constants, when necessary.
+This can be done using the following command:
+
+  IDL> DEFSYSV, "!GD", GETDATA_CONSTANTS()
+
+although this isn't strictly necessary, since constants could be fetched from
+GETDATA_CONSTANTS() as necessary, if desired.  Nevertheless, for simplicity,
+the remainder of this documentation refers to the system variable !GD as
+defined above, whenever it needs to refer to a GetData constant.
+
+Instead of using a DIRFILE pointer, an integer dirfile unit number is used to
+refer to an open dirfile object.  Space is available in the DLM for only 1023
+dirfile units.  If an application attempts to open more than 1023 dirfiles
+simultaneously, the DLM will emit an error message and immediately return to the
+interpreter.  Passing an invalid dirfile unit number to a procedure which
+requires one as input (other than GD_CLOSE and GD_DISCARD, which will simply
+ignore it) will result in the call failing with error code !GD.E_BAD_DIRFILE.
+
+IDL supports all GetData data types with the exception of INT8.  Attempting to
+return data as INT8 will result in an error.
+
+Except for the functions GETDATA_CONSTANTS, GD_ERROR, GD_ERROR_COUNT,
+GD_ERROR_STRING, and GD_INVALID_DIRFILE, all IDL GetData functions and
+procedures may take two optional keyword parameters which deal with error
+reporting:
+
+  ERROR:   a variable into which the dirfile error number resulting from this
+           call will be stored.  It will be the !GD.E_* error code corresponding
+           to the C API error code.  On success this will be !GD.E_OK (= 0).  If
+           this parameter is not specified, the dirfile error can still be
+           retrieved by calling GD_ERROR() after this call.
+  ESTRING: a variable in which the string representation of the error resulting
+           from this call will be stored.  If this parameter is not specified,
+           the the dirfile error string can still be retrieved by calling
+           GD_ERROR_STRING() after the call.
+
+For brevity, these keyword parameters are omitted from the subroutine prototypes
+given below.
+
+The GD_ENTRY Structure
+----------------------
+
+The GD_ENTRY structure is used in place of the C API's gd_entry_t data type.  It
+is essentially equivalent and is defined as:
+
+** Structure GD_ENTRY, 30 tags, length=512, data length=502:
+  FIELD        STRING
+  FIELD_TYPE   INT
+  FRAGMENT     INT
+  IN_FIELDS    STRING     Array[3]
+  A            DOUBLE     Array[6]
+  CA           DCOMPLEX   Array[6]
+  ARRAY_LEN    INT
+  B            DOUBLE     Array[3]
+  CB           DCOMPLEX   Array[3]
+  BITNUM       INT
+  COMP_SCAL    INT
+  COUNT_VAL    INT
+  DATA_TYPE    INT
+  DIVIDEND     DOUBLE
+  CDIVIDEND    DCOMPLEX
+  M            DOUBLE     Array[3]
+  CM           DCOMPLEX   Array[3]
+  N_FIELDS     INT
+  NUMBITS      INT
+  PERIOD       INT
+  POLY_ORD     INT
+  SCALAR       STRING     Array[6]
+  SCALAR_IND   INT        Array[6]
+  SHIFT        LONG
+  SPF          UINT
+  TABLE        STRING
+  UTHRESHOLD   ULONG
+  ITHRESHOLD   LONG
+  RTHRESHOLD   DOUBLE
+  WINDOP       INT
+
+The DATA_TYPE member is used for both RAW and CONST fields.  (The gd_entry_t
+object has a 'const_type' member for the CONST fields instead.)  For details on
+how to use this structure, see the gd_entry(3) manual page.
+
+
+IDL GetData Subroutines
+-----------------------
+
+The following subroutines are available in the IDL GetData bindings.
+In general, they are named equivalently to their counterparts in the C API,
+and differences in behaviour from the C API functionality is noted below.
+Keyword parameters are always optional, unless noted below.
+
+FUNCTION GETDATA_CONSTANTS()
+
+  This function takes no inputs or keyword parameters, and returns a
+  GD_CONSTANTS structure defining various useful GetData library constants.  The
+  use of this function is discussed further above.
+
+PROCEDURE GD_ADD, dirfile_unit, entry, PARENT=parent
+
+  This procedure adds the field entry given by 'entry' to the dirfile.  The
+  'entry' input should be a GD_ENTRY structure.  If the keyword parameter
+  PARENT is given, the field will be added as a metafield under the given parent
+  field, otherwise the field will be added to the fragment index indicated in
+  the 'entry' structure.  See gd_add(3) and gd_madd(3).
+
+PROCEDURE GD_ADD_ALIAS, dirfile_unit, field_code, target, FRAGMENT=fragment,
+  PARENT=parent
+
+  This procedure adds an alias called 'field_code' pointing to 'target' to
+  the fragment indicated by 'fragment'.  See gd_add_alias(3).
+
+PROCEDURE GD_ADD_BIT, dirfile_unit, field_name, in_field, BITNUM=bitnum,
+  FRAGMENT=fragment, NUMBITS=numbits, PARENT=parent
+
+  This procedure adds a BIT field with the name 'field_name' to the dirfile.
+  The input vector field is given by 'in_field'.  If not given, bitnum
+  defaults to zero and numbits to one.  If PARENT is given, this field is
+  added as a metafield under the given parent field.  Otherwise, the field is
+  added to the fragment indexed by FRAGMENT, or the primary format file if
+  FRAGMENT is not given either.  See gd_add_bit(3) and gd_madd_bit(3).
+
+PROCEDURE GD_ADD_CARRAY, dirfile_unit, field_name, FRAGMENT=fragment,
+  LENGTH=length, PARENT=parent, TYPE=type, VALUE=value
+
+  This procedure adds a CARRAY field with the name 'field_name' to the dirfile.
+  The storage type of the field is given by the TYPE keyword, which defaults to
+  !GD.FLOAT64.  If given, the initial value of the field is given by the VALUE
+  keyword, in this case LENGTH is ignored, if also given.  if VALUE is not
+  given, LENGTH must be specified, and the field will be initialised to all
+  zeros.  If PARENT is given, this field is added as a metafield under the
+  given parent field.  Otherwise, the field is added to the fragment indexed by
+  FRAGMENT, or the primary format file if FRAGMENT is not given either.  See
+  gd_add_carray(3) and gd_madd_carray(3).
+
+PROCEDURE GD_ADD_CONST, dirfile_unit, field_name, FRAGMENT=fragment,
+  PARENT=parent, TYPE=type, VALUE=value
+
+  This procedure adds a CONST field with the name 'field_name' to the dirfile.
+  The storage type of the field is given by the TYPE keyword, which defaults to
+  !GD.FLOAT64.  The initial value of the field is given by the VALUE keyword,
+  which defaults to zero.  If PARENT is given, this field is added as a
+  metafield under the given parent field.  Otherwise, the field is added to the
+  fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not
+  given either.  See gd_add_const(3) and gd_madd_const(3).
+
+PROCEDURE GD_ADD_DIVIDE, dirfile_unit, field_name, in_field1, in_field2,
+  FRAGMENT=fragment, PARENT=parent
+
+  This procedure adds a DIVIDE field with the name 'field_name' to the dirfile. 
+  The input vector fields are given by 'in_field1' and 'in_field2'.  If PARENT
+  is given, this field is added as a metafield under the given parent field.
+  Otherwise, the field is added to the fragment indexed by FRAGMENT, or the
+  primary format file if FRAGMENT is not given either.  See gd_add_divide(3)
+  and gd_madd_divide(3).
+
+PROCEDURE GD_ADD_LINCOM, dirfile_unit, field_name, in_field1, m1, b1,
+  [in_field2, m2, b2, [in_field3, m3, b3,]] FRAGMENT=fragment, PARENT=parent
+
+  This procedure adds a LINCOM field with the name 'field_name' to the dirfile.
+  The number of fields in the LINCOM is determined by the number of inputs
+  passed to the function.  The scale factors and offset terms may be real or
+  complex valued.  If PARENT is given, this field is added as a metafield under
+  the given parent field.  Otherwise, the field is added to the fragment indexed
+  by FRAGMENT, or the primary format file if FRAGMENT is not given either.  See
+  gd_add_lincom(3), gd_add_clincom(3), gd_madd_lincom(3), and
+  gd_madd_clincom(3). 
+
+PROCEDURE GD_ADD_LINTERP, dirfile_unit, field_name, in_field, table,
+  FRAGMENT=fragment, PARENT=parent
+
+  This procedure adds a LINTERP field with the name 'field_name' to the dirfile.
+  The input vector field is given by 'in_field', and pathname of the look up
+  table is 'table'.  If PARENT is given, this field is added as a metafield
+  under the given parent field.  Otherwise, the field is added to the fragment
+  indexed by FRAGMENT, or the primary format file if FRAGMENT is not given
+  either.  See gd_add_linterp(3) and gd_madd_linterp(3).
+
+PROCEDURE GD_ADD_MPLEX, dirfile_unit, field_name, in_field, count_field,
+  value, FRAGMENT=fragment, MAX=max, PARENT=parent
+
+  This procedure adds a MPLEX field with the name 'field_name' to the dirfile.
+  The input vector is 'in_field', the multiplex index vector is 'count_field',
+  the value of the multiplex index is 'value' and the maximum value is 'max',
+  if specified.  If PARENT is given, this field is added as a metafield under
+  the given parent field.  Otherwise, the field is added to the fragment indexed
+  by FRAGMENT, or the primary format file if FRAGMENT is not given either.  See
+  gd_add_mplex(3) and gd_madd_mplex(3).
+
+PROCEDURE GD_ADD_MULTIPLY, dirfile_unit, field_name, in_field1, in_field2,
+  FRAGMENT=fragment, PARENT=parent
+
+  This procedure adds a MULTIPLY field with the name 'field_name' to the
+  dirfile.  The input vector fields are given by 'in_field1' and 'in_field2'.
+  If PARENT is given, this field is added as a metafield under the given parent
+  field.  Otherwise, the field is added to the fragment indexed by FRAGMENT, or
+  the primary format file if FRAGMENT is not given either.  See
+  gd_add_multiply(3) and gd_madd_multiply(3).
+
+PROCEDURE GD_ADD_PHASE, dirfile_unit, field_name, in_field, shift,
+  FRAGMENT=fragment, PARENT=parent
+
+  This procedure adds a PHASE field with the name 'field_name' to the dirfile.
+  The input vector field is given by 'in_field' and the shift by 'shift'.  If
+  PARENT is given, this field is added as a metafield under the given parent
+  field.  Otherwise, the field is added to the fragment indexed by FRAGMENT, or
+  the primary format file if FRAGMENT is not given either.  See gd_add_phase(3)
+  and gd_madd_phase(3).
+
+PROCEDURE GD_ADD_POLYNOM, dirfile_unit, field_name, in_field, a0, [a1, [a2,
+  [a3, [a4, [a5,]]]]] FRAGMENT=fragment, PARENT=parent
+
+  This procedure adds a POLYNOM field with the name 'field_name' to the dirfile.
+  The input vector field is given by 'in_field' and the shift by the remaining
+  inputs.  The order of the polynomial will be automatically determined by the
+  number of co-efficients given.  If only a0 is given, it should be an array
+  containing the co-efficients, otherwise each a<i> should be one co-efficient.
+  If PARENT is given, this field is added as a metafield under the given parent
+  field.  Otherwise, the field is added to the fragment indexed by FRAGMENT, or
+  the primary format file if FRAGMENT is not given either.  See
+  gd_add_polynom(3) and gd_madd_polynom(3).
+
+PROCEDURE GD_ADD_RAW, dirfile_unit, field_name data_type, FRAGMENT=fragment,
+  SPF=spf
+
+  This procedure adds a RAW field with the name 'field_name' to the dirfile.
+  The data type specified by 'data_type' should be one of the data type
+  constants: !GD.UINT8, !GD.INT8, &c.  The number of samples per frame of the
+  raw data is given by the SPF keyword, which defaults to one, if not given.
+  The field will be added to the fragment indexed by FRAGMENT, if given, or else
+  to the primary format file.  See gd_add_raw(3).
+
+PROCEDURE GD_ADD_RECIP, dirfile_unit, field_name, in_field, DIVIDEND=dividend,
+  FRAGMENT=fragment, PARENT=parent
+
+  This procedure adds a RECIP field with the name 'field_name' to the dirfile.
+  The input vector field is given by 'in_field'.  If not given, dividend
+  defaults to one.  If PARENT is given, this field is added as a metafield under
+  the given parent field.  Otherwise, the field is added to the fragment
+  indexed by FRAGMENT, or the primary format file if FRAGMENT is not given
+  either.  See gd_add_recip(3), gd_add_crecip(3), gd_madd_recip(3),
+  gd_madd_crecip(3).
+
+PROCEDURE GD_ADD_SBIT, dirfile_unit, field_name, in_field, BITNUM=bitnum,
+  FRAGMENT=fragment, NUMBITS=numbits, PARENT=parent
+
+  This procedure adds a SBIT field with the name 'field_name' to the dirfile.
+  The input vector field is given by 'in_field'.  If not given, bitnum
+  defaults to zero and numbits to one.  If PARENT is given, this field is
+  added as a metafield under the given parent field.  Otherwise, the field is
+  added to the fragment indexed by FRAGMENT, or the primary format file if
+  FRAGMENT is not given either.  See gd_add_sbit(3) and gd_madd_sbit(3).
+
+PROCEDURE GD_ADD_SPEC, dirfile_unit, line, FRAGMENT=fragment, PARENT=parent
+
+  This procedure adds a field described by the field specification line 'line'
+  to the dirfile.  If PARENT is given, this field is added as a metafield under
+  the given parent field.  Otherwise, the field is added to the fragment indexed
+  by FRAGMENT, or the primary format file if FRAGMENT is not given either.  See
+  gd_add_spec(3) and gd_madd_spec(3).
+
+PROCEDURE GD_ADD_STRING, dirfile_unit, field_name, FRAGMENT=fragment,
+  PARENT=parent, VALUE=value
+
+  This procedure adds a STRING field with the name 'field_name' to the dirfile.
+  The initial value of the field is given by the VALUE keyword, which defaults
+  to the empty string.  If PARENT is given, this field is added as a metafield
+  under the given parent field.  Otherwise, the field is added to the fragment
+  indexed by FRAGMENT, or the primary format file if FRAGMENT is not given
+  either.  See gd_add_string(3) and gd_madd_string(3).
+
+PROCEDURE GD_ADD_WINDOW, dirfile_unit, field_name, in_field, check_field,
+  threshold, /CLR, /EQ, /GE, /GT, /LE, /LT, /NE, /SET, FRAGMENT=fragment,
+  PARENT=parent
+
+  This procedure adds a WINDOW field with the name 'field_name' to the dirfile.
+  The input vector field is given by 'in_field' and the check field is given by
+  'check_field.  The window operation is specified by one of the optional
+  parameters, CLR, EQ, GE, &c.  If PARENT is given, this field is added as a
+  metafield under the given parent field.  Otherwise, the field is added to the
+  fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not
+  given either.  See gd_add_window(3), and gd_madd_window(3).
+
+FUNCTION GD_ALIASES(dirfile_unit, field_code)
+
+  This function returns a list of aliases of 'field_code' (including field_code)
+  itself.  See gd_aliases(3).
+
+FUNCTION GD_ALIAS_TARGET(dirfile_unit, field_code)
+
+  This procedure returns the target pointed to by the alias 'field_code'.  See
+  gd_alias_target(3).
+
+PROCEDURE GD_ALTER_AFFIXES(dirfile_unit, FRAGMENT=fragment, PREFIX=prefix,
+  SUFFIX=suffix)
+
+  This procedure modifies the prefix and/or suffix of the fragment index
+  specified by FRAGMENT.  Zero is assumed if FRAGMENT is not specified.  See
+  gd_alter_affixes(3).
+
+PROCEDURE GD_ALTER_BIT, dirfile_unit, field_code, BITNUM=bitnum,
+  IN_FIELD=in_field, NUMBITS=numbits
+
+  This procedure modifies the metadata of the BIT field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  See gd_alter_bit(3).
+
+PROCEDURE GD_ALTER_CARRAY, dirfile_unit, field_code, TYPE=type, LENGTH=length
+
+  This procedure modifies the metadata of the field specified by 'field_code',
+  updating the storage data type and array length if specified as keyword
+  parameters.  If given, TYPE should be one of the data type constants:
+  !GD.UINT8, !GD.INT8, &c.  See gd_alter_carray(3).
+
+PROCEDURE GD_ALTER_CONST, dirfile_unit, field_code, TYPE=type
+
+  This procedure modifies the metadata of the field specified by 'field_code',
+  updating the storage data type if specified as a keyword parameter.  If given,
+  TYPE should be one of the data type constants: !GD.UINT8, !GD.INT8, &c.  See
+  gd_alter_const(3).
+
+PROCEDURE GD_ALTER_DIVIDE, dirfile_unit, field_code, IN_FIELD1=in_field1,
+  IN_FIELD2=in_field2
+
+  This procedure modifies the metadata of the DIVIDE field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  See gd_alter_divide(3).
+
+PROCEDURE GD_ALTER_ENCODING, dirfile_unit, encoding, FRAGMENT=fragment,
+  /RECODE
+
+  This procedure modifies the encoding of part or all of the dirfile.  The
+  new encoding is given be 'encoding' and should either be a string indicating
+  the encoding type: 'BZIP2', 'GZIP', 'LZMA', 'SLIM', 'TEXT', 'NONE', or else
+  a numeric encoding type: !GD.BZIP2_ENCODED, &c.  If FRAGMENT is given, only
+  the fragment with that index is modified, otherwise all fragments are
+  modified.  If RECODE is specified, the data files on disk will be updated for
+  the new encoding.  See gd_alter_encoding(3).
+
+PROCEDURE GD_ALTER_ENDIANNESS, dirfile_unit, /ARM_ENDIAN, /BIG_ENDIAN,
+  FRAGMENT=fragment, /LITTLE_ENDIAN, /NOT_ARM_ENDIAN, /RECODE
+
+  This procedure modifies the byte sex of part or all of the dirfile.  The
+  new byte sex is the bitwise or of the two endianness KEYWORD flags, if given,
+  as described in the gd_alter_endianness manual page.  If FRAGMENT is
+  given, only the fragment with that index is modified, otherwise all fragments
+  are modified.  If RECODE is specified, the data files on disk will be updated
+  for the new byte sex.  See gd_alter_endianness(3).
+
+PROCEDURE GD_ALTER_ENTRY, dirfile_unit, field_code, entry, /RECODE
+
+  This procedure modifies the field specified by 'field_code' to conform to
+  the field metadata given in the GD_ENTRY structure 'entry'.  If RECODE is
+  specified, and the field is a RAW or LINTERP entry, the data on disk will
+  be updated to reflect changes to the field metadata.  See
+  gd_alter_entry(3).
+
+PROCEDURE GD_ALTER_FRAMEOFFSET, dirfile_unit, frameoffset,
+  FRAGMENT=fragment, /RECODE
+
+  This procedure modifies the frame offset of part or all of the dirfile.  The
+  new frame offset is given by 'frameoffset'.  If FRAGMENT is given, only the
+  fragment with that index is modified, otherwise all fragments are modified.
+  If RECODE is specified, the data files on disk will be updated for the new
+  frame offset.  See gd_alter_frameoffset(3).
+
+PROCEDURE GD_ALTER_LINCOM, dirfile_unit, field_code, B=b,
+  IN_FIELDS=in_fields, M=m, N_FIELDS=n_fields
+
+  This procedure modifies the metadata of the LINCOM field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  If specified, B, IN_FIELDS, M must be arrays of length n_fields
+  (which may be simultaneously updated).  The numeric parameters may be either
+  real or complex valued.  If N_FIELDS specifies more fields than the field
+  currently has, but B, IN_FIELDS, or M are not specified, the new values will
+  contain uninitialised data.  See gd_alter_lincom(3) and gd_alter_clincom(3).
+
+PROCEDURE GD_ALTER_LINTERP, dirfile_unit, field_code, IN_FIELD=in_field,
+  /RENAME_TABLE, TABLE=table
+
+  This procedure modifies the metadata of the LINTERP field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  If both TABLE and RENAME_TABLE are specified, the name of the
+  file containing the look up table will be renamed to reflect changes to the
+  field metadata.  See gd_alter_linterp(3).
+
+PROCEDURE GD_ALTER_MPLEX, dirfile_unit, field_code, COUNT_FIELD=count_field,
+  PERIOD=period, COUNT_VAL=count_val, IN_FIELD=in_field
+
+  This procedure modifies the metadata of the MPLEX field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  See gd_alter_mplex(3).
+
+PROCEDURE GD_ALTER_MULTIPLY, dirfile_unit, field_code, IN_FIELD1=in_field1,
+  IN_FIELD2=in_field2
+
+  This procedure modifies the metadata of the MULTIPLY field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  See gd_alter_multiply(3).
+
+PROCEDURE GD_ALTER_PHASE, dirfile_unit, field_code, IN_FIELD=in_field,
+  SHIFT=shift
+
+  This procedure modifies the metadata of the PHASE field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  See gd_alter_phase(3).
+
+PROCEDURE GD_ALTER_POLYNOM, dirfile_unit, field_code, A=a,
+  IN_FIELD=in_field, POLY_ORD=poly_ord
+
+  This procedure modifies the metadata of the POLYNOM field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  If specified, A must be an array of length poly_ord + 1
+  (which may be simultaneously updated).  This array may be either real or
+  complex valued.  If POLY_ORD specifies a higher order than the field
+  currently has, but A is not specified, the new co-efficients will contain
+  uninitialised data.  This procedure may also be called GD_ALTER_CPOLYNOM
+  without change in functionality.  See gd_alter_polynom(3) and
+  gd_alter_cpolynom(3).
+
+PROCEDURE GD_ALTER_RAW, dirfile_unit, field_code, /RECODE, SPF=spf,
+  TYPE=type
+
+  This procedure modifies the metadata of the RAW field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  If given, TYPE should be one of the data type constants:
+  !GD.UINT8, !GD.INT8, &c.   If RECODE is specified, the file on disk backing
+  this RAW file will be update to reflect changes in the field metadata.
+  See gd_alter_raw(3).
+
+PROCEDURE GD_ALTER_RECIP, dirfile_unit, field_code, DIVIDEND=dividend,
+  IN_FIELD=in_field
+
+  This procedure modifies the metadata of the RECIP field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  See gd_alter_recip(3) and gd_alter_crecip(3).
+
+PROCEDURE GD_ALTER_SBIT, dirfile_unit, field_code, BITNUM=bitnum,
+  IN_FIELD=in_field, NUMBITS=numbits
+
+  This procedure modifies the metadata of the SBIT field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  See gd_alter_sbit(3).
+
+PROCEDURE GD_ALTER_SPEC, dirfile_unit, line, PARENT=parent, /RECODE
+
+  This procedure modifies the metadata of the field specified by the field
+  specification line 'line' to conform to the specification.  If /RECODE is
+  given, data on disk is update, if applicable, to correspond with changes made
+  to the field metadata.  If PARENT is given, the field is assumed to be a
+  metafield under the given parent.  See gd_alter_spec(3) and gd_malter_spec(3).
+
+PROCEDURE GD_ALTER_WINDOW, dirfile_unit, field_code, CHECK_FIELD=check_field,
+  /CLR, /EQ, /GE, /GT, IN_FIELD=in_field, /LE, /LT, /NE, /SET,
+  THRESHOLD=threshold
+
+  This procedure modifies the metadata of the WINDOW field specified by
+  'field_code', updating only those field parameters specified as keyword
+  parameters.  See gd_alter_window(3).
+
+FUNCTION GD_BOF(dirfile_unit, field_code)
+
+  This function returns the sample number of the position of the
+  beginning-of-field marker for the specified field.  See gd_bof(3).
+
+FUNCTION GD_CARRAY_LEN(dirfileunit, field_code)
+
+  This function returns the length of the specified field.  See
+  gd_carray_len(3).
+
+PROCEDURE GD_CLOSE, dirfile_unit, /DISCARD
+
+  This procedure closes the specified dirfile.  If DISCARD is not given, pending
+  metadata changes are first flushed to disk.  In all cases, pending data writes
+  are flushed to disk before close.  See gd_close(3) and
+  gd_discard(3).
+
+FUNCTION GD_CONSTANTS(dirfile_unit, PARENT=parent, TYPE=type)
+
+  This function returns the value of all CONST fields in the dirfile, converting
+  them to the return type specified by TYPE, which should be one of the data
+  type constants: !GD.UINT8, !GD.UINT16, &c.  If TYPE is not specified, the
+  values are returned as double precision data, even if they are stored as
+  complex values.  If PARENT is given, the value of CONST metafields defined
+  for the given parent field will be returned, otherwise all non-meta CONST
+  fields will be returned.  See gd_constants(3) and gd_mconstants(3).
+
+PROCEDURE GD_DELETE, dirfile_unit, field_code, /DEL_DATA, /DEREF, /FORCE, /ALIAS
+
+  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).
+
+FUNCTION GD_DESYNC(dirfile_unit, /PATHCHECK, /REOPEN)
+
+  This function returns non-zero if the loaded dirfile has become desynchronised
+  from the metadata on disk (due to a third party modifying the dirfile on
+  disk).  If /PATHCHECK is specified, the metadata on disk will be probed via
+  the full canonicalised pathnames to the fragment files, otherwise the
+  dirfile's cached directory descriptors will be used.  If /REOPEN is given,
+  the dirfile will be rescanned and updated if a change is discovered.  See
+  gd_desync(3).
+
+FUNCTION GD_DIRFILENAME(dirfile_unit)
+
+  This function returns the name of the dirfile specified by 'dirfile_unit'.
+  See dirfilename(3).
+
+FUNCTION GD_DIRFILE_STANDARDS(dirfile_unit, [version,] /LATEST, /EARLIEST)
+
+  This function returns the current Standards Version of the loaded dirfile,
+  optionally setting it first.  If more than one of version, LATEST or
+  EARLIEST are provided, results are undefined.  See gd_dirfile_standards(3).
+
+FUNCTION GD_ENCODING(dirfile_unit, FRAGMENT=fragment)
+
+  This function returns the encoding scheme of the fragment indexed by FRAGMENT,
+  or of the primary format file, if FRAGMENT is omitted.  The return value will
+  be one of the !GD.*_ENCODED constants.  See gd_encoding(3).
+
+FUNCTION GD_ENDIANNESS(dirfile_unit, FRAGMENT=fragment)
+
+  This function returns the byte sex of the fragment indexed by FRAGMENT, or of
+  the primary format file, if FRAGMENT is omitted.  The return value will be
+  one of !GD.BIG_ENDIAN or !GD.LITTLE_ENDIAN bitwise or'd with one of
+  !GD.ARM_ENDIAN or !GD.NOT_ARM_ENDIAN.  See gd_endianness(3).
+
+FUNCTION GD_ENTRY(dirfile_unit, field_code)
+
+  This function returns a GD_ENTRY structure containing the field metadata for
+  the field specified by 'field_code'.  See gd_entry(3).
+
+FUNCTION GD_ENTRY_LIST(dirfile_unit, /ALIASES, /HIDDEN, /NOALIAS, PARENT=parent,
+    /SCALARS, TYPE=type, /VECTORS)
+
+  This function returns a list of entry names defined by the dirfile.  If PARENT
+  is given, a list of metafields for the given parent will be returned otherwise
+  top-level fields are considered.  If TYPE is given, which should be one of the
+  !GD.*_ENTRY constants, only fields of the given type will be returned.  If
+  /ALIASES, /SCALARS or /VECTORS is specified, the TYPE parameter is ignored if
+  it is also given.  The list returned includes aliases, unless /NOALIAS is
+  specified, but not hidden fields, unless /HIDDEN is specified.  See
+  gd_entry_list(3).
+
+FUNCTION GD_ENTRY_TYPE(dirfile_unit, field_code)
+
+  This function returns the field type of the field specified by 'field_code'.
+  The returned value will be one of the !GD.*_ENTRY constants.  See
+  gd_entry_type(3).
+
+FUNCTION GD_EOF(dirfile_unit, field_code)
+
+  This function returns the sample number of the position of the end-of-field
+  marker for the specified field.  See gd_eof(3).
+
+FUNCTION GD_ERROR(dirfile_unit)
+
+  This function returns the error status of the last call to the GetData library
+  on the specified dirfile.  The return value will be one of the !GD.E_* codes.
+  This function does not take the normal ERROR and ESTRING keyword parameters.
+  See gd_error(3).
+
+FUNCTION GD_ERROR_COUNT(dirfile_unit)
+
+  This function returns the number of errors encountered by the GetData library
+  on the specified dirfile since this function was last called (or since the
+  dirfile was opened, if this is the first call to this function).  See
+  gd_error_count(3).
+
+FUNCTION GD_ERROR_STRING(dirfile_unit)
+
+  This function returns a human readable string describing the error status of
+  the last call to the GetData library on the specified dirfile.  This function
+  does not take the normal ERROR and ESTRING keyword parameters.  See
+  gd_error_string(3).
+
+FUNCTION GD_FIELD_LIST(dirfile_unit, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS,
+    TYPE=type, /VECTORS)
+
+  An alias for GD_ENTRY_LIST (q.v.) kept for backwards compatibility.
+
+FUNCTION GD_FLAGS(dirfile_unit, PRETTY_PRINT=pretty_print, VERBOSE=verbose)
+
+  This function modifies the operational flags of the dirfile.  If a keyword
+  parameter is zero, the corresponding flag will be cleared; if a keyword
+  parameter is one, the corresponding flag will be set; otherwise, the flag is
+  unchanged.  The function returns the value of the flags register after
+  modification.  See gd_flags(3).
+
+PROCEDURE GD_FLUSH, dirfile_unit, FIELD_CODE=field_code, /NOCLOSE, /NOSYNC
+
+  This procedure flushes pending data writes to disk.  If FIELD_CODE is given,
+  only writes for the given field are flushed to disk.  Otherwise, all fields
+  and metadata changes are flushed to disk.  In normal operation, first the
+  raw data is flushed (synced) and then the raw data files are closed.
+  Specifying /NOSYNC will skip the flushing; specifying /NOCLOSE will skip the
+  closing.  Specifying both will result in an error (since the function is left
+  with nothing to do.)  See gd_flush(3), gd_sync(3) and gd_raw_close(3).
+
+FUNCTION GD_FRAGMENT_AFFIXES(dirfile_unit, FRAGMENT=fragment)
+
+  This function returns a two element array of the field code prefix and suffix
+  of the fragment specified by FRAGMENT.  Zero is assumed if FRAGMENT is not
+  specified.  See gd_fragment_affixes(3).
+
+FUNCTION GD_FRAGMENT_INDEX(dirfile_unit, field_code)
+
+  This function returns the index of the format file fragment which defines the
+  field specified by 'field_code'.  See gd_fragment_index(3).
+
+FUNCTION GD_FRAGMENTNAME(dirfile_unit, fragment_index)
+
+  This function returns the pathname of the format file fragment indexed by
+  'fragment_index'.  See gd_fragmentname(3).
+
+FUNCTION GD_FRAMENUM(dirfile_unit, field_code, value, FIELD_START=field_start,
+  FIELD_END=field_end)
+
+  This function performs a reverse look up on the field specified by
+  'field_code'.  It returns the fractional frame number where the field has the
+  value given by 'value'.  The search is performed between the frame limits
+  FRAME_START and FRAME_END.  If FRAME_START is omitted, the beginning of the
+  frame is used; if FRAME_END is omitted, the end of frame is used.  See
+  gd_framenum(3) and gd_framenum_subset(3).
+
+FUNCTION GD_FRAMEOFFSET(dirfile_unit, FRAGMENT=fragment_index)
+
+  This function returns the frame offset of the fragment indexed by FRAGMENT, or
+  of the primary format file, if FRAGMENT is omitted.  See gd_frameoffset(3).
+
+FUNCTION GD_GETDATA(dirfile_unit, field_code, FIRST_FRAME=first_frame,
+  FIRST_SAMPLE=first_sample, NUM_FRAMES=num_frames, NUM_SAMPLES=num_samples,
+  TYPE=type)
+
+  This function retrieves data from the field specified by 'field_code'.  It
+  returns a list of data, of the type given by TYPE, which should be one of the
+  data type constants: !GD.UINT8, !GD.UINT16, &c.  If TYPE is omitted, this
+  function returns double precision data, even if originally complex valued.
+  The first sample read is given by FIRST_FRAME and/or FIRST_SAMPLE.  If neither
+  of these are given, reading occurs at the current position.  The number of
+  samples requested is given by NUM_FRAMES and/or NUM_SAMPLES.  Fewer samples
+  than requested may be returned, without causing an error, if the end of the
+  field is encountered.  See getdata(3).
+
+FUNCTION GD_GET_CARRAY(dirfile_unit, field_code, TYPE=type)
+
+  This function returns the value of a CONST field, converting it to the return
+  type specified by TYPE, which should be one of the data type constants:
+  !GD.UINT8, !GD.UINT16, &c.  If TYPE is not specified, the value is returned as
+  a double precision number, even if complex valued.  See gd_get_constant(3).
+
+FUNCTION GD_GET_CONSTANT(dirfile_unit, field_code, LENGTH=length, START=start,
+  TYPE=type)
+
+  This function returns all or part of a CARRAY field, converting the data to
+  the return type specified by TYPE, which should be one of the data type
+  constants: !GD.UINT8, !GD.UINT16, &c.  If TYPE is not specified, !GD.FLOAT64
+  is assumed.  The first element returned is given by the START keyword,
+  which defaults to zero.  If LENGTH is not specified, all elements from START
+  to the end of the field are returned, otherwise.  See gd_get_carray_slice(3).
+
+FUNCTION GD_GET_STRING(dirfile_unit, field_code)
+
+  This function returns the value of a STRING field specified by 'field_code'.
+  See gd_get_string(3).
+
+FUNCTION GD_HIDDEN(dirfile_unit, field_code)
+
+  This function returns one if the field or alias specified by 'field_code' is
+  hidden, or zero if it is not.  On error it returns -1.  See gd_hidden(3).
+
+PROCEDURE GD_HIDE, dirfile_unit, field_code
+
+  This procedure hides the field or alias specified by 'field_code'.  See
+  gd_hide(3).
+
+PROCEDURE GD_INCLUDE, dirfile_unit, fragment_name, /ARM_ENDIAN, /BIG_ENDIAN,
+  /CREAT, ENCODING=encoding, /EXCL, /FORCE_ENCODING, /FORCE_ENDIANNESS,
+  FRAGMENT=fragment, INDEX=index, /IGNORE_DUPS, /IGNORE_REFS, /LITTLE_ENDIAN,
+  /NOT_ARM_ENDIAN, /PEDANTIC, /PERMISSIVE, PREFIX=prefix, SUFFIX=suffix, /TRUNC
+
+  This procedure adds the format file fragment specified by 'fragment_name' to
+  the format file indexed by FRAGMENT, or else the primary format file, if
+  FRAGMENT is not given.  If specified, the fragment index of the newly added
+  fragment is returned in INDEX.  If specified, ENCODING should either be a
+  string indicating the encoding type: 'BZIP2', 'GZIP', 'LZMA', 'SLIM', 'TEXT',
+  'NONE', or else a numeric encoding type: !GD.BZIP2_ENCODED, &c.  The meaning
+  of the remaining keyword flags is discussed in the gd_include manual page.
+  See gd_include(3) and gd_include_affix(3).
+ 
+FUNCTION GD_INVALID_DIRFILE()
+
+  This functions returns a dirfile unit number corresponding to a newly created
+  invalid dirfile.  See gd_invalid_dirfile(3).
+
+PROCEDURE GD_METAFLUSH, dirfile_unit
+
+  This procedure flushes pending metadata changes to the dirfile to disk.  See
+  gd_metaflush(3).
+
+PROCEDURE GD_MOVE, dirfile_unit, field_code, new_fragment, /ALIAS, /MOVE_DATA
+
+  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).
+
+PROCEDURE GD_MPLEX_LOOKBACK dirfile_unit, [lookback,] /ALL
+
+  This procedure sets the MPLEX lookback length to the value given, if supplied,
+  or to the maximum value, if /ALL is given, or else to the default value if
+  neither is provided.  See gd_mplex_lookback(3).
+
+FUNCTION GD_NALIASES(dirfile_unit, field_code)
+
+  This function returns the number of aliases of 'field_code' (including
+  field_code itself).  See gd_naliases(3).
+
+FUNCTION GD_NATIVE_TYPE(dirfile_unit, field_code)
+
+  This function returns the native data type of the field given by 'field_code'.
+  The return value will be one of the data type constants: !GD.UINT8, !GD.INT8,
+  &c.  See gd_native_type(3).
+
+FUNCTION GD_NENTRIES(dirfile_unit, /ALIAS, /HIDDEN, /NOALIAS, PARENT=parent,
+    /SCALARS, TYPE=type, /VECTORS)
+
+  This function returns the number of entries in the dirfile satisfying the
+  given criteria.  If PARENT is given, the number of metafields for the given
+  parent will be returned otherwise top-level fields are considered.  If TYPE is
+  given, which should be one of the !GD.*_ENTRY constants, only fields of the
+  given type will be counted.  If /ALIASES, /SCALARS or /VECTORS is specified,
+  the TYPE parameter is ignored if it is also given.  The number returned
+  includes aliases, unless /NOALIAS is specified, but not hidden fields, unless
+  /HIDDEN is specified.  See gd_nentries(3).
+
+FUNCTION GD_NFIELDS(dirfile_unit, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS,
+    TYPE=type, /VECTORS)
+
+  An alias for GD_NENTRIES (q.v.) kept for backwards compatibility.
+
+FUNCTION GD_NFRAGMENTS(dirfile_unit)
+
+  This function returns the number of format file fragments in the dirfile.
+  See gd_nfragments(3).
+
+FUNCTION GD_NFRAMES(dirfile_unit)
+
+  This function returns the number of frames in the dirfile.  See
+  gd_nframes(3).
+
+FUNCTION GD_NVECTORS(dirfile_unit, PARENT=parent)
+
+  This function returns the number of vector type fields defined by the dirfile.
+  If PARENT is given, the number vector type metafields for the given parent
+  will be returned.  Otherwise, the total number of vector fields in the
+  database will be returned.  See gd_nvectors(3) and gd_nmvectors(3).
+
+FUNCTION GD_OPEN(dirfilename, /ARM_ENDIAN, /BIG_ENDIAN, /CREAT,
+  ENCODING=encoding, /EXCL, /FORCE_ENCODING, /FORCE_ENDIANNESS, /IGNORE_DUPS,
+  /IGNORE_REFS, /LITTLE_ENDIAN, /NOT_ARM_ENDIAN, /PEDANTIC, /PERMISSIVE,
+  /PRETTY_PRINT, /RDWR, /TRUNC, /TRUNCSUB, /VERBOSE)
+
+  This function opens the dirfile specified by 'dirfilename', returning the
+  dirfile unit number which can be subsequently used to refer to it.  If
+  specified, ENCODING should either be a string indicating the encoding type:
+  'BZIP2', 'GZIP', 'LZMA', 'SIE', 'SLIM', 'TEXT', 'ZZIP', 'ZZSLIM', 'NONE', or
+  else a numeric encoding type: !GD.BZIP2_ENCODED, &c.  The meaning of the other
+  keyword flags is explained in the gd_open(3) manual page.  A parser callback
+  function cannot be used by the IDL GetData bindings.  See gd_open(3).
+
+FUNCTION GD_PARENT_FRAGMENT(dirfile_unit, fragment_index)
+
+  This function returns the index of the format file fragment which includes
+  the fragment indexed by 'fragment_index'.  See gd_parent_fragment(3).
+
+PROCEDURE GD_PROTECT, dirfile_unit, protection, FRAGMENT=fragment
+
+  This function changes the (advisory) protection level of the fragment indexed
+  by FRAGMENT to 'protection', which should be one of the !GD.PROTECT_* values.
+  If FRAGMENT is not given, the protection level of all fragments is changed.  
+  See gd_protect(3).
+
+FUNCTION GD_PROTECTION(dirfile_unit, FRAGMENT=fragment)
+
+  This function returns the (advisory) protection level for the format file
+  fragment indexed by FRAGMENT, or for the primary format file, if FRAGMENT is
+  omitted.  The returned value will be one of the !GD.PROTECT_* constants.  See
+  gd_protection(3).
+
+PROCEDURE GD_PUTDATA, dirfile_unit, field_code, data, FIRST_FRAME=first_frame,
+  FIRST_SAMPLE=first_sample
+
+  This procedure writes data in the numerical vector 'data' to the field
+  specified by 'field_code'.  The keywords FIRST_FRAME and/or FIRST_SAMPLE
+  indicate the first sample written.  If neither of these are specified, the
+  data is written at the current position.  See putdata(3).
+
+PROCEDURE GD_PUT_CARRAY, dirfile_unit, field_code, value, START=start
+
+  This procedure stores the data in 'value' to the CARRAY field specified by
+  'field_code'.  START indicates the first element of the field which is
+  written.  Zero is assumed for START if not given.  See gd_put_carray_slice(3).
+
+PROCEDURE GD_PUT_CONSTANT, dirfile_unit, field_code, value
+
+  This procedure stores the number 'value' in the CONST field specified by
+  'field_code'.  See gd_put_constant(3).
+
+PROCEDURE GD_PUT_STRING, dirfile_unit, field_code, value
+
+  This procedure stores the string 'value' in the STRING field specified by
+  'field_code'.  See gd_put_string(3).
+
+FUNCTION GD_RAW_FILENAME(dirfile_unit, field_code)
+
+  This function returns the pathname of the data file backing the RAW field
+  specified by 'field_code'.  See gd_raw_filename(3).
+
+FUNCTION GD_REFERENCE(dirfile_unit)
+
+  This function returns the name of the RAW field used as the reference field
+  for the dirfile.  See gd_reference(3).
+
+PROCEDURE GD_RENAME, dirfile_unit, field_code, new_name, /MOVE_DATA, /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).
+
+FUNCTION GD_SEEK(dirfile_unit, field_code, FRAME_NUM=frame_num,
+  SAMPLE_NUM=sample_num, WHENCE=whence, /WRITE)
+
+  This function sets the current I/O position of the field specified by
+  'field_code' to the position given by FRAME_NUM and SAMPLE_NUM (which both
+  default to zero).  WHENCE should be one of the !GD.SEEK_* symbols.  If the
+  next operation on the field is a write (via GD_PUTDATA), the /WRITE flag
+  should also be specified.  See gd_seek(3).
+
+FUNCTION GD_SPF(dirfile_unit, field_code)
+
+  This function returns the number of samples per frame of the field specified
+  by 'field_code'.  See gd_spf(3).
+
+FUNCTION GD_STRINGS(dirfile_unit, PARENT=parent, TYPE=type)
+
+  This function returns the value of all STRING fields in the dirfile.  If
+  PARENT is given, the value of STRING metafields defined for the given parent
+  field will be returned, otherwise all non-meta STRING fields will be returned.
+  See gd_strings(3) and gd_mstrings(3).
+
+FUNCTION GD_STRTOK(dirfile_unit, STRING=string)
+
+  If STRING is given, this function returns the first token of the string.
+  Otherwise, it returns the next token of a string provided to a previous call.
+  See gd_strtok(3).
+
+FUNCTION GD_TELL(dirfile_unit, field_code)
+  
+  This function returns the current I/O position of the specified field.  See
+  gd_tell(3).
+
+PROCEDURE GD_UNHIDE, dirfile_unit, field_code
+
+  This procedure unhides the field or alias specified by 'field_code'.  See
+  gd_unhide(3).
+
+PROCEDURE GD_UNINCLUDE, dirfile_unit, fragment_index, /DELETE
+
+  This function removes the format file fragment indexed by 'fragment_index'.
+  If DELETE is specified, the fragment is also deleted from disk.  See
+  gd_uninclude(3).
+
+FUNCTION GD_VALIDATE(dirfile_unit, field_code)
+
+  This function checks whether 'field_code' is valid for reading and writing.
+  If it is this function returns zero.  Otherwise it returns non-zero.  See
+  gd_validate(3).
+
+PROCEDURE GD_VERBOSE_PREFIX, dirfile_unit, PREFIX=prefix)
+
+  This procedure sets the dirfile verbose prefix to PREFIX, if given, or else
+  removes it.  See gd_verbose_prefix(3).
+
+FUNCTION GD_VECTOR_LIST(dirfile_unit, PARENT=parent)
+
+  This function returns a list of vector type fields defined by the dirfile.  If
+  PARENT is given, a list of vector metafields for the given parent will be
+  returned.  Otherwise all non-meta vector fields will be returned.  See
+  gd_vector_list(3) and gd_mvector_list(3).
diff --git a/doc/README.matlab b/doc/README.matlab
new file mode 100644
index 0000000..687cb52
--- /dev/null
+++ b/doc/README.matlab
@@ -0,0 +1,19 @@
+MATLAB BINDINGS FOR GETDATA
+===========================
+
+The MATLAB bindings consist of a compatibility library, libgetdata-matlab, a
+collection of MEX functions, and a few pure MATLAB functions implementing the
+bindings.
+
+The compatibility library is installed in ${libdir}.  By default, the MATLAB
+files are installed in ${libdir}/getdata/matlab/getdata, although this path
+can be changed with the --with-matlab-dir option to ./configure.  To use the
+bindings, the installation directory must be added to the MATLAB path.
+
+Full documentation of the bindings are provided from within the MATLAB help
+system.  After installing the bindings, running
+
+  >> help getdata
+
+will provide an overview of the bindings and provide a list of the functions
+availabe.
diff --git a/doc/README.perl b/doc/README.perl
new file mode 100644
index 0000000..46be671
--- /dev/null
+++ b/doc/README.perl
@@ -0,0 +1,16 @@
+PERL BINDINGS FOR GETDATA
+=========================
+
+The Perl bindings consist of a perl module, `GetData.pm'.  They should work with
+Perl 5.6 or newer.  Complex data are represented within the module as
+Math::Complex objects.
+
+The GetData Perl bindings are documented in POD markup within GetData.pm.
+After installation, this documentation should be available in section 3 of
+the UNIX manual:
+
+  $ man 3 GetData
+
+Before installation, the manual can be read using a command along the lines of
+
+ $ pod2man bindings/perl/GetData.pm.in | nroff -mandoc | less
diff --git a/doc/README.python b/doc/README.python
new file mode 100644
index 0000000..bdb332f
--- /dev/null
+++ b/doc/README.python
@@ -0,0 +1,23 @@
+PYTHON BINDINGS FOR GETDATA
+===========================
+
+The python bindings consist of a python extension module, `pygetdata.so'.  They
+should work with Python version 2.3, or any later 2.x version.
+
+If found at configure time, the bindings will be built with NumPy support, which
+will result in requests for vector data returning NumPy arrays instead of Python
+lists.  If built with NumPy support, importing the module will fail if the numpy
+module cannot be found.  NumPy support should be preferred: it is more
+efficient both in memory usage and speed of data retrieval.
+
+Full documentation for the Python bindings to the GetData library is contained
+within the pygetdata module itself.  To read this documentation, execute
+
+$ pydoc pygetdata
+
+from the system shell, or
+
+>>> import pygetdata
+>>> help(pygetdata)
+
+from within the Python interpreter, after the bindings have been installed.
diff --git a/doc/unclean_database_recovery.txt b/doc/unclean_database_recovery.txt
new file mode 100644
index 0000000..3da5da3
--- /dev/null
+++ b/doc/unclean_database_recovery.txt
@@ -0,0 +1,184 @@
+UNCLEAN DATABASE RECOVERY PROCEDURE
+===================================
+
+A function returning the dreaded GD_E_UNCLEAN_DB error indicates that
+the call has left the open dirfile database in an "unclean" state.
+This document outlines procedures to recover such an unclean dirfile.
+It is expected that this process will largely be automated in the
+future.
+
+This file is current as of the GetData 0.7.0 library.
+
+0  Contents
+=-=-=-=-=-=
+
+1  Preamble
+2  Mitigation
+3  Recovery
+4  Checking
+
+
+1  Preamble
+=-=-=-=-=-=
+
+If you are not interested in the mechanism of how an unclean database
+comes about, you may skip directly to the next section (Mitigation).
+
+The GD_E_UNCLEAN_DB error may be returned by the following functions
+when they are asked to modify binary data:
+
+- dirfile_alter_encoding()
+- dirfile_alter_endianness()
+- dirfile_alter_frameoffset()
+
+If they aren't asked to modify binary data, GD_E_UNCLEAN_DB will never
+be returned.  In an abstract sense, all these functions modify binary
+data with the following procedure:
+
+1. copies are made of all the binary data files, after modification,
+for the fragment
+
+2a. If an error occurred in step one, the binary file copies are
+deleted.
+
+2b. If no error occurred in step one, the binary data files are moved
+into place.  In the case of dirfile_alter_endianness() and
+dirfile_alter_frameoffset(), the files are moved over top of the old
+files.  In the case of dirfile_alter_encoding(), the files have a new
+name, due to the differing extension, so after moving the new files,
+the old files are deleted.
+
+Steps 1 and 2a never produces GD_E_UNCLEAN_DB.  Step 2b will produce
+GD_E_UNCLEAN_DB if moving the new files fails, or if the delete of the
+old file fails.
+
+A move is accomplished through the rename(2) system call.  A delete is
+accomplished through through the unlink(2) system call.  See their man
+pages for reasons they might fail.
+
+An unclean database will suffer from one or more of the following
+problems:
+
+- Binary data files with incorrect names.
+- Both pre- and post-modification copies of the binary data.
+
+If multiple fragments are modified by a single call of these functions
+by passing GD_ALL_FRAGMENTS as the fragment index, the operation
+proceeds one fragment at a time, aborting early in the case of error.
+As a result, at most one fragment will ever be unclean (the ones
+before the unclean fragment will have been successfully modified, the
+ones after will be still in their unmodified state).
+
+
+2  Mitigation
+=-=-=-=-=-=-=
+
+Once GD_E_UNCLEAN_DB is encountered by an application, the open
+DIRFILE object should be closed using gd_close(3) or gd_discard(3)
+since further use of the dirfile may corrupt the database.  The
+GetData library encourages this behaviour by marking the database
+as invalid, which will cause most calls on the dirfile to fail.  If
+the pathname of the fragment in which the error occurred is not
+known (possibly because GD_ALL_FRAGMENTS was used),
+gd_error_string(3) may be called before closing the dirfile to get
+the pathname of the affected fragment.
+
+
+3  Recovery
+=-=-=-=-=-=
+
+The procedure for database recovery should be as follows:
+
+
+3.1  Determination of affected fragment
+---------------------------------------
+
+Before recovery can be accomplished, the unclean fragment must be
+determined.  The easiest way to do this is to call get_error_string(3)
+before closing the dirfile.  The error string for the GD_E_UNCLEAN_DB
+error contains the path to the unclean fragment.
+
+If this has not been done, the unclean fragment may be locatable by
+searching for temporary or duplicate files (see below) which haven't
+been cleaned up.
+
+
+3.2  Fragment preparation
+-------------------------
+
+Edit the unclean fragment with a text editor.  The error will have
+caused GetData to not update the fragment with the new encoding/
+endianness/frame offset.  Update this now.
+
+Make a list of RAW fields defined in the unclean fragment.
+
+
+3.3  RAW field classification
+-----------------------------
+
+Now go through the RAW field list.  Each RAW field should fall into
+one of these classes:
+
+Class A:  A temporary file exists with a name of the form
+<field_name>_XXXXXX where the "XXXXXX" represents an arbitrary set of
+six characters.  In this case there should also be a file with the
+proper binary file name, i.e. the field name, possibly appended with
+an encoding suffix.
+
+Class B: No temporary file exists, the only file is the one with the
+proper binary file name (with the new encoding suffix, if
+appropriate).
+
+Of these two classes, RAW fields of Class B can be ignored: they are
+already clean.  The RAW fields of Class A need to be cleaned.
+
+
+3.4  RAW Field Cleaning
+-----------------------
+
+Cleaning is a simple procedure: the temporary file contains the newly
+modified binary data, but it has the wrong name.  The correctly named
+binary file contains the old unmodified data.
+
+If the encoding was not changed (i.e. GD_E_UNCLEAN_DB was returned by
+a function other than dirfile_alter_encoding(3)), the field should be
+cleaned by simply moving the temporary file over top of the existing
+binary file with the correct name.
+
+If the encoding was changed (i.e. GD_E_UNCLEAN_DB was returned by
+dirfile_alter_encoding(3)), the field should be cleaned by renaming
+the temporary file and replacing the "_XXXXXX" part with the correct
+encoding suffix (see dirfile-encoding(5)).  The old file should then
+be deleted.
+
+The important point here is: the temporary file contains the correct
+data.  It must be kept.  This procedure should be repeated for each 
+RAW file in Class A.
+
+
+4  Checking
+=-=-=-=-=-=
+
+Once the dirfile has been cleaned, it should be checked by opening it
+read-only and attempting to read each of the RAW fields in the
+(formerly) unclean fragment.  If the procedure has been performed
+correctly, the expected data should be returned.
+
+If the data returned appear corrupted, it is possible that the old
+data file was not deleted; recheck the dirfile.  If an I/O error
+occurs, it is possible that the replacement file has an incorrect
+name or permissions; again, recheck the dirfile.
+
+
+-----------------------------------
+
+Copyright (C) 2008 D. V. Wiebe
+
+This document is part of the GetData project.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+Texts.  A copy of the license is included in the `COPYING.DOC' file
+as part of this distribution.
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..377bb86
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-11-20.07; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+	shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
+
+    -o) chowncmd="$chownprog $2"
+	shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call 'install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names problematic for 'test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dst_arg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+	/*) prefix='/';;
+	[-=\(\)!]*) prefix='./';;
+	*)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test X"$d" = X && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ltmain.sh b/ltmain.sh
new file mode 100644
index 0000000..ee470df
--- /dev/null
+++ b/ltmain.sh
@@ -0,0 +1,11147 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+##               by inline-source v2014-01-03.01
+
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.6
+package_revision=2.4.6
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
+fi
+
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+	  export $_G_var
+	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
+	fi"
+done
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp	$nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+    test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+    _G_progs_list=$1
+    _G_check_func=$2
+    _G_PATH=${3-"$PATH"}
+
+    _G_path_prog_max=0
+    _G_path_prog_found=false
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+    for _G_dir in $_G_PATH; do
+      IFS=$_G_save_IFS
+      test -z "$_G_dir" && _G_dir=.
+      for _G_prog_name in $_G_progs_list; do
+        for _exeext in '' .EXE; do
+          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+          func_executable_p "$_G_path_prog" || continue
+          case `"$_G_path_prog" --version 2>&1` in
+            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+            *)     $_G_check_func $_G_path_prog
+		   func_path_progs_result=$func_check_prog_result
+		   ;;
+          esac
+          $_G_path_prog_found && break 3
+        done
+      done
+    done
+    IFS=$_G_save_IFS
+    test -z "$func_path_progs_result" && {
+      echo "no acceptable sed could be found in \$PATH" >&2
+      exit 1
+    }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+  for _G_i in 1 2 3 4 5 6 7; do
+    _G_sed_script=$_G_sed_script$nl$_G_sed_script
+  done
+  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+  _G_sed_script=
+
+  func_check_prog_sed ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo '' >> conftest.nl
+      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  rm -f conftest.sed
+  SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+  func_check_prog_grep ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    _G_path_prog_max=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo 'GREP' >> conftest.nl
+      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
+
+: ${CP="cp -f"}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+
+
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
+
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
+
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion.  Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+  s/$_G_bs4/&\\
+/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+  s/\n//g"
+
+
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
+
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
+
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
+
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
+
+# Make sure we have an absolute progpath for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
+     progdir=`cd "$progdir" && pwd`
+     progpath=$progdir/$progname
+     ;;
+  *)
+     _G_IFS=$IFS
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS=$_G_IFS
+       test -x "$progdir/$progname" && break
+     done
+     IFS=$_G_IFS
+     test -n "$progdir" || progdir=`pwd`
+     progpath=$progdir/$progname
+     ;;
+esac
+
+
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
+
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
+
+opt_dry_run=false
+opt_quiet=false
+opt_verbose=false
+
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
+
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
+
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
+{
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset=''
+        tc_bold='';   tc_standout=''
+        tc_red='';   tc_green=''
+        tc_blue='';  tc_cyan=''
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
+
+    require_term_colors=:
+}
+
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+    $debug_cmd
+
+    eval _G_current_value='`$ECHO $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+    $debug_cmd
+
+    '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $debug_cmd
+
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    $debug_cmd
+
+    _G_directory_path=$1
+    _G_dir_list=
+
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$_G_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        _G_dir_list=$_G_directory_path:$_G_dir_list
+
+        # If the last portion added has no slash in it, the list is done
+        case $_G_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
+      done
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
+
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+	IFS=$func_mkdir_p_IFS
+        # mkdir can fail with a 'File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$_G_dir" 2>/dev/null || :
+      done
+      IFS=$func_mkdir_p_IFS
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
+    fi
+}
+
+
+# func_mktempdir [BASENAME]
+# -------------------------
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, BASENAME is the basename for that directory.
+func_mktempdir ()
+{
+    $debug_cmd
+
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
+
+    if test : = "$opt_dry_run"; then
+      # Return a directory name, but don't create it in dry-run mode
+      _G_tmpdir=$_G_template-$$
+    else
+
+      # If mktemp works, use that first and foremost
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$_G_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
+
+        func_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+    fi
+
+    $ECHO "$_G_tmpdir"
+}
+
+
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
+{
+    $debug_cmd
+
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+		s|/\./|/|g
+		t dotsl
+		s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # Start from root dir and reassemble the path.
+    func_normal_abspath_result=
+    func_normal_abspath_tpath=$1
+    func_normal_abspath_altnamespace=
+    case $func_normal_abspath_tpath in
+      "")
+        # Empty path, that just means $cwd.
+        func_stripname '' '/' "`pwd`"
+        func_normal_abspath_result=$func_stripname_result
+        return
+        ;;
+      # The next three entries are used to spot a run of precisely
+      # two leading slashes without using negated character classes;
+      # we take advantage of case's first-match behaviour.
+      ///*)
+        # Unusual form of absolute path, do nothing.
+        ;;
+      //*)
+        # Not necessarily an ordinary path; POSIX reserves leading '//'
+        # and for example Cygwin uses it to access remote file shares
+        # over CIFS/SMB, so we conserve a leading double slash if found.
+        func_normal_abspath_altnamespace=/
+        ;;
+      /*)
+        # Absolute path, do nothing.
+        ;;
+      *)
+        # Relative path, prepend $cwd.
+        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+        ;;
+    esac
+
+    # Cancel out all the simple stuff to save iterations.  We also want
+    # the path to end with a slash for ease of parsing, so make sure
+    # there is one (and only one) here.
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+    while :; do
+      # Processed it all yet?
+      if test / = "$func_normal_abspath_tpath"; then
+        # If we ascended to the root using ".." the result may be empty now.
+        if test -z "$func_normal_abspath_result"; then
+          func_normal_abspath_result=/
+        fi
+        break
+      fi
+      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcdr"`
+      # Figure out what to do with it
+      case $func_normal_abspath_tcomponent in
+        "")
+          # Trailing empty path component, ignore it.
+          ;;
+        ..)
+          # Parent dir; strip last assembled component from result.
+          func_dirname "$func_normal_abspath_result"
+          func_normal_abspath_result=$func_dirname_result
+          ;;
+        *)
+          # Actual path component, append it.
+          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+          ;;
+      esac
+    done
+    # Restore leading double-slash if one was found on entry.
+    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+    $debug_cmd
+
+    $opt_quiet || func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+    $debug_cmd
+
+    func_relative_path_result=
+    func_normal_abspath "$1"
+    func_relative_path_tlibdir=$func_normal_abspath_result
+    func_normal_abspath "$2"
+    func_relative_path_tbindir=$func_normal_abspath_result
+
+    # Ascend the tree starting from libdir
+    while :; do
+      # check if we have found a prefix of bindir
+      case $func_relative_path_tbindir in
+        $func_relative_path_tlibdir)
+          # found an exact match
+          func_relative_path_tcancelled=
+          break
+          ;;
+        $func_relative_path_tlibdir*)
+          # found a matching prefix
+          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+          func_relative_path_tcancelled=$func_stripname_result
+          if test -z "$func_relative_path_result"; then
+            func_relative_path_result=.
+          fi
+          break
+          ;;
+        *)
+          func_dirname $func_relative_path_tlibdir
+          func_relative_path_tlibdir=$func_dirname_result
+          if test -z "$func_relative_path_tlibdir"; then
+            # Have to descend all the way to the root!
+            func_relative_path_result=../$func_relative_path_result
+            func_relative_path_tcancelled=$func_relative_path_tbindir
+            break
+          fi
+          func_relative_path_result=../$func_relative_path_result
+          ;;
+      esac
+    done
+
+    # Now calculate path; take care to avoid doubling-up slashes.
+    func_stripname '' '/' "$func_relative_path_result"
+    func_relative_path_result=$func_stripname_result
+    func_stripname '/' '/' "$func_relative_path_tcancelled"
+    if test -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
+    fi
+
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
+    fi
+
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
+    :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
+func_quote_for_eval ()
+{
+    $debug_cmd
+
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+	  ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+	func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    $debug_cmd
+
+    case $1 in
+      *[\\\`\"]*)
+	_G_arg=`$ECHO "$1" | $SED \
+	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        _G_arg=$1 ;;
+    esac
+
+    case $_G_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        _G_arg=\"$_G_arg\"
+        ;;
+    esac
+
+    func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    $opt_dry_run || {
+      eval "$_G_user_locale
+	    $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $debug_cmd
+
+    $opt_verbose && func_echo "$*"
+
+    :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    printf '%s\n%s\n' "$1" "$2" \
+      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false.  Use it like this:
+#
+#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+    $debug_cmd
+
+    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next 'cmd' execution.
+      eval _G_hook_result=\$${_G_hook}_result
+      eval set dummy "$_G_hook_result"; shift
+    done
+
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_options_prep_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_silent_option_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_option_validation_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+    $debug_cmd
+
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
+
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
+
+    # save modified positional parameters for caller
+    func_options_result=$func_run_hooks_result
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
+{
+    $debug_cmd
+
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
+
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+    $debug_cmd
+
+    func_parse_options_result=
+
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
+
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy "$func_run_hooks_result"; shift
+
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
+
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+		      ;;
+
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+	# Separate optargs to long options (plugins may need this):
+	--*=*)        func_split_equals "$_G_opt"
+	              set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+    $debug_cmd
+
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+    func_run_hooks func_validate_options ${1+"$@"}
+
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
+}
+
+
+
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    $debug_cmd
+
+    eval \$ECHO \""Usage: $usage"\"
+    eval \$ECHO \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message"
+    exit 0
+}
+
+
+# func_missing_arg ARGNAME
+# ------------------------
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $debug_cmd
+
+    func_error "Missing argument for '$1'."
+    exit_cmd=exit
+}
+
+
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
+
+
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
+{
+    $debug_cmd
+
+    eval \$ECHO \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+	h
+	/^Written by/q' < "$progpath"
+    echo
+    eval \$ECHO \""$usage_message"\"
+}
+
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
+
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
+
+    exit $?
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
+
+
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+    $debug_cmd
+
+    $warning_func ${1+"$@"}
+}
+
+
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --config             show all configuration variables
+       --debug              enable verbose shell tracing
+   -n, --dry-run            display commands without modifying any files
+       --features           display basic configuration information and exit
+       --mode=MODE          use operation mode MODE
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message
+
+MODE must be one of the following:
+
+       clean           remove files from the build directory
+       compile         compile a source file into a libtool object
+       execute         automatically set library path, then run a program
+       finish          complete the installation of libtool libraries
+       install         install libraries or executables
+       link            create a library or an executable
+       uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+       host-triplet:   $host
+       shell:          $SHELL
+       compiler:       $LTCC
+       compiler flags: $LTCFLAGS
+       linker:         $LD (gnu? $with_gnu_ld)
+       version:        $progname (GNU libtool) 2.4.6
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool at gnu.org>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+    exit 0
+}
+
+
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
+    func_xform_result=${1%.*}.lo
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
+
+
+# func_fatal_configuration ARG...
+# -------------------------------
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func__fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "Fatal configuration error."
+}
+
+
+# func_config
+# -----------
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+
+# func_features
+# -------------
+# Display the features supported by this script.
+func_features ()
+{
+    echo "host: $host"
+    if test yes = "$build_libtool_libs"; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test yes = "$build_old_libs"; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+
+    exit $?
+}
+
+
+# func_enable_tag TAGNAME
+# -----------------------
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+    # Global variable:
+    tagname=$1
+
+    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+    sed_extractcf=/$re_begincf/,/$re_endcf/p
+
+    # Validate tagname.
+    case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+        func_fatal_error "invalid tag name: $tagname"
+        ;;
+    esac
+
+    # Don't test for the "default" C tag, as we know it's
+    # there but not specially marked.
+    case $tagname in
+        CC) ;;
+    *)
+        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	  taglist="$taglist $tagname"
+
+	  # Evaluate the configuration.  Be careful to quote the path
+	  # and the sed script, to avoid splitting on whitespace, but
+	  # also don't use non-portable quotes within backquotes within
+	  # quotes we have to do it in 2 steps:
+	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	  eval "$extractedcf"
+        else
+	  func_error "ignoring unknown tag $tagname"
+        fi
+        ;;
+    esac
+}
+
+
+# func_check_version_match
+# ------------------------
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+    if test "$package_revision" != "$macro_revision"; then
+      if test "$VERSION" != "$macro_version"; then
+        if test -z "$macro_version"; then
+          cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+        else
+          cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+        fi
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+      fi
+
+      exit $EXIT_MISMATCH
+    fi
+}
+
+
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+    $debug_mode
+
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
+
+    nonopt=
+    preserve_args=
+
+    # Shorthand for --mode=foo, only valid as the first argument
+    case $1 in
+    clean|clea|cle|cl)
+      shift; set dummy --mode clean ${1+"$@"}; shift
+      ;;
+    compile|compil|compi|comp|com|co|c)
+      shift; set dummy --mode compile ${1+"$@"}; shift
+      ;;
+    execute|execut|execu|exec|exe|ex|e)
+      shift; set dummy --mode execute ${1+"$@"}; shift
+      ;;
+    finish|finis|fini|fin|fi|f)
+      shift; set dummy --mode finish ${1+"$@"}; shift
+      ;;
+    install|instal|insta|inst|ins|in|i)
+      shift; set dummy --mode install ${1+"$@"}; shift
+      ;;
+    link|lin|li|l)
+      shift; set dummy --mode link ${1+"$@"}; shift
+      ;;
+    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+      shift; set dummy --mode uninstall ${1+"$@"}; shift
+      ;;
+    esac
+
+    # Pass back the list of options.
+    func_quote_for_eval ${1+"$@"}
+    libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
+
+
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
+{
+    $debug_cmd
+
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+	# An option not handled by this hook function:
+        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+      esac
+    done
+
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
+
+
+
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
+    fi
+
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
+
+    case $host in
+      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+        # don't eliminate duplications in $postdeps and $predeps
+        opt_duplicate_compiler_generated_deps=:
+        ;;
+      *)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
+    esac
+
+    $opt_help || {
+      # Sanity checks first:
+      func_check_version_match
+
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
+
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+        func_error "unrecognized option '-dlopen'"
+        $ECHO "$help" 1>&2
+        exit $EXIT_FAILURE
+      fi
+
+      # Change the help message to a mode-specific one.
+      generic_help=$help
+      help="Try '$progname --help --mode=$opt_mode' for more information."
+    }
+
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_validate_options libtool_validate_options
+
+
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_p file
+# True iff FILE is a libtool '.la' library or '.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool '.la' library or '.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if 'file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case $lalib_p_line in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test yes = "$lalib_p"
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    test -f "$1" &&
+      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_dirname_and_basename "$1" "" "."
+    func_stripname '' '.exe' "$func_basename_result"
+    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $debug_cmd
+
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$sp$nl
+      eval cmd=\"$cmd\"
+      IFS=$save_ifs
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# 'FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $debug_cmd
+
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+  func_resolve_sysroot_result=$1
+  case $func_resolve_sysroot_result in
+  =*)
+    func_stripname '=' '' "$func_resolve_sysroot_result"
+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+    ;;
+  esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+  case $lt_sysroot:$1 in
+  ?*:"$lt_sysroot"*)
+    func_stripname "$lt_sysroot" '' "$1"
+    func_replace_sysroot_result='='$func_stripname_result
+    ;;
+  *)
+    # Including no sysroot.
+    func_replace_sysroot_result=$1
+    ;;
+  esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $debug_cmd
+
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	func_append_quoted CC_quoted "$arg"
+      done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_append_quoted CC_quoted "$arg"
+	    done
+	    CC_expanded=`func_echo_all $CC`
+	    CC_quoted_expanded=`func_echo_all $CC_quoted`
+	    case "$@ " in
+	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with '--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=$1
+    if test yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
+    else
+      write_lobj=none
+    fi
+
+    if test yes = "$build_old_libs"; then
+      write_oldobj=\'$3\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "$write_libobj"
+    }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+  $debug_cmd
+
+  func_convert_core_file_wine_to_w32_result=$1
+  if test -n "$1"; then
+    # Unfortunately, winepath does not exit with a non-zero error code, so we
+    # are forced to check the contents of stdout. On the other hand, if the
+    # command is not found, the shell will set an exit code of 127 and print
+    # *an error message* to stdout. So we must check for both error code of
+    # zero AND non-empty stdout, which explains the odd construction:
+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+        $SED -e "$sed_naive_backslashify"`
+    else
+      func_convert_core_file_wine_to_w32_result=
+    fi
+  fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+  $debug_cmd
+
+  # unfortunately, winepath doesn't convert paths, only file names
+  func_convert_core_path_wine_to_w32_result=
+  if test -n "$1"; then
+    oldIFS=$IFS
+    IFS=:
+    for func_convert_core_path_wine_to_w32_f in $1; do
+      IFS=$oldIFS
+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+      if test -n "$func_convert_core_file_wine_to_w32_result"; then
+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
+          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
+        else
+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+        fi
+      fi
+    done
+    IFS=$oldIFS
+  fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+  $debug_cmd
+
+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+    if test "$?" -ne 0; then
+      # on failure, ensure result is empty
+      func_cygpath_result=
+    fi
+  else
+    func_cygpath_result=
+    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
+  fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format.  Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+  $debug_cmd
+
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+  $debug_cmd
+
+  if test -z "$2" && test -n "$1"; then
+    func_error "Could not determine host file name corresponding to"
+    func_error "  '$1'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback:
+    func_to_host_file_result=$1
+  fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+  $debug_cmd
+
+  if test -z "$4" && test -n "$3"; then
+    func_error "Could not determine the host path corresponding to"
+    func_error "  '$3'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback.  This is a deliberately simplistic "conversion" and
+    # should not be "improved".  See libtool.info.
+    if test "x$1" != "x$2"; then
+      lt_replace_pathsep_chars="s|$1|$2|g"
+      func_to_host_path_result=`echo "$3" |
+        $SED -e "$lt_replace_pathsep_chars"`
+    else
+      func_to_host_path_result=$3
+    fi
+  fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+  $debug_cmd
+
+  case $4 in
+  $1 ) func_to_host_path_result=$3$func_to_host_path_result
+    ;;
+  esac
+  case $4 in
+  $2 ) func_append func_to_host_path_result "$3"
+    ;;
+  esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via '$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+  $debug_cmd
+
+  $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.  If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+  $debug_cmd
+
+  case ,$2, in
+    *,"$to_tool_file_cmd",*)
+      func_to_tool_file_result=$1
+      ;;
+    *)
+      $to_tool_file_cmd "$1"
+      func_to_tool_file_result=$func_to_host_file_result
+      ;;
+  esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+  func_to_host_file_result=$1
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_to_host_file_result=$func_convert_core_msys_to_w32_result
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+    # LT_CYGPATH in this case.
+    func_to_host_file_result=`cygpath -m "$1"`
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    func_convert_core_file_wine_to_w32 "$1"
+    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result=$func_cygpath_result
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+    func_convert_core_file_wine_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result=$func_cygpath_result
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via '$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format.  If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+#   file name conversion function    : func_convert_file_X_to_Y ()
+#   path conversion function         : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same.  If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+  $debug_cmd
+
+  if test -z "$to_host_path_cmd"; then
+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+    to_host_path_cmd=func_convert_path_$func_stripname_result
+  fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+  $debug_cmd
+
+  func_init_to_host_path_cmd
+  $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+  func_to_host_path_result=$1
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from ARG.  MSYS
+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+    # and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result=$func_convert_core_msys_to_w32_result
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
+# a working winepath.  Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result=$func_cygpath_result
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from
+    # ARG. msys behavior is inconsistent here, cygpath turns them
+    # into '.;' and ';.', and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result=$func_cygpath_result
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[	 ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $debug_cmd
+
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg=$arg
+	arg_mode=normal
+	;;
+
+      target )
+	libobj=$arg
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify '-o' more than once"
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-pie | -fpie | -fPIE)
+          func_append pie_flag " $arg"
+	  continue
+	  ;;
+
+	-shared | -static | -prefer-pic | -prefer-non-pic)
+	  func_append later " $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
+	  lastarg=
+	  save_ifs=$IFS; IFS=,
+	  for arg in $args; do
+	    IFS=$save_ifs
+	    func_append_quoted lastarg "$arg"
+	  done
+	  IFS=$save_ifs
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
+
+	  # Add the arguments to base_compile.
+	  func_append base_compile " $lastarg"
+	  continue
+	  ;;
+
+	*)
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg=$srcfile
+	  srcfile=$arg
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_append_quoted base_compile "$lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with '-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj=$func_basename_result
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from '$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+	test yes = "$build_libtool_libs" \
+	  || func_fatal_configuration "cannot build a shared library"
+	build_old_libs=no
+	continue
+	;;
+
+      -static)
+	build_libtool_libs=no
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name '$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname=$func_basename_result
+    xdir=$func_dirname_result
+    lobj=$xdir$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test yes = "$build_old_libs"; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test no = "$compiler_c_o"; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+      lockfile=$output_obj.lock
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test yes = "$need_locks"; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test warn = "$need_locks"; then
+      if test -f "$lockfile"; then
+	$ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+      func_append removelist " $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    func_append removelist " $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+    srcfile=$func_to_tool_file_result
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test yes = "$build_libtool_libs"; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test no != "$pic_mode"; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	func_append command " -o $lobj"
+      fi
+
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test warn = "$need_locks" &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test yes = "$suppress_opt"; then
+	suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile$pie_flag"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test yes = "$compiler_c_o"; then
+	func_append command " -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      func_append command "$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test warn = "$need_locks" &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test no != "$need_locks"; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $opt_mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
+  -shared           do not build a '.o' file suitable for static linking
+  -static           only build a '.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to '-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the '--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the 'install' or 'cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
+  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  use a list of object files found in FILE to specify objects
+  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with '-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in '.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
+
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode '$opt_mode'"
+        ;;
+    esac
+
+    echo
+    $ECHO "Try '$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test : = "$opt_help"; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	func_mode_help
+      done
+    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	echo
+	func_mode_help
+      done
+    } |
+    $SED '1d
+      /^When reporting/,/^Report/{
+	H
+	d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $debug_cmd
+
+    # The first argument is the command name.
+    cmd=$nonopt
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $opt_dlopen; do
+      test -f "$file" \
+	|| func_fatal_help "'$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "'$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "'$file' was not linked with '-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir=$func_dirname_result
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  func_append dir "/$objdir"
+	else
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir=$func_dirname_result
+	;;
+
+      *)
+	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir=$absdir
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic=$magic
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -* | *.la | *.lo ) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file=$progdir/$program
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file=$progdir/$program
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_append_quoted args "$file"
+    done
+
+    if $opt_dry_run; then
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    else
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd=\$cmd$args
+    fi
+}
+
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $debug_cmd
+
+    libs=
+    libdirs=
+    admincmds=
+
+    for opt in "$nonopt" ${1+"$@"}
+    do
+      if test -d "$opt"; then
+	func_append libdirs " $opt"
+
+      elif test -f "$opt"; then
+	if func_lalib_unsafe_p "$opt"; then
+	  func_append libs " $opt"
+	else
+	  func_warning "'$opt' is not a valid libtool archive"
+	fi
+
+      else
+	func_fatal_error "invalid argument '$opt'"
+      fi
+    done
+
+    if test -n "$libs"; then
+      if test -n "$lt_sysroot"; then
+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+      else
+        sysroot_cmd=
+      fi
+
+      # Remove sysroot references
+      if $opt_dry_run; then
+        for lib in $libs; do
+          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
+        done
+      else
+        tmpdir=`func_mktempdir`
+        for lib in $libs; do
+	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	    > $tmpdir/tmp-la
+	  mv -f $tmpdir/tmp-la $lib
+	done
+        ${RM}r "$tmpdir"
+      fi
+    fi
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || func_append admincmds "
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_quiet && exit $EXIT_SUCCESS
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      echo "----------------------------------------------------------------------"
+      echo "Libraries have been installed in:"
+      for libdir in $libdirs; do
+	$ECHO "   $libdir"
+      done
+      echo
+      echo "If you ever happen to want to link against installed libraries"
+      echo "in a given directory, LIBDIR, you must either use libtool, and"
+      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
+      echo "flag during linking and do at least one of the following:"
+      if test -n "$shlibpath_var"; then
+	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
+	echo "     during execution"
+      fi
+      if test -n "$runpath_var"; then
+	echo "   - add LIBDIR to the '$runpath_var' environment variable"
+	echo "     during linking"
+      fi
+      if test -n "$hardcode_libdir_flag_spec"; then
+	libdir=LIBDIR
+	eval flag=\"$hardcode_libdir_flag_spec\"
+
+	$ECHO "   - use the '$flag' linker flag"
+      fi
+      if test -n "$admincmds"; then
+	$ECHO "   - have your system administrator run these commands:$admincmds"
+      fi
+      if test -f /etc/ld.so.conf; then
+	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
+      fi
+      echo
+
+      echo "See any operating system documentation about shared libraries for"
+      case $host in
+	solaris2.[6789]|solaris2.1[0-9])
+	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	  echo "pages."
+	  ;;
+	*)
+	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
+	  ;;
+      esac
+      echo "----------------------------------------------------------------------"
+    fi
+    exit $EXIT_SUCCESS
+}
+
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $debug_cmd
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
+       # Allow the use of GNU shtool's install command.
+       case $nonopt in *shtool*) :;; *) false;; esac
+    then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    func_append install_prog "$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=false
+    stripme=
+    no_mode=:
+    for arg
+    do
+      arg2=
+      if test -n "$dest"; then
+	func_append files " $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=: ;;
+      -f)
+	if $install_cp; then :; else
+	  prev=$arg
+	fi
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
+	    arg2=$install_override_mode
+	    no_mode=false
+	  fi
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      func_append install_prog " $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+	func_quote_for_eval "$arg2"
+      fi
+      func_append install_shared_prog " $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the '$prev' option requires an argument"
+
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+	func_quote_for_eval "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_for_eval_result"
+      fi
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=:
+    if $isdir; then
+      destdir=$dest
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir=$func_dirname_result
+      destname=$func_basename_result
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "'$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "'$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic=$magic
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	func_append staticlibs " $file"
+	;;
+
+      *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "'$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) func_append current_libdirs " $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) func_append future_libdirs " $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir=$func_dirname_result
+	func_append dir "$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking '$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname=$1
+	  shift
+
+	  srcname=$realname
+	  test -n "$relink_command" && srcname=${realname}T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme=$stripme
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  os2*)
+	    case $realname in
+	    *_dll.a)
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try 'ln -sf' first, because the 'ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib=$destdir/$realname
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name=$func_basename_result
+	instname=$dir/${name}i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile=$destdir/$destname
+	else
+	  func_basename "$file"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest=$destfile
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to '$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test yes = "$build_old_libs"; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile=$destdir/$destname
+	else
+	  func_basename "$file"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=.exe
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
+
+	  finalize=:
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "'$lib' has not been installed in '$libdir'"
+	      finalize=false
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test no = "$fast_install" && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if $finalize; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file=$func_basename_result
+	        outputname=$tmpdir/$file
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_quiet || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink '$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file=$outputname
+	      else
+	        func_warning "cannot relink '$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name=$func_basename_result
+
+      # Set up the ranlib parameters.
+      oldlib=$destdir/$name
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run '$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
+    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms=${my_outputname}S.c
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist=$output_objdir/$my_outputname.nm
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test yes = "$dlself"; then
+	  func_verbose "generating symbol list for '$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
+	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols=$output_objdir/$outputname.exp
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin* | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from '$dlprefile'"
+	  func_basename "$dlprefile"
+	  name=$func_basename_result
+          case $host in
+	    *cygwin* | *mingw* | *cegcc* )
+	      # if an import library, we need to obtain dlname
+	      if func_win32_import_lib_p "$dlprefile"; then
+	        func_tr_sh "$dlprefile"
+	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
+	        dlprefile_dlbasename=
+	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+	          # Use subshell, to avoid clobbering current variable values
+	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+	          if test -n "$dlprefile_dlname"; then
+	            func_basename "$dlprefile_dlname"
+	            dlprefile_dlbasename=$func_basename_result
+	          else
+	            # no lafile. user explicitly requested -dlpreopen <import library>.
+	            $sharedlib_from_linklib_cmd "$dlprefile"
+	            dlprefile_dlbasename=$sharedlib_from_linklib_result
+	          fi
+	        fi
+	        $opt_dry_run || {
+	          if test -n "$dlprefile_dlbasename"; then
+	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+	          else
+	            func_warning "Could not compute DLL name from $name"
+	            eval '$ECHO ": $name " >> "$nlist"'
+	          fi
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+	        }
+	      else # not an import lib
+	        $opt_dry_run || {
+	          eval '$ECHO ": $name " >> "$nlist"'
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	        }
+	      fi
+	    ;;
+	    *)
+	      $opt_dry_run || {
+	        eval '$ECHO ": $name " >> "$nlist"'
+	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	      }
+	    ;;
+          esac
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  func_show_eval '$RM "${nlist}I"'
+	  if test -n "$global_symbol_to_import"; then
+	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+	  fi
+
+	  echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+	    echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+	  fi
+	  echo >> "$output_objdir/$my_dlsyms" "\
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{ {\"$my_originator\", (void *) 0},"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+	  fi
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  echo >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) func_append symtab_cflags " $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj=$output_objdir/${my_outputname}S.$objext
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for '$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+  $debug_cmd
+
+  win32_libid_type=unknown
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      case $nm_interface in
+      "MS dumpbin")
+	if func_cygming_ms_implib_p "$1" ||
+	   func_cygming_gnu_implib_p "$1"
+	then
+	  win32_nmres=import
+	else
+	  win32_nmres=
+	fi
+	;;
+      *)
+	func_to_tool_file "$1" func_convert_file_msys_to_w32
+	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	  $SED -n -e '
+	    1,100{
+		/ I /{
+		    s|.*|import|
+		    p
+		    q
+		}
+	    }'`
+	;;
+      esac
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+  $debug_cmd
+
+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+  $debug_cmd
+
+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+    $SED '/^Contents of section '"$match_literal"':/{
+      # Place marker at beginning of archive member dllname section
+      s/.*/====MARK====/
+      p
+      d
+    }
+    # These lines can sometimes be longer than 43 characters, but
+    # are always uninteresting
+    /:[	 ]*file format pe[i]\{,1\}-/d
+    /^In archive [^:]*:/d
+    # Ensure marker is printed
+    /^====MARK====/p
+    # Remove all lines with less than 43 characters
+    /^.\{43\}/!d
+    # From remaining lines, remove first 43 characters
+    s/^.\{43\}//' |
+    $SED -n '
+      # Join marker and all lines until next marker into a single line
+      /^====MARK====/ b para
+      H
+      $ b para
+      b
+      :para
+      x
+      s/\n//g
+      # Remove the marker
+      s/^====MARK====//
+      # Remove trailing dots and whitespace
+      s/[\. \t]*$//
+      # Print
+      /./p' |
+    # we now have a list, one entry per line, of the stringified
+    # contents of the appropriate section of all members of the
+    # archive that possess that section. Heuristic: eliminate
+    # all those that have a first or second character that is
+    # a '.' (that is, objdump's representation of an unprintable
+    # character.) This should work for all archives with less than
+    # 0x302f exports -- but will fail for DLLs whose name actually
+    # begins with a literal '.' or a single character followed by
+    # a '.'.
+    #
+    # Of those that remain, print the first one.
+    $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+  $debug_cmd
+
+  if func_cygming_gnu_implib_p "$1"; then
+    # binutils import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+  elif func_cygming_ms_implib_p "$1"; then
+    # ms-generated import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+  else
+    # unknown
+    sharedlib_from_linklib_result=
+  fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+		   'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test yes = "$lock_old_archive_extraction"; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $debug_cmd
+
+    my_gentop=$1; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=
+    my_xlib=
+    my_xabs=
+    my_xdir=
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib=$func_basename_result
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir=$my_gentop/$my_xlib_u
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  func_basename "$darwin_archive"
+	  darwin_base_archive=$func_basename_result
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches; do
+	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+    done
+
+    func_extract_archives_result=$my_oldobjs
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory where it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=${1-no}
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ that is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options that match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test yes = "$fast_install"; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	\$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# fixup the dll searchpath if we need to.
+	#
+	# Fix the DLL searchpath if we need to.  Do this before prepending
+	# to shlibpath, because on Windows, both are PATH and uninstalled
+	# libraries must come first.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	# Export our shlibpath_var if we have one.
+	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+      func_exec_program \${1+\"\$@\"}
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+*/
+EOF
+	    cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* declarations of non-ANSI functions */
+#if defined __MINGW32__
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined __CYGWIN__
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined other_platform || defined ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined _MSC_VER
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+#elif defined __MINGW32__
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined __CYGWIN__
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined other platforms ... */
+#endif
+
+#if defined PATH_MAX
+# define LT_PATHMAX PATH_MAX
+#elif defined MAXPATHLEN
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+  defined __OS2__
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free (stale); stale = 0; } \
+} while (0)
+
+#if defined LT_DEBUGWRAPPER
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+	    cat <<EOF
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_path "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_path "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test yes = "$fast_install"; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  int rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, (size_t) argc + 1);
+
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (STREQ (argv[i], dumpscript_opt))
+	{
+EOF
+	    case $host in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  lt_dump_script (stdout);
+	  return 0;
+	}
+      if (STREQ (argv[i], debug_opt))
+	{
+          lt_debug = 1;
+          continue;
+	}
+      if (STREQ (argv[i], ltwrapper_option_prefix))
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+		    "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+EOF
+	    cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
+EOF
+	    cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+		  tmp_pathspec);
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+		  actual_cwrapper_path);
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(main) libtool target name: %s\n",
+		  target_name);
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+     because on Windows, both *_VARNAMEs are PATH but uninstalled
+     libraries must come first. */
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+		  nonnull (lt_argv_zero));
+  for (i = 0; i < newargc; i++)
+    {
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+		      i, nonnull (newargz[i]));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
+  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      lt_debugprintf (__FILE__, __LINE__,
+		      "(main) failed to launch target \"%s\": %s\n",
+		      lt_argv_zero, nonnull (strerror (errno)));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  size_t tmp_len;
+  char *concat_name;
+
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = (size_t) (q - p);
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      lt_debugprintf (__FILE__, __LINE__,
+		      "checking path component for symlinks: %s\n",
+		      tmp_pathspec);
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  lt_fatal (__FILE__, __LINE__,
+		    "error accessing file \"%s\": %s",
+		    tmp_pathspec, nonnull (strerror (errno)));
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal (__FILE__, __LINE__,
+		"could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (STREQ (str, pat))
+	*str = '\0';
+    }
+  return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+	       int line, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+  va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    size_t len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      size_t orig_value_len = strlen (orig_value);
+      size_t add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[--len] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+	new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+	{
+	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+	  size_t length;
+	  unsigned int backslashes;
+	  const char *s;
+	  char *quoted_string;
+	  char *p;
+
+	  length = 0;
+	  backslashes = 0;
+	  if (quote_around)
+	    length++;
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		length += backslashes + 1;
+	      length++;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    length += backslashes + 1;
+
+	  quoted_string = XMALLOC (char, length + 1);
+
+	  p = quoted_string;
+	  backslashes = 0;
+	  if (quote_around)
+	    *p++ = '"';
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		{
+		  unsigned int j;
+		  for (j = backslashes + 1; j > 0; j--)
+		    *p++ = '\\';
+		}
+	      *p++ = c;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    {
+	      unsigned int j;
+	      for (j = backslashes; j > 0; j--)
+		*p++ = '\\';
+	      *p++ = '"';
+	    }
+	  *p = '\0';
+
+	  new_argv[i] = quoted_string;
+	}
+      else
+	new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+		;;
+	    esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+	    func_emit_wrapper yes |
+	      $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $debug_cmd
+
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $debug_cmd
+
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # what system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll that has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    bindir=
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    os2dllname=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=false
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module=$wl-single_module
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+	test yes != "$build_libtool_libs" \
+	  && func_fatal_configuration "cannot build a shared library"
+	build_old_libs=no
+	break
+	;;
+      -all-static | -static | -static-libtool-libs)
+	case $arg in
+	-all-static)
+	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
+	    func_warning "complete static linking is impossible in this configuration"
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	-static)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	  ;;
+	-static-libtool-libs)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	esac
+	build_libtool_libs=no
+	build_old_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg=$1
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	bindir)
+	  bindir=$arg
+	  prev=
+	  continue
+	  ;;
+	dlfiles|dlprefiles)
+	  $preload || {
+	    # Add the symbol object into the linking commands.
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
+	    preload=:
+	  }
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test no = "$dlself"; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test dlprefiles = "$prev"; then
+	      dlself=yes
+	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test dlfiles = "$prev"; then
+	      func_append dlfiles " $arg"
+	    else
+	      func_append dlprefiles " $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols=$arg
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file '$arg' does not exist"
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex=$arg
+	  prev=
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) func_append deplibs " $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir=$arg
+	  prev=
+	  continue
+	  ;;
+	mllvm)
+	  # Clang does not use LLVM to link, so we can simply discard any
+	  # '-mllvm $arg' options when doing the link step.
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat "$save_arg"`
+	    do
+#	      func_append moreargs " $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if func_lalib_unsafe_p "$arg"; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		func_source "$arg"
+
+		if test -z "$pic_object" ||
+		   test -z "$non_pic_object" ||
+		   test none = "$pic_object" &&
+		   test none = "$non_pic_object"; then
+		  func_fatal_error "cannot find name of object for '$arg'"
+		fi
+
+		# Extract subdirectory from the argument.
+		func_dirname "$arg" "/" ""
+		xdir=$func_dirname_result
+
+		if test none != "$pic_object"; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object=$xdir$pic_object
+
+		  if test dlfiles = "$prev"; then
+		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+		      func_append dlfiles " $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test dlprefiles = "$prev"; then
+		    # Preload the old-style object.
+		    func_append dlprefiles " $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  func_append libobjs " $pic_object"
+		  arg=$pic_object
+		fi
+
+		# Non-PIC object.
+		if test none != "$non_pic_object"; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object=$xdir$non_pic_object
+
+		  # A standard non-PIC object
+		  func_append non_pic_objects " $non_pic_object"
+		  if test -z "$pic_object" || test none = "$pic_object"; then
+		    arg=$non_pic_object
+		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object=$pic_object
+		  func_append non_pic_objects " $non_pic_object"
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if $opt_dry_run; then
+		  # Extract subdirectory from the argument.
+		  func_dirname "$arg" "/" ""
+		  xdir=$func_dirname_result
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "'$arg' is not a valid libtool object"
+		fi
+	      fi
+	    done
+	  else
+	    func_fatal_error "link input file '$arg' does not exist"
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	os2dllname)
+	  os2dllname=$arg
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex=$arg
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release=-$arg
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    func_fatal_error "only absolute run-paths are allowed"
+	    ;;
+	  esac
+	  if test rpath = "$prev"; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) func_append rpath " $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) func_append xrpath " $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	shrext)
+	  shrext_cmds=$arg
+	  prev=
+	  continue
+	  ;;
+	weak)
+	  func_append weak_libs " $arg"
+	  prev=
+	  continue
+	  ;;
+	xcclinker)
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xcompiler)
+	  func_append compiler_flags " $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $wl$qarg"
+	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg=$arg
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	func_fatal_error "'-allow-undefined' must not be used because it is the default"
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -bindir)
+	prev=bindir
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
+	fi
+	if test X-export-symbols = "X$arg"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework)
+	prev=framework
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	func_stripname "-L" '' "$arg"
+	if test -z "$func_stripname_result"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between '-L' and '$1'"
+	  else
+	    func_fatal_error "need path for '-L' option"
+	  fi
+	fi
+	func_resolve_sysroot "$func_stripname_result"
+	dir=$func_resolve_sysroot_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of '$dir'"
+	  dir=$absdir
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "* | *" $arg "*)
+	  # Will only happen for absolute or sysroot arguments
+	  ;;
+	*)
+	  # Preserve sysroot, but never include relative directories
+	  case $dir in
+	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+	    *) func_append deplibs " -L$dir" ;;
+	  esac
+	  func_append lib_search_path " $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
+	  *) func_append dllsearchpath ":$dir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) func_append dllsearchpath ":$testbindir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test X-lc = "X$arg" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test X-lc = "X$arg" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    func_append deplibs " System.ltframework"
+	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test X-lc = "X$arg" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test X-lc = "X$arg" && continue
+	    ;;
+	  esac
+	elif test X-lc_r = "X$arg"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	func_append deplibs " $arg"
+	continue
+	;;
+
+      -mllvm)
+	prev=mllvm
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot|--sysroot)
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	prev=xcompiler
+	continue
+	;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) func_append new_inherited_linker_flags " $arg" ;;
+	esac
+	continue
+	;;
+
+      -multi_module)
+	single_module=$wl-multi_module
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # and Darwin in order for the loader to find any dlls it needs.
+	  func_warning "'-no-install' is ignored for $host"
+	  func_warning "assuming '-no-fast-install' instead"
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -os2dllname)
+	prev=os2dllname
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	=*)
+	  func_stripname '=' '' "$dir"
+	  dir=$lt_sysroot$func_stripname_result
+	  ;;
+	*)
+	  func_fatal_error "only absolute run-paths are allowed"
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) func_append xrpath " $dir" ;;
+	esac
+	continue
+	;;
+
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -static | -static-libtool-libs)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -weak)
+        prev=weak
+	continue
+	;;
+
+      -Wc,*)
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs=$IFS; IFS=,
+	for flag in $args; do
+	  IFS=$save_ifs
+          func_quote_for_eval "$flag"
+	  func_append arg " $func_quote_for_eval_result"
+	  func_append compiler_flags " $func_quote_for_eval_result"
+	done
+	IFS=$save_ifs
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Wl,*)
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs=$IFS; IFS=,
+	for flag in $args; do
+	  IFS=$save_ifs
+          func_quote_for_eval "$flag"
+	  func_append arg " $wl$func_quote_for_eval_result"
+	  func_append compiler_flags " $wl$func_quote_for_eval_result"
+	  func_append linker_flags " $func_quote_for_eval_result"
+	done
+	IFS=$save_ifs
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg=$func_quote_for_eval_result
+	;;
+
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # -fstack-protector*   stack protector flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -stdlib=*            select c++ std lib with clang
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
+        func_quote_for_eval "$arg"
+	arg=$func_quote_for_eval_result
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        func_append compiler_flags " $arg"
+        continue
+        ;;
+
+      -Z*)
+        if test os2 = "`expr $host : '.*\(os2\)'`"; then
+          # OS/2 uses -Zxxx to specify OS/2-specific options
+	  compiler_flags="$compiler_flags $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  case $arg in
+	  -Zlinker | -Zstack)
+	    prev=xcompiler
+	    ;;
+	  esac
+	  continue
+        else
+	  # Otherwise treat like 'Some other compiler flag' below
+	  func_quote_for_eval "$arg"
+	  arg=$func_quote_for_eval_result
+        fi
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+	arg=$func_quote_for_eval_result
+	;;
+
+      *.$objext)
+	# A standard object.
+	func_append objs " $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if func_lalib_unsafe_p "$arg"; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  func_source "$arg"
+
+	  if test -z "$pic_object" ||
+	     test -z "$non_pic_object" ||
+	     test none = "$pic_object" &&
+	     test none = "$non_pic_object"; then
+	    func_fatal_error "cannot find name of object for '$arg'"
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  func_dirname "$arg" "/" ""
+	  xdir=$func_dirname_result
+
+	  test none = "$pic_object" || {
+	    # Prepend the subdirectory the object is found in.
+	    pic_object=$xdir$pic_object
+
+	    if test dlfiles = "$prev"; then
+	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+		func_append dlfiles " $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test dlprefiles = "$prev"; then
+	      # Preload the old-style object.
+	      func_append dlprefiles " $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    func_append libobjs " $pic_object"
+	    arg=$pic_object
+	  }
+
+	  # Non-PIC object.
+	  if test none != "$non_pic_object"; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object=$xdir$non_pic_object
+
+	    # A standard non-PIC object
+	    func_append non_pic_objects " $non_pic_object"
+	    if test -z "$pic_object" || test none = "$pic_object"; then
+	      arg=$non_pic_object
+	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object=$pic_object
+	    func_append non_pic_objects " $non_pic_object"
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if $opt_dry_run; then
+	    # Extract subdirectory from the argument.
+	    func_dirname "$arg" "/" ""
+	    xdir=$func_dirname_result
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "'$arg' is not a valid libtool object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	func_append deplibs " $arg"
+	func_append old_deplibs " $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	func_resolve_sysroot "$arg"
+	if test dlfiles = "$prev"; then
+	  # This library was specified with -dlopen.
+	  func_append dlfiles " $func_resolve_sysroot_result"
+	  prev=
+	elif test dlprefiles = "$prev"; then
+	  # The library was specified with -dlpreopen.
+	  func_append dlprefiles " $func_resolve_sysroot_result"
+	  prev=
+	else
+	  func_append deplibs " $func_resolve_sysroot_result"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	func_quote_for_eval "$arg"
+	arg=$func_quote_for_eval_result
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the '$prevarg' option requires an argument"
+
+    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname=$func_basename_result
+    libobjs_save=$libobjs
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
+    func_dirname "$output" "/" ""
+    output_objdir=$func_dirname_result$objdir
+    func_to_tool_file "$output_objdir/"
+    tool_output_objdir=$func_to_tool_file_result
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_preserve_dup_deps; then
+	case "$libs " in
+	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	esac
+      fi
+      func_append libs " $deplib"
+    done
+
+    if test lib = "$linkmode"; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+	  esac
+	  func_append pre_post_deps " $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+	passes="conv dlpreopen link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=false
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test lib,link = "$linkmode,$pass"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs=$tmp_deplibs
+      fi
+
+      if test lib,link = "$linkmode,$pass" ||
+	 test prog,scan = "$linkmode,$pass"; then
+	libs=$deplibs
+	deplibs=
+      fi
+      if test prog = "$linkmode"; then
+	case $pass in
+	dlopen) libs=$dlfiles ;;
+	dlpreopen) libs=$dlprefiles ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test lib,dlpreopen = "$linkmode,$pass"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  func_resolve_sysroot "$lib"
+	  case $lib in
+	  *.la)	func_source "$func_resolve_sysroot_result" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+	    func_basename "$deplib"
+            deplib_base=$func_basename_result
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) func_append deplibs " $deplib" ;;
+	    esac
+	  done
+	done
+	libs=$dlprefiles
+      fi
+      if test dlopen = "$pass"; then
+	# Collect dlpreopened libraries
+	save_deplibs=$deplibs
+	deplibs=
+      fi
+
+      for deplib in $libs; do
+	lib=
+	found=false
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	  if test prog,link = "$linkmode,$pass"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    func_append compiler_flags " $deplib"
+	    if test lib = "$linkmode"; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test lib != "$linkmode" && test prog != "$linkmode"; then
+	    func_warning "'-l' is ignored for archives/objects"
+	    continue
+	  fi
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
+	  if test lib = "$linkmode"; then
+	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+	  else
+	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+	  fi
+	  for searchdir in $searchdirs; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib=$searchdir/lib$name$search_ext
+	      if test -f "$lib"; then
+		if test .la = "$search_ext"; then
+		  found=:
+		else
+		  found=false
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if $found; then
+	    # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if func_lalib_p "$lib"; then
+		  library_names=
+		  old_library=
+		  func_source "$lib"
+		  for l in $old_library $library_names; do
+		    ll=$l
+		  done
+		  if test "X$ll" = "X$old_library"; then # only static version available
+		    found=false
+		    func_dirname "$lib" "" "."
+		    ladir=$func_dirname_result
+		    lib=$ladir/$old_library
+		    if test prog,link = "$linkmode,$pass"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+		;;
+	      *) ;;
+	      esac
+	    fi
+	  else
+	    # deplib doesn't seem to be a libtool library
+	    if test prog,link = "$linkmode,$pass"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test prog,link = "$linkmode,$pass"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test lib = "$linkmode"; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test conv = "$pass" && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    func_stripname '-L' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
+	    ;;
+	  prog)
+	    if test conv = "$pass"; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test scan = "$pass"; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    func_stripname '-L' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
+	    ;;
+	  *)
+	    func_warning "'-L' is ignored for archives/objects"
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test link = "$pass"; then
+	    func_stripname '-R' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    dir=$func_resolve_sysroot_result
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) func_append xrpath " $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la)
+	  func_resolve_sysroot "$deplib"
+	  lib=$func_resolve_sysroot_result
+	  ;;
+	*.$libext)
+	  if test conv = "$pass"; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=false
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		    valid_a_lib=:
+		  fi
+		;;
+		pass_all)
+		  valid_a_lib=:
+		;;
+	      esac
+	      if $valid_a_lib; then
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      else
+		echo
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because the file extensions .$libext of this argument makes me believe"
+		echo "*** that it is just a static archive that I should not use here."
+	      fi
+	      ;;
+	    esac
+	    continue
+	    ;;
+	  prog)
+	    if test link != "$pass"; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test conv = "$pass"; then
+	    deplibs="$deplib $deplibs"
+	  elif test prog = "$linkmode"; then
+	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      func_append newdlprefiles " $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      func_append newdlfiles " $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=:
+	  continue
+	  ;;
+	esac # case $deplib
+
+	$found || test -f "$lib" \
+	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "'$lib' is not a valid libtool archive"
+
+	func_dirname "$lib" "" "."
+	ladir=$func_dirname_result
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	inherited_linker_flags=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	if test lib,link = "$linkmode,$pass" ||
+	   test prog,scan = "$linkmode,$pass" ||
+	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
+	  test -n "$dlopen" && func_append dlfiles " $dlopen"
+	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+	fi
+
+	if test conv = "$pass"; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      func_fatal_error "cannot find name of link library for '$lib'"
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    func_append convenience " $ladir/$objdir/$old_library"
+	    func_append old_convenience " $ladir/$objdir/$old_library"
+	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
+	    func_fatal_error "'$lib' is not a convenience library"
+	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_preserve_dup_deps; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $deplib"
+	  done
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	if test -n "$old_library" &&
+	   { test yes = "$prefer_static_libs" ||
+	     test built,no = "$prefer_static_libs,$installed"; }; then
+	  linklib=$old_library
+	else
+	  for l in $old_library $library_names; do
+	    linklib=$l
+	  done
+	fi
+	if test -z "$linklib"; then
+	  func_fatal_error "cannot find name of link library for '$lib'"
+	fi
+
+	# This library was specified with -dlopen.
+	if test dlopen = "$pass"; then
+	  test -z "$libdir" \
+	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
+	  if test -z "$dlname" ||
+	     test yes != "$dlopen_support" ||
+	     test no = "$build_libtool_libs"
+	  then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    func_append dlprefiles " $lib $dependency_libs"
+	  else
+	    func_append newdlfiles " $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    func_warning "cannot determine absolute directory name of '$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
+	    abs_ladir=$ladir
+	  fi
+	  ;;
+	esac
+	func_basename "$lib"
+	laname=$func_basename_result
+
+	# Find the relevant object directory and library name.
+	if test yes = "$installed"; then
+	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    #func_warning "library '$lib' was moved."
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    libdir=$abs_ladir
+	  else
+	    dir=$lt_sysroot$libdir
+	    absdir=$lt_sysroot$libdir
+	  fi
+	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    # Remove this search path later
+	    func_append notinst_path " $abs_ladir"
+	  else
+	    dir=$ladir/$objdir
+	    absdir=$abs_ladir/$objdir
+	    # Remove this search path later
+	    func_append notinst_path " $abs_ladir"
+	  fi
+	fi # $installed = yes
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
+
+	# This library was specified with -dlpreopen.
+	if test dlpreopen = "$pass"; then
+	  if test -z "$libdir" && test prog = "$linkmode"; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
+	  fi
+	  case $host in
+	    # special handling for platforms with PE-DLLs.
+	    *cygwin* | *mingw* | *cegcc* )
+	      # Linker will automatically link against shared library if both
+	      # static and shared are present.  Therefore, ensure we extract
+	      # symbols from the import library if a shared library is present
+	      # (otherwise, the dlopen module name will be incorrect).  We do
+	      # this by putting the import library name into $newdlprefiles.
+	      # We recover the dlopen module name by 'saving' the la file
+	      # name in a special purpose variable, and (later) extracting the
+	      # dlname from the la file.
+	      if test -n "$dlname"; then
+	        func_tr_sh "$dir/$linklib"
+	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+	        func_append newdlprefiles " $dir/$linklib"
+	      else
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      fi
+	    ;;
+	    * )
+	      # Prefer using a static library (so that no silly _DYNAMIC symbols
+	      # are required to link).
+	      if test -n "$old_library"; then
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      # Otherwise, use the dlname, so that lt_dlopen finds it.
+	      elif test -n "$dlname"; then
+	        func_append newdlprefiles " $dir/$dlname"
+	      else
+	        func_append newdlprefiles " $dir/$linklib"
+	      fi
+	    ;;
+	  esac
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test lib = "$linkmode"; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test prog,link = "$linkmode,$pass"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test prog = "$linkmode" && test link != "$pass"; then
+	  func_append newlib_search_path " $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=false
+	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
+	     test no = "$build_libtool_libs"; then
+	    linkalldeplibs=:
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) func_stripname '-L' '' "$deplib"
+	         func_resolve_sysroot "$func_stripname_result"
+	         func_append newlib_search_path " $func_resolve_sysroot_result"
+		 ;;
+	    esac
+	    # Need to link against all dependency_libs?
+	    if $linkalldeplibs; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if $opt_preserve_dup_deps; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test prog,link = "$linkmode,$pass"; then
+	  if test -n "$library_names" &&
+	     { { test no = "$prefer_static_libs" ||
+	         test built,yes = "$prefer_static_libs,$installed"; } ||
+	       test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
+	      # Make sure the rpath contains only unique directories.
+	      case $temp_rpath: in
+	      *"$absdir:"*) ;;
+	      *) func_append temp_rpath "$absdir:" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) func_append compile_rpath " $absdir" ;;
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append finalize_rpath " $libdir" ;;
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if $alldeplibs &&
+	     { test pass_all = "$deplibs_check_method" ||
+	       { test yes = "$build_libtool_libs" &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test built = "$use_static_libs" && test yes = "$installed"; then
+	  use_static_libs=no
+	fi
+	if test -n "$library_names" &&
+	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc* | *os2*)
+	      # No point in relinking DLLs because paths are not encoded
+	      func_append notinst_deplibs " $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test no = "$installed"; then
+	      func_append notinst_deplibs " $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule=$dlpremoduletest
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
+	    echo
+	    if test prog = "$linkmode"; then
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $ECHO "*** $linklib is not portable!"
+	  fi
+	  if test lib = "$linkmode" &&
+	     test yes = "$hardcode_into_libs"; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) func_append compile_rpath " $absdir" ;;
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append finalize_rpath " $libdir" ;;
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    shift
+	    realname=$1
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname=$dlname
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw* | *cegcc* | *os2*)
+	        func_arith $current - $age
+		major=$func_arith_result
+		versuffix=-$major
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname=$realname
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot=$soname
+	    func_basename "$soroot"
+	    soname=$func_basename_result
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      func_verbose "extracting exported symbol list from '$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      func_verbose "generating import library for '$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test no = "$hardcode_direct"; then
+		add=$dir/$linklib
+		case $host in
+		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir=-L$dir ;;
+		  *-*-darwin* )
+		    # if the lib is a (non-dlopened) module then we cannot
+		    # link against it, someone is ignoring the earlier warnings
+		    if /usr/bin/file -L $add 2> /dev/null |
+			 $GREP ": [^:]* bundle" >/dev/null; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library"; then
+			  echo
+			  echo "*** And there doesn't seem to be a static archive available"
+			  echo "*** The link will probably fail, sorry"
+			else
+			  add=$dir/$old_library
+			fi
+		      elif test -n "$old_library"; then
+			add=$dir/$old_library
+		      fi
+		    fi
+		esac
+	      elif test no = "$hardcode_minus_L"; then
+		case $host in
+		*-*-sunos*) add_shlibpath=$dir ;;
+		esac
+		add_dir=-L$dir
+		add=-l$name
+	      elif test no = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test yes = "$hardcode_direct" &&
+	         test no = "$hardcode_direct_absolute"; then
+		add=$dir/$linklib
+	      elif test yes = "$hardcode_minus_L"; then
+		add_dir=-L$absdir
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      func_append add_dir " -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add=-l$name
+	      elif test yes = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test yes != "$lib_linked"; then
+	      func_fatal_configuration "unsupported hardcode properties"
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test prog = "$linkmode"; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test yes != "$hardcode_direct" &&
+		 test yes != "$hardcode_minus_L" &&
+		 test yes = "$hardcode_shlibpath_var"; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) func_append finalize_shlibpath "$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test yes = "$hardcode_direct" &&
+	       test no = "$hardcode_direct_absolute"; then
+	      add=$libdir/$linklib
+	    elif test yes = "$hardcode_minus_L"; then
+	      add_dir=-L$libdir
+	      add=-l$name
+	    elif test yes = "$hardcode_shlibpath_var"; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) func_append finalize_shlibpath "$libdir:" ;;
+	      esac
+	      add=-l$name
+	    elif test yes = "$hardcode_automatic"; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib"; then
+		add=$inst_prefix_dir$libdir/$linklib
+	      else
+		add=$libdir/$linklib
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir=-L$libdir
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    func_append add_dir " -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add=-l$name
+	    fi
+
+	    if test prog = "$linkmode"; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test prog = "$linkmode"; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test unsupported != "$hardcode_direct"; then
+	    test -n "$old_library" && linklib=$old_library
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test yes = "$build_libtool_libs"; then
+	  # Not a shared library
+	  if test pass_all != "$deplibs_check_method"; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    echo
+	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
+	    if test yes = "$module"; then
+	      echo "*** But as you try to build a module library, libtool will still create "
+	      echo "*** a static module, that should work as long as the dlopening application"
+	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		echo
+		echo "*** However, this would only work if libtool was able to extract symbol"
+		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
+		echo "*** not find such a program.  So, this module is probably useless."
+		echo "*** 'nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test no = "$build_old_libs"; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test lib = "$linkmode"; then
+	  if test -n "$dependency_libs" &&
+	     { test yes != "$hardcode_into_libs" ||
+	       test yes = "$build_old_libs" ||
+	       test yes = "$link_static"; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) func_append xrpath " $temp_xrpath";;
+		   esac;;
+	      *) func_append temp_deplibs " $libdir";;
+	      esac
+	    done
+	    dependency_libs=$temp_deplibs
+	  fi
+
+	  func_append newlib_search_path " $absdir"
+	  # Link against this library
+	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    case $deplib in
+              -L*) func_stripname '-L' '' "$deplib"
+                   func_resolve_sysroot "$func_stripname_result";;
+              *) func_resolve_sysroot "$deplib" ;;
+            esac
+	    if $opt_preserve_dup_deps; then
+	      case "$tmp_libs " in
+	      *" $func_resolve_sysroot_result "*)
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $func_resolve_sysroot_result"
+	  done
+
+	  if test no != "$link_all_deplibs"; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      path=
+	      case $deplib in
+	      -L*) path=$deplib ;;
+	      *.la)
+	        func_resolve_sysroot "$deplib"
+	        deplib=$func_resolve_sysroot_result
+	        func_dirname "$deplib" "" "."
+		dir=$func_dirname_result
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    func_warning "cannot determine absolute directory name of '$dir'"
+		    absdir=$dir
+		  fi
+		  ;;
+		esac
+		if $GREP "^installed=no" $deplib > /dev/null; then
+		case $host in
+		*-*-darwin*)
+		  depdepl=
+		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names"; then
+		    for tmp in $deplibrary_names; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$absdir/$objdir/$depdepl"; then
+		      depdepl=$absdir/$objdir/$depdepl
+		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
+		      path=
+		    fi
+		  fi
+		  ;;
+		*)
+		  path=-L$absdir/$objdir
+		  ;;
+		esac
+		else
+		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "'$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    #func_warning "'$deplib' seems to be moved"
+
+		  path=-L$absdir
+		fi
+		;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      if test link = "$pass"; then
+	if test prog = "$linkmode"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	fi
+      fi
+      dependency_libs=$newdependency_libs
+      if test dlpreopen = "$pass"; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test dlopen != "$pass"; then
+	test conv = "$pass" || {
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) func_append lib_search_path " $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	}
+
+	if test prog,link = "$linkmode,$pass"; then
+	  vars="compile_deplibs finalize_deplibs"
+	else
+	  vars=deplibs
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) func_append tmp_libs " $deplib" ;;
+	      esac
+	      ;;
+	    *) func_append tmp_libs " $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=
+	  ;;
+	esac
+	if test -n "$i"; then
+	  func_append tmp_libs " $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test prog = "$linkmode"; then
+      dlfiles=$newdlfiles
+    fi
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "'-l' and '-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "'-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+	func_warning "'-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+	func_warning "'-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+	func_warning "'-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "'-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs=$output
+      func_append objs "$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form 'libNAME.la'.
+      case $outputname in
+      lib*)
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	test no = "$module" \
+	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
+
+	if test no != "$need_lib_prefix"; then
+	  # Add the "lib" prefix for modules if required
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test pass_all != "$deplibs_check_method"; then
+	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
+	else
+	  echo
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
+	  func_append libobjs " $objs"
+	fi
+      fi
+
+      test no = "$dlself" \
+	|| func_warning "'-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test 1 -lt "$#" \
+	&& func_warning "ignoring multiple '-rpath's for a libtool library"
+
+      install_libdir=$1
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test yes = "$build_libtool_libs"; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a '.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	test -n "$vinfo" && \
+	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
+
+	test -n "$release" && \
+	  func_warning "'-release' is ignored for convenience libraries"
+      else
+
+	# Parse the version information argument.
+	save_ifs=$IFS; IFS=:
+	set dummy $vinfo 0 0 0
+	shift
+	IFS=$save_ifs
+
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to '-version-info'"
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major=$1
+	  number_minor=$2
+	  number_revision=$3
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # that has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  # correct linux to gnu/linux during the next big refactor
+	  darwin|freebsd-elf|linux|osf|windows|none)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age=$number_minor
+	    revision=$number_revision
+	    ;;
+	  freebsd-aout|qnx|sunos)
+	    current=$number_major
+	    revision=$number_minor
+	    age=0
+	    ;;
+	  irix|nonstopux)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age=$number_minor
+	    revision=$number_minor
+	    lt_irix_increment=no
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current=$1
+	  revision=$2
+	  age=$3
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "CURRENT '$current' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "REVISION '$revision' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "AGE '$age' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  func_error "AGE '$age' is greater than the current interface number '$current'"
+	  func_fatal_error "'$vinfo' is not valid version information"
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
+	  # Darwin ld doesn't like 0 for these options...
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
+	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
+	  ;;
+
+	freebsd-aout)
+	  major=.$current
+	  versuffix=.$current.$revision
+	  ;;
+
+	freebsd-elf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
+	  ;;
+
+	irix | nonstopux)
+	  if test no = "$lt_irix_increment"; then
+	    func_arith $current - $age
+	  else
+	    func_arith $current - $age + 1
+	  fi
+	  major=$func_arith_result
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring=$verstring_prefix$major.$revision
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test 0 -ne "$loop"; do
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring=$verstring_prefix$major.$iface:$verstring
+	  done
+
+	  # Before this point, $major must not contain '.'.
+	  major=.$major
+	  versuffix=$major.$revision
+	  ;;
+
+	linux) # correct to gnu/linux during the next big refactor
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
+	  ;;
+
+	osf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=.$current.$age.$revision
+	  verstring=$current.$age.$revision
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test 0 -ne "$loop"; do
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring=$verstring:$iface.0
+	  done
+
+	  # Make executables depend on our current version.
+	  func_append verstring ":$current.0"
+	  ;;
+
+	qnx)
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sco)
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sunos)
+	  major=.$current
+	  versuffix=.$current.$revision
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 file systems.
+	  func_arith $current - $age
+	  major=$func_arith_result
+	  versuffix=-$major
+	  ;;
+
+	*)
+	  func_fatal_configuration "unknown library version type '$version_type'"
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring=0.0
+	    ;;
+	  esac
+	  if test no = "$need_version"; then
+	    versuffix=
+	  else
+	    versuffix=.0.0
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test yes,no = "$avoid_version,$need_version"; then
+	  major=
+	  versuffix=
+	  verstring=
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test yes = "$allow_undefined"; then
+	  if test unsupported = "$allow_undefined_flag"; then
+	    if test yes = "$build_old_libs"; then
+	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+	      build_libtool_libs=no
+	    else
+	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+	    fi
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag=$no_undefined_flag
+	fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" :
+      func_append libobjs " $symfileobj"
+      test " " = "$libobjs" && libobjs=
+
+      if test relink != "$opt_mode"; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$ECHO "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *.gcno)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+	       if test -n "$precious_files_regex"; then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
+		   continue
+		 fi
+	       fi
+	       func_append removelist " $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
+	func_append oldlibs " $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  func_replace_sysroot "$libdir"
+	  func_append temp_xrpath " -R$func_replace_sysroot_result"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_rpath " $libdir" ;;
+	  esac
+	done
+	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles=$dlfiles
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) func_append dlfiles " $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles=$dlprefiles
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) func_append dlprefiles " $lib" ;;
+	esac
+      done
+
+      if test yes = "$build_libtool_libs"; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    func_append deplibs " System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
+	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test yes = "$build_libtool_need_lc"; then
+	      func_append deplibs " -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=
+	versuffix=
+	major=
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $opt_dry_run || $RM conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $opt_dry_run || $RM conftest
+	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    func_append newdeplibs " $i"
+		    i=
+		    ;;
+		  esac
+		fi
+		if test -n "$i"; then
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+		    func_append newdeplibs " $i"
+		  else
+		    droppeddeps=yes
+		    echo
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which I believe you do not have"
+		    echo "*** because a test_compile did reveal that the linker did not use it for"
+		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+		;;
+	      *)
+		func_append newdeplibs " $i"
+		;;
+	      esac
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+		  ldd_output=`ldd conftest`
+		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      func_append newdeplibs " $i"
+		      i=
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i"; then
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+		      func_append newdeplibs " $i"
+		    else
+		      droppeddeps=yes
+		      echo
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      echo "*** I have the capability to make that library automatically link in when"
+		      echo "*** you link to this library.  But I can only do this if you have a"
+		      echo "*** shared version of the library, which you do not appear to have"
+		      echo "*** because a test_compile did reveal that the linker did not use this one"
+		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  echo
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  echo "*** make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
+		fi
+		;;
+	      *)
+		func_append newdeplibs " $i"
+		;;
+	      esac
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib"; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		if test -n "$file_magic_glob"; then
+		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+		else
+		  libnameglob=$libname
+		fi
+		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  if test yes = "$want_nocaseglob"; then
+		    shopt -s nocaseglob
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		    $nocaseglob
+		  else
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		  fi
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib=$potent_lib
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
+			func_append newdeplibs " $a_deplib"
+			a_deplib=
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib"; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib"; then
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      func_append newdeplibs " $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib"; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib=$potent_lib # see symlink-check above in file_magic test
+		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
+		      func_append newdeplibs " $a_deplib"
+		      a_deplib=
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib"; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib"; then
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      func_append newdeplibs " $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=
+	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    for i in $predeps $postdeps; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
+	    done
+	  fi
+	  case $tmp_deplibs in
+	  *[!\	\ ]*)
+	    echo
+	    if test none = "$deplibs_check_method"; then
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	    ;;
+	  esac
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
+
+	if test yes = "$droppeddeps"; then
+	  if test yes = "$module"; then
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test no = "$build_old_libs"; then
+	      oldlibs=$output_objdir/$libname.$libext
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
+
+	    if test no = "$allow_undefined"; then
+	      echo
+	      echo "*** Since this library must not contain undefined symbols,"
+	      echo "*** because either the platform does not support them or"
+	      echo "*** it was explicitly requested with -no-undefined,"
+	      echo "*** libtool will only create a static version of it."
+	      if test no = "$build_old_libs"; then
+		oldlibs=$output_objdir/$libname.$libext
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    func_append new_libs " -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) func_append new_libs " $deplib" ;;
+	  esac
+	  ;;
+	*) func_append new_libs " $deplib" ;;
+	esac
+      done
+      deplibs=$new_libs
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test yes = "$build_libtool_libs"; then
+	# Remove $wl instances when linking with ld.
+	# FIXME: should test the right _cmds variable.
+	case $archive_cmds in
+	  *\$LD\ *) wl= ;;
+        esac
+	if test yes = "$hardcode_into_libs"; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath=$finalize_rpath
+	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		func_replace_sysroot "$libdir"
+		libdir=$func_replace_sysroot_result
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs=$libdir
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		func_append dep_rpath " $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append perm_rpath " $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir=$hardcode_libdirs
+	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      func_append rpath "$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath=$finalize_shlibpath
+	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	shift
+	realname=$1
+	shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname=$realname
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib=$output_objdir/$realname
+	linknames=
+	for link
+	do
+	  func_append linknames " $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
+
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols=$output_objdir/$libname.uexp
+	  func_append delfiles " $export_symbols"
+	fi
+
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    func_dll_def_p "$export_symbols" || {
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols=$export_symbols
+	      export_symbols=
+	      always_export_symbols=yes
+	    }
+	  fi
+	  ;;
+	esac
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for '$libname.la'"
+	    export_symbols=$output_objdir/$libname.exp
+	    $opt_dry_run || $RM $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs=$IFS; IFS='~'
+	    for cmd1 in $cmds; do
+	      IFS=$save_ifs
+	      # Take the normal branch if the nm_file_list_spec branch
+	      # doesn't work or if tool conversion is not needed.
+	      case $nm_file_list_spec~$to_tool_file_cmd in
+		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+		  try_normal_branch=yes
+		  eval cmd=\"$cmd1\"
+		  func_len " $cmd"
+		  len=$func_len_result
+		  ;;
+		*)
+		  try_normal_branch=no
+		  ;;
+	      esac
+	      if test yes = "$try_normal_branch" \
+		 && { test "$len" -lt "$max_cmd_len" \
+		      || test "$max_cmd_len" -le -1; }
+	      then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      elif test -n "$nm_file_list_spec"; then
+		func_basename "$output"
+		output_la=$func_basename_result
+		save_libobjs=$libobjs
+		save_output=$output
+		output=$output_objdir/$output_la.nm
+		func_to_tool_file "$output"
+		libobjs=$nm_file_list_spec$func_to_tool_file_result
+		func_append delfiles " $output"
+		func_verbose "creating $NM input file list: $output"
+		for obj in $save_libobjs; do
+		  func_to_tool_file "$obj"
+		  $ECHO "$func_to_tool_file_result"
+		done > "$output"
+		eval cmd=\"$cmd1\"
+		func_show_eval "$cmd" 'exit $?'
+		output=$save_output
+		libobjs=$save_libobjs
+		skipped_export=false
+	      else
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS=$save_ifs
+	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  tmp_export_symbols=$export_symbols
+	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	fi
+
+	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands, which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    func_append tmp_deplibs " $test_deplib"
+	    ;;
+	  esac
+	done
+	deplibs=$tmp_deplibs
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test yes = "$compiler_needs_object" &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  else
+	    gentop=$output_objdir/${outputname}x
+	    func_append generated " $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    func_append libobjs " $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	fi
+
+	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  func_append linker_flags " $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test relink = "$opt_mode"; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test yes = "$module" && test -n "$module_cmds"; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
+	  fi
+	fi
+
+	if test : != "$skipped_export" &&
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  func_basename "$output"
+	  output_la=$func_basename_result
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  last_robj=
+	  k=1
+
+	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+	    output=$output_objdir/$output_la.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    echo 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
+	    done
+	    echo ')' >> $output
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$func_to_tool_file_result
+	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+	    output=$output_objdir/$output_la.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test yes = "$compiler_needs_object"; then
+	      firstobj="$1 "
+	      shift
+	    fi
+	    for obj
+	    do
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
+	    done
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-$k.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test -z "$objlist" ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test 1 -eq "$k"; then
+		    # The first file doesn't have a previous command to add.
+		    reload_objs=$objlist
+		    eval concat_cmds=\"$reload_cmds\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    reload_objs="$objlist $last_robj"
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-$k.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-$k.$objext
+		  objlist=" $obj"
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      reload_objs="$objlist $last_robj"
+	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	      fi
+	      func_append delfiles " $output"
+
+	    else
+	      output=
+	    fi
+
+	    ${skipped_export-false} && {
+	      func_verbose "generating symbol list for '$libname.la'"
+	      export_symbols=$output_objdir/$libname.exp
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	      fi
+	    }
+
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
+
+	    # Loop through the commands generated above and execute them.
+	    save_ifs=$IFS; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS=$save_ifs
+	      $opt_quiet || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test relink = "$opt_mode"; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
+	    done
+	    IFS=$save_ifs
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          ${skipped_export-false} && {
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols=$export_symbols
+	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands, which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  }
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test yes = "$module" && test -n "$module_cmds"; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
+	    fi
+	  fi
+	fi
+
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  func_append libobjs " $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
+	fi
+
+	save_ifs=$IFS; IFS='~'
+	for cmd in $cmds; do
+	  IFS=$sp$nl
+	  eval cmd=\"$cmd\"
+	  IFS=$save_ifs
+	  $opt_quiet || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test relink = "$opt_mode"; then
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS=$save_ifs
+
+	# Restore the uninstalled library and exit
+	if test relink = "$opt_mode"; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      func_show_eval '${RM}r "$gentop"'
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test yes = "$module" || test yes = "$export_dynamic"; then
+	  # On all known operating systems, these are identical.
+	  dlname=$soname
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "'-l' and '-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "'-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+	func_warning "'-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+	func_warning "'-version-info' is ignored for objects"
+
+      test -n "$release" && \
+	func_warning "'-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
+	;;
+      *)
+	libobj=
+	obj=$output
+	;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD[\ \$]*) wl= ;;
+      esac
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
+	else
+	  gentop=$output_objdir/${obj}x
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # If we're not building shared, we need to use non_pic_objs
+      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
+
+      # Create the old-style object.
+      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
+
+      output=$obj
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      test yes = "$build_libtool_libs" || {
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      }
+
+      if test -n "$pic_flag" || test default != "$pic_mode"; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output=$libobj
+	func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+	func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+	func_warning "'-version-info' is ignored for programs"
+
+      test -n "$release" && \
+	func_warning "'-release' is ignored for programs"
+
+      $preload \
+	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test CXX = "$tagname"; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      func_append compile_command " $wl-bind_at_load"
+	      func_append finalize_command " $wl-bind_at_load"
+	    ;;
+	  esac
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    func_append new_libs " -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) func_append new_libs " $deplib" ;;
+	  esac
+	  ;;
+	*) func_append new_libs " $deplib" ;;
+	esac
+      done
+      compile_deplibs=$new_libs
+
+
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_rpath " $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs=$libdir
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    func_append rpath " $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append perm_rpath " $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
+	  *) func_append dllsearchpath ":$libdir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) func_append dllsearchpath ":$testbindir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir=$hardcode_libdirs
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath=$rpath
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs=$libdir
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    func_append rpath " $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_perm_rpath " $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir=$hardcode_libdirs
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath=$rpath
+
+      if test -n "$libobjs" && test yes = "$build_old_libs"; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" false
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=:
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=false
+        ;;
+      *cygwin* | *mingw* )
+        test yes = "$build_libtool_libs" || wrappers_required=false
+        ;;
+      *)
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
+        fi
+        ;;
+      esac
+      $wrappers_required || {
+	# Replace the output file specification.
+	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	link_command=$compile_command$compile_rpath
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
+
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
+	# Delete the generated files.
+	if test -f "$output_objdir/${outputname}S.$objext"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
+	fi
+
+	exit $exit_status
+      }
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    func_append rpath "$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    func_append rpath "$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test yes = "$no_install"; then
+	# We don't need to create a wrapper script.
+	link_command=$compile_var$compile_command$compile_rpath
+	# Replace the output file specification.
+	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$opt_dry_run || $RM $output
+	# Link the executable and exit
+	func_show_eval "$link_command" 'exit $?'
+
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      case $hardcode_action,$fast_install in
+        relink,*)
+	  # Fast installation is not supported
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+
+	  func_warning "this platform does not like uninstalled shared libraries"
+	  func_warning "'$output' will be relinked during installation"
+	  ;;
+        *,yes)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+	*,no)
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+	*,needless)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=
+          ;;
+      esac
+
+      # Replace the output file specification.
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      if test -n "$postlink_cmds"; then
+	func_to_tool_file "$output_objdir/$outputname"
+	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource=$output_path/$objdir/lt-$output_name.c
+	    cwrapper=$output_path/$output_name.exe
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
+
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host"; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+	      else
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
+	      fi
+	    }
+	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_wrapper no > $output
+	    chmod +x $output
+	  ;;
+	esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      case $build_libtool_libs in
+        convenience)
+	  oldobjs="$libobjs_save $symfileobj"
+	  addlibs=$convenience
+	  build_libtool_libs=no
+	  ;;
+	module)
+	  oldobjs=$libobjs_save
+	  addlibs=$old_convenience
+	  build_libtool_libs=no
+          ;;
+	*)
+	  oldobjs="$old_deplibs $non_pic_objects"
+	  $preload && test -f "$symfileobj" \
+	    && func_append oldobjs " $symfileobj"
+	  addlibs=$old_convenience
+	  ;;
+      esac
+
+      if test -n "$addlibs"; then
+	gentop=$output_objdir/${outputname}x
+	func_append generated " $gentop"
+
+	func_extract_archives $gentop $addlibs
+	func_append oldobjs " $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
+	cmds=$old_archive_from_new_cmds
+      else
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  func_append oldobjs " $func_extract_archives_result"
+	fi
+
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  echo "copying selected object files to avoid basename conflicts..."
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
+	  func_mkdir_p "$gentop"
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    func_basename "$obj"
+	    objbase=$func_basename_result
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		func_arith $counter + 1
+		counter=$func_arith_result
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      func_append oldobjs " $gentop/$newobj"
+	      ;;
+	    *) func_append oldobjs " $obj" ;;
+	    esac
+	  done
+	fi
+	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+	tool_oldlib=$func_to_tool_file_result
+	eval cmds=\"$old_archive_cmds\"
+
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	elif test -n "$archiver_list_spec"; then
+	  func_verbose "using command file archive linking..."
+	  for obj in $oldobjs
+	  do
+	    func_to_tool_file "$obj"
+	    $ECHO "$func_to_tool_file_result"
+	  done > $output_objdir/$libname.libcmd
+	  func_to_tool_file "$output_objdir/$libname.libcmd"
+	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  func_verbose "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
+	  for obj in $save_oldobjs
+	  do
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj"; then
+		RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
+	      objlist=
+	      len=$len0
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test -z "$oldobjs"; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test yes = "$build_old_libs" && old_library=$libname.$libext
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      if test yes = "$hardcode_automatic"; then
+	relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+	for installed in no yes; do
+	  if test yes = "$installed"; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output=$output_objdir/${outputname}i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		func_basename "$deplib"
+		name=$func_basename_result
+		func_resolve_sysroot "$deplib"
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		test -z "$libdir" && \
+		  func_fatal_error "'$deplib' is not a valid libtool archive"
+		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      -L*)
+		func_stripname -L '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -L$func_replace_sysroot_result"
+		;;
+	      -R*)
+		func_stripname -R '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -R$func_replace_sysroot_result"
+		;;
+	      *) func_append newdependency_libs " $deplib" ;;
+	      esac
+	    done
+	    dependency_libs=$newdependency_libs
+	    newdlfiles=
+
+	    for lib in $dlfiles; do
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "'$lib' is not a valid libtool archive"
+		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      *) func_append newdlfiles " $lib" ;;
+	      esac
+	    done
+	    dlfiles=$newdlfiles
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "'$lib' is not a valid libtool archive"
+		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      esac
+	    done
+	    dlprefiles=$newdlprefiles
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      func_append newdlfiles " $abs"
+	    done
+	    dlfiles=$newdlfiles
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      func_append newdlprefiles " $abs"
+	    done
+	    dlprefiles=$newdlprefiles
+	  fi
+	  $RM $output
+	  # place dlname in correct position for cygwin
+	  # In fact, it would be nice if we could use this code for all target
+	  # systems that can't hard-code library paths into their executables
+	  # and that have no shared library path variable independent of PATH,
+	  # but it turns out we can't easily determine that from inspecting
+	  # libtool variables, so we have to hard-code the OSs to which it
+	  # applies here; at the moment, that means platforms that use the PE
+	  # object format with DLL files.  See the long comment at the top of
+	  # tests/bindir.at for full details.
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+	      # If a -bindir argument was supplied, place the dll there.
+	      if test -n "$bindir"; then
+		func_relative_path "$install_libdir" "$bindir"
+		tdlname=$func_relative_path_result/$dlname
+	      else
+		# Otherwise fall back on heuristic.
+		tdlname=../bin/$dlname
+	      fi
+	      ;;
+	  esac
+	  $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that cannot go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test no,yes = "$installed,$need_relink"; then
+	    $ECHO >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $debug_cmd
+
+    RM=$nonopt
+    files=
+    rmforce=false
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic=$magic
+
+    for arg
+    do
+      case $arg in
+      -f) func_append RM " $arg"; rmforce=: ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir=$func_dirname_result
+      if test . = "$dir"; then
+	odir=$objdir
+      else
+	odir=$dir/$objdir
+      fi
+      func_basename "$file"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
+
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test clean = "$opt_mode"; then
+	case " $rmdirs " in
+	  *" $odir "*) ;;
+	  *) func_append rmdirs " $odir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif $rmforce; then
+	continue
+      fi
+
+      rmfiles=$file
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    func_append rmfiles " $odir/$n"
+	  done
+	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+	  case $opt_mode in
+	  clean)
+	    case " $library_names " in
+	    *" $dlname "*) ;;
+	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+	    esac
+	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+	    ;;
+	  uninstall)
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	    ;;
+	  esac
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if func_lalib_p "$file"; then
+
+	  # Read the .lo file
+	  func_source $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" && test none != "$pic_object"; then
+	    func_append rmfiles " $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
+	    func_append rmfiles " $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test clean = "$opt_mode"; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    func_append rmfiles " $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      func_append rmfiles " $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+	    if test yes = "$fast_install" && test -n "$relink_command"; then
+	      func_append rmfiles " $odir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name"; then
+	      func_append rmfiles " $odir/lt-$noexename.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+
+    # Try to remove the $objdir's in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
+
+test -z "$opt_mode" && {
+  help=$generic_help
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode '$opt_mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# where we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4
new file mode 100644
index 0000000..3f33ad1
--- /dev/null
+++ b/m4/ax_compare_version.m4
@@ -0,0 +1,174 @@
+# ===========================================================================
+#       http://www.nongnu.org/autoconf-archive/ax_compare_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+#   This macro compares two version strings. Due to the various number of
+#   minor-version numbers that can exist, and the fact that string
+#   comparisons are not compatible with numeric comparisons, this is not
+#   necessarily trivial to do in a autoconf script. This macro makes doing
+#   these comparisons easy.
+#
+#   The six basic comparisons are available, as well as checking equality
+#   limited to a certain number of minor-version levels.
+#
+#   The operator OP determines what type of comparison to do, and can be one
+#   of:
+#
+#    eq  - equal (test A == B)
+#    ne  - not equal (test A != B)
+#    le  - less than or equal (test A <= B)
+#    ge  - greater than or equal (test A >= B)
+#    lt  - less than (test A < B)
+#    gt  - greater than (test A > B)
+#
+#   Additionally, the eq and ne operator can have a number after it to limit
+#   the test to that number of minor versions.
+#
+#    eq0 - equal up to the length of the shorter version
+#    ne0 - not equal up to the length of the shorter version
+#    eqN - equal up to N sub-version levels
+#    neN - not equal up to N sub-version levels
+#
+#   When the condition is true, shell commands ACTION-IF-TRUE are run,
+#   otherwise shell commands ACTION-IF-FALSE are run. The environment
+#   variable 'ax_compare_version' is always set to either 'true' or 'false'
+#   as well.
+#
+#   Examples:
+#
+#     AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
+#     AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
+#
+#   would both be true.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
+#     AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
+#
+#   would both be false.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
+#
+#   would be true because it is only comparing two minor versions.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
+#
+#   would be true because it is only comparing the lesser number of minor
+#   versions of the two values.
+#
+#   Note: The characters that separate the version numbers do not matter. An
+#   empty string is the same as version 0. OP is evaluated by autoconf, not
+#   configure, so must be a string, not a variable.
+#
+#   The author would like to acknowledge Guido Draheim whose advice about
+#   the m4_case and m4_ifvaln functions make this macro only include the
+#   portions necessary to perform the specific comparison specified by the
+#   OP argument in the final configure script.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Tim Toolan <toolan at ele.uri.edu>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+
+dnl #########################################################################
+AC_DEFUN([AX_COMPARE_VERSION], [
+  AC_REQUIRE([AC_PROG_AWK])
+
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+  AS_VAR_PUSHDEF([A],[ax_compare_version_A])
+  A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
+                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/[[^0-9]]//g'`
+
+  AS_VAR_PUSHDEF([B],[ax_compare_version_B])
+  B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
+                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/[[^0-9]]//g'`
+
+  dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
+  dnl # then the first line is used to determine if the condition is true.
+  dnl # The sed right after the echo is to remove any indented white space.
+  m4_case(m4_tolower($2),
+  [lt],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
+  ],
+  [gt],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
+  ],
+  [le],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
+  ],
+  [ge],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
+  ],[
+    dnl Split the operator from the subversion count if present.
+    m4_bmatch(m4_substr($2,2),
+    [0],[
+      # A count of zero means use the length of the shorter version.
+      # Determine the number of characters in A and B.
+      ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
+      ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
+
+      # Set A to no more than B's length and B to no more than A's length.
+      A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
+      B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
+    ],
+    [[0-9]+],[
+      # A count greater than zero means use only that many subversions
+      A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
+      B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
+    ],
+    [.+],[
+      AC_WARNING(
+        [illegal OP numeric parameter: $2])
+    ],[])
+
+    # Pad zeros at end of numbers to make same length.
+    ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
+    B="$B`echo $A | sed 's/./0/g'`"
+    A="$ax_compare_version_tmp_A"
+
+    # Check for equality or inequality as necessary.
+    m4_case(m4_tolower(m4_substr($2,0,2)),
+    [eq],[
+      test "x$A" = "x$B" && ax_compare_version=true
+    ],
+    [ne],[
+      test "x$A" != "x$B" && ax_compare_version=true
+    ],[
+      AC_WARNING([illegal OP parameter: $2])
+    ])
+  ])
+
+  AS_VAR_POPDEF([A])dnl
+  AS_VAR_POPDEF([B])dnl
+
+  dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
+  if test "$ax_compare_version" = "true" ; then
+    m4_ifvaln([$4],[$4],[:])dnl
+    m4_ifvaln([$5],[else $5])dnl
+  fi
+]) dnl AX_COMPARE_VERSION
diff --git a/m4/compiler.m4 b/m4/compiler.m4
new file mode 100644
index 0000000..342547f
--- /dev/null
+++ b/m4/compiler.m4
@@ -0,0 +1,203 @@
+dnl Copyright (C) 2008, 2009, 2010 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+dnl GD_LANG_COMPILER_INTEL
+dnl -------------------------------------------------------------
+dnl Check whether the compiler for the current language is Intel.
+dnl
+dnl This is modelled after autoconf's _AC_LANG_COMPILER_GNU macro.
+AC_DEFUN([GD_LANG_COMPILER_INTEL],
+[AC_CACHE_CHECK([whether we are using the Intel _AC_LANG compiler],
+[gd_cv_[]_AC_LANG_ABBREV[]_compiler_intel],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __INTEL_COMPILER
+       choke me
+#endif
+]])],
+[gd_compiler_intel=yes],
+[gd_compiler_intel=no])
+gd_cv_[]_AC_LANG_ABBREV[]_compiler_intel=$gd_compiler_intel
+])])
+
+dnl GD_LANG_F77_COMPILER_INTEL
+dnl -------------------------------------------------------------
+dnl Check whether the compiler for Fortran is Intel.
+AC_DEFUN([GD_LANG_F77_COMPILER_INTEL],
+[AC_CACHE_CHECK([whether we are using the Intel Fortran-77 compiler],
+[gd_cv_f77_compiler_intel],
+[if $F77 -help 2>/dev/null | grep -q 'Intel.R. Fortran Compiler'; then
+gd_cv_f77_compiler_intel=yes
+else
+gd_cv_f77_compiler_intel=no
+fi
+])])
+
+dnl GD_LANG_FC_COMPILER_INTEL
+dnl -------------------------------------------------------------
+dnl Check whether the compiler for free-form Fortran is Intel.
+AC_DEFUN([GD_LANG_FC_COMPILER_INTEL],
+[AC_CACHE_CHECK([whether we are using the Intel Fortran compiler],
+[gd_cv_fc_compiler_intel],
+[if $FC -help 2>/dev/null | grep -q 'Intel.R. Fortran Compiler'; then
+gd_cv_fc_compiler_intel=yes
+else
+gd_cv_fc_compiler_intel=no
+fi
+])])
+
+dnl GD_PROG_CC_WEXTRA
+dnl -------------------------------------------------------------
+dnl Check whether the C compiler accepts -Wextra
+AC_DEFUN([GD_PROG_CC_WEXTRA],
+[gd_saved_CFLAGS=$CFLAGS
+AC_CACHE_CHECK([whether $CC accepts -Wextra], gd_cv_prog_cc_wextra,
+[CFLAGS="-Wextra"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cc_wextra=yes],
+[gd_cv_prog_cc_wextra=no])])
+CFLAGS=$gd_saved_CFLAGS])
+
+
+dnl GD_PROG_CXX_WEXTRA
+dnl -------------------------------------------------------------
+dnl Check whether the C++ compiler accepts -Wextra
+AC_DEFUN([GD_PROG_CXX_WEXTRA],
+[gd_saved_CXXFLAGS=$CXXFLAGS
+AC_CACHE_CHECK([whether $CXX accepts -Wextra], gd_cv_prog_cxx_wextra,
+[CXXFLAGS="-Wextra"
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cxx_wextra=yes],
+[gd_cv_prog_cxx_wextra=no])
+AC_LANG_POP([C++])])
+CXXFLAGS=$gd_saved_CXXFLAGS])
+
+
+dnl GD_PROG_F77_WEXTRA
+dnl -------------------------------------------------------------
+dnl Check whether the Fotran-77 compiler accepts -Wextra
+AC_DEFUN([GD_PROG_F77_WEXTRA],
+[gd_saved_FFLAGS=$FFLAGS
+AC_CACHE_CHECK([whether $F77 accepts -Wextra], gd_cv_prog_f77_wextra,
+[FFLAGS="-Wextra"
+AC_LANG_PUSH([Fortran 77])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_f77_wextra=yes],
+[gd_cv_prog_f77_wextra=no])
+AC_LANG_POP([Fortran 77])])
+FFLAGS=$gd_saved_FFLAGS])
+
+
+dnl GD_PROG_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])
+
+
+dnl GD_PROG_FC_WEXTRA
+dnl -------------------------------------------------------------
+dnl Check whether the free-form Fotran compiler accepts -Wextra
+AC_DEFUN([GD_PROG_FC_WEXTRA],
+[gd_saved_FCFLAGS=$FCFLAGS
+AC_CACHE_CHECK([whether $FC accepts -Wextra], gd_cv_prog_fc_wextra,
+[FCFLAGS="-Wextra"
+AC_LANG_PUSH([Fortran 77])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_fc_wextra=yes],
+[gd_cv_prog_fc_wextra=no])
+AC_LANG_POP([Fortran 77])])
+FCFLAGS=$gd_saved_FCFLAGS])
+
+dnl GD_PROG_CC_WALL
+dnl -------------------------------------------------------------
+dnl Check whether the C compiler accepts -Wall
+AC_DEFUN([GD_PROG_CC_WALL],
+[gd_saved_CFLAGS=$CFLAGS
+AC_CACHE_CHECK([whether $CC accepts -Wall], gd_cv_prog_cc_wall,
+[CFLAGS="-Wall"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cc_wall=yes],
+[gd_cv_prog_cc_wall=no])])
+CFLAGS=$gd_saved_CFLAGS])
+
+
+dnl GD_PROG_CXX_WALL
+dnl -------------------------------------------------------------
+dnl Check whether the C++ compiler accepts -Wall
+AC_DEFUN([GD_PROG_CXX_WALL],
+[gd_saved_CXXFLAGS=$CXXFLAGS
+AC_CACHE_CHECK([whether $CXX accepts -Wall], gd_cv_prog_cxx_wall,
+[CXXFLAGS="-Wall"
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cxx_wall=yes],
+[gd_cv_prog_cxx_wall=no])
+AC_LANG_POP([C++])])
+CXXFLAGS=$gd_saved_CXXFLAGS])
+
+
+dnl GD_PROG_F77_WALL
+dnl -------------------------------------------------------------
+dnl Check whether the Fotran-77 compiler accepts -Wall
+AC_DEFUN([GD_PROG_F77_WALL],
+[gd_saved_FFLAGS=$FFLAGS
+AC_CACHE_CHECK([whether $F77 accepts -Wall], gd_cv_prog_f77_wall,
+[FFLAGS="-Wall"
+AC_LANG_PUSH([Fortran 77])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_f77_wall=yes],
+[gd_cv_prog_f77_wall=no])
+AC_LANG_POP([Fortran 77])])
+FFLAGS=$gd_saved_FFLAGS])
+
+
+dnl GD_PROG_FC_WALL
+dnl -------------------------------------------------------------
+dnl Check whether the free-form Fotran compiler accepts -Wall
+AC_DEFUN([GD_PROG_FC_WALL],
+[gd_saved_FCFLAGS=$FCFLAGS
+AC_CACHE_CHECK([whether $FC accepts -Wall], gd_cv_prog_fc_wall,
+[FCFLAGS="-Wall"
+AC_LANG_PUSH([Fortran 77])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_fc_wall=yes],
+[gd_cv_prog_fc_wall=no])
+AC_LANG_POP([Fortran 77])])
+FCFLAGS=$gd_saved_FCFLAGS])
+
+dnl GD_C_RESTRICT_ARRAY
+dnl -----------------------------------------------------------
+dnl Check whether "<type> *restrict foo[]" is allowed.
+AC_DEFUN([GD_C_RESTRICT_ARRAY],[
+dnl do nothing if restrict hasn't been found
+if ! test "x$ac_cv_c_restrict" = "xno"; then
+AC_CACHE_CHECK([whether restrict can be applied to pointer array arguments],
+[gd_cv_c_restrict_array],[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+    int *foo (int *restrict bar@<:@3@:>@) { return bar@<:@2@:>@; }
+], [])],
+[gd_cv_c_restrict_array="yes"],[gd_cv_c_restrict_array="no"])
+])
+fi
+
+if test "x$gd_cv_c_restrict_array" = "xyes"; then
+AC_DEFINE([GD_RESTRICT_ARRAY_OK], [1],
+[Define to 1 if restrict can used on pointer arrays])
+fi
+])
diff --git a/m4/encoding.m4 b/m4/encoding.m4
new file mode 100644
index 0000000..d93f919
--- /dev/null
+++ b/m4/encoding.m4
@@ -0,0 +1,140 @@
+dnl Copyright (C) 2008-2010 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+dnl GD_CHECK_ENCODING
+dnl -------------------------------------------------------------
+dnl Run a bunch of checks to see if we can build and test encodings
+dnl based on an external library.  This function is easily broken.
+AC_DEFUN([GD_CHECK_ENCODING],
+[
+have_this_header=
+have_this_lib=
+m4_define([gd_encoding], [$1])
+AC_ARG_WITH([lib$2], AS_HELP_STRING([--with-lib$2=PREFIX],
+            [use the lib$2 installed in PREFIX [default: autodetect]]),
+            [
+             case "${withval}" in
+               no) use_[]gd_encoding="no" ;;
+               yes) use_[]gd_encoding="yes"; gd_encoding[]_prefix= ;;
+               *) use_[]gd_encoding="yes"; gd_encoding[]_prefix="${withval}" ;;
+             esac
+             ], [ use_[]gd_encoding="yes"; gd_encoding[]_prefix=; ])
+m4_divert_once([HELP_WITH], AS_HELP_STRING([--without-lib$2],
+            [disable encodings supported by lib$2, even if the library is present]))
+
+echo
+echo "*** Configuring gd_encoding support"
+echo
+
+if test "x$no_extern" = "xyes"; then
+  use_[]gd_encoding="no";
+fi
+
+if test "x$use_[]gd_encoding" = "xyes"; then
+  dnl search for library
+  saved_ldflags=$LDFLAGS
+  saved_libs=$LIBS
+  if test "x$gd_encoding[]_prefix" != "x"; then
+    LDFLAGS="$LDFLAGS -L$gd_encoding[]_prefix/lib"
+  fi
+  AC_CHECK_LIB([$2],[$3],[have_this_lib=yes
+  LIBS="$LIBS -l$2"]
+  AC_DEFINE(AS_TR_CPP([HAVE_LIB$2]), 1,
+    [Define to 1 if you have the `$2' library (-l$2).]))
+
+ifelse(`x$7', `x',,[
+  AC_CHECK_FUNCS([$7])
+])
+  LDFLAGS=$saved_ldflags
+  LIBS=$saved_libs
+
+dnl search for header
+  saved_cppflags=$CPPFLAGS
+  if test "x$gd_encoding[]_prefix" != "x"; then
+    CPPFLAGS="$CPPFLAGS -I$gd_encoding[]_prefix/include"
+  fi
+  AC_CHECK_HEADERS([$4],[have_this_header=yes])
+  CPPFLAGS=$saved_cppflags
+fi
+
+dnl cleanup
+AS_TR_CPP(gd_encoding[_CPPFLAGS])=
+AS_TR_CPP(gd_encoding[_LDFLAGS])=
+AS_TR_CPP(gd_encoding[_LIBS])=
+if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then
+  if test "x$gd_encoding[]_prefix" = "x"; then
+    AS_TR_CPP(gd_encoding[_LIBS])="-l$2"
+    AS_TR_CPP(gd_encoding[_SEARCHPATH])="$PATH"
+  else 
+    AS_TR_CPP(gd_encoding[_CPPFLAGS])="-I$gd_encoding[]_prefix/include"
+    AS_TR_CPP(gd_encoding[_LDFLAGS])="-L$gd_encoding[]_prefix/lib"
+    AS_TR_CPP(gd_encoding[_LIBS])="-l$2"
+    AS_TR_CPP(gd_encoding[_SEARCHPATH])="$gd_encoding[]_prefix/bin:$PATH"
+  fi
+  AC_DEFINE(AS_TR_CPP([USE_]gd_encoding), [], [ Define to enable ]gd_encoding[ support ])
+else
+  use_[]gd_encoding="no";
+  AS_TR_CPP(gd_encoding[_SEARCHPATH])="$PATH"
+fi
+AC_SUBST(AS_TR_CPP(gd_encoding[_CPPFLAGS]))
+AC_SUBST(AS_TR_CPP(gd_encoding[_LDFLAGS]))
+AC_SUBST(AS_TR_CPP(gd_encoding[_LIBS]))
+
+dnl executables needed for tests
+m4_define([gd_progname], regexp([$5 ], [^\([^ ]*\) ], [\1]))
+AC_PATH_PROGS([path_]gd_progname, [$5], [not found], [$AS_TR_CPP(gd_encoding[_SEARCHPATH])])
+
+if test "x$path_[]gd_progname" != "xnot found"; then
+  AC_DEFINE_UNQUOTED(AS_TR_CPP(gd_progname), ["$path_]gd_progname["],
+                     [ Define to the full path to the `]gd_progname[' binary ])
+fi
+
+ifelse(`x$6', `x',,[
+m4_define([gd_unprogname], regexp([$6 ], [^\([^ ]*\) ], [\1]))
+AC_PATH_PROGS([path_]gd_unprogname, [$6], [not found], [$AS_TR_CPP(gd_encoding[_SEARCHPATH])])
+
+if test "x$path_[]gd_unprogname" != "xnot found"; then
+  AC_DEFINE_UNQUOTED(AS_TR_CPP(gd_unprogname), ["$path_]gd_unprogname["],
+                     [ Define to the full path to the `]gd_unprogname[' binary ])
+fi
+])
+AM_CONDITIONAL(AS_TR_CPP([USE_]gd_encoding), [test "x$use_]gd_encoding[" = "xyes"])
+
+if test "x$path_[]gd_progname" != "xnot found" -a \
+  "x$path_[]gd_unprogname" != "xnot found"; then
+  AC_DEFINE(AS_TR_CPP([TEST_]gd_encoding), [], [ Define to enable ]gd_encoding[ tests ])
+fi
+
+dnl add to summary and private lib list
+if test "x$use_[]gd_encoding" != "xno"; then
+  if test "x$use_modules" != "xno"; then
+    ENCODINGS_MODS="${ENCODINGS_MODS} gd_encoding";
+  else
+    ENCODINGS_BUILT="${ENCODINGS_BUILT} gd_encoding";
+    if test -z "$PRIVATE_LIBS"; then
+      PRIVATE_LIBS="[$]AS_TR_CPP(gd_encoding[_LDFLAGS]) [$]AS_TR_CPP(gd_encoding[_LIBS])"
+    else
+      PRIVATE_LIBS="[$]AS_TR_CPP(gd_encoding[_LDFLAGS]) $PRIVATE_LIBS [$]AS_TR_CPP(gd_encoding[_LIBS])"
+    fi
+  fi
+else
+  ENCODINGS_LEFT="${ENCODINGS_LEFT} gd_encoding";
+fi
+])
diff --git a/m4/floatordering.m4 b/m4/floatordering.m4
new file mode 100644
index 0000000..7a58ba2
--- /dev/null
+++ b/m4/floatordering.m4
@@ -0,0 +1,69 @@
+dnl Copyright (C) 2010 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+dnl GD_C_FLOATORDERING
+dnl -----------------------------------------------------------
+dnl Attempt to determine the ordering of double precision floats
+AC_DEFUN([GD_C_FLOATORDERING],
+  [AC_CACHE_CHECK([floating point endianness], [gd_cv_c_floatordering],
+[gd_cv_c_floatordering=unknown
+# check for arm middle endianness
+AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+[[#if ! (defined __arm__ && ! (defined __VFP_FP__ || defined __MAVERICK___))
+  not arm middle endian
+#endif
+]])],
+[gd_cv_c_floatordering=arm],
+[# not middle-endian arm, check for __FLOAT_WORD_ORDER
+AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([[#include <endian.h>]],
+[[#ifndef __FLOAT_WORD_ORDER
+  no __FLOAT_WORD_ORDER defined
+#endif
+]])],
+[# __FLOAT_WORD_ORDER is defined; is it BIG_ENDIAN?
+AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([[#include <endian.h>]],
+[[#if __FLOAT_WORD_ORDER != BIG_ENDIAN
+  not big endian
+#endif
+]])],
+[gd_cv_c_floatordering="big"],
+[gd_cv_c_floatordering="little"])],
+[# no __FLOAT_WORD_ORDER defined; so we just assume it's the same as the
+ # integer ordering
+AC_COMPILE_IFELSE(
+[AC_LANG_SOURCE(
+[[#ifndef WORDS_BIGENDIAN
+  not big endian
+#endif
+]])],
+[gd_cv_c_floatordering="big"],
+[gd_cv_c_floatordering="little"])])])])
+
+if test $gd_cv_c_floatordering = "arm"; then
+AC_DEFINE([ARM_ENDIAN_DOUBLES], [1],
+  [ Define to 1 if your processor stores double-precision floats in the old
+    ARM middle-endian format ])
+elif test $gd_cv_c_floatordering = "big"; then
+AC_DEFINE([FLOATS_BIGENDIAN], [1],
+  [ Define to 1 if your processor stores double-precision floats in big-endian
+    order])
+fi])
diff --git a/m4/idl.m4 b/m4/idl.m4
new file mode 100644
index 0000000..3f5e64e
--- /dev/null
+++ b/m4/idl.m4
@@ -0,0 +1,134 @@
+dnl Copyright (C) 2009-2010 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+dnl GD_IDL_CHECK_VERSION
+dnl ---------------------------------------------------------------
+dnl Define IDL_VERSION to the version of the idl interpreter
+AC_DEFUN([GD_IDL_CHECK_VERSION],
+[
+idl_version_ok="no"
+idl_header=`( echo | $1 2>&1 )` #''
+IDL_VERSION="unknown"
+if echo $idl_header | grep -q "IDL Version"; then
+  IDL_VERSION=`echo $idl_header | grep Version | sed -e 's/IDL Version \(@<:@^ @:>@*\).*/\1/'` #'
+  AX_COMPARE_VERSION([$IDL_VERSION],[ge],[$2],[idl_version_ok="yes"])
+fi
+if test "x$idl_version_ok" = "xyes"; then
+  $3
+  true
+else
+  $4
+  true
+fi
+])
+
+dnl GD_IDL
+dnl ---------------------------------------------------------------
+dnl Look for idl.  Then determine whether we can build an IDL module.
+AC_DEFUN([GD_IDL],
+[
+idl_min_version=$1
+AC_ARG_WITH([idl], AS_HELP_STRING([--with-idl=PATH],
+            [use the IDL interpreter located in PATH [default: autodetect]]),
+            [
+              case "${withval}" in
+                no) have_idl="no" ;;
+                yes) user_idl= ; have_idl= ;;
+                *) user_idl="${withval}"; have_idl= ;;
+              esac
+            ], [ user_idl=; have_idl= ])
+
+
+AC_ARG_WITH([idl-dlm-dir], AS_HELP_STRING([--with-idl-dlm-dir=PATH],
+      [install the IDL bindings into PATH [default: autodetect]]),
+      [
+        case "${withval}" in
+          no) local_idl_dlm_path= ;;
+          *) local_idl_dlm_path="${withval}"
+        esac
+      ], [ local_idl_dlm_path= ])
+
+if test "x${have_idl}" != "xno"; then
+
+dnl try to find a sufficiently new IDL.
+if test "x$user_idl" != "x"; then
+  AC_MSG_CHECKING([whether $user_idl is an IDL interpreter version >= $idl_min_version])
+  GD_IDL_CHECK_VERSION([$user_idl], [$idl_min_version],
+  [AC_MSG_RESULT([yes])
+  IDL=$user_idl],
+  [AC_MSG_RESULT([no])
+  IDL="not found"])
+else
+  AC_MSG_CHECKING([for an IDL interpreter version >= $idl_min_version])
+  IDL="not found"
+  for prog in idl idl7 idl6 idl5; do
+  _AS_PATH_WALK([$PATH],
+  [for exec_ext in '' $ac_executable_extensions; do
+    if AS_EXECUTABLE_P(["$as_dir/$prog$exec_ext"]); then
+      GD_IDL_CHECK_VERSION( ["$as_dir/$prog$exec_ext"],
+      [$idl_min_version], [ IDL="$as_dir/$prog$exec_ext"; break 3] )
+    fi
+  done])
+  done
+  AC_MSG_RESULT([$IDL])
+fi
+
+if test "x$IDL" = "xnot found"; then
+  have_idl="no"
+  IDL=
+fi
+AC_SUBST([IDL])
+
+fi
+
+if test "x${have_idl}" != "xno"; then
+dnl idl version
+AC_MSG_CHECKING([$IDL version])
+AC_MSG_RESULT([$IDL_VERSION])
+
+dnl calculate idl CPPFLAGS and LIBS
+AC_MSG_CHECKING([for $IDL DLM directory])
+if test "x${local_idl_dlm_path}" = "x"; then
+  idldir=`(echo 'print,"@@@"+!DLM_PATH' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@\(@<:@^:@:>@*\)/\1/'`
+else
+  idldir="$local_idl_dlm_path"
+fi
+AC_MSG_RESULT([$idldir])
+AC_SUBST([idldir])
+
+AC_MSG_CHECKING([IDL compiler flags])
+IDL_CFLAGS=`(echo 'print,"@@@"+!MAKE_DLL.CC' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@.*%X \(.*\) %C.*/\1/' | sed -e 's/\(.* \)-c\(.*\)/\1\2/' | sed -e 's/"//g'`
+AC_MSG_RESULT([$IDL_CFLAGS])
+AC_SUBST([IDL_CFLAGS])
+
+AC_SUBST([IDL_CFLAGS])
+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_RESULT([$IDL_LIBS])
+AC_SUBST([IDL_LIBS])
+
+dnl header check
+saved_CPPFLAGS=${CPPFLAGS}
+CPPFLAGS="${CPPFLAGS} ${IDL_CFLAGS}"
+AC_CHECK_HEADERS(idl_export.h,,[have_idl="no"])
+CPPFLAGS=${saved_CPPFLAGS}
+
+fi
+])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 0000000..a3bc337
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,8369 @@
+# 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
new file mode 100644
index 0000000..94b0829
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,437 @@
+# 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
new file mode 100644
index 0000000..48bc934
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,124 @@
+# 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
new file mode 100644
index 0000000..fa04b52
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# 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
new file mode 100644
index 0000000..c6b26f8
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,99 @@
+# 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
new file mode 100644
index 0000000..a43c2f2
--- /dev/null
+++ b/m4/matlab.m4
@@ -0,0 +1,161 @@
+dnl Copyright (C) 2013 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+dnl GD_MATLAB
+dnl ---------------------------------------------------------------
+dnl Look for mex; sets and substs MEX on success
+AC_DEFUN([GD_MEX],
+[
+dnl --without-mex basically does the same as --disable-matlab
+AC_ARG_WITH([mex], AS_HELP_STRING([--with-mex=PATH],
+            [use the MATLAB MEX compiler located at PATH.  ]
+            [[default: autodetect]]),
+            [
+              case "${withval}" in
+                no) have_matlab="no" ;;
+                yes) user_mex= ;;
+                *) user_mex="${withval}";;
+              esac
+            ], [ user_mex= ])
+
+dnl try to find mex
+MEX="not found"
+if test "x$user_mex" != "x"; then
+  AC_MSG_CHECKING([if $user_mex is a MATLAB mex compiler])
+  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
+    AC_MSG_RESULT([no])
+  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])
+])
+
+dnl GD_MEX_VAR
+dnl ---------------------------------------------------------------
+dnl Determine a MEX variable and store it in the supplied local
+dnl variable
+AC_DEFUN([GD_MEX_VAR],
+[
+$1=`$MEX -v 2>/dev/null | ${AWK} '/$2 *=/ { print @S|@4 }'`
+])
+
+dnl GD_MATLAB_EVAL
+dnl ---------------------------------------------------------------
+dnl Evaluate something in MATLAB and store it in the supplied local
+dnl variable
+AC_DEFUN([GD_MATLAB_EVAL],
+[
+ifelse(`$#', `2', [matlab_int=$MATLAB], [matlab_int=$3])
+$1=`$matlab_int -nodisplay -nosplash -nojvm -nodesktop -r "fprintf(2, '@@@%s@@@\n', $2); quit" 2>&1 >/dev/null | ${AWK} 'BEGIN { FS="@@@" } /^@@@/ { print @S|@2 }'`
+])
+
+dnl GD_MATLAB
+dnl ---------------------------------------------------------------
+dnl Look for matlab, &c.
+dnl
+AC_DEFUN([GD_MATLAB],
+[
+dnl --without-matlab basically does the same as --disable-matlab
+AC_ARG_WITH([matlab], AS_HELP_STRING([--with-matlab=PATH],
+            [use the MATLAB interpreter located at PATH.  ]
+            [[default: autodetect]]),
+            [
+              case "${withval}" in
+                no) have_matlab="no" ;;
+                yes) user_matlab= ; have_matlab= ;;
+                *) user_matlab="${withval}"; have_matlab= ;;
+              esac
+            ], [ user_matlab=; have_matlab= ])
+
+dnl find MEX first
+if test "x${have_matlab}" != "xno"; then
+  GD_MEX
+fi
+
+dnl find matlab
+if test "x${have_matlab}" != "xno"; then
+  dnl try to find matlab
+  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
+  else
+    AC_PATH_PROG([MATLAB], [matlab], [not found])
+  fi
+
+  if test "x$MATLAB" = "xnot found"; then
+    have_matlab=no
+    MATLAB=
+  fi
+  AC_SUBST([MATLAB])
+fi
+
+if test "x${have_matlab}" != "xno"; then
+  dnl installdir
+  default_matlabbasedir=$libdir/getdata/matlab
+  AC_ARG_WITH([matlab-dir], AS_HELP_STRING([--with-matlab-dir=PATH],
+        [ Install Matlab bindings in PATH/getdata.  ]
+        [[default: LIBDIR/getdata/matlab]]),
+      [
+      case "${withval}" in
+      no) matlabbasedir=$default_matlabbasedir ;;
+      *) matlabbasedir="${withval}" ;;
+      esac
+      ], [ matlabbasedir=$default_matlabbasedir ])
+  AC_MSG_CHECKING([matlab install directory])
+  AC_MSG_RESULT([$matlabbasedir])
+  AC_SUBST([matlabbasedir])
+
+  dnl mex extension
+  AC_MSG_CHECKING([MEX extension])
+  GD_MATLAB_EVAL([mexext], [mexext])
+  AC_MSG_RESULT([.$mexext])
+  AC_SUBST([mexext])
+
+  dnl flags
+  AC_MSG_CHECKING([MatLab CPPFLAGS])
+  GD_MEX_VAR([matlab_prefix], [MATLAB])
+  MATLAB_CPPFLAGS="-I${matlab_prefix}/extern/include"
+  AC_MSG_RESULT([$MATLAB_CPPFLAGS])
+  AC_SUBST([MATLAB_CPPFLAGS])
+fi
+])
diff --git a/m4/perl.m4 b/m4/perl.m4
new file mode 100644
index 0000000..794d1fa
--- /dev/null
+++ b/m4/perl.m4
@@ -0,0 +1,196 @@
+dnl Copyright (C) 2009-2011 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+dnl GD_PERL_CONFIG
+dnl ---------------------------------------------------------------
+dnl query perl for the specified configuration value and store it in the
+dnl supplied local variable
+AC_DEFUN([GD_PERL_CONFIG],
+[
+ifelse(`$#', `2', [perl_int=$PERL], [perl_int=$3])
+# 3=$3
+$1=`$perl_int -V::$2: | sed -e "s/'//g" | sed -e "s/[ \t]*$//"`
+])
+
+dnl GD_PERL_CHECK_VERSION
+dnl ---------------------------------------------------------------
+dnl Define PERL_VERSION to the version of the idl interpreter
+AC_DEFUN([GD_PERL_CHECK_VERSION],
+[
+perl_version_ok="no"
+GD_PERL_CONFIG([PERL_VERSION], [version], [$1])
+AX_COMPARE_VERSION([$PERL_VERSION],[ge],[$2],[perl_version_ok="yes"])
+if test "x$perl_version_ok" = "xyes"; then
+  $3
+  true
+else
+  $4
+  true
+fi
+])
+
+dnl GD_PERL_MAN3EXT
+dnl ---------------------------------------------------------------
+dnl Define PERL_MAN3EXT to the section 3 manual extension used by Module::Build
+AC_DEFUN([GD_PERL_MAN3EXT],
+[
+AC_MSG_CHECKING([for the section 3 manual page extension])
+PERL_MAN3EXT=`$PERL -MModule::Build -e 'print "\n>>GD ", Module::Build->new(module_name=>"conftest",dist_version=>0)->config('man3ext'), " GD<<";' | $AWK '/>>GD .* GD<</ { print @S|@2 }'`
+AC_MSG_RESULT([.$PERL_MAN3EXT])
+AC_SUBST([PERL_MAN3EXT])
+])
+
+dnl GD_PERL_CHECK_MODULE
+dnl ---------------------------------------------------------------
+dnl Define HAVE_<MODULE_NAME> if the specified module exists
+AC_DEFUN([GD_PERL_CHECK_MODULE],
+[
+AC_MSG_CHECKING([for $1])
+if $PERL -M$1 -e 'exit' > /dev/null 2>&1; then
+  AS_TR_SH([HAVE_$1])=yes
+else
+  AS_TR_SH([HAVE_$1])=no
+fi
+AC_MSG_RESULT([${AS_TR_SH([HAVE_$1])}])
+])
+
+dnl GD_PERL
+dnl ---------------------------------------------------------------
+dnl Look for perl5.  Then determine whether we can build XSUBs.
+AC_DEFUN([GD_PERL],
+[
+first_perl=5.8.0
+perl_prog_list="perl perl5 \
+perl5.14 perl5.12 perl5.10 perl5.8 \
+perl5.14.0 \
+perl5.12.3 perl5.12.2 perl5.12.1 perl5.12.0 \
+perl5.10.1 perl5.10.0 \
+perl5.8.9 perl5.8.8 perl5.8.7 perl5.8.6 perl5.8.5 perl5.8.4 perl5.8.3 \
+perl5.8.2 perl5.8.1 perl5.8.0"
+
+dnl --without-perl basically does the same as --disable-perl
+AC_ARG_WITH([perl], AS_HELP_STRING([--with-perl=PATH],
+            [use the Perl interpreter located in PATH.  [default: autodetect]]),
+            [
+              case "${withval}" in
+                no) have_perl="no" ;;
+                yes) user_perl= ; have_perl= ;;
+                *) user_perl="${withval}"; have_perl= ;;
+              esac
+            ], [ user_perl=; have_perl= ])
+
+if test "x${have_perl}" != "xno"; then
+
+  dnl try to find a sufficiently new perl.
+  if test "x$user_perl" != "x"; then
+    AC_MSG_CHECKING([whether $user_perl version >= $first_perl])
+    GD_PERL_CHECK_VERSION([$user_perl], [$first_perl],
+    [AC_MSG_RESULT([yes])
+    PERL=$user_perl],
+    [AC_MSG_RESULT([no])
+    PERL="not found"])
+  else
+    AC_MSG_CHECKING([for Perl interpreter version >= $first_perl])
+    PERL="not found"
+    for perl in $perl_prog_list; do
+    _AS_PATH_WALK([$PATH],
+    [for exec_ext in '' $ac_executable_extensions; do
+      if AS_EXECUTABLE_P(["$as_dir/$perl$exec_ext"]); then
+        GD_PERL_CHECK_VERSION( ["$as_dir/$perl$exec_ext"],
+        [$first_perl], [ PERL="$as_dir/$perl$exec_ext"; break 3] )
+      fi
+    done])
+    done
+    AC_MSG_RESULT([$PERL])
+  fi
+
+  if test "x$PERL" = "xnot found"; then
+    have_perl="no"
+    PERL=
+  fi
+  AC_SUBST([PERL])
+
+  fi
+
+  if test "x${have_perl}" != "xno"; then
+  dnl perl version
+  AC_MSG_CHECKING([$PERL version])
+  GD_PERL_CONFIG([PERL_VERSION], [version])
+  AC_MSG_RESULT([$PERL_VERSION])
+
+fi
+
+AC_ARG_WITH([perl-dir], AS_HELP_STRING([--with-perl-dir=PATH],
+[ Install Perl bindings in PATH.  If PATH is the special word `vendor', install
+Perl bindings into the default vendor-specific module directory (if present).
+If PATH is the special word `site', install Perl bindings into the default
+site-specific module directory.  [default: site] ]),
+    [
+    case "${withval}" in
+    vendor|site) perl_inst_type="${withval}" ;;
+    no) perl_inst_type="site" ;;
+    *) perl_inst_type="local"; local_perl_path="${withval}" ;;
+    esac
+    ], [ perl_inst_type="site" ])
+
+if test "x${have_perl}" != "xno"; then
+  GD_PERL_CHECK_MODULE([Math::Complex])
+  GD_PERL_CHECK_MODULE([Module::Build])
+  GD_PERL_CHECK_MODULE([Test::Harness])
+fi
+
+if test "$HAVE_Math__Complex$HAVE_Module__Build" != "yesyes"; then
+  have_perl=no
+fi
+
+if test "x${have_perl}" != "xno"; then
+
+  dnl calculate the extension module directory
+  AC_MSG_CHECKING([Perl module directory])
+  if test $perl_inst_type = "vendor"; then
+    GD_PERL_CONFIG([perldir], [vendorarchexp])
+    GD_PERL_CONFIG([perlmandir], [vendorman3direxp])
+    if test $perldir = "UNKNOWN"; then
+      perl_inst_type = "site";
+    fi
+  fi
+
+  if test $perl_inst_type = "site"; then
+    GD_PERL_CONFIG([perldir], [sitearchexp])
+    GD_PERL_CONFIG([perlmandir], [siteman3direxp])
+  elif test $perl_inst_type != "vendor"; then
+    perldir="${local_perl_path}"
+    perlmandir="${man3dir}"
+  fi
+
+  if test "x$perlmandir" = "xUNKNOWN"; then
+    perlmandir="${mandir}"
+  fi
+
+  AC_SUBST([perldir])
+  AC_MSG_RESULT([$perldir])
+
+  AC_MSG_CHECKING([Perl man directory])
+  AC_SUBST([perlmandir])
+  AC_MSG_RESULT([$perlmandir])
+
+  GD_PERL_MAN3EXT
+fi
+])
diff --git a/m4/python.m4 b/m4/python.m4
new file mode 100644
index 0000000..f09ba4a
--- /dev/null
+++ b/m4/python.m4
@@ -0,0 +1,166 @@
+dnl Copyright (C) 2009-2011, 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_PYTHON
+dnl ---------------------------------------------------------------
+dnl Look for python.  Then determine whether we can build extension modules.
+AC_DEFUN([GD_PYTHON],
+[
+last_python=2.7
+first_python=$1
+
+if test "x$SEQ" == "xnot found"; then
+  if test "x$JOT" == "xnot found"; then
+    python_prog_list="python python2"
+  else
+    python_prog_list="python python2 dnl
+    `$JOT -w 'python%.1f' - $last_python $first_python -0.1`" #'
+  fi
+else
+  python_prog_list="python python2 dnl
+  `$SEQ -f 'python%.1f' $last_python -0.1 $first_python`" #'
+fi
+
+dnl --without-python basically does the same as --disable-python
+AC_ARG_WITH([python], AS_HELP_STRING([--with-python=PATH],
+            [use the Python interpreter located in PATH [default: autodetect]]),
+            [
+              case "${withval}" in
+                no) have_python="no" ;;
+                yes) user_python= ; have_python= ;;
+                *) user_python="${withval}"; have_python= ;;
+              esac
+            ], [ user_python=; have_python= ])
+
+AC_ARG_WITH([python-module-dir], AS_HELP_STRING([--with-python-module-dir=PATH],
+      [install the Python bindings into PATH [default: autodetect]]),
+      [
+        case "${withval}" in
+          no) local_python_modpath= ;;
+          *) local_python_modpath="${withval}"
+        esac
+      ], [ local_python_modpath= ])
+
+if test "x${have_python}" != "xno"; then
+
+dnl try to find a sufficiently new python.
+if test "x$user_python" != "x"; then
+  AC_MSG_CHECKING([whether $user_python version >= $first_python])
+  AM_PYTHON_CHECK_VERSION([$user_python], [$first_python],
+  [AC_MSG_RESULT([yes])
+  PYTHON=$user_python],
+  [AC_MSG_RESULT([no])
+  PYTHON="not found"])
+else
+  AC_MSG_CHECKING([for Python interpreter version >= $first_python])
+  PYTHON="not found"
+  for py in $python_prog_list; do
+  _AS_PATH_WALK([$PATH],
+  [for exec_ext in '' $ac_executable_extensions; do
+    if AS_EXECUTABLE_P(["$as_dir/$py$exec_ext"]); then
+      AM_PYTHON_CHECK_VERSION( ["$as_dir/$py$exec_ext"],
+      [$first_python], [ PYTHON="$as_dir/$py$exec_ext"; break 3] )
+    fi
+  done])
+  done
+  AC_MSG_RESULT([$PYTHON])
+fi
+
+if test "x$PYTHON" = "xnot found"; then
+  have_python="no"
+  PYTHON=
+fi
+AC_SUBST([PYTHON])
+
+fi
+
+if test "x${have_python}" != "xno"; then
+dnl python version
+AC_MSG_CHECKING([$PYTHON version])
+PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[:3]]"`
+AC_MSG_RESULT([$PYTHON_VERSION])
+
+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} "
+else
+  PYTHON_LIBS=""
+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 calculate the exec prefix
+pyexec_prefix=$exec_prefix
+test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix
+test "x$pyexec_prefix" = xNONE && pyexec_prefix=$ac_default_prefix
+
+dnl calculate the extension module directory
+AC_MSG_CHECKING([Python extension module directory])
+if test "x${local_python_modpath}" = "x"; then
+  pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='${pyexec_prefix}')" 2>/dev/null || echo "${pyexec_prefix}/lib/python${PYTHON_VERSION}/site-packages"`
+else
+  pythondir=$local_python_modpath
+fi
+AC_SUBST([pythondir])
+AC_MSG_RESULT([$pythondir])
+
+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
new file mode 100644
index 0000000..71566f3
--- /dev/null
+++ b/m4/version.m4
@@ -0,0 +1,45 @@
+dnl Copyright (C) 2008-2015 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+m4_define(getdata_major,    0)
+m4_define(getdata_minor,    8)
+m4_define(getdata_revision, 9)
+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)
+dnl libgetdata current interface implementation revision
+m4_define(getdata_impl_revision,    7)
+dnl libgetdata interface age (current interface - oldest supported interface)
+m4_define(getdata_iface_age,        1)
+
+dnl libgetdata++ interface version info (current:revision:age)
+m4_define(getdataxx_version, 5:1:2)
+
+dnl libfgetdata interface version info
+m4_define(fgetdata_version, 4:4:2)
+
+dnl libf95getdata interface version info
+m4_define(f95getdata_version, 5:3:3)
+
+dnl libgetdata-matlab interface version info
+m4_define(matlabgetdata_version, 0:1:0)
diff --git a/m4/win32.m4 b/m4/win32.m4
new file mode 100644
index 0000000..61defa5
--- /dev/null
+++ b/m4/win32.m4
@@ -0,0 +1,43 @@
+dnl Copyright (C) 2010 D. V. Wiebe
+dnl
+dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+dnl
+dnl This file is part of the GetData project.
+dnl
+dnl GetData is free software; you can redistribute it and/or modify it under
+dnl the terms of the GNU Lesser General Public License as published by the
+dnl Free Software Foundation; either version 2.1 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl GetData is distributed in the hope that it will be useful, but WITHOUT
+dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with GetData; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+dnl GD_MSYS_SHELL
+dnl ---------------------------------------------------------------
+dnl Find the Win32 path to the MSYS shell.
+AC_DEFUN([GD_MSYS_SHELL],
+[
+AC_MSG_CHECKING([whether we're running under Msys])
+if test "x`uname -o 2> /dev/null`" = "xMsys"; then
+this_is_msys=yes
+else
+this_is_msys=no
+fi
+AC_MSG_RESULT([$this_is_msys])
+
+if test "$this_is_msys" = "yes"; then
+AC_MSG_CHECKING([for the Win32 MSYS shell])
+msys_root=`mount | ${GREP} 'on / ' | awk '{print [$]1}'`
+msys_shell1="$msys_root`echo $SHELL | ${SED} -e 's/\//\\\\/g'`.exe"
+msys_shell=`echo "$msys_shell1" | ${SED} -e 's/\\\\/\\\\\\\\/g'`
+AC_MSG_RESULT([$msys_shell1])
+AC_DEFINE_UNQUOTED([MSYS_SHELL], ["$msys_shell"],
+[ Define to the full Win32 path to the `sh.exe' binary ])
+fi
+])
diff --git a/man/GD_SIZE.3 b/man/GD_SIZE.3
new file mode 100644
index 0000000..6818fe5
--- /dev/null
+++ b/man/GD_SIZE.3
@@ -0,0 +1,59 @@
+.\" GD_SIZE.3.  The GD_SIZE man page.
+.\"
+.\" Copyright (C) 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH GD_SIZE 3 "20 February 2013" "Version 0.8.3" "GETDATA"
+.SH NAME
+GD_SIZE \(em report the size of a GetData data sample
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int GD_SIZE(gd_type_t " type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR GD_SIZE ()
+preprocessor macro returns the size (in bytes) of a single sample of data of the type
+specified by
+.IR type ,
+which should be one of the symbols
+.IP
+.nh
+.ad l
+.BR GD_NULL ", " GD_UINT8 ", " GD_INT8 ", " GD_UINT16 ", " GD_INT16 ,
+.BR GD_UINT32 ", " GD_INT32 ", " GD_FLOAT32 ", " GD_FLOAT64 ", " GD_COMPLEX64 ,
+.BR GD_COMPLEX128 ", " GD_UNKNOWN .
+.ad n
+.hy
+.PP
+Passing
+.B GD_NULL
+or
+.B GD_UNKNOWN
+to this macro will return zero.  For the other types, the value returned is simply the bit-size encoded
+in the type symbol divided by eight, so, e.g.,
+.B GD_SIZE(GD_COMPLEX64)
+will return 8.
+.PP
+No error checking is performed on
+.IR type :
+behaviour resulting from passing something other than the symbols listed above to this macro is unspecified.
+See
+.BR gd_getdata (3)
+for the meaning of the above symbols.
+.SH SEE ALSO
+.BR gd_getdata (3)
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644
index 0000000..5ad1224
--- /dev/null
+++ b/man/Makefile.am
@@ -0,0 +1,129 @@
+# Copyright (C) 2008-2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+
+nodist_man_MANS = gd_alter_encoding.3 gd_alter_endianness.3 \
+											 gd_alter_frameoffset.3
+dist_man_MANS = checkdirfile.1 dirfile2ascii.1 gd_add.3 gd_add_alias.3 \
+								gd_add_bit.3 gd_add_spec.3 gd_alias_target.3 gd_aliases.3 \
+								gd_alter_affixes.3 gd_alter_bit.3 gd_alter_entry.3 \
+								gd_alter_protection.3 gd_alter_spec.3 gd_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_native_type.3 gd_nentries.3 gd_nfragments.3 gd_nframes.3 \
+								gd_nframes64.3 gd_parent_fragment.3 gd_parser_callback.3 \
+								gd_protection.3 gd_put_carray_slice.3 \
+								gd_put_string.3 gd_putdata.3 gd_putdata64.3 gd_raw_filename.3 \
+								gd_reference.3 gd_rename.3 gd_rewrite_fragment.3 gd_seek.3 \
+								gd_seek64.3 gd_spf.3 gd_strings.3 gd_strtok.3 gd_tell.3 \
+								gd_tell64.3 gd_uninclude.3 gd_validate.3 gd_verbose_prefix.3 \
+								GD_SIZE.3 dirfile.5 dirfile-encoding.5 dirfile-format.5
+
+# these are real_file:alias
+MAN3ALIASES=gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \
+	gd_add_bit.3:gd_add_const.3 gd_add_bit.3:gd_add_cpolynom.3 \
+	gd_add_bit.3:gd_add_crecip.3 gd_add_bit.3:gd_add_divide.3 \
+	gd_add_bit.3:gd_add_lincom.3 gd_add_bit.3:gd_add_linterp.3 \
+	gd_add_bit.3:gd_add_mplex.3 gd_add_bit.3:gd_add_multiply.3 \
+	gd_add_bit.3:gd_add_polynom.3 gd_add_bit.3:gd_add_phase.3 \
+	gd_add_bit.3:gd_add_raw.3 gd_add_bit.3:gd_add_recip.3 \
+	gd_add_bit.3:gd_add_sbit.3 gd_add_bit.3:gd_add_string.3 \
+	gd_add_bit.3:gd_add_window.3 \
+	gd_madd_bit.3:gd_madd_carray.3 gd_madd_bit.3:gd_madd_clincom.3 \
+	gd_madd_bit.3:gd_madd_const.3 gd_madd_bit.3:gd_madd_cpolynom.3 \
+	gd_madd_bit.3:gd_madd_crecip.3 gd_madd_bit.3:gd_madd_divide.3 \
+	gd_madd_bit.3:gd_madd_lincom.3 gd_madd_bit.3:gd_madd_linterp.3 \
+	gd_madd_bit.3:gd_madd_mplex.3 gd_madd_bit.3:gd_madd_multiply.3 \
+	gd_madd_bit.3:gd_madd_phase.3 gd_madd_bit.3:gd_madd_polynom.3 \
+	gd_madd_bit.3:gd_madd_recip.3 gd_madd_bit.3:gd_madd_sbit.3 \
+	gd_madd_bit.3:gd_madd_string.3 gd_madd_bit.3:gd_madd_window.3 \
+	gd_add.3:gd_madd.3 \
+	gd_add_spec.3:gd_madd_spec.3 \
+	gd_cbopen.3:gd_open.3 \
+	gd_close.3:gd_discard.3 \
+	gd_include_affix.3:gd_include.3 \
+	gd_alter_bit.3:gd_alter_carray.3 gd_alter_bit.3:gd_alter_clincom.3 \
+	gd_alter_bit.3:gd_alter_const.3 gd_alter_bit.3:gd_alter_cpolynom.3 \
+	gd_alter_bit.3:gd_alter_crecip.3 gd_alter_bit.3:gd_alter_divide.3 \
+	gd_alter_bit.3:gd_alter_lincom.3 gd_alter_bit.3:gd_alter_linterp.3 \
+	gd_alter_bit.3:gd_alter_mplex.3 gd_alter_bit.3:gd_alter_multiply.3 \
+	gd_alter_bit.3:gd_alter_phase.3 gd_alter_bit.3:gd_alter_polynom.3 \
+	gd_alter_bit.3:gd_alter_recip.3 gd_alter_bit.3:gd_alter_raw.3 \
+	gd_alter_bit.3:gd_alter_sbit.3 gd_alter_bit.3:gd_alter_window.3 \
+	gd_alter_spec.3:gd_malter_spec.3 \
+	gd_framenum_subset.3:gd_framenum.3 \
+	gd_get_carray_slice.3:gd_get_carray.3 \
+	gd_get_carray_slice.3:gd_get_constant.3 \
+	gd_put_carray_slice.3:gd_put_carray.3 \
+	gd_put_carray_slice.3:gd_put_constant.3 \
+	gd_delete.3:gd_delete_alias.3 \
+	gd_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 \
+	gd_nentries.3:gd_nfields.3 gd_nentries.3:gd_nfields_by_type.3 \
+	gd_nentries.3:gd_nmfields.3 gd_nentries.3:gd_nmfields_by_type.3 \
+	gd_nentries.3:gd_nmvectore.3 gd_nentries.3:gd_nvectors.3 \
+	gd_entry_list.3:gd_field_list.3 gd_entry_list.3:gd_field_list_by_type.3 \
+	gd_entry_list.3:gd_mfield_list.3 gd_entry_list.3:gd_mfield_list_by_type.3 \
+	gd_entry_list.3:gd_nmvectore.3 gd_entry_list.3:gd_vector_list.3 \
+	gd_frameoffset64.3:gd_alter_frameoffset64.3
+
+#man conversion
+HTMLMANS=$(addsuffix .html,${nodist_man_MANS}) \
+				 $(addsuffix .html,${dist_man_MANS})
+
+%.html: % make_html.pl
+	./make_html.pl $< > $@
+
+htmlman: $(HTMLMANS)
+	for m in $(MAN3ALIASES); do \
+		./make_html.pl `echo $$m | $(SED) -e 's/:\\(.*\\).3/ \\1/'` \
+			> `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/.*://'`; \
+	 done
+
+install-data-hook:
+	cd $(DESTDIR)$(mandir)/man3 && \
+		for m in $(MAN3ALIASES); do \
+		rm -f `echo $$m | $(SED) -e 's/.*://'`; \
+		$(LN_S) `echo $$m | $(SED) -e 's/:/ /'`; \
+		done
+
+uninstall-hook:
+	cd $(DESTDIR)$(mandir)/man3 && \
+		for m in $(MAN3ALIASES); do \
+		rm -f `echo $$m | $(SED) -e 's/.*://'`; \
+		done
+
+clean-local:
+	rm -f *~ *.html
+	rm -f $(nodist_man_MANS)
diff --git a/man/Makefile.in b/man/Makefile.in
new file mode 100644
index 0000000..90be4b1
--- /dev/null
+++ b/man/Makefile.in
@@ -0,0 +1,834 @@
+# 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 = man
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(srcdir)/gd_alter_encoding.3.in \
+	$(srcdir)/gd_alter_endianness.3.in \
+	$(srcdir)/gd_alter_frameoffset.3.in $(dist_man_MANS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES = gd_alter_encoding.3 gd_alter_endianness.3 \
+	gd_alter_frameoffset.3
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ 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__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
+	"$(DESTDIR)$(man5dir)"
+man3dir = $(mandir)/man3
+man5dir = $(mandir)/man5
+NROFF = nroff
+MANS = $(dist_man_MANS) $(nodist_man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008-2010 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+nodist_man_MANS = gd_alter_encoding.3 gd_alter_endianness.3 \
+											 gd_alter_frameoffset.3
+
+dist_man_MANS = checkdirfile.1 dirfile2ascii.1 gd_add.3 gd_add_alias.3 \
+								gd_add_bit.3 gd_add_spec.3 gd_alias_target.3 gd_aliases.3 \
+								gd_alter_affixes.3 gd_alter_bit.3 gd_alter_entry.3 \
+								gd_alter_protection.3 gd_alter_spec.3 gd_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_native_type.3 gd_nentries.3 gd_nfragments.3 gd_nframes.3 \
+								gd_nframes64.3 gd_parent_fragment.3 gd_parser_callback.3 \
+								gd_protection.3 gd_put_carray_slice.3 \
+								gd_put_string.3 gd_putdata.3 gd_putdata64.3 gd_raw_filename.3 \
+								gd_reference.3 gd_rename.3 gd_rewrite_fragment.3 gd_seek.3 \
+								gd_seek64.3 gd_spf.3 gd_strings.3 gd_strtok.3 gd_tell.3 \
+								gd_tell64.3 gd_uninclude.3 gd_validate.3 gd_verbose_prefix.3 \
+								GD_SIZE.3 dirfile.5 dirfile-encoding.5 dirfile-format.5
+
+
+# these are real_file:alias
+MAN3ALIASES = gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \
+	gd_add_bit.3:gd_add_const.3 gd_add_bit.3:gd_add_cpolynom.3 \
+	gd_add_bit.3:gd_add_crecip.3 gd_add_bit.3:gd_add_divide.3 \
+	gd_add_bit.3:gd_add_lincom.3 gd_add_bit.3:gd_add_linterp.3 \
+	gd_add_bit.3:gd_add_mplex.3 gd_add_bit.3:gd_add_multiply.3 \
+	gd_add_bit.3:gd_add_polynom.3 gd_add_bit.3:gd_add_phase.3 \
+	gd_add_bit.3:gd_add_raw.3 gd_add_bit.3:gd_add_recip.3 \
+	gd_add_bit.3:gd_add_sbit.3 gd_add_bit.3:gd_add_string.3 \
+	gd_add_bit.3:gd_add_window.3 \
+	gd_madd_bit.3:gd_madd_carray.3 gd_madd_bit.3:gd_madd_clincom.3 \
+	gd_madd_bit.3:gd_madd_const.3 gd_madd_bit.3:gd_madd_cpolynom.3 \
+	gd_madd_bit.3:gd_madd_crecip.3 gd_madd_bit.3:gd_madd_divide.3 \
+	gd_madd_bit.3:gd_madd_lincom.3 gd_madd_bit.3:gd_madd_linterp.3 \
+	gd_madd_bit.3:gd_madd_mplex.3 gd_madd_bit.3:gd_madd_multiply.3 \
+	gd_madd_bit.3:gd_madd_phase.3 gd_madd_bit.3:gd_madd_polynom.3 \
+	gd_madd_bit.3:gd_madd_recip.3 gd_madd_bit.3:gd_madd_sbit.3 \
+	gd_madd_bit.3:gd_madd_string.3 gd_madd_bit.3:gd_madd_window.3 \
+	gd_add.3:gd_madd.3 \
+	gd_add_spec.3:gd_madd_spec.3 \
+	gd_cbopen.3:gd_open.3 \
+	gd_close.3:gd_discard.3 \
+	gd_include_affix.3:gd_include.3 \
+	gd_alter_bit.3:gd_alter_carray.3 gd_alter_bit.3:gd_alter_clincom.3 \
+	gd_alter_bit.3:gd_alter_const.3 gd_alter_bit.3:gd_alter_cpolynom.3 \
+	gd_alter_bit.3:gd_alter_crecip.3 gd_alter_bit.3:gd_alter_divide.3 \
+	gd_alter_bit.3:gd_alter_lincom.3 gd_alter_bit.3:gd_alter_linterp.3 \
+	gd_alter_bit.3:gd_alter_mplex.3 gd_alter_bit.3:gd_alter_multiply.3 \
+	gd_alter_bit.3:gd_alter_phase.3 gd_alter_bit.3:gd_alter_polynom.3 \
+	gd_alter_bit.3:gd_alter_recip.3 gd_alter_bit.3:gd_alter_raw.3 \
+	gd_alter_bit.3:gd_alter_sbit.3 gd_alter_bit.3:gd_alter_window.3 \
+	gd_alter_spec.3:gd_malter_spec.3 \
+	gd_framenum_subset.3:gd_framenum.3 \
+	gd_get_carray_slice.3:gd_get_carray.3 \
+	gd_get_carray_slice.3:gd_get_constant.3 \
+	gd_put_carray_slice.3:gd_put_carray.3 \
+	gd_put_carray_slice.3:gd_put_constant.3 \
+	gd_delete.3:gd_delete_alias.3 \
+	gd_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 \
+	gd_nentries.3:gd_nfields.3 gd_nentries.3:gd_nfields_by_type.3 \
+	gd_nentries.3:gd_nmfields.3 gd_nentries.3:gd_nmfields_by_type.3 \
+	gd_nentries.3:gd_nmvectore.3 gd_nentries.3:gd_nvectors.3 \
+	gd_entry_list.3:gd_field_list.3 gd_entry_list.3:gd_field_list_by_type.3 \
+	gd_entry_list.3:gd_mfield_list.3 gd_entry_list.3:gd_mfield_list_by_type.3 \
+	gd_entry_list.3:gd_nmvectore.3 gd_entry_list.3:gd_vector_list.3 \
+	gd_frameoffset64.3:gd_alter_frameoffset64.3
+
+
+#man conversion
+HTMLMANS = $(addsuffix .html,${nodist_man_MANS}) \
+				 $(addsuffix .html,${dist_man_MANS})
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign man/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+gd_alter_encoding.3: $(top_builddir)/config.status $(srcdir)/gd_alter_encoding.3.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+gd_alter_endianness.3: $(top_builddir)/config.status $(srcdir)/gd_alter_endianness.3.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+gd_alter_frameoffset.3: $(top_builddir)/config.status $(srcdir)/gd_alter_frameoffset.3.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man1: $(dist_man_MANS) $(nodist_man_MANS)
+	@$(NORMAL_INSTALL)
+	@list1=''; \
+	list2='$(dist_man_MANS) $(nodist_man_MANS)'; \
+	test -n "$(man1dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.1[a-z]*$$/p'; \
+	fi; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man1:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS) $(nodist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+install-man3: $(dist_man_MANS) $(nodist_man_MANS)
+	@$(NORMAL_INSTALL)
+	@list1=''; \
+	list2='$(dist_man_MANS) $(nodist_man_MANS)'; \
+	test -n "$(man3dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.3[a-z]*$$/p'; \
+	fi; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man3:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man3dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS) $(nodist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.3[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
+install-man5: $(dist_man_MANS) $(nodist_man_MANS)
+	@$(NORMAL_INSTALL)
+	@list1=''; \
+	list2='$(dist_man_MANS) $(nodist_man_MANS)'; \
+	test -n "$(man5dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.5[a-z]*$$/p'; \
+	fi; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man5:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man5dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS) $(nodist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.5[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
+installdirs:
+	for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man3 install-man5
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
+uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5
+
+.MAKE: install-am install-data-am install-strip uninstall-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	clean-local cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am \
+	install-data-hook install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-man1 install-man3 \
+	install-man5 install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags-am uninstall uninstall-am uninstall-hook \
+	uninstall-man uninstall-man1 uninstall-man3 uninstall-man5
+
+
+%.html: % make_html.pl
+	./make_html.pl $< > $@
+
+htmlman: $(HTMLMANS)
+	for m in $(MAN3ALIASES); do \
+		./make_html.pl `echo $$m | $(SED) -e 's/:\\(.*\\).3/ \\1/'` \
+			> `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/.*://'`; \
+	 done
+
+install-data-hook:
+	cd $(DESTDIR)$(mandir)/man3 && \
+		for m in $(MAN3ALIASES); do \
+		rm -f `echo $$m | $(SED) -e 's/.*://'`; \
+		$(LN_S) `echo $$m | $(SED) -e 's/:/ /'`; \
+		done
+
+uninstall-hook:
+	cd $(DESTDIR)$(mandir)/man3 && \
+		for m in $(MAN3ALIASES); do \
+		rm -f `echo $$m | $(SED) -e 's/.*://'`; \
+		done
+
+clean-local:
+	rm -f *~ *.html
+	rm -f $(nodist_man_MANS)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/man/checkdirfile.1 b/man/checkdirfile.1
new file mode 100644
index 0000000..0a66635
--- /dev/null
+++ b/man/checkdirfile.1
@@ -0,0 +1,67 @@
+.\" checkdirfile.1.  The checkdirfile man page.
+.\"
+.\" Copyright (C) 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH checkdirfile 1 "21 February 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+checkdirfile \(em verify Dirfile database metadata
+.SH SYNOPSIS
+.nh
+.ad l
+.P
+.B checkdirfile
+.I DIRFILE
+.P
+.B checkdirfile
+.RB "[\| " \-\-help " | " \-\-version " \|]"
+.hy
+.ad n
+.SH DESCRIPTION
+Report errors in metadata of the dirfile(5) database specified by 
+.IR DIRFILE .
+
+Three separate checks are performed.  First, the format specification metadata
+is scanned for syntax errors (see dirfile-format(5)) and Dirfile Standards
+compliance.  Second, fields defined in the database are checked for
+self-consistency.  Finally, the database is queried for its length.
+.P
+.B --help
+.PD 0
+.TP
+.PD
+.B --version
+Show usage and version information and exit.
+
+.SH AUTHOR
+
+checkdirfile was written by D. V. Wiebe.
+
+.SH REPORTING BUGS
+
+Please send reports of bugs to getdata\-devel at lists.sourceforge.net
+
+The GetData home page: <http://getdata.sourceforge.net/>
+
+.SH COPYRIGHT
+
+Copyright \(co 2010 D. V. Wiebe
+
+checkdirfile is licenced under the GNU LPGL version 2.1 or later.
+
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/dirfile-encoding.5 b/man/dirfile-encoding.5
new file mode 100644
index 0000000..5a02421
--- /dev/null
+++ b/man/dirfile-encoding.5
@@ -0,0 +1,276 @@
+.\" dirfile-encoding.5.  The dirfile-encoding man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH dirfile-encoding 5 "26 January 2013" "Standards Version 9" "DATA FORMATS"
+.SH NAME
+dirfile-encoding \(em dirfile database encoding schemes
+.SH DESCRIPTION
+The
+.I Dirfile Standards
+indicate that
+.B RAW
+fields defined in the database are accompanied by binary files containing the
+field data in the specified simple data type.  In certain situations, it may be
+advantageous to convert the binary files in the database into a more convenient
+form.  This is accomplished by
+.I encoding
+the binary file into the alternate form.  A common use-case for encoding a
+binary file is to compress it to save disk space.  Only data is modified by an
+encoding scheme.  Database metadata is never encoded.
+
+Support for encoding schemes is optional.  An implementation need not support
+any particular encoding scheme, or may only support certain operations with it,
+but should expect to encounter unknown encoding schemes and fail gracefully in
+such situations.
+
+Additionally, how a particular encoding is implemented is not specified by the
+Dirfile Standards, but, for purposes of interoperability, all dirfile
+implementations are encouraged to support the encoding implementation used by
+the GetData dirfile reference implementation, elaborated below.
+
+An encoding scheme is local to the particular
+.I format specification fragment
+in which it is indicated.  This allows a single dirfile to have binary files
+which are stored using multiple encodings, by having them defined in multiple
+fragments.
+
+The rest of this manual page discusses specifics of the encoding framework
+implemented in the GetData library, and does not constitute part of the
+Dirfile Standards.
+
+.SH THE GETDATA ENCODING FRAMEWORK
+
+The GetData library provides an encoding framework which abstracts binary file
+I/O, allowing for generic support for a wide variety of encoding schemes.
+Functions which may make use of the encoding framework are:
+.IP
+.BR gd_add "(3), " gd_add_raw "(3), " gd_add_spec (3),
+.BR gd_alter_encoding "(3), " gd_alter_endianness (3),
+.BR gd_alter_frameoffset "(3), " gd_alter_entry (3),
+.BR gd_alter_raw "(3), " gd_alter_spec "(3), " gd_getdata (3),
+.BR gd_move "(3), " gd_nframes "(3), " gd_putdata (3),
+and
+.BR gd_rename (3).
+.P
+Most of the encodings supported by GetData are implemented through external
+libraries which handle the actual file I/O and data translation.  All such
+libraries are optional; a build of the library which omits an external library
+will lack support for the associated encoding scheme.  In this case, GetData
+will still properly identify the encoding scheme, but attempts to use GetData
+for file I/O via the encoding will fail with the
+.B GD_E_UNSUPPORTED
+error code.
+
+GetData discovers the encoding scheme of a particular RAW field by noting the
+filename extension of files associated with the field.  Binary files which form
+an unencoded dirfile have no file extension.  The file extension used by the
+other encodings are noted below.  Encoding discovery proceeds by searching for
+files with the known list of file extensions (in an unspecified order) and
+stopping when the first successful match is made.  Because of this, when the a
+field has multiple data files with different, supported file extensions which
+could legitimately be associated with it, the encoding scheme discovered by
+GetData is not well defined.
+
+In addition to raw (unencoded) data, GetData supports eight other encoding
+schemes:
+.I text
+encoding,
+.I bzip2
+encoding,
+.I gzip
+encoding,
+.I lzma
+encoding, 
+.I sie
+(sample-index encoding),
+.I slim
+encoding,
+.I zzip
+encoding, and
+.I zzslim
+encoding, all discussed below.
+.PP
+The text encoding and the sample-index encoding are implemented by GetData
+natively and need no external library.  As a result, they are always present in
+the library.
+
+.SS 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.
+
+GetData caches an uncompressed megabyte of data at a time to speed access times.
+A call to
+.BR gd_nframes (3)
+requires decompression of the entire binary file to determine its uncompressed
+size, and may take some time to complete.
+The file extension of the BZip2 Encoding is
+.BR .bz2 .
+
+.SS GZip Encoding
+
+The GZip Encoding compresses raw binary files using Lempel-Ziv coding (LZ77) as
+implemented in the gzip format.  GetData's GZip Encoding scheme is implemented
+through the the
+.I zlib compression library
+written by Jean-loup Gailly and Mark Adler. 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.
+
+To speed the operation of
+.BR gd_nframes (3),
+the GZip Encoding takes the uncompressed size of the file the gzip footer, which
+contains the file's uncompressed size in bytes, modulo 2**32.  As a result,
+using a field with an (uncompressed) binary file size larger than 4\~GiB as the
+reference field will result in the wrong number of frames being reported.
+The file extension of the GZip Encoding is
+.BR .gz .
+
+.SS LZMA Encoding
+
+The LZMA Encoding reads compressed raw binary files using the Lempel-Ziv Markov
+Chain Algorithm (LZMA) as implemented in the xz container format.  GetData's
+LZMA Encoding scheme is implemented through the
+.IR "lzma library" ,
+part of the
+.I XZ Utils
+suite written by Lasse Collin, Ville Koskinen, and Igor Pavlov.  GetData's LZMA
+Encoding framework currently lacks write capabilities; as a result the LZMA
+Encoding does not support functions which modify binary data.
+
+As with the BZip2 Encoding, GetData caches an uncompressed megabyte of data at a
+time to speed access times.  A call to
+.BR gd_nframes (3)
+requires decompression of the entire binary file to determine its uncompressed
+size, and may take some time to complete.
+The file extension of the LZMA Encoding is
+.BR .xz ,
+or
+.BR .lzma .
+
+.SS Sample-Index Encoding
+
+The Sample-Index Encoding (SIE) compresses raw binary data by replacing runs of
+repeated data, similar to run-length encoding.  SIE files contain binary records
+consisting of a 64-bit sample number followed by a datum (the size and format of
+which is determined by the RAW field's data type in the format metadata).  The
+sample number indicates the last sample of the field which has the specified
+value.  The first sample with the value is the sample immediately following the
+data in the previous record, or sample number zero, for the first record.
+Sample numbers are relative to any
+.B /FRAMEOFFSET
+specified in the Dirfile metadata.  All operations are supported by the
+Sample-Index Encoding.  The file extension of the Sample-Index Encoding is
+.BR .sie .
+
+.SS Slim Encoding
+
+The Slim Encoding reads compressed raw binary files using the slimlib
+compression library written by Joseph Fowler.  The slimlib library was developed
+at Princeton University to compress dirfile-like data.  GetData's Slim Encoding
+framework currently lacks write capabilities; as a result, the Slim Encoding
+does not support function which modify binary files.  The file extension of the
+Slim Encoding is
+.BR .slm .
+
+Using the Slim Encoding with GetData may result in unexpected, but manageable,
+memory usage.  See the
+.BR gd_getdata (3)
+manual page for details.
+
+.SS Text Encoding
+
+The Text Encoding replaces the binary data files with 7-bit ASCII files
+containing a decimal text encoding of the data, one sample per line.  All
+operations are supported by the Text Encoding.  The file extension of the
+Text Encoding is
+.BR .txt .
+
+.SS ZZip Encoding
+
+The ZZip Encoding reads compressed raw binary files using the DEFLATE algorithm
+as implemented in the PKWARE ZIP archive container format.  GetData's ZZip
+Encoding scheme is implemented through the
+.I zzip library
+written by Tomi Ollila and Guido Draheim.  The ZZip Encoding framework
+currently lacks write capabilities; as a result the ZZip Encoding does not
+support functions which modify binary data.
+.PP
+Unlike most encoding schemes, the ZZip encoding merges all binary data files
+defined in a given fragment into a single ZIP archive.  The name of this
+archive is
+.I raw.zip
+by default, but a different name may be specified using the second parameter to
+the 
+.B /ENCODING
+directive.  For example,
+.IP
+.B /ENCODING zzip
+archive
+.PP
+indicates that the ZIP archive is called
+.IR archive.zip .
+The file extension of the ZZip Encoding is
+.BR .zip .
+
+.SS ZZSlim Encoding
+
+The ZZSlim Encoding is a convolution of the Slim Encoding and the ZZip Encoding.
+To create ZZSlim Encoded files, first the raw data are compressed using the
+slim library, and then these slim-compressed files are archived (and compressed
+again) into a ZIP archive.  As with the ZZip Encoding, the ZIP archive is
+.I raw.zip
+by default, but a different name may be specified with the
+.B /ENCODING
+directive.
+.PP
+Notably, since the archives have the same name as ZZip Encoded data, automatic
+encoding detection on ZZSlim Encoded data always fails: they are incorrectly
+identified as simply ZZip Encoded.  As a result, an
+.B /ENCODING
+directive in the format file or else a
+.B GD_ZZSLIM_ENCODED
+flag passed to
+.BR gd_open (3)
+is required to read ZZSlim encoded data.  The file extension of the ZZSlim
+Encoding is
+.BR .zip .
+
+Using the ZZSlim Encoding with GetData may result in unexpected, but manageable,
+memory usage.  See the
+.BR gd_getdata (3)
+manual page for details.
+
+.SH AUTHOR
+
+This manual page was written by D. V. Wiebe
+.nh
+<dvw at ketiltrout.net>.
+.hy 1
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile\-format (5),
+.BR bzip2 (1),
+.BR gzip (1),
+.BR xz (1),
+.BR zlib (3).
diff --git a/man/dirfile-format.5 b/man/dirfile-format.5
new file mode 100644
index 0000000..c1be545
--- /dev/null
+++ b/man/dirfile-format.5
@@ -0,0 +1,1557 @@
+.\" dirfile-format.5.  The dirfile format specification man page.
+.\"
+.\" Copyright (C) 2005, 2006, 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH dirfile\-format 5 "3 April 2013" "Standards Version 9" "DATA FORMATS"
+.SH NAME
+dirfile\-format \(em the dirfile database format specification file
+.SH DESCRIPTION
+The
+.I dirfile format specification
+fully specifies the raw and derived time streams and auxiliary information
+for a
+.BR dirfile (5)
+database.
+
+The format specification is contained in one or more case-sensitive text files
+located in the dirfile tree.  Each file is known as a
+.IR fragment .
+The primary fragment is the file called
+.B format
+located in the base dirfile directory.  This file may contain only part of
+the format specification, and may reference other fragments (using the
+.B /INCLUDE
+directive) containing further format specification.  This inclusion mechanism
+may be nested arbitrarily deep.
+
+The explicit text encoding of these files is not specified by these Standards,
+but it must be 7\-bit ASCII compatible. Examples of acceptable character
+encodings include all the ISO\~8859 character sets
+.RI ( i.e.
+Latin-1 through Latin-10, among others), as well as the UTF-8 encoding of
+Unicode and UCS.
+
+This document primarily describes the latest version of the Standards (Version
+9); differences with previous versions are noted where relevant.  A complete
+list of changes between versions is given in the
+.B HISTORY
+section below.
+
+.SH SYNTAX
+The format specification is composed of field specification lines and directive lines,
+optionally separated by blank lines or lines containing only whitespace.
+Lines are separated by the line-feed character (0x0A).  Unless escaped (see
+below), the hash mark
+.RB ( # )
+is the comment delimiter; the comment delimiter, and any text following it to
+the end of the line, is ignored.
+
+.SS Tokens
+Both field specification lines and directive lines consist of several tokens
+separated by whitespace.  Whitespace consists of one or more whitespace
+characters.  These are: space (0x20), horizontal tab (0x09), vertical tab
+(0x0B), form-feed (0x0C), and carriage return (0x0D).  The first token of a
+directive line is always a
+.IR "reserved word" .
+The first token of a field specification line is never a reserved word.  Any
+amount of whitespace may precede the first token on a line.
+
+Since tokens are separated by whitespace, to include a whitespace character in
+a token, it must either escaped by preceding it by a backslash character
+.RB ( \e ),
+or be replaced by a
+.I character escape sequence
+(see below), or else the token must be enclosed in quotation marks
+.RB ( """" ).
+The quotation marks themselves are stripped from the token. The
+.I null-token
+(that is, the token consisting of zero characters) may be specified by a pair
+of quotation marks with nothing between them
+.RB ( """""" ).
+To include a literal quotation mark in a token, it must be escaped
+.RB ( \e" ).
+Similarly, a hash mark may be included in a token by including it in a quoted
+token or else by escaping it
+.RB ( \e# ),
+otherwise the hash mark is understood as the comment delimiter.
+
+It is a syntax error to have a line which contains unmatched quotation marks, or
+in which the last character is the backslash character.
+
+Several characters when escaped by a preceding backslash character are
+interpreted as special characters in tokens.  The character escape sequences
+are:
+.RS
+.TP
+.B \ea
+an alert (bell) character (ASCII 0x07 / U+0007)
+.TP
+.B \eb
+a backspace character (ASCII 0x08 / U+0008)
+.TP
+.B \ee
+an escape character (ASCII 0x1B / U+001B)
+.TP
+.B \ef
+a form-feed character (ASCII 0x0C / U+000C)
+.TP
+.B \en
+a line-feed character (ASCII 0x0A / U+000A)
+.TP
+.B \er
+a carriage return character (ASCII 0x0D / U+000D)
+.TP
+.B \et
+a horizontal tab character (ASCII 0x09 / U+0009)
+.TP
+.B \ev
+a vertical tab character (ASCII 0x0B / U+000B)
+.TP
+.B \e\e
+a backslash character (ASCII 0x5C / U+005C)
+.TP
+.BI \e ooo
+the single byte given by the octal number
+.I ooo 
+(1 to 3 octal digits).
+.TP
+.BI \ex hh
+the single byte given by the hexadecimal number
+.I hh
+(1 or 2 hexadecimal digits).
+.TP
+.BI \eu hhhhhhh
+the UTF-8 byte sequence encoding the Unicode code point given by the hexadecimal
+number
+.I hhhhhhh
+(1 to 7 hexadecimal digits).
+.RE
+
+Any other character which is escaped is interpreted as the character itself.
+.RI ( i.e.
+.B \ec
+is interpreted as
+.BR c ;
+also, as pointed out above,
+.B \e"
+and
+.B \e#
+are interpreted as simply
+.B """"
+and
+.BR # ,
+without their special meanings).
+
+No token may contain the NULL character (ASCII 0x00 / U+0000).  Furthermore,
+although support is present to create UTF-8 byte sequences, tokens are not
+required to be valid UTF-8 sequences.  Any byte sequence not containing the NULL
+character forms a valid token.  However, there may be further restrictions on
+allowed characters for a token in a particular situation, (for example, when
+used as a field name).
+
+Standards Version 5 and earlier do not recognise the character escape sequences,
+nor allow quoting of tokens. As a result, they prohibit both whitespace and the
+comment delimiter from being used in tokens. 
+
+.SH DIRECTIVES
+
+There are ten 
+.IR directives ,
+each specified by a different
+.IR "reserved word", 
+which cannot be used as field names in the dirfile.  As of Standards Version 8,
+all reserved words start with an initial forward slash
+.RB ( / ),
+to distinguish them from field names.  Standards Versions 5, 6, and 7 permitted
+the omission of the initial forward slash, while in Standards Version 4 and
+earlier, reserved words may not have an initial forward slash.  Like the rest of
+the format specification, directives are case sensitive.
+
+A number of the directives have
+.IR "fragment scope" .
+A directive with fragment scope only applies to the fragment in which it is
+present, plus any sub-fragments indicated by the
+.B /INCLUDE
+directive, but only if those sub-fragments don't have their own corresponding
+directive.  Directives which have fragment scope are:
+.BR /ENCODING ", " /ENDIAN ", " /FRAMEOFFSET ", and " /PROTECT .
+Because of these scoping rules, different portions of the dirfile may have
+different encodings, endiannesses, frame offsets, or protection levels.
+
+If a directive with fragment scope appears more than once in a fragment, only
+the last such directive is honoured, with the exception that the effect of
+a directive is not propagated to sub-fragments if the directive line
+appears after the sub-fragment is included.  The scoping rules of the remaining
+directives are discussed below.
+
+.TP
+.B /ALIAS
+The /ALIAS directive defines an alternate name for a field defined elsewhere in
+the format specification (called the "target").  Aliases may not be used as the
+parent field in a
+.B /META
+directive, but are in most other ways indistinguishable from the target's
+original, canonical name.  Aliases may be chained (that is, the target name
+appearing in an /ALIAS directive may itself be an alias).  In this case, the new
+alias is another name for the target's own target.  Just as there is no
+requirement that the input fields of a derived field exist,
+it is not an error for the target of an alias to not exist.  Syntax is:
+.IP
+.RS
+.B /ALIAS
+.I <name> <target>
+.RE
+.IP
+A metafield alias may defined using the
+.IR <parent-field> / <alias-name>
+syntax for
+.I name
+in the /ALIAS directive.  No restriction is placed on
+.IR target ;
+specifically, a metafield alias may target a top-level field, or a metafield
+of with a different parent; conversely, a top-level alias may target a
+metafield.
+.IP
+A metafield alias may never appear as the parent part of a metafield field code,
+even if it refers to a top-level field.  That is, given the valid format:
+.IP
+.RS
+field1 \fBRAW UINT8\fR 1
+.br
+field1/meta \fBCONST FLOAT64\fR 0.0
+.br
+field2 \fBRAW UINT8\fR 1
+.br
+\fB/ALIAS\fR field2/alias field1
+.RE
+.IP
+the metafield
+.I field1/meta
+may not be referred to as
+.IR field2/alias/meta ,
+even though
+.I field2/alias
+is a valid field code referring to
+.IR field1 .
+.IP
+The /ALIAS directive has no scope: it is processed immediately.  It appeared in
+Standards Version 9.
+.TP
+.B /ENCODING
+The /ENCODING directive specifies the encoding scheme used to encode binary
+files in the dirfile.  The encoding scheme may be one of the predefined names
+listed below, which are described in more detail in
+.BR dirfile\-encoding (5),
+or any other site-specific encoding scheme.  The predefined scheme names are:
+.RS
+.TP
+.B none
+The dirfile is unencoded.
+.TP
+.B bzip2
+The dirfile is compressed using the bzip2 compression scheme.
+.TP
+.B gzip
+The dirfile is compressed using the gzip compression scheme.
+.TP
+.B lzma
+The dirfile is compressed using the LZMA compression scheme.
+.TP
+.B slim
+The dirfile is compressed using the slim compression scheme.
+.TP
+.B sie
+The dirfile is sample-index encoded (a variant of run-length encoding).
+.TP
+.B text
+The dirfile is text encoded.
+.TP
+.B zzip
+The dirfile is compressed and encapsulated using the zzip compression scheme.
+.TP
+.B zzslim
+The dirfile is compressed and encapsulated using a combination of the zzip
+and slim compression schemes.
+.PP
+Implementations should fail gracefully when encountering an unknown encoding
+scheme.  If no encoding scheme is specified, behaviour is implementation
+dependent.  Syntax is:
+.IP
+.B /ENCODING \fI<scheme> \fR[\fI<enc-datum>\fR]
+.PP
+The
+.I enc-datum
+token provides additional data for certain encoding schemes; see
+.BR dirfile-encoding (5)
+for details.  The form of enc-datum is not specified.
+.PP
+The /ENCODING directive has
+.IR "fragment scope" .
+It appeared in Standards Version 6.  The predefined schemes
+.nh
+.BR sie ", " zzip ", and " zzslim ,
+.hy
+and the optional
+.I enc-datum
+token, appeared in Standards Version 9; the predefined scheme
+.B lzma
+appeared in Standards Version 7; all other predefined schemes appeared in
+Standards Version 6.
+.RE
+.TP
+.B /ENDIAN
+The /ENDIAN directive specifies the endianness of the raw data in the database.
+The assumed endianness of raw data in dirfiles which omit this directive is
+implementation dependent.  Syntax
+is:
+.RS
+.IP
+.B /ENDIAN
+.RB "( " big " | " little " ) [ " arm " ]"
+.PP
+where the "arm" token should be included if double precision floating point data
+are stored in the ARM middle-endian format.  The /ENDIAN directive has
+.IR "fragment scope" .
+It appeared in Standards Version 5.  The optional
+.B arm
+token appeared in Standards Version 8.
+.RE
+.TP
+.B /FRAMEOFFSET
+The /FRAMEOFFSET directive specifies the frame number of the first frame for
+which data exists in binary files associated with
+.B RAW
+fields.  Syntax is:
+.RS
+.IP
+.BI /FRAMEOFFSET\~ <integer>
+.PP
+The /FRAMEOFFSET directive has
+.IR "fragment scope" .
+It appeared in Standards Version 1.
+.RE
+.TP
+.B /HIDDEN
+The /HIDDEN directive indicates that the specified field name is
+.IR hidden .
+The difference (if any) between a field name which is
+.I hidden
+and one that is not is implementation dependent.  Hiddenness is not inherited
+by metafields of the specified field.  Hiddenness applies to the name, not the
+field itself; it does not hide all aliases of the field-name, and if field-name
+an alias, the alias is hidden, not its target.  Syntax is:
+.RS
+.IP
+.BR /HIDDEN\~ <field-name>
+.PP
+A /HIDDEN directive must appear after the specification of
+.IR field-name ,
+(which occurs either in a field specification line, or an
+.B /ALIAS
+directive, or a
+.B /META
+directive) in the same fragment.
+.PP
+The /HIDDEN directive has no scope: it is processed immediately.  It appeared in
+Standards Version 9.
+.RE
+.TP
+.B /INCLUDE
+The /INCLUDE directive specifies another file (called a
+.IR "fragment" )
+to parse for additional format specification for the dirfile.  The inclusion is
+processed immediately, before the fragment containing the /INCLUDE directive
+(the
+.IR "parent fragment" )
+is parsed further.  RAW fields specified in the included fragment are located in
+the directory containing the fragment file, and not in the directory containing
+the parent fragment, and the binary file encoding may be different for each
+fragment.  The fragment may be specified either with an absolute path, or else a
+path relative to the directory containing the parent fragment.
+.IP
+The /INCLUDE directive may optionally specify a
+.I prefix
+and/or
+.I suffix
+to apply to field names defined in the included fragment.  If present, affixes
+are applied to all field-names (including aliases) defined in the included
+fragment and any fragments it further includes.  Affixes nest, with the affixes
+of the deepest inclusion innermost.  Affixes are not applied to the names of
+binary files associated with
+.B RAW
+fields.  Syntax is:
+.RS
+.IP
+.B /INCLUDE \fI<file> \fR[\fI<prefix> \fR[\fI<suffix>\fR]]
+.PP
+To specify only a suffix, use the null-token
+.RB ( """""" )
+as
+.IR prefix .
+The /INCLUDE directive has no scope: it is processed immediately.  It appeared
+in Standards Version 3.  The optional
+.I prefix
+and
+.I suffix
+appeared in Standards Version 9.
+.RE
+.TP
+.B /META
+The /META directive specifies a metafield attached to a particular parent
+field.  The field metadata may be of any allowed type except
+.BR RAW .
+Metafields are retrieved in exactly the same way as regular field data, but the
+.I field code
+specified consists of the parent and metafield names joined with a forward
+slash:
+.RS
+.IP
+.IB <parent-field> / <meta-field>
+.PP
+META fields may not be specified before their parent field has been.  Syntax is:
+.IP
+.B /META
+.I <parent-field>
+{field specification line}
+.PP
+The
+.I <parent-field>
+code may not be an alias.  As an illustration of this concept,
+.IP
+.B /META 
+pfield meta
+.B CONST FLOAT64
+3.291882
+.PP
+provides a scalar metadatum called
+.I meta
+with value 3.291882 attached to the field
+.IR pfield .
+This particular metafield may be referred to by the
+.I field code
+"pfield/meta".  Note that different parent fields may have metafields with
+the same name, since all references to metafields must include the parent
+field name.  Metafields may not themselves have further sub-metafields.
+.PP
+As an alternative to the /META directive, starting with Standards Version 7,
+a metafield may be specified by a standard field specification line, using
+.IP
+.IB <parent-field> / <meta-field>
+.PP
+as the field name.  That is, the above example metafield could have also been
+specified as:
+.IP
+pfield/meta
+.B CONST FLOAT64
+3.291882
+.PP
+The /META directive has no scope: it is processed immediately.  It appeared in
+Standards Version 6.
+.RE
+.TP
+.B /PROTECT
+The /PROTECT directive specifies the advisory protection level of the current
+fragment and of the
+.B RAW
+fields defined therein.  The protection level indicates whether writing to the
+fragment, or the binary data on disk is permitted.  Syntax is:
+.RS
+.IP
+.BI /PROTECT\~ <level>
+.PP
+Four advisory protection levels are defined:
+.TP
+.I none
+No protection at all: data and metadata may be freely changed.  This is the
+default, if no /PROTECT directive is present.
+.TP
+.I format
+The dirfile metadata is protected from change, but
+.B RAW
+data on disk may be modified.
+.TP
+.I data
+The
+.B RAW
+data on disk is protected from change, but metadata may be modified.
+.TP
+.I all
+Both metadata and data on disk are protected from change.
+.PP
+The /PROTECT directive has
+.IR "fragment scope" .
+It appeared in Standards Version 6.
+.RE
+.TP
+.B /REFERENCE
+The /REFERENCE directive specifies the name of the field to use as the dirfile's
+reference field (see
+.BR dirfile (5)).
+If no /REFERENCE directive is specified, the first
+.B RAW
+field encountered is used as the reference field.  The /REFERENCE directive must
+specify a
+.B RAW
+field.  Syntax is:
+.RS
+.IP
+.BI /REFERENCE\~ <field-code>
+.PP
+The /REFERENCE directive has
+.IR "global scope" :
+if multiple /REFERENCE directives appear in the dirfile metadata, only the last
+such is honoured.  It appeared in Standards Version 6.
+.RE
+.TP
+.B /VERSION
+The /VERSION directive specifies the particular version of the Dirfile Standards
+to which the dirfile format specification conforms.  This directive should
+occur before any version dependent syntax is encountered.  As of Standards
+Version 6, no such syntax exists, and this directive is provided primarily to
+ease forward compatibility.  Syntax is:
+.RS
+.IP
+.BI /VERSION\~ <integer>
+.PP
+The /VERSION directive has
+.IR "immediate scope" :
+its effect is immediate, and it applies only to metadata below it, including
+and propagating downwards to sub-fragments after the directive.
+.PP
+In Standards Version 8 and earlier, its effect also propagates upwards back to
+the parent fragment, and affects subsequent metadata.  Starting with Standards
+Version 9, this no longer happens.  As a result, a /VERSION directive which
+indicates a version of 9 or later never propagates upwards; additionally,
+/VERSION directives found in subfragments included in a Version 9 or later
+fragment aren't propagated upwards into that fragment, regardless of the
+Version of the subfragments.  The /VERSION directive appeared in Standards
+Version 5.
+.RE
+
+.SH FIELD SPECIFICATION LINES
+
+Any line which does not start with a
+.I reserved word
+is assumed to be a field specification line.  A field specification line
+consists of at least two tokens.  The first token is the
+.IR "field name" .
+The second token is the
+.IR "field type" .
+Subsequent tokens are field parameters.  The meaning and number these parameters
+depends on the field type specified.
+
+.SS Field Names
+The first token in a field
+specification line is the field name.  The field name consists of one or more
+characters, excluding both ASCII control characters (the bytes 0x01 through
+0x1F), and the characters
+.IP
+.B &\t/\t;\t<\t>\t|\t.
+.PP
+which are reserved (but see below for the use of
+.B /
+to specify metafields).
+The full stop
+.RB ( . )
+is allowed in Standards Version 5 and earlier.  The ampersand, semicolon, less
+than, greater than, and vertical line
+.RB ( "& / ; < > |" )
+are allowed in Standards Version 4 and earlier.  Furthermore, due to the lack
+of an escape or quoting mechanism (see 
+.B Tokens
+above), Standards Version 5 and earlier also prohibit whitespace and the
+comment delimiter
+.RB ( # )
+in field names.
+.PP
+The field name may not be
+.IR INDEX ,
+which is a special, implicit field which contains the integer frame index.
+Standards Version 5 and earlier also prohibit
+.IR FILEFRAM ,
+which was an alias for
+.IR INDEX .
+Field names are case sensitive.  Standards Version 3 and 4 restrict field names
+to 50 characters. Standards Version 2 and earlier restrict field names to 16
+characters. Additionally, the filesystem may put restrictions on the length 
+and acceptable characters of a
+.B RAW
+field name, regardless of Standards Version. 
+
+Starting in Standards Version 7, if the field name beginning a field
+specification line contains exactly one
+.B /
+character, the line is assumed to specify a metafield.  See the
+.B /META
+directive above for further details.  A field name may not contain more than one
+.BR / .
+
+.SS Field Types
+There are fifteen field types.  Of these, twelve are of vector type
+.RB ( BIT ", " DIVIDE ", " LINCOM ", " LINTERP ", " MPLEX ", " MULTIPLY ,
+.BR PHASE ", " POLYNOM ", " RAW ", " RECIP ", " SBIT ", and " WINDOW )
+and three are of scalar type
+.RB ( CONST ", " CARRAY ", and " STRING ).
+The eleven vector field types other than
+.B RAW
+fields are also called
+.IR "derived fields" ,
+since they derive their value from one or more input fields.
+.PP
+Five of these derived fields
+.RB ( DIVIDE ", " LINCOM ", " MPLEX ", " MULTIPLY ", and " WINDOW )
+may have more than one input field.  In situations where these input fields
+have differing sample rates, the sample rate of the derived field is the same
+as the sample rate of the first (left-most) input field specified.  Furthermore,
+the input fields are synchronised by aligning them on frame boundaries, assuming
+equally-spaced sampling throughout a frame, and using the last sample of each
+input field which did not occur after the sample of the derived field being
+computed.  That is, if the first and second input fields have sample rates
+.I s1
+and
+.IR s2 ,
+the derived field also has sample rate
+.I s1
+and, for every sample of the derived field,
+.IR n ,
+the
+.IR n 'th
+sample of the first field is used (since they have the same sample rate by
+definition), and the sample number used of the second field,
+.IR m ,
+is computed as:
+.IP
+\fIm\fR = \fBfloor\fR((\fIn\fR * \fIs2\fR) / \fIs1\fR).
+.PP
+Starting in Standards Version 6, certain scalar field parameters in the field
+specifications may be specified using
+.B CONST
+or
+.B CARRAY
+fields, instead of literal values.  A list of parameters for which this is
+allowed is given below in the
+.B Field Parameters
+section.
+.PP
+The possible fields types are:
+.TP
+.B BIT
+The BIT vector field type extracts one or more bits out of an input vector
+field as an unsigned number.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B BIT
+.I <input> <first-bit> \fR[\fI<num-bits>\fR]
+.PP
+which specifies
+.I fieldname
+to be the value of bits
+.I first-bit
+through
+.IR first-bit + num-bits -1
+of the input vector field
+.IR input ,
+when
+.I input
+is converted from its native type to an (endianness corrected) unsigned 64-bit
+integer.  If
+.I num-bits
+is omitted, it is assumed to be 1.  The
+.B SBIT
+field type is a signed version of this field type.  The optional
+.I num-bits
+parameter appeared in Standards Version 1.
+.RE
+.TP
+.B CARRAY
+The CARRAY scalar field type is a list of constants fully specified in the
+format specification metadata.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B CARRAY
+.I <type> <value0> <value1> <value2> ...
+.PP
+where
+.I type
+may be any supported native data type (see the description of the
+.B RAW
+field type below), and
+.IR value0 ", " value1 ,
+&c. are the values of successive elements in the scalar list interpreted as
+indicated by
+.IR type .
+No limit is placed on the number of elements in a
+.BR CARRAY .
+(Note: despite being multivalued, this is not considered a vector field since
+the elements of the
+.B CARRAY
+are not indexed by frames.)  It appeared in Standards Version 8.
+.RE
+.TP
+.B CONST
+The CONST scalar field type is a constant fully specified in the format
+specification metadata.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B CONST
+.I <type> <value>
+.PP
+where
+.I type
+may be any supported native data type (see the description of the
+.B RAW
+field type below), and
+.I value
+is the numerical value of the constant interpreted as indicated by
+.IR type .
+It appeared in Standards Version 6.
+.RE
+.TP
+.B DIVIDE
+The DIVIDE vector field type is the quotient of two vector fields.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B DIVIDE
+.I <field1> <field1>
+.PP
+The derived field is computed as:
+.IP
+fieldname = field1 / field2.
+.PP
+It was introduced in Standards Version 8.
+.RE
+.TP
+.B LINCOM
+The LINCOM vector field type is the linear combination of one, two or three
+input vector fields.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B LINCOM
+.RI [ <n> "] " "<field1> <a1> <b1> " [ "<field2> <a2> <b2> " [ "<field3> <a3>"
+.IR <b3> ]]
+.PP
+where
+.IR n ,
+if present, indicates the number of input vector fields (1, 2, or 3).  The
+derived field is computed as:
+.IP
+fieldname = (a1 * field1 + b1) + (a2 * field2 + b2) + (a3 * field3 + b3)
+.PP
+with the
+.I field2
+and
+.I field3
+terms included only if specified.
+
+If
+.I n
+is not specified, the number of fields is determined by looking at the supplied
+parameters.  Since it is possible to create a field code which is identical to
+a literal number, the third token on the line is assumed to be
+.I n
+if it the entire token can be parsed as a literal number using the rules
+outlined in
+.BR strtod (3).
+That is, if the field code specifying
+.I field1
+could be mistaken for a literal number,
+.I n
+must be specified to prevent ambiguity.  In standards Version 6 and earlier,
+.I n
+is mandatory.
+.RE
+.TP
+.B LINTERP
+The LINTERP vector field type specifies a table look up based on another vector
+field.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B LINTERP
+.I <input> <table>
+.PP
+where
+.I input
+is the input vector field for the table lookup, and
+.I table
+is the path to the lookup table file for the field.  If this path is relative,
+it is assumed to be relative to the directory containing the fragment defining
+this field.  The lookup table file is an ASCII text file with two whitespace
+separated columns of
+.I x
+and
+.I y
+values.  Values are linearly interpolated between the points specified in the
+lookup table.
+.RE
+.TP
+.B MPLEX
+The MPLEX vector field type permits the multiplexing of several low sample rate
+fields into a single data field of higher sample rate.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B MPLEX
+.I <input> <index> <count> \fR[\fI<period>\fR]
+.PP
+where
+.I input
+is the input vector containing the multiplexed fields,
+.I index
+is the vector containing the mutliplex index,
+.I count
+is the value of the multiplex index when the computed field is stored in
+.IR input ,
+and
+.IR period ,
+if present and non-zero, is the number of samples between successive occurrances
+of the value
+.I count
+in the index vector.  A
+.I period 
+of zero (or, equivalently, it's omission) indicates that either the value
+.I count
+is not equally spaced in the index vector, or else that the spacing is unknown. 
+Both
+.I count
+and
+.I period
+are integers, and
+.I period
+may not be negative.
+.PP
+At every sample
+.IR n ,
+the derived field is computed as:
+.IP
+fieldname[n] = (index == count) ? input[n] : fieldname[n - 1]
+.PP
+The
+.I index
+vector is converted to an integer type for comparison.  The value of the
+derived field before the first sample where
+.I index
+equals
+.I count
+is implementation dependent.
+.PP
+The values of
+.I count
+and
+.I period
+place no restrictions on values contained in
+.IR index .
+Specifically, particular values of
+.I index
+(including
+.IR count )
+need not be equally spaced (neither by
+.I period
+nor any other spacing);
+.I index
+need not ever take on the value
+.I count
+(in which case the value of the entirety of the derived field is
+implementation dependent).  Different MPLEX field definitions which use the
+same index vector may specify different
+.IR period s.
+MPLEX appeared in Standards Version 9.
+
+.RE
+.TP
+.B MULTIPLY
+The MULTIPLY vector field type is the product of two vector fields.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B MULTIPLY
+.I <field1> <field2>
+.PP
+The derived field is computed as:
+.IP
+fieldname = field1 * field2.
+.PP
+It appeared in Standards Version 2.
+.RE
+.TP
+.B PHASE
+The PHASE vector field type shifts an input vector field by the specified number
+of samples.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B PHASE
+.I <input> <shift>
+.PP
+which specifies
+.I fieldname
+to be the input vector field,
+.IR input ,
+shifted by
+.I shift
+samples.  A positive
+.I shift
+indicates a forward shift, towards the end-of-field.  Results of shifting past
+the beginning- or end-of-field is implementation dependent.  PHASE appeared in
+Standards Version 4.
+.RE
+.TP
+.B POLYNOM
+The POLYNOM vector field type specifies a polynomial function of a single input
+vector field.  Syntax is:
+.RS
+.IP
+.I <field_name>
+.B POLYNOM
+.I <input> <a0> <a1>
+.RI [ <a2> " [" <a3> " [" <a4> " [" <a5> ]]]]
+.PP
+where
+.I <input>
+is the input field code, and the order of the computed polynomial is determined
+by how many co-efficients are present in the specification.  The derived field
+is computed as:
+.IP
+fieldname = a0 + a1 * input + a2 * input**2 + a3 * input**3 + a4 * input**4
++ a5 * input**5
+.PP
+where
+.I **
+is the element-wise exponentiation operator, and the higher order terms are
+computed only if the corresponding co-efficients
+.RI a i
+are specified.  POLYNOM appeared in Standards Version 7.
+.RE
+.TP
+.B RAW
+The RAW vector field type specifies raw time streams on disk.  In this case, the
+field name should correspond to the name of the file containing the time stream.
+Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B RAW
+.I <type> <sample-rate>
+.PP
+where
+.I sample-rate
+is the number of samples per dirfile frame for the time stream and
+.I type
+is a token specifying the native data format type:
+.RS
+.TP
+.I UINT8
+unsigned 8-bit integer
+.TP
+.I INT8
+signed (two's complement) 8-bit integer
+.TP
+.I UINT16
+unsigned 16-bit integer
+.TP
+.I INT16
+signed (two's complement) 16-bit integer
+.TP
+.I UINT32
+unsigned 32-bit integer
+.TP
+.I INT32
+signed (two's complement) 32-bit integer
+.TP
+.I UINT64
+unsigned 64-bit integer
+.TP
+.I INT64
+signed (two's complement) 64-bit integer
+.TP
+.I FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.I FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.I COMPLEX64
+a 64-bit complex number consisting of two IEEE-754 standard 32-bit single
+precision floating point numbers representing the real and imaginary parts of
+the complex number (Standards Version 7 and later)
+.TP
+.I COMPLEX128
+a 128-bit complex number consisting of two IEEE-754 standard 64-bit double
+precision floating point numbers representing the real and imaginary parts of
+the complex number (Standards Version 7 and later).
+.RE
+
+For more information on the storage of complex valued data, see dirfile(5).
+Two additional type names exist:
+.I FLOAT
+is equivalent to
+.IR FLOAT32 ,
+and
+.I DOUBLE
+is equivalent to
+.IR FLOAT64 .
+Standards Version 9 deprecates these two aliases, but still allows them.
+
+All these type names (except those for complex data, which came later) were
+introduced in Standards Version 5.  Earlier Standards Versions specified data
+types with single character type aliases:
+
+.RS
+.TP
+.I c
+UINT8
+.TP
+.I u
+UINT16
+.TP
+.I s
+INT16
+.TP
+.I U
+UINT32
+.TP
+.IR i ", " S
+INT32
+.TP
+.I f
+FLOAT32
+.TP
+.I d
+FLOAT64
+.RE
+
+Types
+.IR INT8 ", " UINT64 ", " INT64 ", " COMPLEX64 ,
+and
+.I COMPLEX128
+are not supported before Standards Version 5, so no single character type
+aliases exist for these types.  These single character type aliases were
+deprecated in Standards Version 5 and removed in Standards Version 8.
+.RE
+.TP
+.B RECIP
+The RECIP vector field type computes the reciprocal of a single input vector
+field.  Syntax is:
+.RS
+.IP
+.I <field_name>
+.B RECIP
+.I <input> <dividend>
+.PP
+where
+.I <input>
+is the input field code and
+.I <dividend>
+is a scalar quantity.  The derived field is computed as:
+.IP
+fieldname = dividend / input.
+.PP
+RECIP appeared in Standards Version 8.
+.RE
+.TP
+.B SBIT
+The SBIT vector field type extracts one or more bits out of an input vector
+field as a signed number.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B SBIT
+.I <input> <first-bit> \fR[\fI<bits>\fR]
+.PP
+which specifies
+.I fieldname
+to be the value of bits
+.I first-bit
+through
+.IR first-bit + bits -1
+of the input vector field
+.IR input ,
+when
+.I input
+is converted from its native type to a (endianness corrected) signed 64-bit
+integer.  If
+.I bits
+is omitted, it is assumed to be 1.  The
+.B BIT
+field type is an unsigned version of this field type.  SBIT appeared in
+Standards Version 7.
+.RE
+.TP
+.B STRING
+The STRING scalar field type is a character string fully specified in the format
+file metadata.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B STRING
+.I <value>
+.PP
+where
+.I value
+is the string value of the field.  Note that
+.I value
+is a single token.  To include whitespace in the string, enclose
+.I value
+in quotation marks
+.RB ( """" ),
+or else escape the whitespace with the backslash character
+.RB ( \e ).
+STRING appeared in Standards Version 6.
+.RE
+.TP
+.B WINDOW
+The WINDOW vector field type isolates a portion of an input vector based on a 
+comparison.  Syntax is:
+.RS
+.IP
+.I <fieldname>
+.B WINDOW
+.I <input> <check> <op> <threshold>
+.PP
+where
+.I input
+is the vector containing the data to extract,
+.I check
+is the vector on which to test the comparison,
+.I threshold
+is the value against which
+.I check
+is compared, and
+.I op
+is one of the following tokens indicating the particular comparison performed:
+.RS
+.TP
+.I EQ
+data are extracted where
+.IR check ,
+converted to a 64-bit signed integer, equals
+.IR threshold ,
+.TP
+.I GE
+data are extracted where
+.IR check ,
+converted to a 64-bit floating-point number, is greater than or equal to
+.IR threshold ,
+.TP
+.I GT
+data are extracted where
+.IR check ,
+converted to a 64-bit floating-point number, is strictly greater than
+.IR threshold ,
+.TP
+.I LE
+data are extracted where
+.IR check ,
+converted to a 64-bit floating-point number, is less than or equal to
+.IR threshold ,
+.TP
+.I LT
+data are extracted where
+.IR check ,
+converted to a 64-bit floating-point number, is strictly less than
+.IR threshold ,
+.TP
+.I NE
+data are extracted where
+.IR check ,
+converted to a 64-bit signed integer, is not equal to
+.IR threshold ,
+.TP
+.I SET
+data are extracted where at least one bit set in
+.IR threshold
+is also set in
+.IR check ,
+when converted to a 64-bit unsigned integer,
+.TP
+.I CLR
+data are extracted where at least one bit set in
+.IR threshold
+is not set in
+.IR check ,
+when converted to a 64-bit unsigned integer,
+.RE
+.PP
+The storage type of
+.I threshold
+depends on the operator, and follows the interpretation of
+.IR check .
+It may never be complex valued.
+.PP
+Outside the region extracted, the value of the derived field is implementation
+dependent.
+.PP
+Note: with the
+.B EQ
+operator, this derived field type is very similar to the MPLEX field type above.
+The primary difference is that MPLEX mandates the value of the derived field
+outside the extracted region, while WINDOW does not.  WINDOW appeared in
+Standards Version 9.
+.RE
+
+.SS Field Parameters
+All input vector field parameters should be
+.I field codes
+(see below).  Additionally, the scalar field parameters listed may be either
+literal numbers or else the
+.I field code
+of a
+.B CONST
+field containing the value, or the
+.I field code
+of a
+.B CARRAY
+followed by a left angle bracket
+.RI ( < ),
+then an non-negative integer used as the
+.B CARRAY
+element index, then a right angle bracket
+.RI ( > ),
+that is:
+.IP
+.IB fieldcode < n >
+.PP
+If the angle
+brackets and element index are omitted from a
+.B CARRAY
+field code used as a parameter, the first element in the field (index zero) is
+assumed.
+.PP
+Field parameters which may be specified using a scalar field code are:
+.RS
+.TP
+.BR BIT ", " SBIT
+.IR bitnum ", " numbits
+.TP
+.B LINCOM
+any of the
+.IR m "i, or " b i
+.TP
+.B MPLEX
+.IR count ", " max
+.TP
+.B PHASE
+.I shift
+.TP
+.B POLYNOM
+any of the
+.IR a i
+.TP
+.B RAW
+.I spf
+.TP
+.B RECIP
+.I dividend
+.TP
+.B WINDOW
+.I threshold
+.RE
+.PP
+Since it is possible to create a field code which is identical to a literal
+number, a parameter is assumed to be the field code of a scalar field only if
+the entire token cannot be parsed as a literal number using the rules outlined
+in
+.BR strtod (3).
+For example, a
+.B CONST
+field whose field code consists solely of digits can never be used as a
+parameter in a field specification line.
+
+Starting in Standards Version 7, literal complex number is specified as two
+real (floating point) numbers separated by a semicolon
+.RB ( ; )
+with no intervening whitespace.  So, for example, the tokens
+.IP
+1;0 \t 0;1 \t 4;0 \t 0;5 \t 9.313e2;74.1
+.PP
+represent, respectively, the real unit, the imaginary unit, the real number
+four, the imaginary number
+.RI 5 i ,
+and the complex number
+.RI "931.3 + 74.1" i .
+Because the semicolon character cannot be used in field names, a complex valued
+literal can never be mistaken for a field code.  This allows, among other
+things, the composition of complex valued fields from purely real input fields.
+For example, a complex valued field,
+.IR z ,
+may be created from a real valued field
+.IR re ,
+representing the real part of the complex number, and the real valued field
+.IR im ,
+representing the imaginary part of the complex number, with the following
+.B LINCOM
+specification:
+.IP
+.I z
+.B LINCOM
+.I re
+1 0
+.I im
+0;1 0
+.PP
+Starting in Standards Version 9, in additional to decimal notation, literal
+integer parameters may be specified as hexadecimal numbers, by prefixing the
+number (after an optional
+.RB ' + '
+or
+.RB ' - '
+sign) with
+.B 0x
+or
+.BR 0X ,
+or as octal numbers, by prefixing the number with
+.BR 0 ,
+as described in
+.BR strtol (3).
+Similarly, floating point literal numbers (both purely real ones and
+components of complex literals) may be specified in hexadecimal by prefixing
+them with
+.B 0x
+or
+.BR 0X ,
+and using
+.B p
+or
+.B P
+as the binary exponent prefix, as described in the C99 standard.  Both uppercase
+and lowercase hexadecimal digits may be used.  In cases where a literal
+floating point number may apear, the tokens
+.B INF
+or
+.BR INFINITY ,
+optionally preceded by a
+.RB ' + '
+or
+.RB ' - '
+sign, and
+.BR NAN ,
+optionally immediately followed by
+.RB ' ( ',
+then a sequence of characters, then
+.RB ' ) ',
+and all disregarding case, will be interpreted as the special floating point
+values explained in
+.BR strtod (3).
+
+.SS Field Codes
+When specifying the input to a field, either as a scalar parameter, or as an
+input vector field to a
+.RB non- RAW
+vector field,
+.I field codes
+are used.  A
+.I field code
+is one of:
+.IP \(bu 4
+a simple field name, possibly an alias, indicating a vector or scalar field
+.IP \(bu 4
+a parent field name, followed by a forward slash, followed by a metafield name,
+indicating a metafield.  See the description of the
+.B /META
+directive above for further details. 
+.IP \(bu 4
+either of the above, followed by a period, followed by a
+.IR "representation suffix" ,
+but only if the field or metafield specified is not a
+.B STRING
+type field.
+.PP
+A 
+.IR "representation suffix"
+may be used used to extract a real number from a complex value.  The available
+suffixes and their meanings are:
+.TP
+.B .a
+This representation indicates the angle (in radians) between the positive real
+axis and the value (ie. the complex argument).  The argument is in the range
+[-pi, pi], and a branch cut exists along the negative real axis.  At the branch
+cut, -pi is returned if the imaginary part is -0, and pi is returned if the
+imaginary part is +0.  If
+.IR z =0,
+zero is returned.
+.TP
+.B .i
+This representation indicates the projection of the value onto the imaginary
+axis (ie. the imaginary part of the number).
+.TP
+.B .m
+This representation indicates the modulus of the value (ie. its absolute
+value).
+.TP 
+.B .r
+This representation indicates the projection of the value onto the real axis
+(ie.  the real part of the number).
+.PP
+If the specified field is purely real, the representations are calculated as
+if the imaginary part was equal to +0.  For example, given a complex valued
+vector,
+.IR z ,
+a vector containing the real part of
+.IR z ", "  re_z ,
+could be produced with:
+.IP
+.I re_z
+.B PHASE
+.I z.r
+0
+.PP
+and similarly for the complex field's imaginary part, argument, and absolute
+value.  (Although it should be pointed out this simplistic an example isn't
+strictly necessary, since
+.I z.r
+could be used wherever
+.I re_z
+would be.)
+
+.SH HISTORY
+
+This document describes Versions 9 and earlier of the Dirfile Standards.
+
+Version 9 of the Standards (April 2012) added the
+.B MPLEX
+and
+.B WINDOW
+field types, the
+.B /ALIAS
+and
+.B /HIDDEN
+directives, the affixes to
+.BR /INCLUDE ,
+the 
+.BR sie ", " zzip ,
+and
+.B zzslim
+encoding schemes, along with the optional
+.I enc_datum
+token to
+.BR /ENCODING .
+It permitted specification of integer literals in octal and hexadecimal.
+Finally, it deprecated the type aliases
+.I FLOAT
+and
+.IR DOUBLE .
+
+Version 8 of the Standards (November 2010) added the
+.BR DIVIDE ", " RECIP ,
+and
+.B CARRAY
+field types, made the forward slash on reserved words mandatory, and prohibited
+using the single character data type aliases in the specification of
+.B RAW
+fields.  It also introduced the optional second
+.RI ( arm )
+token to the
+.B /ENDIAN
+directive.
+
+Version 7 of the Standards (October 2009) added the
+.B SBIT
+and
+.B POLYNOM
+field types, and the directive-less method of specifying metafields.  It also
+introduced the data types
+.I COMPLEX128
+and
+.IR COMPLEX64 ,
+along with the notion of
+.IR representations ,
+and the
+.B lzma
+encoding scheme.  Finally, it made the number of fields parameter for
+.I LINCOM
+optional.
+
+Version 6 of the Standards (October 2008) added the
+.BR /ENCODING ", " /META ", " /PROTECT ", and " /REFERENCE
+directives, and the
+.B CONST
+and
+.B STRING
+field types.  It permitted whitespace in tokens and introduced the character
+escape sequences. It allowed
+.B CONST
+fields to be used as parameters in field specification lines.  It also removed
+.I FILEFRAM
+as an alias for
+.IR INDEX ,
+and prohibited
+.BR .
+but allowed
+.B #
+and
+.B \e
+in field names.
+
+Version 5 of the Standards (August 2008) added
+.B VERSION
+and
+.BR ENDIAN ,
+slash demarcation of reserved words, and removed the restriction on field
+name length.  It introduced the data types
+.IR INT8 ", " INT64 ,
+and
+.IR UINT64 ,
+the new-style type specifiers, and increased the range of the
+.B BIT
+field type from 32 to 64 bits.  It also prohibited the characters
+.B &;<>\e|
+in field names.
+
+Version 4 of the Standards (October 2006) added the
+.B PHASE
+field type.
+
+Version 3 of the Standards (January 2006) added
+.B INCLUDE 
+and increased the allowed length of a field name from 16 to 50 characters.
+
+Version 2 of the Standards (September 2005) added the
+.B MULTIPLY
+field type.
+
+Version 1 of the Standards (November 2004) added
+.B FRAMEOFFSET
+and the optional fourth argument to the
+.B BIT
+field type.
+
+Version 0 of the Standards (before March 2003) refers to the dirfile standards
+supported by the
+.BR getdata (3)
+library originally introduced into the
+.BR kst (1)
+sources, which contained support for all other features covered by this
+document.
+
+.SH AUTHORS
+
+The dirfile specification was developed by C. B. Netterfield
+.nh
+<netterfield at astro.utoronto.ca>.
+.hy 1
+
+Since Standards Version 3, the dirfile specification has been maintained by
+D. V. Wiebe
+.nh
+<getdata at ketiltrout.net>.
+.hy 1
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile\-encoding (5)
diff --git a/man/dirfile.5 b/man/dirfile.5
new file mode 100644
index 0000000..b2dd99f
--- /dev/null
+++ b/man/dirfile.5
@@ -0,0 +1,135 @@
+.\" dirfile.5.  The dirfile man page.
+.\"
+.\" Copyright (C) 2005, 2006, 2008, 2009, 2014 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH dirfile 5 "15 July 2014" "Standards Version 9" "DATA FORMATS"
+.SH NAME
+dirfile \(em a filesystem-based database format for time-ordered binary data
+.SH DESCRIPTION
+The
+.I dirfile
+database format is designed to provide a fast, simple format for storing and
+reading binary time-ordered data.  Dirfiles can be read using the GetData
+library.
+
+The dirfile database is centred around one or more time-ordered data streams (a
+.IR "time stream" ).
+Each time stream is written to disk in a separate file, in its native binary
+format.  The name of these binary files correspond to the time stream's
+.IR "field name" .
+Two time streams may have different constant sampling frequencies and mechanisms
+exist within the dirfile format to ensure these time streams remain properly
+sequenced in time.
+
+To do this, the time streams in the dirfile are subdivided into
+.IR frames .
+Each frame contains an integer number of samples of each time stream.  When
+synchronous retrieval of data from more than one time stream is required,
+position in the dirfile can be specified in frames, which will ensure
+synchronicity.
+
+The binary files are all located in a central directory, known as the
+.IR "dirfile directory" .
+The dirfile as a whole may be referred to by its dirfile directory path.
+
+Included in the dirfile along with the time streams is the
+.IR "dirfile format specification" ,
+which is an ASCII text file called
+.B format
+located in the dirfile directory.  This file fully specifies the dirfile's
+metadata.  For the syntax of this file, see
+.BR dirfile\-format (5).
+
+Version 3 of the Dirfile Standards introduced the
+.I "large dirfile"
+extension.  This extension added the ability to distribute the dirfile metadata
+among multiple files (called
+.IR fragments )
+in addition to the 
+.B format
+file, as well as the ability to house portions of the database in
+.IR subdirfiles .
+These subdirfiles may be fully fledged dirfiles in their own right, but may also
+be contained within a larger, parent dirfile.  See
+.BR dirfile\-format (5)
+for information on specifying these subdirfiles.
+
+In addition to the raw fields on disk, the dirfile format specification may
+also specify
+.I derived fields
+which are calculated from one or more raw or derived time streams.  Derived
+fields behave identically to raw fields when read via GetData.  See
+.BR dirfile\-format (5)
+for a complete list of derived field types.  Dirfiles may also contain both
+numerical and character string constant
+.IR "scalar fields" ,
+also further outlined in
+.BR dirfile\-format (5).
+
+Dirfiles are designed to be written to and read simultaneously. The dirfile
+specification dictates that one particular raw field (specified either
+explicitly or implicitly by the format specification) is to be used as the
+.IR "reference field" :
+all other vector fields are assumed to have at least as many frames as the
+reference field has, and the size (in frames) of the reference field is used as
+the size of the dirfile as a whole.
+
+Version 6 of the Dirfile Standards added the ability to encode the binary files
+on disk.  Each
+.I fragment
+may have its own encoding scheme. Notably this can be used to compress these
+files.  See
+.BR dirfile\-encoding (5)
+for information on encoding schemes.
+
+.SS Complex Number Storage Format
+Version 7 of the Dirfile Standards added support for complex valued data.
+Two types of complex valued data are supported by the Dirfile Standards:
+.IP \(bu 4
+A 64-bit complex number consisting of a IEEE-754 standard 32-bit single
+precision floating point real part and a IEEE-754 standard 32-bit single
+precision floating point imaginary part, and
+.IP \(bu 4
+A 128-bit complex number consisting of a IEEE-754 standard 64-bit double
+precision floating point real part and a IEEE-754 standard 64-bit double
+precision floating point imaginary part.
+.PP
+No integer-type complex numbers are supported.
+
+Unencoded complex numbers are stored on disk in "Fortran order", that is
+with the IEEE-754 real part followed by the IEEE-754 imaginary part.  The
+specified endianness of the two components follows that of purely real floating
+point numbers.  Endianness does not affect the ordering of the real and
+imaginary parts.  This format also conforms to the C99 and C++11 standards.
+
+To aid in using complex valued data, dirfile field codes may contain a
+.I representation suffix
+which specifies a function to apply to the complex valued data to map it into
+purely real data.  See
+.BR dirfile\-format (5).
+
+.SH AUTHORS
+
+The Dirfile format was developed by C. B. Netterfield
+.nh
+<netterfield at astro.utoronto.ca>.
+.hy 1
+It is now maintained by D. V. Wiebe
+.nh
+<getdata at ketiltrout.net>.
+.hy 1
+
+.SH SEE ALSO
+.BR dirfile\-encoding (5),
+.BR dirfile\-format (5)
diff --git a/man/dirfile2ascii.1 b/man/dirfile2ascii.1
new file mode 100644
index 0000000..68201f6
--- /dev/null
+++ b/man/dirfile2ascii.1
@@ -0,0 +1,163 @@
+.\" dirfile2ascii.1.  The dirfile2ascii man page.
+.\"
+.\" Copyright (C) 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH dirfile2ascii 1 "21 February 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+dirfile2ascii \(em output dirfile database vectors as ASCII text
+.SH SYNOPSIS
+.nh
+.ad l
+.HP
+\fBdirfile2ascii\fR [ \fIOPTION\fR ]... \fIDIRFILE\fR
+.RB "[ [ " \-a " | " \-A " | " \-e " | " \-E " | " \-F " | " \-g " | " \-G " |"
+.BR \-o " | " \-i " | " \-u " | " \-x " | " \-X " ]"
+.IR FIELD " ]..."
+.hy
+.ad n
+.SH DESCRIPTION
+Fetches data from a dirfile(5) database specified by
+.I DIRFILE
+and writes it as ASCII to standard output.  Any number of vector
+.IR FIELD s
+may be specified.  Each specified field is printed in a separate column.
+
+Mandatory arguments to long options are mandatory for short options too.
+.TP
+.BR \-d ", " \-\-delimeter =\fIdelim\fR
+separate columns by
+.IR delim .
+(Default: a single space.)
+.TP
+.BR \-f ", " \-\-first\-frame =\fIfirst_frame\fB\-\fIlast_frame\fR
+read from frame
+.I first_frame
+to frame
+.I last_frame
+(inclusive).
+.TP
+.BR \-f ", " \-\-first\-frame =\fIfirst_frame\fB:\fInframes\fR
+equivalent to \fB\-\-first\-frame\fR=\fIfirst_frame\fR
+\fB\-\-num-frames\fR=\fInframes\fR.
+.TP
+.BR \-f ", " \-\-first\-frame =\fIfirst_frame\fR
+If \fIfirst_frame\fR\~>=\~0, start reading at frame
+.IR first_frame .
+If 
+.I first_frame
+is -1 and \fB\-\-num-frames\fR=\fInframes\fR is specified, read the last
+.I nframes
+frames.  If
+.B \-\-first-frame
+is not specified, reading starts at frame zero.
+.TP
+.BR \-n ", " \-\-num\-frames =\fInframes\fR
+read at most
+.I nframes
+frames.  If not specified, or if \fBnframes\fR\~=\~0, all frames to the
+end-of-field are read.
+.TP
+.BR \-p ", " \-\-precision =\fIformat\fR
+use
+.I format
+to format output.
+.I format
+may contain any of the flag characters, a field width, and/or a precision as
+specified in
+.BR printf (3).
+It may \fInot\fR contain a length modifier.
+.TP
+.BR \-q ", " \-\-quiet
+don't write diagnostic messages on standard error.  (This is the default
+behaviour).
+.TP
+.BR \-s ", " \-\-skip =\fIframe_skip\fR
+if \fIframe_skip\fR\~>\~0, output only one sample for every
+.I frame_skip
+frames.
+.TP
+.BR \-v ", " \-\-verbose
+write diagnostic messages on standard error.
+.TP
+.BR \-z ", " \-\-fill =\fISTRING\fR
+Fill columns which go past the end of their corresponding field with the string
+.IR STRING .
+The default behaviour is to fill columns with floating-point conversions with
+.B NaN
+and columns with integer conversion with
+.BR 0 ,
+which mirrors what occurs when an attempt is made to print data from before the
+start of a field.  (Note: the default behaviour cannot be reproduced with this
+option, since
+.I STRING
+is applied to all columns, regardless of conversion type.)
+.P
+In addition to the above, each
+.I FIELD
+argument may be preceded by a short option, one of:
+.BR \-a ", " \-A ", " \-e ", " \-E ", " \-F ", " \-g ", " \-G ", " \-i ,
+.BR \-o ", " \-u ", " \-x ", " \-X ,
+indicating the conversion to be used.  See
+.BR printf (3)
+for the meaning of these conversion specifiers.  The output flags, width, and
+precision may be specified by using
+.BR \-\-precision .
+If no conversion specifier is given,
+.B %f
+is used.
+
+For conversion specifiers
+.BR %a ", " %A ", " %e ", " %E ", " %f ", " %F ", " %g ", " %G ,
+data is read from the dirfile as double precision floats.  For conversion
+specifier \fB%i\fR, data is read as 64-bit signed integers.  For conversion
+specifiers
+.BR %o ", " %u ", " %x ", " %X ,
+data is read as 64-bit unsigned integers.
+
+.SH LIMITATIONS
+No native support for printing complex data is provided.  This may be worked
+around by using dirfile(5) representation suffixes.  For example, the command
+.IP
+.B dirfile2ascii
+.I DIRFILE
+.IB FIELD .r
+.IB FIELD .i
+.P
+will print the real and imaginary parts of the complex valued field
+.I FIELD
+in the first and second columns, respectively.
+
+.SH AUTHOR
+
+dirfile2ascii was written by Matthew Truch and D. V. Wiebe.
+
+.SH REPORTING BUGS
+
+Please send reports of bugs to getdata\-devel at lists.sourceforge.net
+
+The GetData home page: <http://getdata.sourceforge.net/>
+
+.SH COPYRIGHT
+
+Copyright \(co 2010 Matthew Truch.
+
+dirfile2ascii is licenced under the GNU LPGL version 2.1 or later.
+
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+.SH SEE ALSO
+.BR defile (1),
+.BR dirfile (5),
+.BR printf (3)
diff --git a/man/gd_add.3 b/man/gd_add.3
new file mode 100644
index 0000000..05dc71b
--- /dev/null
+++ b/man/gd_add.3
@@ -0,0 +1,230 @@
+.\" gd_add.3.  The gd_add man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_add 3 "26 July 2012" "Version 0.8.1" "GETDATA"
+.SH NAME
+gd_add, gd_madd \(em add a field to a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_add(DIRFILE *" dirfile ", const gd_entry_t *" entry );
+.HP
+.BI "int gd_madd(DIRFILE *" dirfile ", const gd_entry_t *" entry ,
+.BI "const char *" parent );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_add ()
+function adds the field described by
+.I entry
+to the dirfile specified by
+.IR dirfile .
+The
+.BR gd_madd ()
+function behaves similarly, but adds the field as a metafield under the
+field indicated by the field code
+.IR parent .
+
+The form of
+.I entry
+is described in detail on the
+.BR gd_entry (3)
+man page.  All relevant members of
+.I entry
+for the field type specified must be properly initialised.  If
+.I entry
+specifies a
+.B CONST
+or
+.B CARRAY
+field, the field's data will be set to zero.  If
+.I entry
+specifies a
+.B STRING
+field, the field data will be set to the empty string.
+
+A metafield may be added either by calling
+.BR gd_madd ()
+with
+.IR entry -> field
+containing only the metafield's name, or else by calling
+.BR gd_add ()
+with the fully formed
+.IB <parent-field> / <meta-field>
+field code in
+.IR entry -> field .
+Regardless of which interface is used, when adding a metafield the value of
+.IR entry -> fragment_index
+is ignored and GetData will add the new metafield to the same format
+specification fragment in which the parent field is defined.  If the specified
+parent field name is an alias, the canonical name of the field will be
+substituted.
+
+Fields added with this interface may contain either literal parameters or
+parameters based on scalar fields.  If an element of the
+.IR entry -> scalar
+array defined for the specified field type is non-NULL, this element will be
+used as the scalar field code, and the corresponding numerical member will be
+ignored, and need not be initialised.  Conversely, if numerical parameters are
+intended, the corresponding
+.IR entry -> scalar
+elements should be set to NULL.  If using an element of a
+.B CARRAY
+field,
+.IR entry -> scalar_ind
+should also be set.
+
+.SH RETURN VALUE
+On success,
+.BR gd_add ()
+and
+.BR gd_madd ()
+return zero.   On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field name provided in
+.IR entry -> field
+contained invalid characters; or it or an input field did not contain the
+affected fragment's prefix or suffix. Alternately, the
+.I parent
+field code was not found, or was already a metafield.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_ENTRY
+There was an error in the specification of the field described by
+.IR entry ,
+or the caller attempted to add a field of type
+.B RAW
+as a metafield.
+.TP
+.B GD_E_BAD_INDEX
+The
+.IR entry -> fragment_index
+parameter was out of range.
+.TP
+.B GD_E_BAD_TYPE
+The
+.IR entry -> data_type
+parameter provided with a
+.BR RAW
+entry, or the
+.IR entry -> const_type
+parameter provided with a
+.B CONST
+or
+.B CARRAY
+entry, was invalid.
+.TP
+.B GD_E_BOUNDS
+The
+.IR entry -> array_len
+parameter provided with a
+.B CARRAY
+entry was greater than GD_MAX_CARRAY_LENGTH.
+.TP
+.B GD_E_DUPLICATE
+The field name provided in
+.IR entry -> field
+duplicated that of an already existing field.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, the creation of a
+.B RAW
+field was attempted and the data of the fragment was protected.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while creating an empty binary file to be associated with
+a newly added
+.B RAW
+field.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the indicated format specification fragment is not known
+to the library.  As a result, the library was unable to create an empty binary
+file to be associated with a newly added
+.B RAW
+field.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the indicated format specification fragment does not
+support creating an empty binary file to be associated with a newly added
+.B RAW
+field.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+GetData 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),
+.BR gd_add_carray (3),
+.BR gd_add_const (3),
+.BR gd_add_divide (3),
+.BR gd_add_lincom (3),
+.BR gd_add_linterp (3),
+.BR gd_add_multiply (3),
+.BR gd_add_phase (3),
+.BR gd_add_polynom (3),
+.BR gd_add_raw (3),
+.BR gd_add_recip (3),
+.BR gd_add_sbit (3),
+.BR gd_add_spec (3),
+.BR gd_add_string (3),
+.BR gd_entry (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_madd_bit (3),
+.BR gd_madd_carray (3),
+.BR gd_madd_const (3),
+.BR gd_madd_divide (3),
+.BR gd_madd_lincom (3),
+.BR gd_madd_linterp (3),
+.BR gd_madd_multiply (3),
+.BR gd_madd_phase (3),
+.BR gd_madd_polynom (3),
+.BR gd_madd_recip (3),
+.BR gd_madd_sbit (3),
+.BR gd_madd_spec (3),
+.BR gd_madd_string (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
diff --git a/man/gd_add_alias.3 b/man/gd_add_alias.3
new file mode 100644
index 0000000..de290ee
--- /dev/null
+++ b/man/gd_add_alias.3
@@ -0,0 +1,101 @@
+.\" gd_add_alias.3.  The gd_add_alias man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_add_alias 3 "26 July 2012" "Version 0.8.1" "GETDATA"
+.SH NAME
+gd_add_alias, gd_madd_alias \(em add a field to a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_add_alias(DIRFILE *" dirfile ", const char *" alias_name ,
+.BI "const char *" target_code ", int " fragment_index );
+.HP
+.BI "int gd_madd_alias(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" alias_name ", const char *" target_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_add_alias ()
+function adds the alias named
+.I alias_name
+pointing to
+.I target_code
+to the fragment indexed by
+.I fragment_index
+in the dirfile specified by
+.IR dirfile .
+The
+.BR gd_madd_alias ()
+function behaves similarly, but adds the field as a meta-entry under the field
+indicated by the field code
+.IR parent .
+
+.SH RETURN VALUE
+On success,
+.BR gd_add_alias ()
+and
+.BR gd_madd_alias ()
+return zero.   On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The
+.IR alias_name
+contained invalid characters; or it or an input field did not contain the
+affected fragment's prefix or suffix. Alternately, the
+.I parent
+field code was not found, or was already a metafield.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The
+.I fragment_index
+specified was out of range.
+.TP
+.B GD_E_DUPLICATE
+The
+.I alias_name
+parameter duplicated that of an already existing entry.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, the creation of a
+.B RAW
+field was attempted and the data of the fragment was protected.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH SEE ALSO
+.BR gd_add (3),
+.BR gd_alias_target (3),
+.BR gd_entry (3),
+.BR gd_madd (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
diff --git a/man/gd_add_bit.3 b/man/gd_add_bit.3
new file mode 100644
index 0000000..516df4b
--- /dev/null
+++ b/man/gd_add_bit.3
@@ -0,0 +1,395 @@
+.\" gd_add_bit.3.  The gd_add_bit man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_add_bit 3 "1 October 2013" "Version 0.8.6" "GETDATA"
+.SH NAME
+gd_add_bit, gd_add_carray gd_add_clincom, gd_add_const, gd_add_cpolynom,
+gd_add_crecip, gd_add_divide, gd_add_lincom, gd_add_linterp, gd_add_multiply,
+gd_add_phase, gd_add_polynom, gd_add_raw, gd_add_recip, gd_add_sbit,
+gd_add_string
+\(em add a field to a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_add_bit(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", int " bitnum ", int " numbits ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_carray(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "gd_type_t " const_type ", size_t " array_len ", gd_type_t " data_type ,
+.BI "void *" value ", int " fragment_index );
+.HP
+.BI "int gd_add_clincom(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "int " n_fields ", const char **" in_fields ", const double complex *" cm ,
+.BI "const double complex *" cb ", int " fragment_index );
+.HP
+.BI "int gd_add_const(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "gd_type_t " const_type ", gd_type_t " data_type ", void *" value ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_cpolynom(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "int " poly_ord ", const char *" in_fields ", const double complex *" ca ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_crecip(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", double complex " cdividend ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_divide(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field1 ", const char *" in_field2 ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_lincom(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "int " n_fields ", const char **" in_fields ", const double *" m ,
+.BI "const double *" b ", int " fragment_index );
+.HP
+.BI "int gd_add_linterp(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", const char *" table ", int " fragment_index );
+.HP
+.BI "int gd_add_mplex(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", const char *" count_field ,
+.BI "int " count_val ", int " period ", int " fragment_index );
+.HP
+.BI "int gd_add_multiply(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field1 ", const char *" in_field2 ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_phase(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", gd_shift_t " shift ", int " fragment_index );
+.HP
+.BI "int gd_add_polynom(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "int " poly_ord ", const char *" in_fields ", const double *" a ,
+.BI int " fragment_index );
+.HP
+.BI "int gd_add_raw(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "gd_type_t " data_type ", unsigned int " spf ", int " fragment_index );
+.HP
+.BI "int gd_add_recip(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", double " dividend ", int " fragment_index );
+.HP
+.BI "int gd_add_sbit(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", int " bitnum ", int " numbits ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_string(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" value ", int " fragment_index );
+.HP
+.BI "int gd_add_window(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", const char *" check_field ", gd_windop_t"
+.IB windop ", gd_triplet_t " threshold ", int " fragment_index );
+.hy
+.ad n
+.SH DESCRIPTION
+These functions provide alternatives to using the
+.BR gd_add (3)
+or
+.BR gd_add_spec (3)
+functions to add a new field of the indicated type to the dirfile specified by
+.IR dirfile .
+.PP
+In all of these calls,
+.I field_name
+indicates the name of the field to be added.  Further,
+.I fragment_index
+is the index of the format specification fragment into which the field should be
+added.  (To convert a fragment index to its file name, see
+.BR gd_fragmentname (3).)
+The meaning and valid types of other arguments may be obtained from the
+.BR gd_entry (3)
+and
+.BR dirfile-format (5)
+manual pages.
+
+The
+.BR gd_add_clincom ()
+and
+.BR gd_add_cpolynom ()
+functions are identical to
+.BR gd_add_lincom ()
+and
+.BR gd_add_polynom (),
+except they take complex scalar parameters, instead of purely real values.
+
+The
+.BR gd_add_lincom ()
+and
+.BR gd_add_clincom ()
+functions takes pointers to three arrays of length
+.I n_fields
+containing the input field names
+.RI ( in_fields ),
+the gain factors
+.RI ( m " or " cm ),
+and the offset terms
+.RI ( b " or " cb ).
+Similarly,
+.BR gd_add_polynom ()
+and
+.BR gd_add_cpolynom ()
+take an array of length
+.I poly_ord
++ 1
+containing the polynomial co-efficients
+.RI ( a " or " ca ).
+
+The
+.BR gd_add_string (),
+.BR gd_add_carry (),
+and
+.BR gd_add_const ()
+functions add the field and set the value of the field to
+.IR value .
+For
+.BR gd_add_const ()
+and
+.BR gd_add_carray (),
+the
+.I const_type
+argument specifies the storage type for the const, while
+.I data_type
+specifies the data type of the value pointed to by
+.IR value .
+
+The
+.B gd_shift_t
+type is a signed 64-bit integer type.  The
+.B gd_triplet_t
+type is defined as:
+.PP
+.in +4n
+.nf
+.fam C
+typedef union {
+  gd_int64_t i;
+  gd_uint64_t u;
+  double r;
+} gd_triplet_t;
+.fam
+.fi
+.in
+.PP
+Which element of this
+.B gd_triplet_t
+union to set depends on the operator selected for the
+.B WINDOW
+field.  See
+.BR gd_entry (3)
+for details.
+.PP
+A metafield may be added to the dirfile either by calling these functions with
+.I field_name
+containing the fully formed
+.IB <parent-field> / <meta-field>
+field code, or else by using the corresponding
+.BR gd_madd_ ...()
+function (see
+.BR gd_madd_bit (3),
+&c.) When adding a metafield with these functions,
+.I fragment_index
+is ignored and GetData will add the new metafield to the same format
+specification fragment in which the parent field is defined.  If the specified
+parent field name is an alias, the canonical name of the field will be
+substituted.
+
+All fields added with this interface must contain literal parameters.  Fields
+with scalar fields as parameters cannot be added with these functions.  Those
+fields must be added with
+.BR gd_add (3)
+or
+.BR gd_add_spec (3).
+
+See
+.B NOTES
+below for information on using
+.BR gd_add_clincom ()", " gd_add_cpolynom (),
+and
+.BR gd_add_crecip ()
+in the C89 GetData API.
+
+.SH RETURN VALUE
+On success, any of these functions returns zero.   On error, -1 is returned and
+the dirfile error is set to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The
+.IR field_name
+contained invalid characters; or it or an input field did not contain the
+affected fragment's prefix or suffix.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_ENTRY
+One or more of the field parameters specified was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The
+.IR fragment_index
+argument was out of range.
+.TP
+.B GD_E_BAD_TYPE
+The
+.IR data_type " or " const_type
+argument provided to
+.BR gd_add_raw "()  or " gd_add_const (),
+was invalid.
+.TP
+.B GD_E_BOUNDS
+The
+.I array_len
+parameter provided to
+.BR gd_add_carray ()
+was greater than GD_MAX_CARRAY_LENGTH.
+.TP
+.B GD_E_DUPLICATE
+The
+.IR field_name
+provided duplicated that of an already existing field.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, the creation of a
+.B RAW
+field was attempted and the data of the fragment was protected.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while creating an empty binary file to be associated with
+a newly added
+.B RAW
+field.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the indicated format specification fragment is not known
+to the library.  As a result, the library was unable to create an empty binary
+file to be associated with a newly added
+.B RAW
+field.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the indicated format specification fragment does not
+support creating an empty binary file to be associated with a newly added
+.B RAW
+field.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH NOTES
+GetData 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 (),
+and
+.BR gd_add_crecip ():
+.PP
+.nf
+.B #define GD_C89_API
+.B #include <getdata.h>
+.fi
+.HP
+.nh
+.ad l
+.BI "int gd_add_clincom(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "int " n_fields ", const char **" in_fields ", const double *" cm ,
+.BI "const double *" cb ", int " fragment_index );
+.HP
+.BI "int gd_add_cpolynom(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "int " poly_ord ", const char *" in_fields ", const double *" ca ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_add_crecip(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", const double " cdividend [2],
+.BI "int " fragment_index );
+.hy
+.ad n
+.PP
+In this case, the array pointers passed as
+.IR cm ", " cb
+or
+.IR ca
+should have twice as many (purely real) elements, consisting of alternating
+real and imaginary parts for the complex data.  That is, for example,
+.IR ca [0]
+should be the real part of the first co-efficient,
+.IR ca [1]
+the imaginary part of the first co-efficient,
+.IR ca [2]
+the real part of the second co-efficient,
+.IR ca [3]
+the imaginary part of the second co-efficient, and so on.  Similarly, the
+.I cdividend
+parameter becomes a double precision array of length two.
+.PP
+For
+.BR gd_add_clincom ()
+and
+.BR gd_add_cpolynom (),
+these are simply different (but equivalent) declarations of the C99 function
+entry point.  For
+.BR gd_add_crecip (),
+however, a different entry point is needed (since the
+.I cdividend
+parameter is passed by reference instead of by value).  In the interests of
+portability, the C89 version of
+.BR gd_add_crecip ()
+is always available, and may be accessed as
+.BR gd_add_crecip89 (),
+with the C89 prototype, in both the C99 and C89 APIs.
+
+
+.SH SEE ALSO
+.BR gd_add (3),
+.BR gd_add_spec (3),
+.BR gd_entry (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_madd_bit (3),
+.BR gd_madd_carray (3),
+.BR gd_madd_const (3),
+.BR gd_madd_divide (3),
+.BR gd_madd_lincom (3),
+.BR gd_madd_linterp (3),
+.BR gd_madd_mplex (3),
+.BR gd_madd_multiply (3),
+.BR gd_madd_phase (3),
+.BR gd_madd_polynom (3),
+.BR gd_madd_recip (3),
+.BR gd_madd_sbit (3),
+.BR gd_madd_string (3),
+.BR gd_madd_window (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
diff --git a/man/gd_add_spec.3 b/man/gd_add_spec.3
new file mode 100644
index 0000000..0af24cf
--- /dev/null
+++ b/man/gd_add_spec.3
@@ -0,0 +1,164 @@
+.\" gd_add_spec.3.  The gd_add_spec man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_add_spec 3 "4 November 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_add_spec, gd_madd_spec \(em add a field to a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_add_spec(DIRFILE *" dirfile ", const char *" line ,
+.BI "int " fragment_index );
+.HP
+.BI "int gd_madd_spec(DIRFILE *" dirfile ", const char *" line ,
+.BI "const char *" parent );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_add_spec ()
+function adds the field described by the field specification line in
+.I line
+to the dirfile specified by
+.IR dirfile .
+The
+.BR gd_madd_spec ()
+function behaves similarly, but adds the field as a metafield under the
+field indicated by the field
+.IR parent .
+Field specification lines are described in detail in
+.BR dirfile-format (5).
+Since Standards Version 7 (see dirfile(5)) permits specifying metafield without
+the use of the
+.B /META
+directive,
+.BR gd_add_spec ()
+may also be used to add metafields, by specifying the metafield's full field
+code.  See dirfile-format(5) for full details.
+
+When using
+.BR gd_madd_spec (),
+.I line
+should only contain a field specification, and not a
+.B /META
+directive.
+
+Passing these functions a directive line instead of a field specification line
+will result in a syntax error.  These functions never call the registered
+parser callback function, even if
+.IR line 
+contains a syntax error.
+
+.SH RETURN VALUE
+On success,
+.BR gd_add_spec ()
+and
+.BR gd_madd_spec ()
+return zero.   On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The
+.I parent
+field code was not found, or was already a metafield.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The
+.IR fragment_index
+argument was out of range.
+.TP
+.B GD_E_FORMAT
+A syntax error was encountered in
+.IR line .
+.TP
+.B GD_E_LINE_TOO_LONG
+The supplied
+.I line
+was longer than the parser was able to deal with.  Lines are limited by the
+storage size of
+.BR ssize_t .
+On 32-bit systems, this limits
+.I line
+to 2**31 bytes.  The limit is larger on 64-bit systems.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, the creation of a
+.B RAW
+field was attempted and the data of the fragment was protected.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while creating an empty binary file to be associated with
+a newly added
+.B RAW
+field.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the indicated format specification fragment is not known
+to the library.  As a result, the library was unable to create an empty binary
+file to be associated with a newly added
+.B RAW
+field.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the indicated format specification fragment does not
+support creating an empty binary file to be associated with a newly added
+.B RAW
+field.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_add (3),
+.BR gd_add_bit (3),
+.BR gd_add_carray (3),
+.BR gd_add_const (3),
+.BR gd_add_divide (3),
+.BR gd_add_lincom (3),
+.BR gd_add_linterp (3),
+.BR gd_add_multiply (3),
+.BR gd_add_phase (3),
+.BR gd_add_recip (3),
+.BR gd_add_raw (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_madd (3),
+.BR gd_madd_bit (3),
+.BR gd_madd_carray (3),
+.BR gd_madd_const (3),
+.BR gd_madd_divide (3),
+.BR gd_madd_lincom (3),
+.BR gd_madd_linterp (3),
+.BR gd_madd_multiply (3),
+.BR gd_madd_phase (3),
+.BR gd_madd_polynom (3),
+.BR gd_madd_recip (3),
+.BR gd_madd_string (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
diff --git a/man/gd_alias_target.3 b/man/gd_alias_target.3
new file mode 100644
index 0000000..9565130
--- /dev/null
+++ b/man/gd_alias_target.3
@@ -0,0 +1,81 @@
+.\" gd_alias_target.3.  The gd_alias_target man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alias_target 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_alias_target \(em return the target of an alias defined in a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char *gd_alias_target(DIRFILE *" dirfile ,
+.BI "const char *" alias_name );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_alias_target ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the target field code of the alias specified by
+.IR alias_name .
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+Note: the target may itself be the an alias, which will have its own target.  To
+obtain the canonical name of the field ultimately referenced by
+.IR alias_name ,
+pass it to
+.BR gd_entry (3)
+and inspect the
+.I field
+member of the gd_entry_t structure returned.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_alias_target ()
+returns a pointer to a read-only character string containing the name of the
+target of the specified alias.  On error,
+.BR gd_alias_target ()
+returns NULL and sets the dirfile error a non-zero error value.  Possible error
+values are:
+.TP 8
+.B GD_E_BAD_CODE
+The name
+.I alias_name
+was not found in the dirfile.
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The entry specified by
+.I alias_name
+was not an alias.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH SEE ALSO
+.BR gd_aliases (3),
+.BR gd_entry (3),
+.BR gd_open (3),
+.BR dirfile (5)
diff --git a/man/gd_aliases.3 b/man/gd_aliases.3
new file mode 100644
index 0000000..1a476a4
--- /dev/null
+++ b/man/gd_aliases.3
@@ -0,0 +1,84 @@
+.\" gd_aliases.3.  The gd_aliases man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_aliases 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_aliases \(em retrieve a list of aliases for a field in a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_aliases(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_aliases ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of aliases of the field specified by
+.IR field_code .
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The array returned will be de-allocated by a call to
+.BR gd_close (3)
+and should not be de-allocated by the caller.  The list returned should not be
+assumed to be in any particular order.  The array is terminated by a NULL
+pointer.  The number of strings in the array can be obtained from a call to
+.BR gd_naliases (3).
+
+The caller may not modify any strings in the array, or the array itself.  Doing
+so may cause database corruption.  The pointer returned is guaranteed to be
+valid until
+.BR gd_aliases ()
+is called again with the same arguments, or until the array is de-allocated by
+a call to
+.BR gd_close (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_aliases ()
+returns a pointer to an array of strings containing the values of all the
+aliases for the specified field.  The array is terminated by a NULL pointer.
+If successful, this list will always contain at least one entry, to wit:
+.IR field_code .
+
+On error it returns NULL and sets the dirfile error to a non-zero error value.
+Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The specified field code was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_alias_target (3),
+.BR gd_naliases (3)
diff --git a/man/gd_alter_affixes.3 b/man/gd_alter_affixes.3
new file mode 100644
index 0000000..3c0b890
--- /dev/null
+++ b/man/gd_alter_affixes.3
@@ -0,0 +1,112 @@
+.\" gd_alter_affixes.3.  The gd_alter_affixes man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alter_affixes 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_alter_affixes \(em modify the field affixes of a fragments in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_affixes(DIRFILE *" dirfile ", int " fragment_index ,
+.BI "const char *" prefix ", const char *" suffix );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_alter_affixes ()
+function sets the field prefix and suffix of fields defined in the format
+specification fragment given by
+.I fragment_index
+to
+.I prefix
+and
+.I suffix
+in the dirfile(5) database specified by
+.IR dirfile .
+
+The field prefix and suffix are appended to all field codes found in the
+specified fragment.  If the parent fragment to the modified fragment contains
+field affixes themselves, they should be included in the affixes passed to
+.BR gd_alter_affixes ().
+See EXAMPLES below for further details.  If
+.I prefix
+or
+.I suffix
+is NULL, the corresponding affix will be unchanged.  To remove an affix, set it
+to the parent fragment's corresponding affix, which may be the empty string
+("").
+
+It is not possible to set affixes on the root format file (i.e.
+.I fragment_index
+may not be zero).
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_alter_affixes ()
+returns zero.  On error, it returns -1 and sets the dirfile error to a non-zero
+error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The supplied
+.I prefix
+or
+.I suffix
+contained invalid characters.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.TP
+.B GD_E_DUPLICATE
+The supplied affixes would result in one or more field codes duplicating an
+existing field code.
+.TP
+.B GD_E_PROTECTED
+The metadata of the given fragment's parent fragment was protected from
+change.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH EXAMPLES
+Dealing with affixes of parent fragments is relatively straightforward.  Say,
+for instance, fragment #1 has a prefix "A" and a suffix "B" and fragment #2 is
+included from fragment #1.  In this case any prefix for fragment #2 must end
+with "A" and any suffix for fragment #2 must begin with "B".
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_fragment_affixes (3),
+.BR gd_include_affix (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_alter_bit.3 b/man/gd_alter_bit.3
new file mode 100644
index 0000000..04ee535
--- /dev/null
+++ b/man/gd_alter_bit.3
@@ -0,0 +1,353 @@
+.\" gd_alter_bit.3.  The gd_alter_bit man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alter_bit 3 "1 October 2013" "Version 0.8.6" "GETDATA"
+.SH NAME
+gd_alter_bit, gd_alter_carray, gd_alter_clincom, gd_alter_const,
+gd_alter_cpolynom, gd_alter_crecip, gd_alter_divide, gd_alter_lincom,
+gd_alter_linterp, gd_alter_multiply, gd_alter_phase, gd_alter_polynom,
+gd_alter_raw, gd_alter_recip, gd_alter_sbit
+\(em modify a field in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_bit(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", int " bitnum ", int " numbits );
+.HP
+.BI "int gd_alter_carray(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_type_t " const_type ", size_t " array_len );
+.HP
+.BI "int gd_alter_clincom(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "int " n_fields ", const char **" in_fields ", const double complex *" cm ,
+.BI "const double complex *" cb );
+.HP
+.BI "int gd_alter_const(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_type_t " const_type );
+.HP
+.BI "int gd_alter_cpolynom(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "int " poly_ord ", const char *" in_field ", const double complex *" ca );
+.HP
+.BI "int gd_alter_crecip(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", complex double " cdividend );
+.HP
+.BI "int gd_alter_divide(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field1 ", const char *" in_field2 );
+.HP
+.BI "int gd_alter_lincom(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "int " n_fields ", const char **" in_fields ", const double *" m ,
+.BI "const double *" b );
+.HP
+.BI "int gd_alter_linterp(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", const char *" table ", int " rename_table );
+.HP
+.BI "int gd_alter_mplex(DIRFILE *" dirfile ", const char *" field_name ,
+.BI "const char *" in_field ", const char *" count_field ,
+.BI "int " count_val ", int " period );
+.HP
+.BI "int gd_alter_multiply(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field1 ", const char *" in_field2 );
+.HP
+.BI "int gd_alter_phase(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", gd_shift_t " shift );
+.HP
+.BI "int gd_alter_polynom(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "int " poly_ord ", const char *" in_field ", const double *" ca );
+.HP
+.BI "int gd_alter_raw(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_type_t " data_type ", unsigned int " spf ", int " recode );
+.HP
+.BI "int gd_alter_recip(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", double " dividend );
+.HP
+.BI "int gd_alter_sbit(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", int " bitnum ", int " numbits );
+.HP
+.BI "int gd_alter_window(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", const char *" check_field ,
+.BI "gd_windop_t " windop ", gd_triplet_t " threshold );
+.hy
+.ad n
+.SH DESCRIPTION
+These functions provide alternatives to using the
+.BR gd_alter_entry (3)
+function to modify a field of the indicated type in the dirfile specified by
+.IR dirfile .
+.PP
+In all of these calls,
+.I field_code
+indicates the the field to be modified, which may be a regular field, or a
+metafield specified by its full (slashed) field code, but should not contain a
+representation suffix.  The meaning and valid
+types of other arguments may be obtained from the
+.BR get_entry (3)
+and
+.BR dirfile-format (5)
+manual pages.  The
+.B gd_shift_t
+type is a signed 64-bit integer type.  The
+.B gd_triplet_t
+type is defined as:
+.PP
+.in +4n
+.nf
+.fam C
+typedef union {
+  gd_int64_t i;
+  gd_uint64_t u;
+  double r;
+} gd_triplet_t;
+.fam
+.fi
+.in
+.PP
+Which element of this
+.B gd_triplet_t
+union to set depends on the operator selected for the
+.B WINDOW
+field.  See
+.BR gd_entry (3)
+for details.
+
+The
+.BR gd_alter_clincom ()
+and
+.BR gd_alter_cpolynom ()
+functions are identical to
+.BR gd_alter_lincom ()
+and
+.BR gd_alter_polynom (),
+except they take complex scalar parameters, instead of purely real values.  This
+only matters for the input of
+.I new
+parameters; if the scalar parameters are not
+changed (by passing NULL instead of a list of scalars), the functions can be
+used interchangeably, regardless of whether the altered field has complex scalar
+parameters or not.
+
+If the corresponding parameters are to be changed, the
+.BR gd_alter_lincom ()
+and
+.BR gd_alter_clincom ()
+functions take pointers to three arrays of length
+.I n_fields
+containing the input field names
+.RI ( in_fields ),
+the gain factors
+.RI ( m " or " cm ),
+and the offset terms
+.RI ( b " or " cb ).
+Similarly,
+.BR gd_alter_polynom ()
+and
+.BR gd_alter_cpolynom ()
+take an array of length
+.I poly_ord
++ 1 containing the polynomial co-efficients
+.RI ( a " or " ca ).
+
+Some field parameters have special values which indicate no change should be
+made to the parameter.  These special values are:
+.TP
+.B NULL\fR:
+any of the string parameters, also 
+.IR m ", " b ", " a ", " cm ", " cb ", or " ca ;
+.TP
+.B 0\fR:
+.IR spf ", " n_fields ", " numbits ", " cdividend ", " dividend ,
+or
+.IR array_len ;
+.TP
+.B -1\fR:
+.IR bitnum " or " period ;
+.TP
+.B GD_NULL\fR:
+.IR data_type " or " const_type ;
+.TP
+.B GD_WINDOP_UNK\fR:
+.IR windop .
+.PP
+All field parameters introduced with this interface must contain literal
+parameters.  Field parameters which are scalar fields cannot be introduced with
+these functions.  To do that, use
+.BR gd_alter_entry (3),
+.BR gd_alter_spec (3)
+or
+.BR gd_malter_spec (3),
+as appropriate.
+
+If
+.I rename_table
+is non-zero, the look-up table referenced by the
+.B LINTERP
+field will be renamed to the path given by
+.IR table .
+If
+.I recode
+is non-zero, the binary file associated with the
+.B RAW
+field will be re-encoded to reflect the new field parameters.  In this case,
+the field's I/O pointer will be reset to the beginning-of-frame.
+
+If
+.BR gd_alter_carray ()
+is used to increase the length of a
+.B CARRAY
+field, the added elements will be uninitialised.  Use
+.BR gd_put_carray_slice (3)
+or equivalent to initialise them.
+
+See
+.B NOTES
+below for information on using
+.BR gd_alter_clincom "(), " gd_alter_crecip (),
+and 
+.BR gd_alter_cpolynom ()
+in the C89 GetData API.
+
+.SH RETURN VALUE
+On success, any of these functions returns zero.   On error, -1 is returned and 
+the dirfile error is set to a non-zero error value.  Possible error values are:
+
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found, or a supplied field code did not contain the appropriate prefix
+or suffix.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_ENTRY
+One or more of the field parameters specified was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The field specified by
+.I field_code
+was of the wrong type for the function called.
+.TP
+.B GD_E_BAD_TYPE
+The
+.IR data_type " or " const_type
+argument was invalid.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, a request to
+translate the binary file associated with a
+.B RAW
+field was attempted, but the data of the fragment was protected.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while translating the binary file associated with a
+modified
+.B RAW
+field, or an I/O error occurred while attempting to rename a
+.B LINTERP
+table file.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the indicated format specification fragment is not known
+to the library.  As a result, the library was unable to translate the binary
+file be associated with a modified
+.B RAW
+field.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the indicated format specification fragment does not
+support translating the binary file associated with a modified
+.B RAW
+field.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH NOTES
+The C89 GetData API provides different prototypes for
+.BR gd_alter_clincom "(), " gd_alter_cpolynom (),
+and
+.BR gd_alter_crecip ():
+.PP
+.nf
+.B #define GD_C89_API
+.B #include <getdata.h>
+.fi
+.HP
+.nh
+.ad l
+.BI "int gd_alter_clincom(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "int " n_fields ", const char **" in_fields ", const double *" cm ,
+.BI "const double *" cb );
+.HP
+.BI "int gd_alter_cpolynom(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "int " poly_ord ", const char *" in_fields ", const double *" ca );
+.HP
+.BI "int gd_alter_crecip(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" in_field ", const double " cdividend [2]);
+.hy
+.ad n
+.PP
+In this case, the array pointers passed as
+.IR cm ", " cb
+or
+.IR ca
+should have twice as many (purely real) elements, consisting of alternating
+real and imaginary parts for the complex data.  That is, for example,
+.IR ca [0]
+should be the real part of the first co-efficient,
+.IR ca [1]
+the imaginary part of the first co-efficient,
+.IR ca [2]
+the real part of the second co-efficient,
+.IR ca [3]
+the imaginary part of the second co-efficient, and so on.  Similarly, the
+.I cdividend
+parameter becomes a double precision array of length two.
+.PP
+For
+.BR gd_alter_clincom ()
+and
+.BR gd_alter_cpolynom (),
+these are simply different (but equivalent) declarations of the C99 function
+entry point.  For
+.BR gd_alter_crecip (),
+however, a different entry point is needed (since the
+.I cdividend
+parameter is passed by reference instead of by value).  In the interests of
+portability, the C89 version of
+.BR gd_alter_crecip ()
+is always available, and may be accessed as
+.BR gd_alter_crecip89 (),
+with the C89 prototype, in both the C99 and C89 APIs.
+
+.SH SEE ALSO
+.BR gd_alter_entry (3),
+.BR gd_alter_spec (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_malter_spec (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
diff --git a/man/gd_alter_encoding.3.in b/man/gd_alter_encoding.3.in
new file mode 100644
index 0000000..eb9e636
--- /dev/null
+++ b/man/gd_alter_encoding.3.in
@@ -0,0 +1,153 @@
+.\" gd_alter_encoding.3.in.  The gd_alter_encoding man page.
+.\"
+.\" @configure_input@
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2014 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alter_encoding 3 "16 October 2014" "Version 0.8.6" "GETDATA"
+.SH NAME
+gd_alter_encoding \(em modify the binary encoding of data in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_encoding(DIRFILE *" dirfile ", unsigned int " encoding ,
+.BI "int " fragment_index ", int " recode );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_alter_encoding ()
+function sets the binary encoding of the format specification fragment given by
+.I fragment_index
+to the encoding specified by
+.I encoding
+in the dirfile(5) database specified by
+.IR dirfile .
+The binary encoding of a fragment indicate the encoding of data stored in binary
+files associated with
+.B RAW
+fields defined in the specified fragment.  The binary encoding of a fragment containing
+no
+.B RAW
+fields is ignored.
+
+The
+.I encoding
+argument should be one of the following:
+.IP
+.nh
+.ad l
+.BR GD_UNENCODED ,\~ GD_BZIP2_ENCODED ,\~ GD_GZIP_ENCODED ,\~
+.BR GD_LZMA_ENCODED ,\~ GD_SLIM_ENCODED  ,\~ GD_SIE_ENCODED ,\~
+.BR GD_TEXT_ENCODED .
+.ad n
+.hy
+.PP
+See
+.BR gd_cbopen (3)
+and dirfile-encoding(5) for the meanings of these symbols and details on the
+supported encoding schemes.
+.PP
+In addition to being simply a valid fragment index,
+.I fragment_index
+may also be the special value
+.BR GD_ALL_FRAGMENTS ,
+which indicates that the encoding of all fragments in the database should
+be changed.
+
+If the
+.I recode
+argument is non-zero, this call will recode the binary data of affected
+.B RAW
+fields to account for the change in binary encoding.  If the encoding of the
+fragment is encoding insensitive, or if the data type is only one byte in
+size, no change is made.  The I/O pointer of all affected
+.B RAW
+fields is reset to the beginning-of-frame.
+
+If
+.I recode
+is zero, affected binary files are left untouched.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_alter_encoding ()
+returns zero.  On error, it returns -1 and sets the dirfile error to a non-zero
+error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.TP
+.B GD_E_PROTECTED
+The metadata of the given format specification fragment was protected from
+change, or the binary data of the fragment was protected from change and binary
+file recoding was requested.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while attempting to recode a binary file.
+.TP
+.B GD_E_UNCLEAN_DB
+An error occurred while moving the recoded file into place.  As a result, the
+database may be in an unclean state.  See the
+.B NOTES
+section below for recovery instructions.  In this case, the dirfile will be
+flagged as invalid, to prevent further database corruption.  It should be
+immediately closed.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the fragment is unknown.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the fragment does not support binary file recoding.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+A binary file recoding occurs out-of-place.  As a result, sufficient space
+must be present on the filesystem for the binary files of all
+.B RAW
+fields in the fragment both before and after translation.  If all fragments
+are updated by specifying
+.BR GD_ALL_FRAGMENTS ,
+the recoding occurs one fragment at a time.
+
+An error code of
+.B GD_E_UNCLEAN_DB
+indicates a system error occurred while moving the re-encoded binary data into
+place or when deleting the old data.  If this happens, the database may be left
+in an unclean state.  The caller should check the filesystem directly to
+ascertain the state of the dirfile data before continuing.  For recovery
+instructions, see the file
+ at absolute_docdir@/unclean_database_recovery.txt.
+.SH SEE ALSO
+.BR gd_cbopen (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_encoding (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_alter_endianness.3.in b/man/gd_alter_endianness.3.in
new file mode 100644
index 0000000..bec720f
--- /dev/null
+++ b/man/gd_alter_endianness.3.in
@@ -0,0 +1,163 @@
+.\" gd_alter_endianness.3.  The gd_alter_endianness man page.
+.\"
+.\" @configure_input@
+.\"
+.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alter_endianness 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_alter_endianness \(em modify the byte sex of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_endianness(DIRFILE *" dirfile ", unsigned long"
+.IB byte_sex ", int " fragment_index ", int " recode );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_alter_endianness ()
+function sets the byte sex of the format specification fragment given by
+.I fragment_index
+to
+.I byte_sex
+in the dirfile(5) database specified by
+.IR dirfile .
+The byte sex of a fragment indicate the endianness of data stored in binary
+files associated with
+.B RAW
+fields defined in the specified fragment.  The byte sex of a fragment containing
+no
+.B RAW
+fields is ignored.
+
+The
+.I byte_sex
+argument should be one of the following:
+.TP
+.BR 0 " (zero)"
+Indicating that the byte sex should be the native endianness of the host,
+whichever that may be.
+.TP
+.B GD_BIG_ENDIAN
+Indicating that the byte sex should be big endian.
+.TP
+.B GD_LITTLE_ENDIAN
+Indicating that the byte sex should be little endian.
+.TP
+.RB ( GD_BIG_ENDIAN " | " GD_LITTLE_ENDIAN )
+Indicating that the byte sex should be the opposite of the native endianness of
+the host, whichever that may be.
+.PP
+Furthermore, any of these may be bitwise or'd
+with
+.B GD_ARM_ENDIAN
+or
+.B GD_NOT_ARM_ENDIAN
+indicating that the floating point data are stored in the ARM middle-endian
+format.
+.PP
+In addition to being simply a valid fragment index,
+.I fragment_index
+may also be the special value
+.BR GD_ALL_FRAGMENTS ,
+which indicates that the byte sex of all fragments in the database should
+be changed.
+
+If the
+.I recode
+argument is non-zero, this call will byte swap the binary data of affected
+.B RAW
+fields to account for the change in byte sex.  If the encoding of the
+fragment is endianness insensitive, or if the data type is only one byte in
+size, no change is made.  If
+.I recode
+is zero, affected binary files are left untouched.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_alter_endianness ()
+returns zero.  On error, it returns -1 and sets the dirfile error to a non-zero
+error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_ARGUMENT
+The supplied
+.I byte_sex
+was invalid.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.TP
+.B GD_E_PROTECTED
+The metadata of the indicated format specification fragment was protected from
+change, or the binary data of the fragment was protected from change and binary
+file byte swapping was requested.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while attempting to byte swap a binary file.
+.TP
+.B GD_E_UNCLEAN_DB
+An error occurred while moving the byte-swapped file into place.  As a result,
+the database may be in an unclean state.  See the
+.B NOTES
+section below for recovery instructions.  In this case, the dirfile will be
+flagged as invalid, to prevent further database corruption.  It should be
+immediately closed.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the fragment is unknown.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the fragment does not support binary file byte swapping.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+A binary file byte swap occurs out-of-place.  As a result, sufficient space
+must be present on the filesystem for the binary files of all
+.B RAW
+fields in the fragment both before and after translation.  If all fragments
+are updated by specifying
+.BR GD_ALL_FRAGMENTS ,
+the byte swapping occurs one fragment at a time.
+
+An error code of
+.B GD_E_UNCLEAN_DB
+indicates a system error occurred while moving the byte-swapped binary data into
+place or when deleting the old data.  If this happens, the database may be left
+in an unclean state.  The caller should check the filesystem directly to
+ascertain the state of the dirfile data before continuing.  For recovery
+instructions, see the file
+ at absolute_docdir@/unclean_database_recovery.txt.
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_endianness (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_alter_entry.3 b/man/gd_alter_entry.3
new file mode 100644
index 0000000..181dbb2
--- /dev/null
+++ b/man/gd_alter_entry.3
@@ -0,0 +1,278 @@
+.\" gd_alter_entry.3.  The gd_alter_entry man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alter_entry 3 "1 October 2013" "Version 0.8.6" "GETDATA"
+.SH NAME
+gd_alter_entry \(em modify the metadata of a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_entry(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const gd_entry_t *" entry ", int " recode );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_alter_entry ()
+function modifies the field specified by 
+.I field_code
+in the dirfile specified by
+.I dirfile
+to correspond to the new parameters specified by
+.IR entry .
+In addition to specifying a regular field,
+.I field_code
+may also refer to a metafield by specifying it using its full (slashed) field
+code.  However,
+.I field_code
+should never contain a representation suffix.
+
+The form of
+.I entry
+is described in detail in the
+.BR get_entry (3)
+man page.  The
+.IR entry -> field
+and
+.IR entry -> fragment_index
+members are ignored by this function and need not be initialised.  All other
+members appropriate to the field type of 
+.I field_code
+should be initialised, except as noted below.  To change the fragment index of a
+field, use
+.BR gd_move (3).
+To change the name of a field, use
+.BR gd_rename (3).
+
+If
+.I field_code
+specifies a
+.B RAW
+field and the
+.I recode
+argument is non-zero, the binary file associated with the field will be
+converted for changes in data type and samples-per-frame.  If
+.I recode
+is zero, no binary file conversion will take place.
+
+If
+.I field_code
+specifies a
+.B LINTERP
+field and the
+.I recode
+argument is non-zero, the look-up table file will be moved if
+.IR entry -> table
+specifies a different path.  If a file with the new pathname already exists, it
+will be overwritten.  If the field specified by
+.I field_code
+is of type other than
+.B RAW
+or
+.BR LINTERP ,
+the
+.I recode
+argument is ignored.
+
+If
+.I field_code
+specified a
+.B LINCOM
+or
+.B POLYNOM
+field, the value of
+.IR entry -> comp_scal
+indicates whether the purely real scalar lists
+.RI ( entry -> a ", or " entry -> b " and " entry -> m )
+or the complex valued lists
+.RI ( entry -> ca ", or " entry -> cb " and " entry -> cm )
+will be used.  The unused counterparts need not be initialised.
+
+The
+.IR entry -> field_type
+member must correspond to the field type of
+.IR field_code .
+This interface cannot be used to change the type of a given field.  To do so,
+delete the old field first with
+.BR gd_delete (3),
+and then create a new field of the desired type with
+.BR gd_add (3).
+
+Some entry members have special values which indicate no change should be
+made to the member.  These special values are:
+.TP
+.B NULL\fR:
+any of the string members, also 
+.IR m ", " b ", " a ", " cm ", " cb ", or " ca ;
+.TP
+.B 0\fR:
+.IR spf ", " n_fields ", " numbits ", " cdividend ", " dividend ", or " array_len ;
+.TP
+.B -1\fR:
+.IR bitnum " or " period ;
+.TP
+.B GD_NULL\fR:
+.IR data_type " or " const_type ;
+.TP
+.B GD_WINDOP_UNK\fR:
+.IR windop .
+.PP
+All
+.IR entry -> scalar
+elements relevant for the given field type must be initialised to one of the
+following values:
+.IP \(bu 4
+a pointer to a field code indicating a new scalar field to be used for the
+corresponding field parameter.  If the parameter was previously a literal
+number, it will be replaced by the specified field code.  If the parameter was
+previously a field code, the new field code will replace the old one.  If the
+field code specifies a
+.B CARRAY
+field, the corresponding
+.IR entry -> scalar_ind
+element should also be set.
+.IP \(bu 4
+a pointer to the empty string ("").  In this case, no change is made to the
+field code for the corresponding field parameter: if one already existed, it is
+kept, otherwise the corresponding literal numerical parameter is used.  If the
+value of the corresponding numerical
+.I entry
+member is the special value listed above indicating no change, no change is
+made to the field parameter at all.
+.IP \(bu 4
+the NULL pointer.  If the corresponding field parameter was previously a field
+code, the field code will be deleted and a literal number used instead.  In the
+special case when a scalar element is NULL and the corresponding numerical
+.I entry
+member contains a special value indicating no change listed above, GetData will
+de-reference the previous field code value and convert it into a literal number
+before removing the field code from the entry.
+.PP
+If this function is used to increase the length of a
+.B CARRAY
+field, the added elements will be uninitialised.  Use
+.BR gd_put_carray_slice (3)
+or equivalent to initialise them.
+
+.SH RETURN VALUE
+On success,
+.BR gd_alter_entry ()
+returns zero.   On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found or a supplied field code did not contain the appropriate prefix
+or suffix.  This error may also result from attempting to dereference a scalar
+field code which indicates a non-existent field.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_ENTRY
+One or more of the parameters specified in
+.I entry
+was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The
+.IR entry -> field_type
+parameter did not correspond to the type of the field specified by
+.IR field_code ,
+or an attempt was made to modify the immutable
+.I INDEX
+field.  This error may also result from attempting to dereference a scalar
+field code which does not indicate a
+.B CONST
+or
+.B CARRAY
+field.
+.TP
+.B GD_E_BAD_TYPE
+The
+.IR entry -> data_type
+parameter provided with a
+.BR RAW
+entry, or the
+.IR entry -> const_type
+parameter provided with a
+.BR CONST
+or
+.BR CARRAY
+entry, was invalid.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, a request to
+translate the binary file associated with a
+.B RAW
+field was attempted, but the data of the fragment was protected.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while translating the binary file associated with a
+modified
+.B RAW
+field, or an I/O error occurred while attempting to rename a
+.B LINTERP
+table file.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the indicated format specification fragment is not known
+to the library.  As a result, the library was unable to translate the binary
+file be associated with a modified
+.B RAW
+field.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the indicated format specification fragment does not
+support translating the binary file associated with a modified
+.B RAW
+field.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_alter_bit (3),
+.BR gd_alter_carray (3),
+.BR gd_alter_const (3),
+.BR gd_alter_divide (3),
+.BR gd_alter_lincom (3),
+.BR gd_alter_linterp (3),
+.BR gd_alter_multiply (3),
+.BR gd_alter_phase (3),
+.BR gd_alter_polynom (3),
+.BR gd_alter_raw (3),
+.BR gd_alter_recip (3),
+.BR gd_alter_spec (3),
+.BR gd_delete (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_malter_spec (3),
+.BR gd_metaflush (3),
+.BR gd_move (3),
+.BR gd_open (3),
+.BR gd_rename (3),
+.BR dirfile-format (5)
diff --git a/man/gd_alter_frameoffset.3.in b/man/gd_alter_frameoffset.3.in
new file mode 100644
index 0000000..521bcfd
--- /dev/null
+++ b/man/gd_alter_frameoffset.3.in
@@ -0,0 +1,141 @@
+.\" gd_alter_frameoffset.3.  The gd_alter_frameoffset man page.
+.\"
+.\" @configure_input@
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alter_frameoffset 3 "20 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_alter_frameoffset \(em modify the starting frame of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_frameoffset(DIRFILE *" dirfile ", off_t " offset ,
+.BI "int " fragment_index ", int " recode );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_alter_frameoffset ()
+function sets the frame offset of the format specification fragment given by
+.I fragment_index
+to
+.I offset
+in the dirfile(5) database specified by
+.IR dirfile .
+The frame offset of a fragment indicate the frame number of the first sample
+of data stored in binary files associated with
+.B RAW
+fields defined in the specified fragment.  The frame offset of a fragment
+containing no
+.B RAW
+fields is ignored.  The frame offset may not be negative.
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+In addition to being simply a valid fragment index,
+.I fragment_index
+may also be the special value
+.BR GD_ALL_FRAGMENTS ,
+which indicates that the frame offset of all fragments in the database should
+be changed.
+
+If the
+.I recode
+argument is non-zero, this call will shift the binary data of affected
+.B RAW
+fields to account for the change in frame offset.  If the new frame offset
+is larger than the old frame offset, this will result in permanent deletion of
+data from the database.  If the new frame offset is smaller than the old frame
+offset, the binary file will be padded at the front with zeroes.  If
+.I recode
+is zero, affected binary files are left untouched.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_alter_frameoffset ()
+returns zero.  On error, it returns -1 and sets the dirfile error to a non-zero
+error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.TP
+.B GD_E_PROTECTED
+The metadata of the given format specification fragment was protected from
+change, or the binary data of the fragment was protected from change and binary
+file shifting was requested.
+.TP
+.B GD_E_RANGE
+The supplied offset was less than zero.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while attempting to shift a binary file.
+.TP
+.B GD_E_UNCLEAN_DB
+An error occurred while moving the shifted file into place.  As a result, the
+database may be in an unclean state.  See the
+.B NOTES
+section below for recovery instructions.  In this case, the dirfile will be
+flagged as invalid, to prevent further database corruption.  It should be
+immediately closed.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the fragment is unknown.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the fragment does not support binary file shifting.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+A binary file shift occurs out-of-place.  As a result, sufficient space
+must be present on the filesystem for the binary files of all
+.B RAW
+fields in the fragment both before and after translation.  If all fragments
+are updated by specifying
+.BR GD_ALL_FRAGMENTS ,
+the shifting occurs one fragment at a time.
+
+An error code of
+.B GD_E_UNCLEAN_DB
+indicates a system error occurred while moving the shifted binary data into
+place or when deleting the old data.  If this happens, the database may be left
+in an unclean state.  The caller should check the filesystem directly to
+ascertain the state of the dirfile data before continuing.  For recovery
+instructions, see the file
+ at absolute_docdir@/unclean_database_recovery.txt.
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_frameoffset (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_alter_protection.3 b/man/gd_alter_protection.3
new file mode 100644
index 0000000..1025ece
--- /dev/null
+++ b/man/gd_alter_protection.3
@@ -0,0 +1,103 @@
+.\" gd_alter_protection.3.  The gd_alter_protection man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alter_protection 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_alter_protection \(em modify the protection level of a dirfile fragment
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_protection(DIRFILE *" dirfile ", int"
+.IB protection_level ", int " fragment_index );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_alter_protection ()
+function sets the advisory protection level of the format specification fragment
+given by
+.I fragment_index
+to
+.I protection_level
+in the dirfile(5) database specified by
+.IR dirfile .
+
+The
+.I protection_level
+argument should be one of the following:
+.TP
+.BR GD_PROTECT_NONE
+Indicating that the fragment should not be protected at all.
+.TP
+.B GD_PROTECT_FORMAT
+Indicating that the fragment's metadata should be protected.
+.TP
+.B GD_PROTECT_DATA
+Indicating that the fragment's binary data should be protected.
+.TP
+.B GD_PROTECT_ALL
+Indicating that both the fragment's metadata and its binary data should be
+protected.  This symbol is equivalent to the bitwise or of
+.B GD_PROTECT_FORMAT
+and
+.BR GD_PROTECT_DATA .
+.PP
+In addition to being simply a valid fragment index,
+.I fragment_index
+may also be the special value
+.BR GD_ALL_FRAGMENTS ,
+which indicates that the protection level of all fragments in the database
+should be changed.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_alter_protection ()
+returns zero.  On error, it returns -1 and sets the dirfile error to a non-zero
+error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ARGUMENT
+The supplied
+.I protection_level
+was invalid.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.TP
+.B GD_E_BAD_PROTECTION
+The supplied protection level was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+This is the only GetData function which ignores the (existing) protection
+level of a format specification fragment.
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_protection (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_alter_spec.3 b/man/gd_alter_spec.3
new file mode 100644
index 0000000..5d11cf8
--- /dev/null
+++ b/man/gd_alter_spec.3
@@ -0,0 +1,175 @@
+.\" gd_alter_spec.3.  The gd_alter_spec man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_alter_spec 3 "17 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_alter_spec, gd_malter_spec \(em modify a field in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_alter_spec(DIRFILE *" dirfile ", const char *" line ,
+.BI "int " recode );
+.HP
+.BI "int gd_malter_spec(DIRFILE *" dirfile ", const char *" line ,
+.BI "const char *" parent ", int " recode );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_alter_spec ()
+function modifies the field described by the field specification line in
+.I line
+to the dirfile specified by
+.IR dirfile .
+The
+.BR gd_malter_spec ()
+function behaves similarly, but modifies the metafield under the field
+indicated by the field code
+.IR parent .
+Field specification lines are described in detail in
+.BR dirfile-format (5).
+
+The name of the field to be modified, which must already exist, will be
+obtained from the field specification line.  When adding a metafield, 
+.I line
+should only contain a field specification, and not a
+.B /META
+directive.
+
+If the modified field is of type
+.B RAW
+and the
+.I recode
+argument is non-zero, the binary file associated with the field will be
+converted for changes in data type and samples-per-frame.  If
+.I recode
+is zero, no binary file conversion will take place.
+
+If the modified field is of type
+.B LINTERP
+and the
+.I recode
+argument is non-zero, the look-up table file will be moved if
+.I line
+specifies a different path, overwriting an existing file with the new
+pathname, if present.  If the field specified by
+.I field_code
+is of type other than
+.B RAW
+or
+.BR LINTERP ,
+the
+.I recode
+argument is ignored.
+
+Passing these functions a directive line instead of a field specification line
+will result in a syntax error.  These functions never call the registered
+parser callback function, even if
+.IR line 
+contains a syntax error.
+
+.SH RETURN VALUE
+On success,
+.BR gd_alter_spec ()
+and
+.BR gd_malter_spec ()
+return zero.   On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified in
+.I line
+was not found, or the
+.I parent
+field code was not found.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_FORMAT
+A syntax error was encountered in
+.IR line .
+.TP
+.B GD_E_LINE_TOO_LONG
+The supplied
+.I line
+was longer than the parser was able to deal with.  Lines are limited by the
+storage size of
+.BR ssize_t .
+On 32-bit systems, this limits
+.I line
+to 2**31 bytes.  The limit is larger on 64-bit systems.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.  Or, a request to
+translate the binary file associated with a
+.B RAW
+field was attempted, but the data of the fragment was protected.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while translating the binary file associated with a
+modified
+.B RAW
+field, or an I/O error occurred while attempting to rename a
+.B LINTERP
+table file.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the indicated format specification fragment is not known
+to the library.  As a result, the library was unable to translate the binary
+file be associated with a modified
+.B RAW
+field.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the indicated format specification fragment does not
+support translating the empty binary file associated with a modified
+.B RAW
+field.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH 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),
+.BR gd_alter_entry (3),
+.BR gd_alter_lincom (3),
+.BR gd_alter_linterp (3),
+.BR gd_alter_multiply (3),
+.BR gd_alter_phase (3),
+.BR gd_alter_raw (3),
+.BR gd_alter_spec (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile-format (5)
diff --git a/man/gd_bof.3 b/man/gd_bof.3
new file mode 100644
index 0000000..4355201
--- /dev/null
+++ b/man/gd_bof.3
@@ -0,0 +1,117 @@
+.\" gd_bof.3.  The gd_bof man page.
+.\"
+.\" Copyright (C) 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_bof 3 "17 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_bof \(em report the start of data in a field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "off_t gd_bof(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_bof ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the sample number of the beginning-of-field marker for the vector
+field given by
+.IR field_code .
+
+The caller should not assume that the beginning-of-field marker falls on a
+frame boundary.  The beginning-of-field marker is never negative.
+
+For a
+.B RAW
+field, the beginning-of-field corresponds to the frame offset of that field
+(see
+.BR gd_frameoffset (3)).
+The beginning-of-field for all other vector field type is the same as the
+beginning-of-field of whichever of its input fields that starts latest.  The
+beginning-of-field marker for the special field
+.I INDEX
+is always zero.
+
+The beginning-of-field marker for a field containing no data is in the same
+location as, or after, its end-of-field marker (see
+.BR gd_eof (3)).
+For a
+.B RAW
+field, the difference between the locations of the beginning- and end-of-field
+markers indicates the number of samples of data actually stored on disk.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_bof ()
+returns the sample number of the end-of-field marker for the indicated field.
+On error, it returns -1 and sets the dirfile error to a non-zero error value.
+Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+or one of the fields it uses as input was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of its inputs was not recognised.
+.TP
+.B GD_E_DIMENSION
+A scalar field was found where a vector field was expected in the definition
+of
+.I field_code 
+or one of its inputs, or else
+.I field_code
+itself specified a scalar field.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR gd_open (3),
+.BR gd_eof (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_nframes (3)
diff --git a/man/gd_bof64.3 b/man/gd_bof64.3
new file mode 100644
index 0000000..1118b6c
--- /dev/null
+++ b/man/gd_bof64.3
@@ -0,0 +1,54 @@
+.\" gd_bof64.3.  The gd_bof64 man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_bof64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_bof64 \(em retrieve data from a dirfile database, with largefile support
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_off64_t gd_bof64(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_bof (3)
+uses a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+It is only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), this function will the same as
+.BR gd_bof (3).
+Otherwise,
+.BR gd_bof (3)
+will be a version of this function which uses a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_bof (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_carray_len.3 b/man/gd_carray_len.3
new file mode 100644
index 0000000..d26db17
--- /dev/null
+++ b/man/gd_carray_len.3
@@ -0,0 +1,88 @@
+.\" 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_carrays.3 b/man/gd_carrays.3
new file mode 100644
index 0000000..f79e5ab
--- /dev/null
+++ b/man/gd_carrays.3
@@ -0,0 +1,144 @@
+.\" gd_carrays.3.  The gd_carrays man page.
+.\"
+.\" Copyright (C) 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_carrays 3 "17 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_carrays \(em retrieve a list of CARRAY values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const gd_carray_t *gd_carrays(DIRFILE *" dirfile ", gd_type_t
+.IB return_type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_carrays ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of values of the all
+.B CARRAY
+fields defined in the database, after type conversion to the data type
+specified by
+.IR return_type .
+Notably, this list does not include /META subfields.  For a list of valid
+symbols to use for
+.IR return_type ,
+see the
+.BR gd_get_carray (3)
+man page.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The array returned will be de-allocated by a call to
+.BR gd_close (3)
+and should not be de-allocated by the caller.  The list returned should not be
+assumed to be in any particular order, except that it is guaranteed to be in the
+same order as the list of
+.B CARRAY
+fields returned by
+.BR gd_field_list_by_type (3).
+The number of values in the array can be obtained from a call to
+.BR gd_nfields_by_type (3).
+
+The caller may not modify any values in the array, nor the array itself.  Doing
+so may cause database corruption.  The pointer returned is guaranteed to be
+valid only until
+.BR gd_carrays ()
+is called again with the same arguments, or until the dirfile's metadata is
+modified (by adding, modifying or deleting an entry), or until the array is
+de-allocated by a call to
+.BR gd_close (3).
+
+A corresponding list of names for these fields may be obtained by calling
+.BR gd_field_list_by_type (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_carrays ()
+returns a pointer to an array of
+.B gd_carray_t
+objects containing the values of all the CARRAYs defined in the dirfile
+database.  The
+.B gd_carray_t
+is defined as:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  size_t       n;              /* array_len */
+  void        *d;              /* CARRAY data */
+} gd_carray_t;
+.fam
+.fi
+.in
+.PP
+where
+.I n
+specifies the length of the
+.B CARRAY
+data, and
+.I d
+is an array of the data values themselves.  The caller should cast the
+.B void
+pointer to a type appropriate for the
+.I return_type
+specified.  The list is terminated by an end-of-list marker consisting of a
+.B gd_carray_t
+item with
+.I n
+set to zero.
+
+If no CARRAYs are defined in the database, a list containing only the
+end-of-list marker is returned.  On error,
+.BR gd_carrays ()
+returns NULL and sets the dirfile error to a non-zero error value.  Possible
+error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_TYPE
+The
+.I return_type
+specified was invalid.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_field_list_by_type (3),
+.BR gd_get_carray (3),
+.BR gd_nfields_by_type (3)
diff --git a/man/gd_cbopen.3 b/man/gd_cbopen.3
new file mode 100644
index 0000000..0484b60
--- /dev/null
+++ b/man/gd_cbopen.3
@@ -0,0 +1,741 @@
+.\" gd_cbopen.3.  The gd_cbopen man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_cbopen 3 "3 April 2013" "Version 0.8.4" "GETDATA"
+.SH NAME
+gd_cbopen, gd_open \(em open or create a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "DIRFILE* gd_cbopen(const char *" dirfilename ", unsigned long"
+.IB flags ", gd_parser_callback_t " sehandler ", void *" extra );
+.HP
+.BI "DIRFILE* gd_open(const char *" dirfilename ", unsigned long " flags );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_cbopen ()
+function opens or creates the dirfile specified by
+.IR dirfilename ,
+returning a DIRFILE object associated with it.  Opening a dirfile will cause the
+library to read and parse the dirfile's format specification (see
+.BR dirfile-format (5)).
+
+If not NULL,
+.I sehandler
+should be a pointer to a function which will be called whenever a syntax error
+is encountered during parsing the format specification.  Specify NULL for this
+parameter if no callback function is to be used.  The caller may use this
+function to correct the error or modify the error handling of the format
+specification parser.  See
+.B The Callback Function
+section below for details on this function.  The
+.I extra
+argument allows the caller to pass data to the callback function.  The pointer
+will be passed to the callback function verbatim.
+
+The
+.BR gd_open ()
+function is equivalent to
+.BR gd_cbopen (),
+with
+.I sehandler
+and
+.I extra
+set to NULL.
+
+The 
+.I flags
+argument should include one of the
+.IR "access modes" :
+.B GD_RDONLY
+(read-only) or 
+.BR GD_RDWR
+(read-write), and may also contain zero or more of the following flags,
+bitwise-or'd together:
+.PP
+.PD 0
+.B GD_ARM_ENDIAN
+.TP
+.PD
+.B GD_NOT_ARM_ENDIAN
+Specifies that double precision floating point raw data on disk are, or are not,
+stored in the middle-endian format used by older ARM processors.
+
+These flag only set the default endianness, and will be overridden when an
+.B /ENDIAN
+directive specifies the byte sex of
+.B RAW
+fields, unless
+.B GD_FORCE_ENDIAN
+is also specified.
+
+On every platform, one of these flags
+.RB ( GD_NOT_ARM_ENDIAN
+on all but middle-ended ARM systems)
+indicates the native behaviour of the platform.  That symbol will equal zero,
+and may be omitted.
+.PP
+.PD 0
+.B GD_BIG_ENDIAN
+.TP
+.PD
+.B GD_LITTLE_ENDIAN
+Specifies the default byte sex of raw data stored on disk to be either
+big-endian (most significant byte first) or little-endian (least significant
+byte first).  Omitting both flags indicates the default should be the native
+endianness of the platform.
+
+Unlike the ARM endianness flags above, neither of these symbols is ever zero.
+Specifying both these flags together will cause the library to assume that the
+endianness of the data is opposite to that of the native architecture, whatever
+that might be.
+
+These flag only set the default endianness, and will be overridden when an
+.B /ENDIAN
+directive specifies the byte sex of
+.B RAW
+fields, unless
+.B GD_FORCE_ENDIAN
+is also specified.
+.TP
+.B GD_CREAT
+An empty dirfile will be created, if one does not already exist.  This will
+create both the dirfile directory and an empty format specification file called
+.IR format .
+The directory will have have mode
+.BR S_IRWXU " | " S_IRWXG " | "  S_IRWXO 
+(0777), modified by the caller's umask value (see
+.BR umask (2)).
+The
+.I format
+file will have mode
+.BR S_IRUSR " | " S_IWUSR " | "  S_IRGRP " | "  S_IWGRP " | " S_IROTH " | " S_IWOTH
+(0666), also modified by the caller's umask.
+
+The owner of the dirfile directory and
+.I format
+file will be the effective user ID of the caller.  Group ownership follows the
+rules outlined in
+.BR mkdir (2).
+.TP
+.B GD_EXCL
+Ensure that this call creates a dirfile: when specified along with
+.BR GD_CREAT ,
+the call will fail if the dirfile specified by
+.I dirfilename
+already exists.  If
+.B GD_CREAT
+is not specified, this flag is ignored.  This flag suffers from all the
+limitations of the
+.B O_EXCL
+flag as indicated in
+.BR open (2).
+.TP
+.B GD_FORCE_ENCODING
+Specifies that
+.B /ENCODING
+directives (see
+.BR dirfile-format (5))
+found in the dirfile format specification should be ignored.  The encoding scheme
+specified in
+.I flags
+will be used instead (see below).
+.TP
+.B GD_FORCE_ENDIAN
+Specifies that
+.B /ENDIAN
+directives (see
+.BR dirfile-format (5))
+found in the dirfile format specification should be ignored.  All raw data will
+be assumed to have the byte sex indicated through the presence or absence of the
+.BR GD_ARM_ENDIAN ", " GD_BIG_ENDIAN ", " GD_LITTLE_ENDIAN ,
+and
+.B GD_NOT_ARM_ENDIAN
+flags.
+.TP
+.B GD_IGNORE_DUPS
+If the dirfile format metadata specifies more than one field with the same name,
+all but one of them will be ignored by the parser.  Without this flag, parsing
+would fail with the
+.B GD_E_FORMAT 
+error, possibly resulting in invocation of the registered callback function.
+Which of the duplicate fields is kept is not specified.  As a result,
+this flag is typically only useful in the case where identical copies of a
+field specification line are present.
+
+No indication is provided to indicate whether a duplicate field has been
+discarded.  If finer grained control is required, the caller should handle
+.B GD_E_FORMAT_DUPLICATE
+suberrors itself with an appropriate callback function.
+.TP
+.B GD_PEDANTIC
+Reject dirfiles which don't conform to the Dirfile Standards.  See the
+.B Standards Compliance
+section below for full details.
+.TP
+.B GD_PERMISSIVE
+Allow non-compliant format specification syntax, even when given along with a
+conflicting
+.B /VERSION
+directive.  See the
+.B Standards Compliance
+section below for full details.
+.TP
+.B GD_PRETTY_PRINT
+When dirfile metadata are flushed to disk (either explicitly via
+.BR gd_metaflush "(3), " gd_rewrite_fragment (3),
+or 
+.BR gd_flush (3)
+or implicitly by closing the dirfile), an attempt will be made to create a
+nicer looking format specification (from a human-readable standpoint).  What
+this explicitly means is not part of the API, and any particular behaviour
+should not be relied on.  If the dirfile is opened read-only, this flag is
+ignored.
+.TP
+.B GD_TRUNC
+If
+.I dirfilename
+specifies an already existing dirfile, it will be truncated before opening.
+Since
+.BR gd_cbopen ()
+decides whether
+.I dirfilename
+specifies an existing dirfile before attempting to parse the dirfile,
+.I dirfilename
+is considered to specify an existing dirfile if it refers to a directory
+containing a regular file called
+.BR format ,
+regardless of the content or form of that file.
+
+Truncation occurs by deleting every regular file and symlink in the specified
+directory, whether the files were referred to by the dirfile before truncation
+or not.  Accordingly, this flag should be used with caution.  Unless
+.B GD_TRUNCSUB
+is also specified, subdirectories are left untouched.  Notably, this operation
+does not consider directories used in
+.B /INCLUDE
+directives.  If the dirfile does not exist, this flag is ignored.
+.TP
+.B GD_TRUNCSUB
+If specified along with
+.BR GD_TRUNC ,
+truncation will descend into subdirectories, deleting all regular files and
+symlinks recursively.  It does not descend into directories pointed to by
+symbolic links: in these cases, just the symlink itself is deleted.  If
+specified without an accompanying
+.BR GD_TRUNC ,
+this flag is ignored.
+.TP
+.B GD_VERBOSE
+Specifies that whenever an error is triggered by the library when working
+on this dirfile, the corresponding error string, which can be retrieved by
+calling 
+.BR gd_error_string (3),
+should be written on the caller's standard error stream
+.RB ( stderr (3))
+by GetData.  The error string may be prefixed by a string specified by the
+caller; see
+.BR gd_verbose_prefix (3).
+Without this flag, GetData writes nothing to standard error.  (GetData never
+writes to standard output.)
+.PP
+Those flags which affect the operation of the library beyond this call itself
+may be modified later using the
+.BR gd_flags (3)
+function.
+.PP
+The
+.I flags
+argument may also be bitwise or'd with one of the following symbols indicating
+the default encoding scheme of the dirfile.  Like the endianness flags, the
+choice of encoding here is ignored if the encoding is specified in the dirfile
+itself, unless
+.B GD_FORCE_ENCODED
+is also specified.  If none of these symbols is present,
+.B GD_AUTO_ENCODED
+is assumed, unless the
+.BR gd_cbopen ()
+call results in creation or truncation of the dirfile.  In that case,
+.B GD_UNENCODED
+is assumed.  See
+.BR dirfile-encoding (5)
+for details on dirfile encoding schemes.
+.TP
+.B GD_AUTO_ENCODED
+Specifies that the encoding type is not known in advance, but should be detected
+by the GetData library.  Detection is accomplished by searching for raw data
+files with extensions appropriate to the encoding scheme.  This method will
+notably fail if the the library is called via
+.BR putdata (3)
+to create a previously non-existent raw field unless a read is first
+successfully performed on the dirfile.  Once the library has determined the
+encoding scheme for the first time, it remembers it for subsequent calls.
+.TP
+.B GD_BZIP2_ENCODED
+Specifies that raw data files are compressed using the Burrows-Wheeler block
+sorting text compression algorithm and Huffman coding, as implemented in the
+bzip2 format.
+.TP
+.B GD_GZIP_ENCODED
+Specifies that raw data files are compressed using Lempel-Ziv coding (LZ77)
+as implemented in the gzip format.
+.TP
+.B GD_LZMA_ENCODED
+Specifies that raw data files are compressed using the Lempel-Ziv Markov Chain
+Algorithm (LZMA) as implemented in the xz container format.
+.TP
+.B GD_SLIM_ENCODED
+Specifies that raw data files are compressed using the slimlib library.
+.TP
+.B GD_SIE_ENCODED
+Specified that raw data files are sample-index encoded, similar to run-length
+encoding, suitable for data that change rarely.
+.TP
+.B GD_TEXT_ENCODED
+Specifies that raw data files are encoded as text files containing one data
+sample per line.  
+.TP
+.B GD_UNENCODED
+Specifies that raw data files are not encoded, but written as simply binary data
+to disk.
+.TP
+.B GD_ZZIP_ENCODED
+Specifies that raw data files are compressed using the DEFLATE algorithm.  All
+raw data files for a given fragment are collected together and stored in a PKZIP
+archive called raw.zip.
+.TP
+.B GD_ZZSLIM_ENCODED
+Specifies that raw data files are compressed using a combinations of compression
+schemes: first files are slim-compressed, as with the
+.B GD_SLIM_ENCODED
+scheme, and then they are collected together and compressed (again) into a PKZIP
+archive called raw.zip, as in the
+.B GD_ZZIP_ENCODED
+scheme.
+
+.SS Standards Compliance
+The latest Dirfile Standards Version which this release of GetData understands
+is provided in the preprocessor macro
+.B GD_DIRFILE_STANDARDS_VERSION
+defined in getdata.h.  GetData is able to open and parse any dirfile which
+conforms to this Standards Version, or to any earlier Version.  The
+.BR dirfile-format (5)
+manual page lists the changes between Standards Versions.
+
+The GetData parser can operate in two modes: a
+.I permissive
+mode, in which much
+non-Standards-compliant syntax is allowed, and a
+.I pedantic
+mode, in which the parser adheres strictly to the Standards.  The mode made
+change during the parsing of a dirfile.  If
+.B GD_PEDANTIC
+is passed to
+.BR gd_cbopen (),
+the parser will start parsing the format specification in
+.I pedantic
+mode, otherwise it will start in
+.I permissive
+mode.
+
+.I Permissive
+mode is provided primarily to allow GetData to be used on dirfiles which
+conform to no single Standard, but which were accepted by the GetData parser
+in previous versions.  It is notably lax regarding reserved field names, and
+field name characters, the mixing of old and new data type specifiers, and
+generally ignores the presence of
+.B /VERSION
+directives.
+In read-write mode,
+.I permissive
+mode should be used with caution, as it can cause unintentional corruption of
+dirfile metadata on write, if the heuristics in the parser incorrectly guessed
+the intention of non-compliant syntax.  In
+.I permissive
+mode, actual syntax errors are still reported as such.
+
+In
+.I pedantic
+mode, the parser conforms to one specific Standards Version. This target
+version may change any number of times in the course of scanning a single
+format specification.  If invoked using the
+.B GD_PEDANTIC
+flag, the parser will start in
+.I pedantic
+mode with a target version equal to
+.BR GD_DIRFILE_STANDARDS_VERSION .
+Whenever a
+.B /VERSION
+directive is encountered in the format specification, the target version is
+changed to the Standards Version specified.  When encountering a
+.B /VERSION
+directive in
+.I permissive
+mode, the parser will switch to
+.I pedantic
+mode, unless the
+.B GD_PERMISSIVE
+flag was passed to
+.BR gd_cbopen (),
+in which case no mode switch will take place.
+
+Independent of the mode of the parser when parsing the format specification,
+GetData will calculate a list of Standards Versions to which the parsed
+metadata conform to.  The
+.BR gd_dirfile_standards (3)
+function can provide this information, and also specify the desired
+Standards Version for writing format metadata back to disk.
+
+.SS The Callback Function
+The caller-supplied
+.I sehandler
+function is called whenever the format specification parser encounters a syntax
+error
+.RI ( i.e.
+whenever it would return the
+.B GD_E_FORMAT
+error).  This callback may be used to correct the error, or to tell the parser
+how to recover from it.
+
+This function should take two pointers as arguments, and return an
+.BR int :
+.RS
+.HP
+.nh
+.ad l
+.BI "int " sehandler "(gd_parser_data_t *" pdata ", void *" extra );
+.hy
+.ad n
+.RE
+.PP
+The
+.I extra
+parameter is the pointer supplied to
+.BR gd_cbopen (),
+passed verbatim to this function.  It can be used to pass caller data to the
+callback.  GetData does not inspect this pointer, not even to check its
+validity.  If the caller needs to pass no data to the callback, it may be NULL.
+
+The
+.B gd_parser_data_t
+type is a structure with at least the following members:
+
+.in +4n
+.fam C
+.nf
+typedef struct {
+  const DIRFILE* dirfile;
+  int suberror;
+  int linenum;
+  const char* filename;
+  char* line;
+  size_t buflen;
+
+  ...
+} gd_parser_data_t;
+.fi
+.fam
+.in
+.PP
+The
+.IR pdata -> dirfile
+member will be a pointer to a DIRFILE object suitable only for passing to
+.BR gd_error_string ().
+Notably, the caller should not assume this pointer will be the same as the
+pointer eventually returned by
+.BR gd_cbopen (),
+nor that it will be valid after the callback function returns.
+
+The
+.IR pdata -> suberror
+parameter will be one of the following symbols indicating the type of syntax
+error encountered:
+.TP
+.B GD_E_FORMAT_ALIAS
+The parent specified for a meta field was an alias.
+.TP
+.B GD_E_FORMAT_BAD_LINE
+The line was indecipherable.  Typically this means that the line contained
+neither a reserved word, nor a field type.
+.TP
+.B GD_E_FORMAT_BAD_NAME
+The specified field name was invalid.
+.TP
+.B GD_E_FORMAT_BAD_SPF
+The samples-per-frame of a RAW field was out-of-range.
+.TP
+.B GD_E_FORMAT_BAD_TYPE
+The data type of a RAW field was unrecognised.
+.TP
+.B GD_E_FORMAT_BITNUM
+The first bit of a BIT field was out-of-range.
+.TP
+.B GD_E_FORMAT_BITSIZE
+The last bit of a BIT field was out-of-range.
+.TP
+.B GD_E_FORMAT_CHARACTER
+An invalid character was found in the line, or a character escape sequence was
+malformed.
+.TP
+.B GD_E_FORMAT_DUPLICATE
+The specified field name already exists.
+.TP
+.B GD_E_FORMAT_ENDIAN
+The byte sex specified by an
+.B /ENDIAN
+directive was unrecognised.
+.TP
+.B GD_E_FORMAT_LITERAL
+An unexpected character was encountered in a complex literal. 
+.TP
+.B GD_E_FORMAT_LOCATION
+The parent of a metafield was defined in another fragment.
+.TP
+.B GD_E_FORMAT_META_META
+An attempt was made to use a metafield as the parent to a new metafield.
+.TP
+.B GD_E_FORMAT_METARAW
+An attempt was made to add a RAW metafield.
+.TP
+.B GD_E_FORMAT_MPLEXVAL
+A MPLEX specification has a negative period.
+.TP
+.B GD_E_FORMAT_N_FIELDS
+The number of fields of a LINCOM field was out-of-range.
+.TP
+.B GD_E_FORMAT_N_TOK
+An insufficient number of tokens was found on the line.
+.TP
+.B GD_E_FORMAT_NO_FIELD
+The parent of a metafield was not found.
+.TP
+.B GD_E_FORMAT_NUMBITS
+The number of bits of a BIT field was out-of-range.
+.TP
+.B GD_E_FORMAT_PROTECT
+The protection level specified by a
+.B /PROTECT
+directive was unrecognised.
+.TP
+.B GD_E_FORMAT_RES_NAME
+A field was specified with the reserved name
+.IR INDEX
+(or with the reserved name
+.IR FILEFRAM
+in a dirfile conforming to Standards Version 5 or earlier).
+.TP
+.B GD_E_FORMAT_UNTERM
+The last token of the line was unterminated.
+.TP
+.B GD_E_FORMAT_WINDOP
+The operation in a WINDOW field was not recognised.
+.PP
+.IR pdata -> filename
+and
+.IR pdata -> linenum
+members contains the pathname of the fragment and line number where the syntax
+error was encountered.  The first line in a fragment is line one.
+.PP
+The
+.IR pdata -> line
+member contains a copy of the line containing the syntax error.  This line may
+be freely modified by the callback function.  It will then be reparsed if the
+callback function returns the symbol
+.B GD_SYNTAX_RESCAN
+(see below).  The size of the memory buffer (which may be greater than the
+length of the actual string) is provided in
+.IR pdata -> buflen ,
+and space is available for at least GD_MAX_LINE_LENGTH bytes.  A larger buffer
+may be used if desired, by assigning a pointer to the new buffer of the desired
+length to
+.IR pdata -> line .
+The new buffer should be allocated with
+.BR malloc (3).
+It will be freed by the parser.  Do not call
+.BR free (3)
+or
+.BR realloc (3)
+on the original pointer passed to the callback as
+.IR pdata -> line :
+it, too, will be freed by the parser.
+
+The callback function should return one of the following symbols, which
+tells the parser how to subsequently handle the error:
+.TP
+.B GD_SYNTAX_ABORT
+The parser should immediately abort parsing the format specification and fail
+with the error
+.BR GD_E_FORMAT .
+This is the default behaviour, if no callback function is provided (or if
+the parser is invoked by calling
+.BR gd_open ()).
+.TP
+.B GD_SYNTAX_CONTINUE
+The parser should continue parsing the format specification.  However, once
+parsing has finished, the parser will fail with the error
+.BR GD_E_FORMAT ,
+even if no further syntax errors are encountered.  This behaviour may be used by
+the caller to identify all lines containing syntax errors in the format
+specification, instead of just the first one.
+.TP
+.B GD_SYNTAX_IGNORE
+The parser should ignore the line containing the syntax error completely, and
+carry on parsing the format specification.  If no further errors are
+encountered, the dirfile will be successfully opened.
+.TP
+.B GD_SYNTAX_RESCAN
+The parser should rescan the
+.I line
+argument, which replaces the line which originally contained the syntax error.
+The line is assumed to have been corrected by the callback function.  If the
+line still contains a syntax error, the callback function will be called again.
+
+Note: the line is not corrected on disk; however, the caller may subsequently
+correct the fragment on disk by calling
+.BR gd_rewrite_fragment (3).
+.PP
+The callback function handles only syntax errors.  The parser may still abort
+early, if a different kind of library error is encountered.  Furthermore,
+although a line may contain more than one syntax error, the parser will only
+ever report one syntax error per line, even if the callback function returns
+.BR GD_SYNTAX_CONTINUE .
+
+.SH RETURN VALUE
+A call to
+.BR gd_cbopen ()
+or
+.BR gd_open ()
+always returns a pointer to a newly allocated DIRFILE object, except in
+instances when it is unable to allocate memory for the DIRFILE object itself,
+in which case it will return NULL.  The DIRFILE object is an opaque structure
+containing the parsed dirfile metadata.  If an error occurred, the dirfile
+error will be set to a non-zero error value.  The DIRFILE object will also
+be internally flagged as invalid.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The library was asked to create or truncate a dirfile opened read-only (i.e.
+.B GD_CREAT
+or
+.B GD_TRUNC
+was specified in
+.I flags
+along with
+.BR GD_RDONLY ).
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_REFERENCE
+The reference field specified by a
+.B /REFERENCE
+directive in the format specification (see
+.BR dirfile-format (5))
+was not found, or was not a
+.B RAW
+field.
+.TP
+.B GD_E_CALLBACK
+The registered callback function,
+.IR sehandler ,
+returned an unrecognised response.
+.TP
+.B GD_E_CREAT
+The library was unable to create the dirfile.
+.TP
+.B GD_E_EXISTS
+The dirfile already exists and both
+.BR GD_CREAT " and " GD_EXCL
+were specified.
+.TP
+.B GD_E_FORMAT
+A syntax error occurred in the format specification.  See also
+.B The Callback Function
+section above.
+.TP
+.B GD_E_LINE_TOO_LONG
+The parser encountered a line in the format specification longer than it was
+able to deal with.  Lines are limited by the storage size of
+.BR ssize_t .
+On 32-bit systems, this limits format specification lines to 2**31 bytes.  The
+limit is larger on 64-bit systems.
+.TP
+.B GD_E_OPEN
+The dirfile format specification could not be opened, or
+.I dirfilename
+does not specify a valid dirfile.
+.TP
+.B GD_E_OPEN_FRAGMENT
+A file specified in an
+.B /INCLUDE
+directive could not be opened.
+.TP
+.B GD_E_TRUNC
+The library was unable to truncate the dirfile.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+When finished with it, a caller should de-allocate the DIRFILE object by calling
+.BR gd_close (3),
+or
+.BR gd_discard (3),
+even if the open failed.
+.SH BUGS
+When working with dirfiles conforming to Standards Versions 4 and earlier
+(before the introduction of the
+.B /ENDIAN
+directive), GetData assumes the dirfile has native byte sex, even though,
+officially, these early Standards stipulated data to be little-endian.  This is
+necessary since, in the absence of an explicit
+.B /VERSION
+directive, it is often impossible to determine the intended Standards Version of
+a dirfile, and the current behaviour is to assume native byte sex for modern
+dirfiles lacking
+.BR /ENDIAN .
+To read an old, little-ended dirfile on a big-ended platform, an
+.B /ENDIAN
+directive should be added to the format specification, or else
+.B GD_LITTLE_ENDIAN
+should be specified by the caller.
+
+GetData 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
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR dirfile-format (5),
+.BR gd_close (3),
+.BR gd_dirfile_standards (3),
+.BR gd_discard (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_flags (3),
+.BR gd_getdata (3),
+.BR gd_include (3),
+.BR gd_parser_callback (3),
+.BR gd_verbose_prefix (3)
diff --git a/man/gd_close.3 b/man/gd_close.3
new file mode 100644
index 0000000..d58029c
--- /dev/null
+++ b/man/gd_close.3
@@ -0,0 +1,115 @@
+.\" gd_close.3.  The gd_close man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_close 3 "17 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_close, gd_discard \(em close a dirfile and free associated memory.
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_close(DIRFILE *" dirfile );
+.HP
+.BI "int gd_discard(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_close ()
+function first calls
+.BR gd_flush (3)
+(with
+.I field_code
+set to NULL) to flush all metadata changes to disk and to close all file handles
+associated with 
+.IR dirfile .
+It then frees memory associated with the DIRFILE object.  If
+.I dirfile
+is NULL, nothing happens, and the call succeeds.
+
+The
+.BR gd_discard ()
+function behaves similarly, except modified metadata is not written to disk,
+but simply discarded.  In order to ensure that modified data files associated
+with
+.B RAW
+fields are properly terminated, changes to
+.B RAW
+data files are still flushed to disk by this function.  If
+.I dirfile
+was opened in read-only mode,
+.BR gd_discard ()
+and
+.BR gd_close ()
+behave identically.
+
+One of these functions should be called on all pointers returned by
+.BR gd_cbopen (3),
+.BR gd_open (3),
+and
+.BR gd_invalid_dirfile (3),
+even if the call to those function failed.  After
+.BR gd_close ()
+or
+.BR gd_discard ()
+returns successfully, the pointer
+.I dirfile
+should be considered invalid.
+.PP
+Metadata is written to disk using the current Standards Version as stored in the
+.I dirfile
+object.  See
+.BR gd_dirfile_standards (3)
+to change or report the current Standards Version.  If the dirfile metadata
+conforms to no known Standards Version, Standards non-compliant metadata will
+be written.
+.SH RETURN VALUE
+.BR gd_close ()
+and
+.BR gd_discard ()
+return zero on success.  On error, they do not de-allocate
+.I dirfile
+and set the dirfile error to a non-zero error value.  Possible error values
+are:
+.TP 8
+.B GD_E_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.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to flush or close one or more open raw files.
+In this case, another call to
+.BR gd_close ()
+or
+.BR gd_discard ()
+may be attempted.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_cbopen (3),
+.BR gd_dirfile_standards (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_flush (3),
+.BR gd_invalid_dirfile (3),
+.BR gd_open (3)
diff --git a/man/gd_constants.3 b/man/gd_constants.3
new file mode 100644
index 0000000..228a2bb
--- /dev/null
+++ b/man/gd_constants.3
@@ -0,0 +1,110 @@
+.\" gd_constants.3.  The gd_constants man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_constants 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_constants \(em retrieve a list of constant values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const void *gd_constants(DIRFILE *" dirfile ", gd_type_t
+.IB return_type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_constants ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of values of the all
+.B CONST
+type fields defined in the database after type conversion to the data type
+specified by
+.IR return_type .
+Notably, this list does not include /META subfields.  For a list of valid
+symbols to use for
+.IR return_type ,
+see the
+.BR gd_get_constant (3)
+man page.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The array returned will be de-allocated by a call to
+.BR gd_close (3)
+and should not be de-allocated by the caller.  The list returned should not be
+assumed to be in any particular order, although it is guaranteed to be in the
+same order as the list of
+.B CONST
+fields returned by
+.BR gd_field_list_by_type (3).
+The array is unterminated.  The number of values in the array can be obtained
+from a call to
+.BR gd_nfields_by_type (3).
+
+The caller may not modify any values in the array, or the array itself.  Doing
+so may cause database corruption.  The pointer returned is guaranteed to be
+valid only until
+.BR gd_constants ()
+is called again with the same arguments, or until the dirfile's metadata is
+modified (by adding, modifying or deleting an entry), or until the array is
+de-allocated by a call to
+.BR gd_close (3).
+
+A corresponding list of names for these fields may be obtained by calling
+.BR gd_field_list_by_type (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_constants ()
+returns a pointer to an array of values containing the values of all the
+constants defined in the dirfile database.  If no constants are defined in the
+database, NULL is returned.  On error it returns NULL and sets the dirfile error
+to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_TYPE
+The
+.I return_type
+specified was invalid.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_field_list_by_type (3),
+.BR gd_get_constant (3),
+.BR gd_nfields_by_type (3)
diff --git a/man/gd_delete.3 b/man/gd_delete.3
new file mode 100644
index 0000000..5d470c4
--- /dev/null
+++ b/man/gd_delete.3
@@ -0,0 +1,165 @@
+.\" gd_delete.3.  The gd_delete man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_delete 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_delete, gd_delete_alias \(em remove an entry from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.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
+.I field_code
+in the dirfile specified by
+.IR dirfile .
+The
+.I field_code
+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
+together:
+.TP 8
+.B GD_DEL_DATA
+If the field to be deleted is a
+.B RAW
+field, also delete the binary data file associated with it.  If
+.I field_code
+specified a
+.B RAW
+field and this flag is not specified, the field will still be deleted but the
+binary file will be left untouched.  Ignored by
+.BR gd_delete_alias ().
+.TP
+.B GD_DEL_DEREF
+If the field to be deleted is a
+.B CONST
+or
+.B CARRAY
+field which is used as a parameter in the specification of other fields, resolve
+these other fields dependence on the deleted field by replacing instances of
+.I field_code
+in their field specifications with the value of the scalar field.
+.TP
+.B GD_DEL_FORCE
+Delete the indicated entry, even if it is used in the specification of other
+fields, either as a input for a derived vector field or as a scalar parameter in
+a field specification, or if it has aliases pointing to it.
+.TP
+.B GD_DEL_META
+If the field to be deleted has metafields attached to it, attempt to delete
+those, too.  If the field has metafields and this flag is not specified, the
+call will fail with the
+.B GD_E_DELETE
+error.  Ignored by
+.BR gd_delete_alias ().
+.SH RETURN VALUE
+On successful deletion, zero is returned.  On error, -1 is returned and the
+dirfile error is set to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_DELETE
+The attempt to delete the field failed.  Either the specified field is used in
+the specification of other fields and
+.B GD_DEL_FORCE
+or
+.B GD_DEL_DEREF
+was not specified, or it has metafields and
+.B GD_DEL_META
+was not specified.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment containing the field was protected from change.
+Or, the deletion of the binary data file associated with a
+.B RAW
+field was attempted and the data of the fragment was protected.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to close or delete the binary file associated
+with a
+.B RAW
+field.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The
+.B GD_DEL_DATA
+flag was given but the encoding scheme of the indicated format specification
+fragment is not known to the library.  As a result, the library was unable to
+delete the binary file associated with a
+.B RAW
+field.
+.TP
+.B GD_E_UNSUPPORTED
+The
+.B GD_DEL_DATA
+flag was given but the encoding scheme of the indicated format specification
+fragment does not support deleting the binary file associated with a
+.B RAW
+field.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_close (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_metaflush (3)
diff --git a/man/gd_desync.3 b/man/gd_desync.3
new file mode 100644
index 0000000..017d53b
--- /dev/null
+++ b/man/gd_desync.3
@@ -0,0 +1,129 @@
+.\" gd_desync.3.  The gd_desync man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_desync 3 "15 March 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_desync \(em check for a change of metadata on disk
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_desync(DIRFILE *" dirfile ", unsigned int " flags );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_desync ()
+function reports whether the metadata of the loaded
+.I dirfile
+has become desynchronised from the format specification fragments on disk, due
+to a third party modifying the Dirfile metadata on disk after GetData opened
+it.  If
+.I dirfile
+has become desynchronised, this function can, optionally, reload the dirfile.
+
+The
+.I flags
+argument influences how the function works.  It should be zero, or else one
+or more of the following flags, bitwise or'd together:
+.TP 8
+.B GD_DESYNC_PATHCHECK
+Ignore GetData's internal directory cache, and use the format specification
+fragments' full path when checking for modifications.  This flag is of
+particular importance when the
+.I dirfilename
+passed to
+.BR gd_cbopen (3),
+or directory paths used in included fragments, contain symbolic links: with this
+flag, these symbolic links will be re-evaluated.  Without it, the target of
+the symbolic links in effect when the dirfile was first opened will be
+considered instead.
+.TP
+.B GD_DESYNC_REOPEN
+If this flag is specified, and
+.BR gd_desync ()
+detects desynchronisation, the Dirfile will be re-opened in place using the
+exiting
+.I dirfile
+pointer.  In this case, upon a positive result from this function, the caller
+must discard all cached information about the dirfile, even the assumption that
+.I dirfile
+has been successfully opened.
+
+Re-opening the dirfile is equivalent to calling
+.BR gd_discard (3),
+and then
+.BR gd_cbopen (3)
+with the same arguments used when originally creating
+.IR dirfile ,
+except that the
+.I dirfile
+pointer doesn't change its value.  As a result, this function may invoke the
+registered parser callback function (see
+.BR gd_cbopen (3)
+and
+.BR gd_parser_callback (3)).
+.SH RETURN VALUE
+On successful deletion, zero is returned if the loaded dirfile has not
+desynchronised, or 1 if it has.  On error, -1 is returned, regardless of
+desynchronisation and the dirfile error is set to a non-zero error value.
+Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to obtain the modification time of a fragment.
+.PP
+Additionally, if
+.B GD_DESYNC_REOPEN
+is used, this function may fail for any of the reasons listed in the
+.BR gd_discard (3)
+and
+.BR gd_cbopen (3)
+manual pages.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH LIMITATIONS
+The current implementation uses file modification times as reported by
+.BR stat (2)
+to detect changes.  These times have a granularity of, at best, one second.  As
+a result, desynchronisation will not be detected in the case when a fragment is
+modified, then GetData reads it, then the fragment is modified again, all within
+one second.  The caller may wish to perform its own monitoring using the
+pathnames returned by
+.BR gd_fragmentname (3).
+.PP
+On systems lacking a POSIX.1-2008 conformant
+.BR fstatat (2)
+(q.v.), this function may always operate as if
+.B GD_DESYNC_PATHCHECK
+had been specified, regardless of the actual
+.IR flags .
+.SH SEE ALSO
+.BR fstatat (2),
+.BR gd_cbopen (3),
+.BR gd_discard (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_parser_callback (3)
diff --git a/man/gd_dirfile_standards.3 b/man/gd_dirfile_standards.3
new file mode 100644
index 0000000..62bdc53
--- /dev/null
+++ b/man/gd_dirfile_standards.3
@@ -0,0 +1,119 @@
+.\" gd_dirfile_standards.3.  The gd_dirfile_standards man page.
+.\"
+.\" Copyright (C) 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_dirfile_standards 3 "29 June 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_dirfile_standards \(em change or report the current Dirfile Standards Version
+for a DirFile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_dirfile_standards(DIRFILE *" dirfile ", int version );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_dirfile_standards ()
+function updates the current Standards Version for the open dirfile
+.I dirfile
+to the value specified by
+.IR version ,
+if possible, and then reports the current Standards Version.  Metadata written to
+disk for
+.I dirfile
+will conform to the current Standards Version.
+
+The Standards Version of the loaded dirfile also affects the operation of
+functions which add fields, such as
+.BR dirfile_add (3)
+or 
+.BR dirfile_add_spec (3);
+and functions which modify field metadata, such as
+.BR dirfile_alter_entry (3)
+or 
+.BR dirfile_alter_spec (3).
+For specific behaviour see the manual page of the appropriate function.
+
+The
+.I version
+parameter should be between zero and the value of the symbol
+.BR GD_DIRFILE_STANDARDS_VERSION ,
+which is the newest Standards Version understood by GetData, inclusive or else
+one of the following special symbols:
+.TP
+.B GD_VERSION_EARLIEST
+Specifies the current Standards Version should be set to the earliest version
+to which the loaded dirfile conforms.
+.TP
+.B GD_VERSION_CURRENT
+Specifies that the current Standards Version should not be changed.  In this
+case, this function simply reports the current Standards Version.
+.TP
+.B GD_VERSION_LATEST
+Specifies the current Standards Version should be set to the latest version
+to which the loaded dirfile conforms.
+.PP
+If the loaded dirfile does not conform to the specified
+.IR version ,
+this function fails, and the current Standards Version is unchanged.  If the
+loaded dirfile conforms to no known Standards Version, this function will fail
+regardless of the value of
+.I version
+(even if
+.B GD_VERSION_CURRENT
+is used).
+
+The caller should not assume that the loaded dirfile conforms to every Standards
+Version between the values reported by
+.B GD_VERSION_EARLIEST
+and
+.BR GD_VERSION_LATEST .
+
+.SH RETURN VALUE
+On success,
+.BR gd_dirfile_standards ()
+returns the current Standards Version of the loaded dirfile, after possibly
+having been updated by the call.  This will be a number between zero and
+.BR GD_DIRFILE_STANDARDS_VERSION
+inclusive.  On error, -1 is returned and the dirfile error is set to a non-zero
+error value, and the current Standards Version is not changed.  Possible error
+values are:
+.TP 8
+.B GD_E_ARGUMENT
+The loaded dirfile did not conform to the specified version.  Or the dirfile
+conforms to no known Standards Version.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH NOTES
+This function only changes the current Standards Version of the loaded dirfile.
+It does not update the any format specification fragments on disk to conform to
+the specified Standards Version.  To do that, use
+.BR gd_metaflush (3)
+or 
+.BR gd_rewrite_fragment (3).
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_metaflush (3),
+.BR gd_rewrite_fragment (3)
diff --git a/man/gd_dirfilename.3 b/man/gd_dirfilename.3
new file mode 100644
index 0000000..ff103ee
--- /dev/null
+++ b/man/gd_dirfilename.3
@@ -0,0 +1,59 @@
+.\" gd_dirfilename.3.  The dirfilename man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_dirfilename 3 "1 August 2012" "Version 0.8.1" "GETDATA"
+.SH NAME
+gd_dirfilename \(em retrieve the name of a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char *gd_dirfilename(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_dirfilename ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns its name.  The name of a dirfile is an absolute pathname which
+refers to the dirfile base directory.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_dirfilename ()
+returns a pointer to a constant string containing the pathname of the dirfile.
+On error, 
+.BR gd_dirfilename ()
+returns NULL and sets the dirfile error to a non-zero value.  Possible error
+values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_cbopen (3),
+.BR path_resolution (7)
diff --git a/man/gd_encoding.3 b/man/gd_encoding.3
new file mode 100644
index 0000000..bec02b6
--- /dev/null
+++ b/man/gd_encoding.3
@@ -0,0 +1,92 @@
+.\" gd_encoding.3.  The gd_encoding man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_encoding 3 "21 April 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_encoding \(em report the binary encoding of data in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned long gd_encoding(DIRFILE *" dirfile ", int " fragment_index );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_encoding ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the binary encoding for the fragment indexed by
+.IR fragment_index .
+The binary encoding of a fragment indicate the encoding of data stored in binary
+files associated with
+.B RAW
+fields defined in the specified fragment.  The encoding of a fragment
+containing no
+.B RAW
+fields is ignored.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_encoding ()
+returns the binary encoding of the specified fragment, which will one of the
+following symbols:
+.IP
+.nh
+.ad l
+.BR GD_UNENCODED ,
+.BR GD_BZIP2_ENCODED ,
+.BR GD_GZIP_ENCODED ,
+.BR GD_LZMA_ENCODED ,
+.BR GD_SIE_ENCODED ,
+.BR GD_SLIM_ENCODED ,
+.BR GD_TEXT_ENCODED ,
+.BR GD_ZZIP_ENCODED ,
+.BR GD_ZZSLIM_ENCODED ,
+.BR GD_ENC_UNSUPPORTED .
+.ad n
+.hy
+.PP
+If the encoding scheme specified in the dirfile
+metadata is unknown to GetData,
+.B GD_ENC_UNSUPPORTED
+will be returned.  See
+.BR gd_cbopen (3)
+and dirfile-encoding(5) for the meanings of the other symbols and details on the
+supported encoding schemes.
+.PP
+On error, it returns zero and sets the dirfile error to a non-zero error value. 
+Possible error values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_alter_encoding (3),
+.BR gd_cbopen (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_getdata (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_endianness.3 b/man/gd_endianness.3
new file mode 100644
index 0000000..24d3b11
--- /dev/null
+++ b/man/gd_endianness.3
@@ -0,0 +1,78 @@
+.\" gd_endianness.3.  The gd_endianness man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_endianness 3 "17 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_endianness \(em report the byte sex of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned long gd_endianness(DIRFILE *" dirfile ", int " fragment_index );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_endianness ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the byte sex for the fragment indexed by
+.IR fragment_index .
+The byte sex of a fragment indicate the endianness of data stored in binary
+files associated with
+.B RAW
+fields defined in the specified fragment.  The endianness of a fragment
+containing no
+.B RAW
+fields is not meaningful.
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_endianness ()
+returns the byte sex of the specified fragment, which will be either
+.BR GD_BIG_ENDIAN " or " GD_LITTLE_ENDIAN ,
+bitwise-or'd with either
+.B GD_ARM_ENDIAN 
+or 
+.BR GD_NOT_ARM_ENDIAN ,
+indicating whether double-precision floating point data in this fragment are
+stored in the old ARM middle-endian format.  On error, it returns zero and
+sets the dirfile error to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_alter_endianness (3),
+.BR gd_getdata (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_open (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_entry.3 b/man/gd_entry.3
new file mode 100644
index 0000000..2412350
--- /dev/null
+++ b/man/gd_entry.3
@@ -0,0 +1,953 @@
+.\" gd_entry.3.  The gd_entry man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_entry 3 "3 April 2013" "Version 0.8.4" "GETDATA"
+.SH NAME
+gd_entry \(em retrieve a dirfile field's metadata
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_entry(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_entry_t *" entry );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_entry ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the metadata associated with the field specified by
+.IR field_code .
+If
+.I field_code
+contains a valid representation suffix, the suffix will be ignored.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The entry will be stored in the gd_entry_t structure indicated by the
+.I entry
+argument, which must be allocated by the caller.  Members available in this
+structure depend on the field type of the field queried.  See below for a
+complete description of this data type.
+
+Strings members in 
+.I entry
+filled by this function (variously, depending on field type:
+.IR field ", the elements of the " in_fields "[] array, " table ;
+see below) will by dynamically allocated by
+.BR gd_entry ()
+and should not point to allocated memory locations before calling this function.
+Only strings provided by the gd_entry_t for the particular field type described
+will be allocated.  These strings should be de-allocated with
+.BR free (3)
+by the caller once they are no longer needed.  The
+.BR gd_free_entry_strings (3)
+function is provided as a convenience to do this.
+
+The returned
+.I entry
+structure, including strings and their pointers may be freely modified by the
+caller.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_entry ()
+returns zero, and writes the field metadata in the supplied gd_entry_t buffer.
+On error, the supplied gd_entry_t buffer is not modified.  In this case,
+.BR gd_entry ()
+returns -1 and sets the dirfile error to a non-zero error value.  Possible
+error values are:
+.TP 8
+.B GD_E_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_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.TP
+.B GD_E_BAD_SCALAR
+A scalar parameter used in the definition of the field was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH THE ENTRY TYPE
+Members available in the gd_entry_t structure depend on the field type
+described.  All gd_entry_t objects are guaranteed to have at least:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  const char  *field;          /* field code */
+  gd_entype_t  field_type;     /* field type */
+  int          fragment_index; /* format fragment index */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I field
+member is the field code of the entry (i.e. its string name).  If the call to
+.BR gd_entry (3)
+is successful, this will be the field name specified as part of the
+.I field_code
+argument.
+.PP
+The
+.I field_type
+member indicates the field type of the entry.  This is an integer type equal
+to one of the following symbols:
+.IP
+.nh
+.ad l
+.BR GD_BIT_ENTRY ,
+.BR GD_CARRAY_ENTRY ,
+.BR GD_CONST_ENTRY ,
+.BR GD_DIVIDE_ENTRY ,
+.BR GD_INDEX_ENTRY ,
+.BR GD_LINCOM_ENTRY ,
+.BR GD_LINTERP_ENTRY ,
+.BR GD_MPLEX_ENTRY ,
+.BR GD_MULTIPLY_ENTRY ,
+.BR GD_PHASE_ENTRY ,
+.BR GD_POLYNOM_ENTRY ,
+.BR GD_RAW_ENTRY ,
+.BR GD_RECIP_ENTRY ,
+.BR GD_SBIT_ENTRY ,
+.BR GD_STRING_ENTRY ,
+.BR GD_WINDOW_ENTRY .
+.ad n
+.hy
+.PP
+.B GD_INDEX_ENTRY
+is a special field type used only for the implicit
+.I INDEX
+field.  The other entry types are explained in detail in dirfile-format(5).
+.PP
+The 
+.I fragment_index
+member indicates the format specification fragment in which this field is
+defined.  This is an integer index to the Dirfile's list of parsed format
+specification fragments.  The name of the file corresponding to
+.I fragment_index
+may be obtained by calling
+.BR gd_fragmentname (3).
+A value of zero for this field indicates that the field is defined in the
+primary fragment, the file called
+.B format
+in the root dirfile directory (see 
+.IR dirfile (5)).
+.PP
+Remaining fields in the gd_entry_t structure depend on the value of
+.IR field_type .
+Callers are advised to check
+.I field_type
+before attempting to access the remaining members.  Members for different
+field types may be stored in the same physical location in core.  Accordingly,
+attempting to access a member not declared for the appropriate field type will
+have unspecified results.
+
+.SS Scalar Parameter Members
+A gd_entry_t describing any field type which permits non-literal scalar field
+parameters
+.RB ( BIT ", " LINCOM ", " MPLEX ", " PHASE ", " POLYNOM ", " RAW ", " RECIP ,
+.BR SBIT ", or " WINDOW )
+will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  const char *scalar[GD_MAX_POLY_ORD + 1];     /* param. fields */
+  int         scalar_ind[GD_MAX_POLY_ORD + 1]; /* CARRAY indices */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+Only certain elements of these arrays will be initialised:
+.IP \(bu
+For
+.B BIT
+and
+.B SBIT
+fields, the first element corresponds to
+.I bitnum
+and the second to
+.IR numbits .
+The remainder are uninitialised.
+.IP \(bu
+For
+.B LINCOM
+fields, the first
+.B GD_MAX_LINCOM
+elements correspond to the slopes
+.RI ( cm )
+and the next
+.B GD_MAX_LINCOM
+elements correspond to the offsets
+.RI ( cb ).
+Only the first
+.I n_fields
+elements of these two sets are initialised.  Notably, this means for
+.I n_fields
+< GD_MAX_LINCOM, there will be uninitialised elements in the middle of these
+arrays between the element corresponding to
+.IR cm [ n_fields
+- 1] and the element corresponding to
+.IR cb [0].
+.IP \(bu
+For
+.B MPLEX
+fields, the first element corresponds to
+.I count_val
+and the second to
+.IR period .
+The remainder are uninitialised.
+.IP \(bu
+For
+.B PHASE
+fields, the first element corresponds to
+.IR shift .
+The remainder are uninitialised.
+.IP \(bu
+For
+.B POLYNOM
+fields, these arrays correspond with the co-efficients
+.IR ca .
+Only the first
+.I poly_ord
++ 1 elements are initialised.
+.IP \(bu
+For
+.B RAW
+fields, the first element corresponds to
+.IR spf .
+The remainder are uninitialised.
+.IP \(bu
+For
+.B RECIP
+fields, the first element corresponds to
+.IR cdividend .
+The remainder are uninitialised.
+.IP \(bu
+For
+.B WINDOW
+fields, the first element corresponds to
+.IR threshold .
+The remainder are uninitialised.
+.PP
+The
+.I scalar
+parameters are NULL if a literal parameter was used, or else a field code
+specifying the scalar parameters. 
+.PP
+If an element of
+.I scalar
+specifies a
+.B CARRAY
+field, the corresponding
+.I scalar_ind
+will indicate the element of the
+.B CARRAY
+used.  For
+.B CONST
+fields,
+.I scalar_ind
+will be -1.
+
+.SS BIT and SBIT Members
+A gd_entry_t describing a
+.B BIT
+or
+.B SBIT
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  const char *in_fields[1];     /* input field code */
+  int         bitnum;           /* first bit */
+  int         numbits;          /* bit length */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I in_fields
+member is an array of length one containing the input field code.
+.PP
+The
+.I bitnum
+member indicates the number of the first bit (counted from zero) extracted from
+the input.  If this value was specified as a scalar field code, this will be
+the numerical value of that field, and
+.IR scalar [0]
+will contain the field code itself, otherwise
+.IR scalar [0]
+will be NULL.
+.PP
+The
+.I numbits
+member indicates the number of bits which are extracted from the input.
+If this value was specified as a scalar field code, this will be the numerical
+value of that field, and
+.IR scalar [1]
+will contain the field code itself, otherwise
+.IR scalar [1]
+will be NULL.
+
+.SS CARRAY Members
+A gd_entry_t describing a
+.B CARRAY
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  gd_type_t   const_type;     /* data type in format specification */
+  size_t      array_len;      /* length of array data */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I const_type
+member indicates the data type of the constant value stored in the format
+file metadata.  See
+.BR gd_getdata (3)
+for a list of valid values that a variable of type
+.B gd_type_t
+may take.
+.PP
+The
+.I array_len
+member gives the number of elements in the array.
+
+.SS CONST Members
+A gd_entry_t describing a
+.B CONST
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  gd_type_t   const_type;     /* data type in format specification */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I const_type
+member indicates the data type of the constant value stored in the format
+file metadata.  See
+.BR gd_getdata (3)
+for a list of valid values that a variable of type
+.B gd_type_t
+may take.
+
+.SS INDEX Members
+A gd_entry_t describing an
+.B INDEX
+entry, which is used only for the implicit
+.I INDEX
+field, provides no additional data.
+
+.SS LINCOM Members
+A gd_entry_t describing a
+.B LINCOM
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  int            n_fields;                  /* # of input fields */
+  int            comp_scal;                 /* complex scalar flag */
+  const char    *in_fields[GD_MAX_LINCOM];  /* input field code(s) */
+  double complex cm[GD_MAX_LINCOM];         /* scale factor(s) */
+  double         m[GD_MAX_LINCOM];          /* scale factor(s) */
+  double complex cb[GD_MAX_LINCOM];         /* offset terms(s) */
+  double         b[GD_MAX_LINCOM];          /* offset terms(s) */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I n_fields
+member indicates the number of input fields.  It will be between one and
+.B GD_MAX_LINCOM
+inclusive.
+.B GD_MAX_LINCOM
+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
+containing the input field code(s).  Only the first
+.I n_fields
+elements of this array are initialised.  The remaining elements contain
+uninitialised data.
+.PP
+The
+.I cm
+and
+.I cb
+members are arrays of the scale factor(s) and offset term(s) for the
+.BR LINCOM .
+Only the first
+.I n_fields
+elements of these array contain meaningful data.
+If any of these values were specified as a scalar field code, this will be the
+numerical value of that field.  The field code corresponding to
+.IR cm [ i ]
+will be stored in
+.IR scalar [ i ]
+and the field code associated with
+.IR cb [ i ]
+will be stored in
+.IR scalar [ i
++
+.BR GD_MAX_LINCOM ].
+Otherwise the corresponding
+.I scalar
+member will be NULL.
+See
+.B NOTES
+below on changes to the declaration of
+.I cm
+and
+.I cb
+when using the C89 GetData API.
+.PP
+The elements of
+.I m
+and
+.I b
+are the real parts of the corresponding elements of
+.I cm
+and
+.IR cb .
+
+.SS LINTERP Members
+A gd_entry_t describing a
+.B LINTERP
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  const char *table             /* linterp table filename */
+  const char *in_fields[1];     /* input field code */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I table
+member is the pathname to the look up table on disk.  This the path as it appars
+in the format specification.  It may be a path relative to the fragment
+directory.  For an canonicalised, absolute version of this path, see
+.BR gd_linterp_tablename (3).
+.PP
+The
+.I in_fields
+member is an array of length one containing the input field code.
+
+.SS MPLEX Members
+A gd_entry_t describing a
+.B MPLEX
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  const char    *in_fields[2];  /* input field codes */
+  int           count_val;      /* value of the multiplex index */
+  int           period;         /* samples between successive count_vals */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I in_fields
+member contains the field codes of the input field (element 0) and the multiplex
+index field (element 1).
+.PP
+The
+.I count_val
+member is the value of the multiplex index field when the output field is stored
+in the input field.
+.PP
+The
+.I period
+member is the number of samples between successive occurrances of
+.I count_val
+in the index vector, or zero, if this is not known or constant.  This is only
+used to determine how far to look back for a starting value for the output
+field; see
+.BR gd_mplex_lookback (3).
+
+.SS MULTIPLY and DIVIDE Members
+A gd_entry_t describing a
+.B MULTIPLY
+or
+.B DIVIDE
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  const char *in_fields[2];     /* input field codes */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I in_fields
+member is an array of length two containing the input field codes.
+
+.SS PHASE Members
+A gd_entry_t describing a
+.B PHASE
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  const char *in_fields[1];     /* input field code */
+  gd_shift_t  shift;            /* phase shift */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I in_fields
+member is an array of length one containing the input field code.
+.PP
+The
+.I shift
+member indicates the shift in samples.  The
+.I gd_shift_t
+type is a 64-bit signed integer type.  A positive value indicates a shift
+forward in time (towards larger frame numbers).  If this value was specified as
+a scalar field code, this will be the numerical value of that field, and
+.IR scalar [0]
+will contain the field code itself, otherwise
+.IR scalar [0]
+will be NULL.
+
+.SS POLYNOM Members
+A gd_entry_t describing a
+.B POLYNOM
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  int            poly_ord;                  /* polynomial order */
+  int            comp_scal;                 /* complex scalar flag */
+  const char    *in_fields[1];              /* input field code(s) */
+  double complex ca[GD_MAX_POLY_ORD + 1];   /* co-efficients(s) */
+  double         a[GD_MAX_POLY_ORD + 1];    /* co-efficients(s) */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I poly_ord
+member indicates the order of the polynomial.  It will be between one and
+.B GD_MAX_POLY_ORD
+inclusive.
+.B GD_MAX_POLY_ORD
+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
+The
+.I ca
+members are arrays of the co-efficient(s) for the
+.BR POLYNOM .
+Only the first
+.I poly_ord
++ 1 elements of this array contains meaningful data.  If any of these values
+were specified as a scalar field code, this will be the numerical value of that
+field.  The field code corresponding to
+.IR ca [ i ]
+will be stored in
+.IR scalar [ i ].
+Otherwise the corresponding
+.I scalar
+member will be NULL.  See
+.B NOTES
+below on changes to the declaration of
+.I ca
+when using the C89 GetData API.
+.PP
+The elements of
+.I a
+are the real parts of the corresponding elements of
+.IR ca .
+
+.SS RAW Members
+A gd_entry_t describing a
+.B RAW
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  unsigned int  spf;          /* samples per frame on disk */
+  gd_type_t     data_type;    /* data type on disk */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I spf
+member contains the samples per frame of the binary data on disk.  If this value
+was specified as a scalar field code, this will be the numerical value of that
+field, and
+.IR scalar [0]
+will contain the field code itself, otherwise
+.IR scalar [0]
+will be NULL.
+.PP
+The
+.I data_type
+member indicates the data type of the binary data on disk.  See
+.BR gd_getdata (3)
+for a list of valid values that a variable of type
+.B gd_type_t
+may take.
+
+.SS RECIP Members
+A gd_entry_t describing a
+.B RECIP
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  int            comp_scal;            /* complex scalar flag */
+  const char    *in_fields[1];         /* input field code */
+  double complex cdividend;            /* scalar dividend */
+  double         dividend;             /* scalar dividend */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I comp_scal
+member is non-zero if any of the co-efficients have a non-zero imaginary part.
+(That is, if comp_scal is zero,
+.I cdividend
+equals
+.IR dividend .)
+.PP
+The
+.I in_fields
+member is an array of length one containing the input field code.
+.PP
+The
+.I cdividend
+member provides the constant dividend of the computed division.  If this value
+was specified as a scalar field code, this will be the numerical value of that
+field, and
+.IR scalar [0]
+will contain the field code itself, otherwise
+.IR scalar [0]
+will be NULL.  The
+.I dividend
+member contains the real part of
+.IR cdividend .
+
+.SS STRING Members
+A gd_entry_t describing a
+.B STRING
+entry provides no additional data.
+
+.SS WINDOW Members
+A gd_entry_t describing a
+.B WINDOW
+entry, will also provide:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  ...
+
+  const char    *in_fields[2];  /* input field codes */
+  gd_windop_t   windop;         /* comparison operator */
+  gd_triplet_t  threshold;      /* the value compared against */
+
+  ...
+} gd_entry_t;
+.fam
+.fi
+.in
+.PP
+The
+.I in_fields
+member contains the field codes of the input field (element 0) and the check
+field (element 1).
+.PP
+The
+.I windop
+member equals one of the following symbols, indicating the particular comparison
+performed on the check field:
+.TP
+.B GD_WINDOP_EQ
+data are extracted when the check field equals
+.IR threshold ;
+.TP
+.B GD_WINDOP_GE
+data are extracted when the check field is greater than or equal to
+.IR threshold ;
+.TP
+.B GD_WINDOP_GT
+data are extracted when the check field is strictly greater than
+.IR threshold ;
+.TP
+.B GD_WINDOP_LE
+data are extracted when the check field is less than or equal to
+.IR threshold ;
+.TP
+.B GD_WINDOP_LT
+data are extracted when the check field is strictly less than
+.IR threshold ;
+.TP
+.B GD_WINDOP_NE
+data are extracted when the check field is not equal to
+.IR threshold ;
+.TP
+.B GD_WINDOP_SET
+data are extracted when at least one bit in
+.I threshold 
+is also set in the check field;
+.TP
+.B GD_WINDOP_CLR
+data are extracted when at least one bit in
+.I threshold 
+is not set in the check field.
+.PP
+The
+.I threshold
+is the value against the check field is compared.  The
+.B gd_triplet_t
+type is defined as:
+.PP
+.in +4n
+.nf
+.fam C
+typedef union {
+  gd_int64_t i;
+  gd_uint64_t u;
+  double r;
+} gd_triplet_t;
+.fam
+.fi
+.in
+.PP
+The particular element of the union to use depends on the value of
+.I windop:
+.IP \(bu
+For
+.B GD_WINDOP_EQ
+and
+.BR GD_WINDOP_NE ,
+the signed integer element,
+.IB threshold . i
+is set;
+.IP \(bu
+For
+.B GD_WINDOP_SET
+and
+.BR GD_WINDOP_CLR ,
+the unsigned integer element,
+.IB threshold . u
+is set;
+.IP \(bu
+For all other values of
+.IR windop ,
+the floating point element,
+.IB threshold . r
+is set.
+
+.SH NOTES
+When using the C89 GetData API (by defining
+.B GD_C89_API
+before including getdata.h), the data types and names of several of the entry
+parameters are different.  The following table lists the correspondences between
+members in the C99 and C89 APIs.
+
+.TS
+center tab(|);
+cbscbs
+rlrl.
+C99 API|C89 API
+int|bitnum|int|u.bit.bitnum
+int|numbits|int|u.bit.numbits
+int|n_fields|int|u.lincom.n_fields
+double complex|cm[3]|double|u.lincom.cm[3][2]
+double|m[3]|double|u.lincom.m[3]
+double complex|cb[3]|double|u.lincom.cb[3][2]
+double|b[3]|double|u.lincom.b[3]
+const char*|table|const char*|u.linterp.table
+int|count_val|int|u.mplex.count_val
+int|period|int|u.mplex.period
+gd_shift_t|shift|gd_shift_t|u.phase.shift
+int|poly_ord|int|u.polynom.poly_ord
+double complex|ca[3]|double|u.polynom.ca[3][2]
+double|a[3]|double|u.polynom.a[3]
+unsigned int|spf|unsigned int|u.raw.spf
+gd_type_t|data_type|gd_type_t|u.raw.data_type
+double complex|cdividend|double|u.recip.cdividend[2]
+double|dividend|double|u.recip.dividend
+gd_type_t|const_type|gd_type_t|u.scalar.const_type
+size_t|array_len|size_t|u.scalar.array_len
+gd_windop_t|windop|gd_windop_t|u.window.windop
+gd_triplet_t|threshold|gd_triplet_t|u.window.threshold
+.TE
+.PP
+In the case of complex valued data in the C89 API, the first element of the
+two-element array is the real part of the complex number, and the second
+element is the imaginary part.
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_free_entry_strings (3),
+.BR gd_cbopen (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_field_list (3),
+.BR gd_fragmentname (3),
+.BR gd_linterp_tablename (3)
+.BR gd_mplex_lookback (3),
+.BR gd_raw_filename (3)
diff --git a/man/gd_entry_list.3 b/man/gd_entry_list.3
new file mode 100644
index 0000000..e95c63f
--- /dev/null
+++ b/man/gd_entry_list.3
@@ -0,0 +1,210 @@
+.\" gd_entry_list.3.  The gd_entry_list man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_entry_list 3 "28 June 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_entry_list, gd_field_list, gd_field_list_by_type gd_mfield_list, gd_mfield_list_by_type,
+gd_mvector_list, gd_vector_list \(em list field entries in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_entry_list(DIRFILE *" dirfile ", const char *" parent ,
+.BI "unsigned int " type ", unsigned int " flags );
+.HP
+.BI "const char **gd_field_list(DIRFILE *" dirfile );
+.HP
+.BI "const char **gd_field_list_by_type(DIRFILE *" dirfile ", gd_entype_t " type );
+.HP
+.BI "const char **gd_mfield_list(DIRFILE *" dirfile ", const char *" parent );
+.HP
+.BI "const char **gd_mfield_list_by_type(DIRFILE *" dirfile ,
+.BI "const char *" parent ", gd_entype_t " type );
+.HP
+.BI "const char **gd_mvector_list(DIRFILE *" dirfile ", const char *" parent );
+.HP
+.BI "const char **gd_vector_list(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_entry_list ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a list of names of field entries satisfying the supplied criteria.
+If
+.I parent
+is non-NULL, metafields under the field specified by
+.I parent
+are considered; otherwise, top-level fields are considered, and metafields
+ignored.
+
+The
+.I type
+argument should be one of the following symbols indicating an explicit entry
+type to list:
+.IP
+.nh
+.ad l
+.BR GD_BIT_ENTRY ", " GD_CARRAY_ENTRY ", " GD_CONST_ENTRY ", " GD_DIVIDE_ENTRY ,
+.BR GD_INDEX_ENTRY ", " GD_LINCOM_ENTRY ", " GD_LINTERP_ENTRY ,
+.BR GD_MPLEX_ENTRY ", " GD_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ,
+.BR GD_POLYNOM_ENTRY ", " GD_RAW_ENTRY ", " GD_RECIP_ENTRY ,
+.BR GD_SBIT_ENTRY ", " GD_STRING_ENTRY ", " GD_WINDOW_ENTRY .
+.ad n
+.hy
+.PP
+.RB ( GD_INDEX_ENTRY
+is a special field type for the implicit
+.I INDEX
+field) or else one of the following special symbols:
+.TP
+.B GD_ALL_ENTRIES \fR(= 0)
+List entries of all types.
+.TP
+.B GD_ALIAS_ENTRIES
+List only aliases.  This is the only way to get a list including aliases which
+do not point to valid field codes.
+.TP
+.B GD_SCALAR_ENTRIES
+List only scalar field types
+.RB ( CONST ", " CARRAY ", " STRING ).
+.TP
+.B GD_VECTOR_ENTRIES
+List only vector field types (all field types except the scalar field types
+listed above).
+.PP
+The
+.I flags
+argument should be zero or more of the following flags, bitwise or'd together:
+.TP
+.B GD_ENTRIES_HIDDEN
+Include hidden entries (see
+.BR gd_hidden (3))
+in the list: normally hidden entries are skipped;
+.TP
+.B GD_ENTRIES_NOALIAS
+Exclude aliases from the list: normally aliases are considered the same as
+their target (that is: if a field satisfies the criteria, both its canonical
+name and all its aliases will appear in the list).
+.PP
+The array returned will be de-allocated by a call to
+.BR gd_close (3)
+and should not be de-allocated by the caller.  The list returned should not be
+assumed to be in any particular order.  The array is terminated by a NULL
+pointer.  The number of elements in the array, excluding the terminating NULL,
+can be obtained from an equivalent call to
+.BR gd_nentries (3).
+
+The caller may not modify any strings in the array, or the array itself.  Doing
+so may cause database corruption.  The pointer returned is guaranteed to be
+valid at least until
+.BR gd_entry_list ()
+is called again on the same DIRFILE object, or until the array is de-allocated
+by a call to
+.BR gd_close (3).
+(Although the data may have become obsolete, if metadata have been modified in
+the interrim.)
+.SS Special Cases
+The call
+.RS
+.BI gd_field_list( dirfile );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_entry_list( dirfile ", NULL, GD_ALL_ENTRIES, 0);
+.RE
+.PP
+The call
+.RS
+.BI gd_field_list_by_type( dirfile ", " type );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_entry_list( dirfile ", NULL, " type ", 0);"
+.RE
+.PP
+The call
+.RS
+.BI gd_mfield_list( dirfile ", " parent );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_entry_list( dirfile ", " parent ", GD_ALL_ENTRIES, 0);"
+.RE
+.PP
+The call
+.RS
+.BI gd_mfield_list_by_type( dirfile ", " parent ", " type );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_entry_list( dirfile ", " parent ", " type ", 0);"
+.RE
+.PP
+The call
+.RS
+.BI gd_mvector_list( dirfile ", " parent );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_entry_list( dirfile ", " parent ", GD_VECTOR_ENTRIES, 0);"
+.RE
+.PP
+The call
+.RS
+.BI gd_vector_list( dirfile );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_entry_list( dirfile ", NULL, GD_VECTOR_ENTRIES, 0);"
+.RE
+
+.SH RETURN VALUE
+Upon successful completion, these functions returns a pointer to an array of
+strings containing the names of all the entries in the database satisfying the
+supplied criteria.  On error, they return zero and sets
+the dirfile error to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_BAD_CODE
+The supplied parent field code was not found, or referred to a metafield itself.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_ENTRY
+The
+.I type
+parameter supplied was not one of the symbols listed above.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_hidden (3),
+.BR gd_nentries (3)
diff --git a/man/gd_entry_type.3 b/man/gd_entry_type.3
new file mode 100644
index 0000000..d120840
--- /dev/null
+++ b/man/gd_entry_type.3
@@ -0,0 +1,102 @@
+.\" gd_entry_type.3.  The gd_entry_type man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_entry_type 3 "21 August 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_entry_type \(em retrieve the type of a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_entype_t gd_entry_type(const DIRFILE *" dirfile ", const char"
+.BI * field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_entry_type ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the field type of the field specified by
+.IR field_code .
+If
+.I field_code
+contains a valid representation suffix, it will be ignored.
+
+The
+.B gd_entype_t
+type is an enumerated type which may take any of the following values:
+.IP
+.nh
+.ad l
+.BR GD_BIT_ENTRY ,
+.BR GD_CARRAY_ENTRY ,
+.BR GD_CONST_ENTRY ,
+.BR GD_DIVIDE_ENTRY ,
+.BR GD_INDEX_ENTRY ,
+.BR GD_LINCOM_ENTRY ,
+.BR GD_LINTERP_ENTRY ,
+.BR GD_MPLEX_ENTRY ,
+.BR GD_MULTIPLY_ENTRY ,
+.BR GD_PHASE_ENTRY ,
+.BR GD_POLYNOM_ENTRY ,
+.BR GD_RAW_ENTRY ,
+.BR GD_RECIP_ENTRY ,
+.BR GD_SBIT_ENTRY ,
+.BR GD_STRING_ENTRY ,
+.BR GD_WINDOW_ENTRY .
+.ad n
+.hy
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_entry_type ()
+returns the field type of the specified field.  On error,
+.BR gd_entry_type ()
+returns
+.B GD_NO_ENTRY
+and sets the dirfile error a non-zero error value.  Possible error
+values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH SEE ALSO
+.BR gd_cbopen (3),
+.BR gd_entry (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_fragmentname (3),
+.BR gd_parent_fragment (3),
+.BR dirfile (5)
diff --git a/man/gd_eof.3 b/man/gd_eof.3
new file mode 100644
index 0000000..e6c8dba
--- /dev/null
+++ b/man/gd_eof.3
@@ -0,0 +1,143 @@
+.\" gd_eof.3.  The gd_eof man page.
+.\"
+.\" Copyright (C) 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_eof 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_eof \(em report the number of samples in a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "off_t gd_eof(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_eof ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the sample number of the end-of-field marker for the vector field
+given by
+.IR field_code .
+This is effectively the total number of samples available for the field,
+including any frame offset.
+
+The caller should not assume that this is equivalent (when accounting for the samples-per-frame of the indicated field) to the number of frames in the database
+returned by
+.BR gd_nframes (3),
+nor even that the end-of-field marker falls on a frame boundary.
+
+For a
+.B RAW
+field, the end-of-field marker occurs immediately after the last datum in the
+data file associated with the field.  For other field types, the end-of-field
+marker is equivalent to the end-of-field marker closest to the start of the
+dirfile of any of the field inputs.  The special field
+.I INDEX
+has no end-of-field marker.
+
+The end-of-field marker for a field containing no data is in the same location
+as, or before, its beginning-of-field marker (see
+.BR gd_bof (3)).
+For a
+.B RAW
+field, the difference between the locations of the beginning- and end-of-field
+markers indicates the number of samples of data actually stored on disk.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_eof ()
+returns the sample number of the end-of-field marker for the indicated field.
+On error, it returns -1 and sets the dirfile error to a non-zero error value.
+Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+or one of the fields it uses as input was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The location of the non-existent end-of-field marker for the special field
+.I INDEX
+was requested, possibly as a result of the field specified by
+.I field_code
+using
+.I INDEX
+as one of its inputs.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of its inputs was not recognised.
+.TP
+.B GD_E_DIMENSION
+A scalar field was found where a vector field was expected in the definition
+of
+.I field_code 
+or one of its inputs, or else
+.I field_code
+itself specified a scalar field.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.TP
+.B GD_E_RAW_IO
+An attempt to
+.BR stat (2)
+the file associated with the field, or one of its input fields, failed.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The size of the decoded data file associated with the specified field or one of
+its inputs could not be determined, because its encoding scheme was not
+understood.
+.TP
+.B GD_E_UNSUPPORTED
+The size of the decoded data file associated with the specified field or one of
+its inputs could not be determined, because its encoding scheme was not
+supported.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR gd_open (3),
+.BR gd_bof (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_nframes (3)
diff --git a/man/gd_eof64.3 b/man/gd_eof64.3
new file mode 100644
index 0000000..101acf3
--- /dev/null
+++ b/man/gd_eof64.3
@@ -0,0 +1,54 @@
+.\" gd_eof64.3.  The gd_eof64 man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_eof64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_eof64 \(em retrieve data from a dirfile database, with largefile support
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_off64_t gd_eof64(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_eof (3)
+uses a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+It is only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), this function will the same as
+.BR gd_eof (3).
+Otherwise,
+.BR gd_eof (3)
+will be a version of this function which uses a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_eof (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_error.3 b/man/gd_error.3
new file mode 100644
index 0000000..9ddd489
--- /dev/null
+++ b/man/gd_error.3
@@ -0,0 +1,44 @@
+.\" gd_error.3.  The gd_error man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_error 3 "20 April 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_error \(em report a GetData library error
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_error(const DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_error ()
+function returns the numeric dirfile error associated with the dirfile
+.I dirfile
+which is set by many GetData library functions.
+
+A textual description of the error may be obtained by calling
+.BR gd_error_string (3).
+
+.SH RETURN VALUE
+The
+.BR gd_error ()
+function always returns the dirfile error corresponding to the error state of
+the last library call on the supplied DIRFILE object.
+.SH SEE ALSO
+.BR gd_error_count (3),
+.BR gd_error_string (3)
diff --git a/man/gd_error_count.3 b/man/gd_error_count.3
new file mode 100644
index 0000000..0b9a7a9
--- /dev/null
+++ b/man/gd_error_count.3
@@ -0,0 +1,58 @@
+.\" gd_error_count.3.  The gd_error_count man page.
+.\"
+.\" Copyright (C) 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_error_count 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_error_count \(em report the number of errors encountered by the GetData
+library
+.SH SYNOPSIS
+.B #inlcude <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_error_check(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The first time
+.BR gd_error_count ()
+is called with the DIRFILE object
+.IR dirfile ,
+it returns the number of errors encountered by the GetData library while
+operating on the specified DIRFILE object, since the DIRFILE's creation.
+Calling this function resets the internal count, so that subsequent calls to
+.BR gd_error_count ()
+return the number of errors encountered only since the previous call to this
+function, for the specified DIRFILE.
+
+The errors themselves are not cached by the library.  The error status of
+the 
+.I last
+library call on
+.I dirfile
+(which might be
+.BR GD_E_OK ,
+indicating no error) can be obtained by calling
+.BR gd_error (3).
+
+.SH RETURN VALUE
+The
+.BR gd_error_count ()
+function always returns the number of GetData errors encountered since the last
+time it was called, or since the dirfile was created. This will be zero, if no
+error has occurred over the given time.
+.SH SEE ALSO
+.BR gd_error (3),
+.BR gd_error_string (3)
diff --git a/man/gd_error_string.3 b/man/gd_error_string.3
new file mode 100644
index 0000000..9cdd0b6
--- /dev/null
+++ b/man/gd_error_string.3
@@ -0,0 +1,71 @@
+.\" gd_error_string.3.  The gd_error_string man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_error_string 3 "20 April 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_error_string \(em report a GetData library error
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "char *gd_error_string(const DIRFILE *" dirfile ", char *" buffer ", size_t
+.IB buflen );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_error_string ()
+function returns a string describing the last dirfile error encountered while
+operating on 
+.IR dirfile .
+
+If 
+.I buffer
+is not NULL, the string is written to this memory location.  At most
+.I buflen
+characters will be written. This always includes a terminating null byte, even
+if the error string was truncated.
+The numeric dirfile error itself may be obtained by calling
+.BR gd_error (3).
+
+If
+.I buffer
+is NULL,
+.BR gd_error_string ()
+will allocate a string of sufficient length using
+.BR malloc (3),
+and
+.I buflen
+is ignored.  In this case, the caller should deallocate the returned string
+using
+.BR free (3)
+when it is no longer needed.
+
+.SH RETURN VALUE
+If
+.I buffer
+is non-NULL, the
+.BR gd_error_string ()
+function returns 
+.IR buffer ,
+or NULL if buflen is less than one.  Otherwise, it returns a newly malloc'd
+string of sufficient length which should be deallocated by the caller.  The
+error state of
+.I dirfile
+is unchanged.
+.SH SEE ALSO
+.BR gd_error (3),
+.BR gd_error_count (3)
diff --git a/man/gd_flags.3 b/man/gd_flags.3
new file mode 100644
index 0000000..4794806
--- /dev/null
+++ b/man/gd_flags.3
@@ -0,0 +1,93 @@
+.\" gd_flags.3.  The gd_flags man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_flags 3 "1 April 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_flags \(em alter GetData operational flags
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned long gd_flags(DIRFILE *" dirfile ", unsigned long " set ,
+.BI "unsigned long " reset );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_flags ()
+function modifies the operational flags of the dirfile(5) database specified by
+.IR dirfile ,
+and returns the new value of the flags register.
+
+The flags which may be queried or modified with this interface are a subset of
+the open flags (see
+.BR gd_cbopen (3)).
+These are:
+.TP
+.B GD_PRETTY_PRINT
+When dirfile metadata are flushed to disk (either explicitly via
+.BR gd_metaflush "(3), " gd_rewrite_fragment (3),
+or 
+.BR gd_flush (3)
+or implicitly by closing the dirfile), an attempt will be made to create a
+nicer looking format specification (from a human-readable standpoint).  What
+this explicitly means is not part of the API, and any particular behaviour
+should not be relied on.  If the dirfile has been opened read-only, this flag is
+ignored.
+.TP
+.B GD_VERBOSE
+Specifies that whenever an error is triggered by the library when working
+on this dirfile, the corresponding error string, which can be retrieved by
+calling 
+.BR gd_error_string (3),
+should be written on the caller's standard error stream
+.RB ( stderr (3))
+by GetData.  The error string may be prefixed by a string specified by the
+caller; see
+.BR gd_verbose_prefix (3).
+Without this flag, GetData writes nothing to standard error.  (GetData never
+writes to standard output.)
+.PP
+Flags which appear only in
+.I set
+will be turned on (enabled); flags which appear only in
+.I reset
+will be turned off (disabled); flags which appear in both
+.I set
+and
+.I reset
+will be toggled.  Flags which appear in neither of these are left unchanged.
+Accordingly, to simply query the current flags, both
+.I set
+and
+.I reset
+should be zero, and to explicitly specify all the flags, ignoring their old
+values, the new flags register should be given in
+.IR set ,
+and it's bitwise complement in
+.IR reset .
+
+.SH RETURN VALUE
+The
+.BR gd_flags ()
+function returns a bitwise or'd collection those of the above flags which are
+enabled after performing the modifications specified (if any).  This function
+does not fail.
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_cbopen (3),
+.BR gd_verbose_prefix (3),
+.BR stderr (3).
diff --git a/man/gd_flush.3 b/man/gd_flush.3
new file mode 100644
index 0000000..6443807
--- /dev/null
+++ b/man/gd_flush.3
@@ -0,0 +1,120 @@
+.\" gd_flush.3.  The gd_flush man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_flush 3 "15 March 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_flush gd_raw_close gd_sync \(em write all pending dirfile changes to disk or
+close open raw fields
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.HP
+.BI "int gd_flush(DIRFILE *" dirfile ", const char *" field_code );
+.HP
+.BI "int gd_raw_close(DIRFILE *" dirfile ", const char *" field_code );
+.HP
+.BI "int gd_sync(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_sync ()
+function flushes all pending writes to disk of raw data files associated with
+.IR field_code ,
+or its input(s), in the dirfile specified by
+.IR dirfile .
+If the
+.I field_code
+contains a valid representation suffix, it will be ignored.  As a special case,
+if
+.I field_code
+is NULL, all fields in
+.I dirfile
+will be flushed.  In this special case, modified metadata will also be flushed
+to disk as if
+.BR gd_metaflush (3)
+had been called.  If the dirfile has been opened read-only, this function does
+nothing.  Additionally, some encoding schemes may implement this as a NOP.
+.PP
+The
+.BR gd_raw_close ()
+function closes any raw data files which GetData has opened associated with
+.IR field_code ,
+or its input(s).  Again, if
+.I field_code
+is NULL, all open data files are closed.
+.PP
+Calling
+.BR gd_flush ()
+is essentially equivalent to calling first
+.BR gd_sync ()
+and then
+.BR gd_raw_close ()
+(ie. it does both tasks), although, if
+.I field_code
+is NULL, the order of operations if may be different than making the two explicit
+calls.
+.SH RETURN VALUE
+On success, these functions return zero.  On error, -1 is returned and the
+dirfile error is set to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_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.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to flush or close the field(s).
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_close (3),
+.BR gd_dirfile_standards (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_metaflush (3)
diff --git a/man/gd_fragment_affixes.3 b/man/gd_fragment_affixes.3
new file mode 100644
index 0000000..3f9526a
--- /dev/null
+++ b/man/gd_fragment_affixes.3
@@ -0,0 +1,88 @@
+.\" gd_fragment_affix.3.  The gd_fragment_affix man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_fragment_affix 3 "2 August 2012" "Version 0.8.1" "GETDATA"
+.SH NAME
+gd_fragment_affix \(em report the field affixes of a fragment of a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_fragment_affix(DIRFILE *" dirfile ", int " fragment_index ,
+.BI "char **" prefix ", char **" suffix );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_fragment_affix ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the field affixes for the fragment indexed by
+.IR fragment_index .
+The field prefix and suffix are appended to all field codes found in the
+specified fragment.
+
+The
+.I prefix
+and
+.I suffix
+parameters point to memory locations in which store the addresses of the
+returned strings.
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_fragment_affix ()
+returns zero.  If non-empty, the prefix and suffix are reported in
+.BR malloc (3)'d
+buffers whose addresses are returned in
+.BI * prefix
+and
+.BI * suffix\fR.
+They should be deallocated by the caller when no longer needed by calling
+.BR free (3).
+If the fragment prefix or suffix is the empty string, NULL is returned in the
+corresponding pointer.
+
+On error, -1 is returned and sets the dirfile error to a non-zero error value.
+In this case, the values of
+.BI * prefix
+and
+.BI * suffix
+are unspecified, but will NOT be pointers to valid allocated memory.  Possible
+dirfile error values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_alter_frameoffset (3),
+.BR gd_include_affixes (3),
+.BR gd_open (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_fragment_index.3 b/man/gd_fragment_index.3
new file mode 100644
index 0000000..ee33739
--- /dev/null
+++ b/man/gd_fragment_index.3
@@ -0,0 +1,75 @@
+.\" gd_fragment_index.3.  The gd_fragment_index man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_fragment_index 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_fragment_index \(em retrieve the fragment containing a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_fragment_index(const DIRFILE *" dirfile ", const char"
+.BI * entry_name );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_fragment_index ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the index number of the fragment defining the field or alias
+specified by
+.IR entry_name ,
+which may not contain a representation suffix.
+
+This is one of the few GetData functions which does not resolve aliases:
+supplying the name of an alias as
+.I entry_name
+will return the index of the fragment containing the alias itself and not that
+of its target.
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_fragment_index ()
+returns the requested fragment index.  On error,
+.BR gd_fragment_index ()
+returns -1 and sets the dirfile error a non-zero error value.  Possible error
+values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The entry specified by
+.I entry_name
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_entry (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_fragmentname (3),
+.BR gd_parent_fragment (3),
+.BR dirfile (5)
diff --git a/man/gd_fragmentname.3 b/man/gd_fragmentname.3
new file mode 100644
index 0000000..d2f6ee0
--- /dev/null
+++ b/man/gd_fragmentname.3
@@ -0,0 +1,78 @@
+.\" gd_fragmentname.3.  The gd_fragmentname man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_fragmentname 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_fragmentname \(em retrieve a dirfile format specification fragment name
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char* gd_fragmentname(const DIRFILE *" dirfile ", int " index );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_fragmentname ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the filename of the format specification fragment indexed by the
+non-negative
+.IR index .
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The fragment with
+.I index
+equal to zero is always the primary fragment for the database (the file called 
+.B format
+in the root dirfile directory).  The largest valid value of
+.I index
+is one less than the total number of fragments, which may be obtained from a
+call to
+.BR gd_nfragments (3).
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_fragmentname ()
+returns a pointer to a read-only character string containing the file name of
+the specified fragment.  On error,
+.BR gd_fragmentname ()
+returns NULL and sets the dirfile error a non-zero error value.  Possible error
+values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_include (3),
+.BR gd_nfragments (3),
+.BR gd_open (3),
+.BR gd_parent_fragment (3)
diff --git a/man/gd_framenum_subset.3 b/man/gd_framenum_subset.3
new file mode 100644
index 0000000..94e3aec
--- /dev/null
+++ b/man/gd_framenum_subset.3
@@ -0,0 +1,174 @@
+.\" gd_framenum_subset.3.  The gd_framenum man page.
+.\"
+.\" Copyright (C) 2009, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_framenum_subset 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_framenum_subset, gd_framenum \(em perform a reverse look-up on a
+monotonic dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "double gd_framenum_subset(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "double " value ", off_t " field_start ", off_t " field_end );
+.HP
+.BI "double gd_framenum(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "double " value );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_framenum_subset ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the fractional frame number at which the field specified by
+.IR field_code ,
+which may contain a representation suffix, equals
+.IR value ,
+by considering the field between the frame limits
+.I field_start
+and
+.IR field_end .
+
+If
+.I field_start
+is zero, the frame offset of the field is used as the lower limit instead (which
+may, in fact, be zero; see
+.BR gd_frameoffset (3)).
+If
+.I field_end
+is zero, the number of frames in the dirfile, as reported by
+.BR gd_nframes (3),
+is used instead as the upper limit.
+
+The
+.BR gd_framenum ()
+function is equivalent to calling
+.BR gd_framenum_subset ()
+with
+.I field_start
+and
+.I field_end
+equal to zero.
+
+The field must be monotonic (either increasing or decreasing) between the
+supplied limits.  It is not required to be strictly monotonic.
+
+If the value searched for lies between two sample values, the frame number
+returned will be calculated by linear interpolation of the field between these
+two samples.  If more than one consecutive sample is equal to the value searched
+for, the fractional frame number of one of these samples will be returned,
+without specifying which particular one will be used.
+
+If the value searched for is found to lie outside of the supplied limits, the
+first two or last two samples of the field will be used to linearly extrapolate
+the returned frame number.  If these two samples happen to have the same value,
+positive or negative infinity will be returned.  When extrapolating, this
+function will never consider data outside the supplied limits, even if such data
+exists.  As a result, the extrapolated value may differ greatly from the value
+considering all the data.
+
+All computation is done in double precision.  As a result, using this function
+on a 64-bit integer field with more precision than a double precision floating
+point number, may result in an inaccurate returned value.  Attempting to use
+this function on a complex valued field will result in an error.
+
+If the field is constant across the entire range, an error results, even if
+the value to search for is equal to the constant value of the field.
+
+.SH RETURN VALUE
+On success, these functions return the fractional frame number at which the
+given function would attain the supplied value, based only on that portion of
+the field between the given limits.  This might be any number, even values
+outside of the supplied limits, up to and including positive or negative
+infinity.
+
+On error, these functions return an IEEE-754 conforming not-a-number (NaN), and
+set the dirfile error to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of its input fields, was not recognised.
+.TP
+.B GD_E_BAD_SCALAR
+A scalar field used in the definition of the field was not found, or was not of
+scalar type.
+.TP
+.B GD_E_DIMENSION
+The field specified by
+.I field_code
+was not a vector field.  Or, a scalar field was found where a vector field was
+expected in the definition of the field or one of its inputs.
+.TP
+.B GD_E_DOMAIN
+The specified field was complex valued, or the supplied frame range was too
+small.  This error may also arise if data is deleted from the field as the
+function is executing.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+maintainer.
+.TP
+.B GD_E_OPEN_LINFILE
+An error occurred while trying to read a LINTERP table from disk.
+.TP
+.B GD_E_RANGE
+The specified field is constant between the supplied limits.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to open or read from a file on disk containing
+a raw field.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of a RAW field could not be determined.  This may also
+indicate that the binary file associated with the RAW field could not be found.
+.TP
+.B GD_E_UNSUPPORTED
+Reading from dirfiles with the encoding scheme of the specified dirfile is not
+supported by the library.  See
+.BR dirfile-encoding (5)
+for details on dirfile encoding schemes.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_frameoffset (3),
+.BR gd_nframes (3)
diff --git a/man/gd_framenum_subset64.3 b/man/gd_framenum_subset64.3
new file mode 100644
index 0000000..2223068
--- /dev/null
+++ b/man/gd_framenum_subset64.3
@@ -0,0 +1,57 @@
+.\" gd_framenum_subset64.3.  The gd_framenum_subset64 man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_framenum_subset64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_framenum_subset64 \(em perform a reverse look-up on a monotonic dirfile
+field, with largefile support.
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "double gd_framenum_subset64(DIRFILE *" dirfile ,
+.BI "const char *" field_code ", double " value ", gd_off64_t " field_start ,
+.BI "gd_off64_t " field_end );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_framenum_subset (3)
+uses a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+It is only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), this function will the same as
+.BR gd_framenum_subset (3).
+Otherwise,
+.BR gd_framenum_subset (3)
+will be a version of this function which uses a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_framenum_subset (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_frameoffset.3 b/man/gd_frameoffset.3
new file mode 100644
index 0000000..95fe69e
--- /dev/null
+++ b/man/gd_frameoffset.3
@@ -0,0 +1,71 @@
+.\" gd_frameoffset.3.  The gd_frameoffset man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_frameoffset 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_frameoffset \(em report the starting frame of fields in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "off_t gd_frameoffset(DIRFILE *" dirfile ", int " fragment_index );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_frameoffset ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the frame offset (see dirfile-format(5)) for the fragment indexed by
+.IR fragment_index .
+The frame offset of a fragment indicate the frame number of the first sample
+of data stored in binary files associated with
+.B RAW
+fields defined in the specified fragment.  The frame offset of a fragment
+containing no
+.B RAW
+fields is ignored.
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_frameoffset ()
+returns the frame offset of the specified fragment.  On error, it
+returns -1 and sets the dirfile error to a non-zero error value.  Possible error
+values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_alter_frameoffset (3),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_frameoffset64.3 b/man/gd_frameoffset64.3
new file mode 100644
index 0000000..459e895
--- /dev/null
+++ b/man/gd_frameoffset64.3
@@ -0,0 +1,65 @@
+.\" gd_frameoffset64.3.  The gd_frameoffset64 man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_frameoffset64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_frameoffset64, gd_alter_frameoffset64 \(em report or change the frame
+offset of fields in a dirfile, with largefile support
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_off64_t gd_frameoffset(DIRFILE *" dirfile ", int " fragment_index );
+.HP
+.BI "int gd_alter_frameoffset64(DIRFILE *" dirfile ", gd_off64_t " offset ,
+.BI "int " fragment_index ", int " move );
+.hy
+.ad n
+.SH DESCRIPTION
+These versions of
+.BR gd_frameoffset (3)
+and
+.BR gd_alter_frameoffset (3)
+use a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+They are only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), these functions will the same as
+.BR gd_framenum_subset (3)
+and
+.BR gd_alter_frameoffset (3).
+Otherwise,
+.BR gd_framenum_subset (3)
+and
+.BR gd_alter_frameoffset (3)
+will be versions of these function which use a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_alter_frameoffset (3),
+.BR gd_frameoffset (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_free_entry_strings.3 b/man/gd_free_entry_strings.3
new file mode 100644
index 0000000..18845e0
--- /dev/null
+++ b/man/gd_free_entry_strings.3
@@ -0,0 +1,70 @@
+.\" gd_free_entry_strings.3.  The gd_free_entry_strings man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_free_entry_strings 3 "16 June 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_free_entry_strings \(em free strings in a GetData gd_entry_t object
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_entry_t *gd_free_entry_strings(gd_entry_t *" entry );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_free_entry_strings ()
+function frees the character strings found in the gd_entry_t object
+.I entry
+which were previously allocated by a call to
+.BR gd_entry (3).
+If
+.I entry
+is NULL, this function does nothing.
+
+If non-NULL,
+.I entry
+must point to a valid and properly initialised gd_entry_t object, such as that
+returned by
+.BR gd_entry (3).
+As well, the caller may construct a properly initialised gd_entry_t object by
+first setting all bits to zero, then setting the field_type parameter to the
+desired gd_entype_t symbol, and finally initialising only the members defined
+for that type.  The results of calling this function are undefined if the
+character strings pointed to by the string members of
+.I entry
+have not been allocated with
+.BR malloc (3),
+unless these pointer members are equal to NULL.
+
+See 
+.BR gd_entry (3)
+for a complete description of the gd_entry_t data type.
+.SH RETURN VALUE
+A call to 
+.BR gd_free_entry_strings ()
+always returns its input,
+.IR entry .
+.SH NOTES
+This function is provided as a convenience only.  Callers may free strings
+allocated by
+.BR gd_entry (3)
+themselves by simply calling
+.BR free (3)
+on the appropriate members for the given entry type, if they prefer to do so.
+.SH SEE ALSO
+.BR gd_entry (3),
+.BR free (3)
diff --git a/man/gd_get_carray_slice.3 b/man/gd_get_carray_slice.3
new file mode 100644
index 0000000..2d98774
--- /dev/null
+++ b/man/gd_get_carray_slice.3
@@ -0,0 +1,216 @@
+.\" gd_get_carray_slice.3.  The gd_get_carray_slice man page.
+.\"
+.\" Copyright (C) 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_get_carray_slice 3 "4 July 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_get_carray, gd_get_carray_slice, gd_get_constant \(em retrieve CONST or\CARRAY data from a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_get_carray_slice(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "unsigned int " start ", size_t " len ", gd_type_t " return_type ,
+.BI "void *" data_out );
+.HP
+.BI "int gd_get_carray(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_type_t " return_type ", void *" data_out );
+.HP
+.BI "int gd_get_constant(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_type_t " return_type ", void *" data_out );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_get_carray_slice ()
+function queries a dirfile(5) database specified by
+.I dirfile
+for the
+.B CONST
+or
+.B CARRAY
+scalar array
+.IR field_code ,
+which may contain a representation suffix.
+The data in the field is converted to the data type specified by
+.IR return_type ,
+and stored in the user-supplied buffer
+.IR data_out .
+The first element of the field stored is given by
+.IR start ,
+and the number of elements stored is given by
+.IR len .
+
+The
+.BR gd_get_carray ()
+function behaves similarly, except it returns the entire field, as if
+.BR gd_get_carray_slice ()
+were called with
+.I start
+equal to zero and
+.I len
+equal to the value returned by
+.BR gd_carray_len (3).
+The
+.BR gd_get_constant ()
+function is equivalent to calling
+.BR gd_get_carray_slice ()
+with
+.I start
+equal to zero and
+.I len
+equal to one.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+The argument
+.I data_out
+must point to a valid memory location of sufficient size to hold all the
+requested data of the return type specified.  The number of elements returned
+by
+.BR gd_get_carray ()
+may be obtained by calling
+.BR gd_carray_len (3).
+Unlike
+.BR gd_getdata (3),
+calling
+.BR gd_get_carray_slice ()
+never results in a short read; attempting to read past the end of the
+field will result in an error, and no data will be returned.
+
+The 
+.I return_type
+argument should be one of the following symbols, which indicates the desired
+return type of the data:
+.RS
+.TP 11
+.B GD_UINT8
+unsigned 8-bit integer
+.TP
+.B GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.B GD_UINT16
+unsigned 16-bit integer
+.TP
+.B GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.B GD_UINT32
+unsigned 32-bit integer
+.TP
+.B GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.B GD_UINT64
+unsigned 64-bit integer
+.TP
+.B GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.B GD_FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.B GD_FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.B GD_COMPLEX64
+C99-conformant 64-bit single precision complex number
+.TP
+.B GD_COMPLEX128
+C99-conformant 128-bit double precision complex number
+.TP
+.B GD_NULL
+the null type: the database is queried as usual, but no data is returned.
+In this case,
+.I data_out
+is ignored and may be NULL.
+.RE
+
+The return type of the field need not be the same as the type of the data stored
+in the database.  Type conversion will be performed as necessary to return the
+requested type.  If the
+.I field_code
+does not indicate a representation, but conversion from a complex value to a
+purely real one is required, only the real portion of the requested vector will
+be returned.
+.SH RETURN VALUE
+On success,
+.BR gd_get_carray ()
+and
+.BR gd_get_carray_slice ()
+return zero.  On error, they return -1 and set the dirfile error to a non-zero
+value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+An invalid
+.I dirfile
+was supplied.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The supplied
+.I field_code
+was not a
+.BR CONST
+nor
+.BR CARRAY .
+The caller should use
+.BR gd_getdata (3)
+or
+.BR gd_get_string (3)
+instead.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of the field codes it uses for input, was invalid.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I return_type
+was specified.
+.TP
+.B GD_E_BOUNDS
+A request for data beyond the end of the field was made.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+maintainer.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered may be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_carray_len (3),
+.BR gd_carrays (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_get_constant (3),
+.BR gd_open (3),
+.BR gd_put_carray_slice (3)
diff --git a/man/gd_get_string.3 b/man/gd_get_string.3
new file mode 100644
index 0000000..042bd98
--- /dev/null
+++ b/man/gd_get_string.3
@@ -0,0 +1,112 @@
+.\" gd_get_string.3.  The gd_get_string man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_get_string 3 "25 May 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_get_string \(em retrieve a string from a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_get_string(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "size_t " len ", char *" data_out );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_get_string ()
+function queries a dirfile(5) database specified by
+.I dirfile
+for the string scalar
+.IR field_code ,
+which should not contain a representation suffix.  The first
+.I len
+characters of the string scalar are stored in the user-supplied buffer
+.IR data_out .
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+If
+.I len
+equals zero, or if
+.I data_out
+equals NULL, no data will be copied to
+.IR data_out ,
+but the length of the string scalar will still be returned by
+.BR gd_get_string ().
+Otherwise, the argument
+.I data_out
+must point to a valid memory location of sufficient size to hold at least
+.I len
+characters.  If the length of the string scalar is greater than
+.IR len ", " data_out
+will not be NULL-terminated.
+.SH RETURN VALUE
+On success,
+.BR gd_get_string ()
+returns the actual length of the specified string scalar, including the trailing
+NULL character.  A return value greater than
+.I len
+indicates that the output string is not null terminated.
+
+On error, it returns 0 and sets the dirfile error to a non-zero
+value.  Possible error values are:
+.TP 8
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+An invalid
+.I dirfile
+was supplied.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The supplied
+.I field_code
+referred to a field of type other than
+.BR STRING .
+The caller should use
+.BR gd_getdata (3),
+or
+.BR gd_get_constant (3)
+instead.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I return_type
+was specified.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+maintainer.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered may be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_put_string (3)
diff --git a/man/gd_getdata.3 b/man/gd_getdata.3
new file mode 100644
index 0000000..536cf1c
--- /dev/null
+++ b/man/gd_getdata.3
@@ -0,0 +1,375 @@
+.\" gd_getdata.3.  The gd_getdata man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_getdata 3 "26 January 2013" "Version 0.8.3" "GETDATA"
+.SH NAME
+gd_getdata \(em retrieve data from a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_getdata(DIRFILE *" dirfile ", const char *" field_code ", off_t"
+.IB first_frame ", off_t " first_sample ", size_t " num_frames ", size_t"
+.IB num_samples ", gd_type_t " return_type ", void *" data_out );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_getdata ()
+function queries a dirfile(5) database specified by
+.I dirfile
+for the field
+.IR field_code .
+It fetches
+.I num_frames
+frames plus
+.I num_samples
+samples from this field, starting 
+.I first_sample
+samples past frame
+.IR first_frame . 
+The data is converted to the data type specified by
+.IR return_type ,
+and stored in the user-supplied buffer
+.IR data_out .
+
+The 
+.I field_code
+may contain one of the representation suffixes listed in dirfile-format(5).
+If it does,
+.BR gd_getdata ()
+will compute the appropriate complex norm before returning the data.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+The argument
+.I data_out
+must point to a valid memory location of sufficient size to hold all data
+requested.
+
+Unless using
+.B GD_HERE 
+(see below), the first sample returned will be
+.IP
+.IR first_frame " * " samples_per_frame " + " first_sample
+.PP
+as measured from the start of the dirfile, where
+.I samples_per_frame
+is the number of samples per frame as returned by
+.BR gd_spf (3).
+The number of samples fetched is, similarly,
+.IP
+.IR num_frames " * " samples_per_frame " + " num_samples .
+.PP
+Although calling
+.BR gd_getdata ()
+using both samples and frames is possible, the function is typically called
+with either
+.IR num_samples " and " first_sample ,
+or
+.IR num_frames " and " first_frames ,
+equal to zero.
+
+Instead of explicitly specifying the origin of the read, the caller may pass the
+special symbol
+.B GD_HERE
+as
+.IR first_frame .
+This will result in the read occurring at the current position of the I/O
+pointer for the field (see
+.BR gd_seek (3)
+for a discussion of field I/O pointers).  In this case, the value of
+.I first_sample
+is ignored.
+
+The 
+.I return_type
+argument should be one of the following symbols, which indicates the desired
+return type of the data:
+.RS
+.TP 11
+.B GD_UINT8
+unsigned 8-bit integer
+.TP
+.B GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.B GD_UINT16
+unsigned 16-bit integer
+.TP
+.B GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.B GD_UINT32
+unsigned 32-bit integer
+.TP
+.B GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.B GD_UINT64
+unsigned 64-bit integer
+.TP
+.B GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.B GD_FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.B GD_FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.B GD_COMPLEX64
+C99-conformant 64-bit single precision complex number
+.TP
+.B GD_COMPLEX128
+C99-conformant 128-bit double precision complex number
+.TP
+.B GD_NULL
+the null type: the database is queried as usual, but no data is returned.
+In this case,
+.I data_out
+is ignored and may be NULL.
+.RE
+
+The return type of the data need not be the same as the type of the data stored
+in the database.  Type conversion will be performed as necessary to return the
+requested type.  If the
+.I field_code
+does not indicate a representation, but conversion from a complex value to a
+purely real one is required, only the real portion of the requested vector will
+be returned.
+
+Upon successful completion, the I/O pointer of the field will be on the sample
+immediately following the last sample returned.  On error, the position of the
+I/O pointer is not specified, and may not even be well defined.
+
+.SS Behaviour While Reading Specific Field Types
+
+.TP
+.BR PHASE :
+A forward-shifted
+.B PHASE
+field will always encounter the end-of-field marker before its input field does.
+This has ramifications when reading
+streaming data
+with
+.BR gd_getdata ()
+and using
+.BR gd_nframes (3)
+to gauge field lengths (that is: a
+forward-shifted
+.B PHASE
+field always has less data in it than
+.BR gd_nframes (3)
+implies that it does).  As with any other field,
+.BR gd_getdata ()
+will return a short count whenever a read from a
+.B PHASE
+field encounters the end-of-field marker.
+
+Backward-shifted
+.B PHASE
+fields do not suffer from this problem, since
+.BR gd_getdata ()
+pads reads past the beginning-of-field marker with NaN or zero as appropriate.
+Database creators who wish to use the
+.B PHASE
+field type with streaming data are encouraged to work around this limitation
+by only using backward-shifted 
+.B PHASE
+fields, by writing
+.B RAW
+data at the maximal frame lag, and then back-shifting all data which should have
+been written earlier.  Another possible work-around is to write
+systematically less data to the reference
+.B RAW
+field in proportion to the maximal forward phase shift.  This method will work
+with applications which respect the database size reported by
+.BR gd_nframes (3)
+resulting in these applications effectively ignoring all frames past the frame
+containing the maximally forward-shifted
+.B PHASE
+field's end-of-field marker.
+
+.TP
+.BR MPLEX :
+Reading an
+.B MPLEX
+field typically requires GetData to read data before the range returned in order
+to determine the value of the first sample returned.  This can become expensive
+if the encoding of the underlying RAW data does not support seeking backwards
+(which is true of most compression encodings).  How much preceding data GetData
+searches for the initial value of the returned data can be adjusted, or the
+lookback disabled completely, using
+.BR gd_mplex_lookback (3).
+If the initial value of the field is not found in the data searched, GetData
+will fill the returned vector, up to the next available sample of the
+mulitplexed field, with zero for integer return types, or IEEE-754-conforming
+NaN (not-a-number) for floating point return types, as it does when providing
+data before the beginning-of-field.
+
+GetData caches the value of the last sample from every
+.B MPLEX
+it reads so that a subsequent read of the field starting from the following
+sample (either through an explicit starting sample given by the caller or else
+implicitly using
+.BR GD_HERE )
+will not need to scan the field backwards.  This cache is invalidated if a
+different return type is used, or if an intervening operation moves the field's
+I/O pointer.
+
+.TP
+.BR WINDOW :
+The samples of a
+.B WINDOW
+for which the field conditional is false will be filled with either zero for
+integer return types, or IEEE-754-conforming NaN (not-a-number) for floating
+point return types.
+
+.SH RETURN VALUE
+In all cases,
+.BR gd_getdata ()
+returns the number of samples (not bytes) successfully read from the database.
+If the end-of-field is encountered before the requested number of samples have
+been read, a short count will result.  The library does not consider this an
+error.  Requests for data before the beginning-of-field marker, which may have
+been shifted from frame zero by the presence of a
+.B FRAMEOFFSET
+directive, will result in the the data being padded at the front by NaN or zero
+depending on whether the return type is of floating point or integral type.
+
+If an error has occurred, zero is returned and the dirfile error
+will be set to a non-zero value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.IR field_code ,
+or one of the fields it uses for input, was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+An invalid
+.I dirfile
+was supplied.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.IR field_code ,
+or in one of the field codes it uses for input, was invalid.
+.TP
+.B GD_E_BAD_SCALAR
+A scalar field used in the definition of the field was not found, or was not of
+scalar type.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I return_type
+was specified.
+.TP
+.B GD_E_DIMENSION
+The supplied
+.I field_code
+referred to a 
+.BR CONST ,\~ CARRAY ,
+or 
+.B STRING
+field.  The caller should use
+.BR gd_get_constant (3),\~ gd_get_carray (3) ,
+or
+.BR gd_get_string (3)
+instead.  Or, a scalar field was found where a vector field was expected in
+the definition of
+.I field_code
+or one of its inputs.
+.TP
+.B GD_E_DOMAIN
+An immediate read was attempted using
+.BR GD_HERE ,
+but the I/O pointer of the field was not well defined because two or more of
+the field's inputs did not agree as to the location of the I/O pointer.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+maintainer.
+.TP
+.B GD_E_OPEN_LINFILE
+An error occurred while trying to read a LINTERP table from disk.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to open or read from a file on disk containing
+a raw field.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of a RAW field could not be determined.  This may also
+indicate that the binary file associated with the RAW field could not be found.
+.TP
+.B GD_E_UNSUPPORTED
+Reading from dirfiles with the encoding scheme of the specified dirfile is not
+supported by the library.  See
+.BR dirfile-encoding (5)
+for details on dirfile encoding schemes.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+To save memory,
+.BR gd_getdata ()
+uses the memory pointed to by
+.I data_out
+as scratch space while computing derived fields.  As a result, if an error is
+encountered during the computation, the contents of this memory buffer are
+unspecified, and may have been modified by this call, even though
+.BR gd_getdata ()
+will report zero samples returned on error.
+
+Reading slim-compressed data (see defile-encoding(5)), may cause unexpected
+memory usage.  This is because slimlib internally caches open decompressed files
+as they are read, and getdata doesn't close data files between
+.BR gd_getdata ()
+calls for efficiency's sake.  Memory used by this internal slimlib buffer can be
+reclaimed by calling
+.BR df_raw_close (3)
+on fields when finished reading them.
+
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR gd_get_constant (3),
+.BR gd_get_string (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_mplex_lookback (3),
+.BR gd_nframes (3),
+.BR gd_open (3),
+.BR gd_raw_close (3),
+.BR gd_seek (3),
+.BR gd_spf (3),
+.BR gd_putdata (3),
+.BR GD_SIZE (3)
diff --git a/man/gd_getdata64.3 b/man/gd_getdata64.3
new file mode 100644
index 0000000..51fb0fd
--- /dev/null
+++ b/man/gd_getdata64.3
@@ -0,0 +1,57 @@
+.\" gd_getdata64.3.  The gd_getdata64 man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_getdata64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_getdata64 \(em retrieve data from a dirfile database, with largefile support
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_getdata64(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_off64_t " first_frame ", gd_off64_t " first_sample ", size_t
+.IB num_frames ", size_t " num_samples ", gd_type_t " return_type ,
+.BI "void *" data_out );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_getdata (3)
+uses a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+It is only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), this function will the same as
+.BR gd_getdata (3).
+Otherwise,
+.BR gd_getdata (3)
+will be a version of this function which uses a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_getdata (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_hidden.3 b/man/gd_hidden.3
new file mode 100644
index 0000000..bc7336d
--- /dev/null
+++ b/man/gd_hidden.3
@@ -0,0 +1,77 @@
+.\" gd_hidden.3.  The gd_hidden man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_hidden 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_hidden \(em retrieve the fragment containing a dirfile field
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_hidden(const DIRFILE *" dirfile ", const char"
+.BI * entry_name );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_hidden ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and indicates whether the field or alias called
+.IR entry_name
+is hidden or not.
+
+A hidden entry does not appear in the field lists returned by the functions
+.BR gd_field_list (3),
+.BR gd_field_list_by_type (3),
+.BR gd_vectors (3),
+.BR gd_constants (3),
+and
+.BR gd_strings (3).
+These omissions are also reflected in the counts returned by the corresponding
+field counting functions
+.RB ( gd_nfields (3),
+&c.).
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_hidden ()
+returns one if the field or alias is hidden, or zero if the entry is not hidden.
+On error it returns -1 and sets the dirfile error a non-zero error value.  (As a
+result, the caller checking simply whether the return value of this function is
+non-zero is usually an error.)  Possible error values are:
+.TP 8
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH SEE ALSO
+.BR gd_entry (3),
+.BR gd_field_list (3),
+.BR gd_hide (3),
+.BR gd_nfields (3),
+.BR gd_open (3),
+.BR gd_unhide (3),
+.BR dirfile (5)
diff --git a/man/gd_hide.3 b/man/gd_hide.3
new file mode 100644
index 0000000..d283c68
--- /dev/null
+++ b/man/gd_hide.3
@@ -0,0 +1,89 @@
+.\" gd_hide.3.  The gd_hidden man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_hide 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_hide, gd_unhide \(em hide or unhide a dirfile database entry
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_hide(const DIRFILE *" dirfile ", const char"
+.BI * entry_name );
+.HP
+.BI "int gd_unhide(const DIRFILE *" dirfile ", const char"
+.BI * entry_name );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_hide ()
+function hides the field or alias called
+.IR entry_name
+in the dirfile(5) database specified by
+.I dirfile
+and indicates whether the field or alias called is hidden or not.  Similarly,
+the
+.BR gd_unhide ()
+function unhides the specified entry.
+
+A hidden entry does not appear in the field lists returned by the functions
+.BR gd_field_list (3),
+.BR gd_field_list_by_type (3),
+.BR gd_vectors (3),
+.BR gd_constants (3),
+and
+.BR gd_strings (3).
+These omissions are also reflected in the counts returned by the corresponding
+field counting functions
+.RB ( gd_nfields (3),
+&c.).  A hidden field is otherwise no different than an unhidden field.
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_hide ()
+and
+.BR gd_unhide ()
+return zero.  On error they returns -1 and sets the dirfile error a non-zero
+error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_PROTECTED
+The metadata of the affected format specification fragments was protected from
+change.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH SEE ALSO
+.BR gd_entry (3),
+.BR gd_field_list (3),
+.BR gd_hidden (3),
+.BR gd_nfields (3),
+.BR gd_open (3),
+.BR dirfile (5)
diff --git a/man/gd_include_affix.3 b/man/gd_include_affix.3
new file mode 100644
index 0000000..c4d3633
--- /dev/null
+++ b/man/gd_include_affix.3
@@ -0,0 +1,354 @@
+.\" gd_include_affix.3.  The gd_include_affix man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_include_affix 3 "21 April 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_include_affix, gd_include \(em add a format specification fragment to a
+dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_include_affix(DIRFILE *" dirfile ", const char *" include_file ,
+.BI "int " parent_fragment ", const char *" prefix ", const char *" suffix ,
+.BI "unsigned long " flags );
+.HP
+.BI "int gd_include(DIRFILE *" dirfile ", const char *" include_file ,
+.BI "int " parent_fragment ", unsigned long " flags );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_include_affix ()
+function adds the format specification fragment given by the path
+.I include_file
+to the specified dirfile, possibly creating the fragment, using the affixes
+specified.  This occurs as if, in the existing fragment indexed
+by
+.IR parent_fragment ,
+the following directive were present:
+.IP
+.B /INCLUDE
+.I <include_file> <prefix> <suffix>
+.PP
+(see
+.BR dirfile-format (5)).
+If a parser callback function had been specified when the dirfile was opened
+using
+.BR gd_cbopen (3),
+or added later with
+.BR gd_parser_callback (3),
+this callback function will be called if a syntax error is encountered while
+parsing the included fragment.
+
+Passing NULL as
+.I prefix
+or
+.I suffix
+is the same as using the empty string (ie. the corresponding affix is empty).
+The function
+.BR gd_include ()
+is equivalent to calling
+.BR gd_include_affix ()
+with both
+.I prefix
+and
+.I suffix
+equal to NULL.
+
+The 
+.I flags
+argument should be a bitwise-or'd collection of zero or more of the following
+flags:
+.PP
+.PD 0
+.B GD_ARM_ENDIAN
+.TP
+.PD
+.B GD_NOT_ARM_ENDIAN
+Specifies that double precision floating point raw data on disk are, or are not,
+stored in the middle-endian format used by older ARM processors.
+
+These flag only set the default endianness, and will be overridden when an
+.B /ENDIAN
+directive specifies the byte sex of
+.B RAW
+fields, unless
+.B GD_FORCE_ENDIAN
+is also specified.
+
+On every platform, one of these flags
+.RB ( GD_NOT_ARM_ENDIAN
+on all but middle-ended ARM systems)
+indicates the native behaviour of the platform.  That symbol will equal zero,
+and may be omitted.
+.PP
+.PD 0
+.B GD_BIG_ENDIAN
+.TP
+.PD
+.B GD_LITTLE_ENDIAN
+Specifies the default byte sex of raw data stored on disk to be either
+big-endian (most significant byte first) or little-endian (least significant
+byte first).  Omitting both flags indicates the default should be the native
+endianness of the platform.
+
+Unlike the ARM endianness flags above, neither of these symbols is ever zero.
+Specifying both these flags together will cause the library to assume that the
+endianness of the data is opposite to that of the native architecture, whatever
+that might be.
+
+These flag only set the default endianness, and will be overridden when an
+.B /ENDIAN
+directive specifies the byte sex of
+.B RAW
+fields, unless
+.B GD_FORCE_ENDIAN
+is also specified.
+.TP
+.B GD_CREAT
+An empty fragment will be created, if one does not already exist.  The fragment
+will have mode
+.BR S_IRUSR " | " S_IWUSR " | "  S_IRGRP " | "  S_IWGRP " | " S_IROTH " | " S_IWOTH
+(0666), modified by the caller's umask value (see
+.BR umask (2)).
+.TP
+.B GD_EXCL
+Ensure that this call creates a new fragment: when specified along with
+.BR GD_CREAT ,
+the call will fail if the file specified by
+.I include_file
+already exists.  If
+.B GD_CREAT
+is not specified, this flag is ignord.  This flag suffers from all the
+limitations of the
+.B O_EXCL
+flag as indicated in
+.BR open (2).
+.TP
+.B GD_FORCE_ENCODING
+Specifies that
+.B /ENCODING
+directives (see
+.BR dirfile-format (5))
+found in the fragment should be ignored.  The encoding scheme
+specified in
+.I flags
+will be used instead (see below).
+.TP
+.B GD_FORCE_ENDIAN
+Specifies that
+.B /ENDIAN
+directives (see
+.BR dirfile-format (5))
+found in the fragment should be ignored.  When specified with one of
+.BR GD_BIG_ENDIAN " or " GD_LITTLE_ENDIAN ,
+the indicated endianness will be assumed.  If this flag is specified with
+neither of those flags, the fragment will be assumed to have the endianness of
+the native architecture.
+.TP
+.B GD_IGNORE_DUPS
+If the fragment specifies more than one field with the same name, or a field 
+with the same name as an existing field, all but one of them will be ignored by
+the parser.  Without this flag, parsing would fail with the
+.B GD_E_FORMAT 
+error, possibly resulting in invocation of the registered callback function.
+Which of the duplicate fields is kept is not specified, nor whether an existing
+field takes precedence over a new one or not.  As a result, this flag is
+typically only useful in the case where identical copies of a field
+specification line are present.
+
+No indication is provided to indicate whether a duplicate field has been
+discarded.  If finer grained control is required, the caller should handle
+.B GD_E_FORMAT_DUPLICATE
+suberrors itself with an appropriate callback function.
+.TP
+.B GD_IGNORE_REFS
+If the dirfile currently has a reference field (either because one was specified
+explicitly, or else because the first
+.B RAW
+field was used),
+.B /REFERENCE
+directives in the included fragment will be ignored.  Otherwise, a
+.B /REFERENCE
+directive in the included fragment will replace the current reference field in
+the dirfile.
+.TP
+.B GD_PEDANTIC
+Specifies that unrecognised lines found during the parsing of the fragment
+should always cause a fatal error.  Without this flag, if a
+.B VERSION
+directive (see
+.BR dirfile-format (5))
+indicates that the fragment being opened conforms Standards Version newer than
+the version understood by the library, unrecognised lines will be silently
+ignored.
+.TP
+.B GD_TRUNC
+If
+.I include_file
+already exists, it will be truncated before opening.  If the file does not
+exist, this flag is ignored.
+
+.PP
+The
+.I flags
+argument may also be bitwise or'd with one of the following symbols indicating
+the default encoding scheme of the fragment.  Like the endianness flags, the
+choice of encoding here is ignored if the encoding is specified in the fragment
+itself, unless
+.B GD_FORCE_ENCODED
+is also specified.  If none of these symbols is present,
+.B GD_AUTO_ENCODED
+is assumed, unless this call results in creation or truncation of the fragment. 
+In that case,
+.B GD_UNENCODED
+is assumed.  See
+.BR dirfile-encoding (5)
+for details on dirfile encoding schemes.
+.TP
+.B GD_AUTO_ENCODED
+Specifies that the encoding type is not known in advance, but should be detected
+by the GetData library.  Detection is accomplished by searching for raw data
+files with extensions appropriate to the encoding scheme.  This method will
+notably fail if the the library is called via
+.BR gd_putdata (3)
+to create a previously non-existent raw field unless a read is first
+successfully performed on the dirfile.  Once the library has determined the
+encoding scheme for the first time, it remembers it for subsequent calls.
+.TP
+.B GD_BZIP2_ENCODED
+Specifies that raw data files are compressed using the Burrows-Wheeler block
+sorting text compression algorithm and Huffman coding, as implemented in the
+bzip2 format.
+.TP
+.B GD_GZIP_ENCODED
+Specifies that raw data files are compressed using Lempel-Ziv coding (LZ77)
+as implemented in the gzip format.
+.TP
+.B GD_LZMA_ENCODED
+Specifies that raw data files are compressed using the Lempel-Ziv Markov Chain
+Algorithm (LZMA) as implemented in the xz container format.
+.TP
+.B GD_SIE_ENCODED
+Specified that raw data files are sample-index encoded, similar to run-length
+encoding, suitable for data that change rarely.
+.TP
+.B GD_SLIM_ENCODED
+Specifies that raw data files are compressed using the slimlib library.
+.TP
+.B GD_TEXT_ENCODED
+Specifies that raw data files are encoded as text files containing one data
+sample per line.  
+.TP
+.B GD_UNENCODED
+Specifies that raw data files are not encoded, but written verbatim to disk.
+.TP
+.B GD_ZZIP_ENCODED
+Specifies that raw data files are compressed using the DEFLATE algorithm.  All
+raw data files for a given fragment are collected together and stored in a PKZIP
+archive called raw.zip.
+.TP
+.B GD_ZZSLIM_ENCODED
+Specifies that raw data files are compressed using a combinations of compression
+schemes: first files are slim-compressed, as with the
+.B GD_SLIM_ENCODED
+scheme, and then they are collected together and compressed (again) into a PKZIP
+archive called raw.zip, as in the
+.B GD_ZZIP_ENCODED
+scheme.
+
+.SH RETURN VALUE
+On success, these functions return the format specification index of the newly
+added fragment.  On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The supplied dirfile was opened in read-only mode.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied parent fragment index was out of range.
+.TP
+.B GD_E_BAD_REFERENCE
+The reference field specified by a
+.B /REFERENCE
+directive in the fragment (see
+.BR dirfile-format (5))
+was not found, or was not a
+.B RAW
+field.  In this case, the included fragment will still be added to the dirfile,
+but the
+.B /REFERENCE
+directive will be ignored.  See also the
+.B BUGS
+section below.
+.TP
+.B GD_E_CALLBACK
+The registered callback function returned an unrecognised response.
+.TP
+.B GD_E_FORMAT
+A syntax error occurred in the fragment.
+.TP
+.B GD_E_LINE_TOO_LONG
+The parser encountered a line in the format specification longer than it was
+able to deal with.  Lines are limited by the storage size of
+.BR ssize_t .
+On 32-bit systems, this limits format specification lines to 2**31 characters.
+The limit is larger on 64-bit systems.
+.TP
+.B GD_E_OPEN_FRAGMENT
+The fragment could not be opened or created.
+.TP
+.B GD_E_PROTECTED
+The metadata of the parent fragment was protected from change.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH BUGS
+If this function fails with the error
+.BR GD_E_BAD_REFERENCE ,
+it typically results in no reference field being defined for the dirfile, even
+if the dirfile contains
+.B RAW
+fields.  As a result, functions which rely on the reference field, such as
+.BR gd_nframes (3),
+will operate incorrectly.  Callers should explicitly set the reference field
+with
+.BR gd_reference (3)
+in this case.
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_alter_affixes (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_fragmentname (3),
+.BR gd_nfragments (3),
+.BR gd_parser_callback (3),
+.BR gd_reference (3),
+.BR gd_uninclude (3),
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR dirfile-format (5)
diff --git a/man/gd_invalid_dirfile.3 b/man/gd_invalid_dirfile.3
new file mode 100644
index 0000000..34814d1
--- /dev/null
+++ b/man/gd_invalid_dirfile.3
@@ -0,0 +1,73 @@
+.\" gd_invalid_dirfile.3.  The gd_invalid_dirfile man page.
+.\"
+.\" Copyright (C) 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_invalid_dirfile 3 "17 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_invalid_dirfile \(em obtain an pointer to an invalid DIRFILE object
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "DIRFILE* gd_invalid_dirfile(void);
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_invalid_dirfile ()
+returns a pointer to a newly allocated, invalid DIRFILE object.  Like any
+other DIRFILE object, the invalid DIRFILE object should be de-allocated by
+calling
+.BR gd_close (3)
+or
+.BR gd_discard (3)
+when it is no longer needed.
+
+The DIRFILE object returned may be passed to any other GetData function which
+requires one, but doing so will inevitably result in that function failing
+with the
+.B GD_BAD_DIRFILE
+error.
+
+A similar effect can be achieved by making an invalid
+.BR gd_open (3)
+call, such as:
+.HP
+.in +2n
+.nf
+.fam C
+.BR gd_open( """""" ,\~ 0 );
+.fam
+.fi
+.in
+.PP
+which also returns a pointer to an invalid DIRFILE object.  The difference
+is that an invalid DIRFILE created in this way has a non-zero dirfile
+error (obtainable with
+.BR gd_error (3)),
+while the dirfile error of the invalid DIRFILE returned by
+.BR gd_invalid_dirfile (3)
+is zero (indicating success).
+
+.SH RETURN VALUE
+This function always returns a pointer to a newly allocated, invalid DIRFILE
+object, except when it is unable to allocate memory for the DIRFILE, in which
+case it returns NULL.
+
+.SH SEE ALSO
+.BR gd_close (3),
+.BR gd_discard (3),
+.BR gd_error (3),
+.BR gd_open (3)
diff --git a/man/gd_linterp_tablename.3 b/man/gd_linterp_tablename.3
new file mode 100644
index 0000000..8b86004
--- /dev/null
+++ b/man/gd_linterp_tablename.3
@@ -0,0 +1,97 @@
+.\" gd_linterp_tablename.3.  The gd_linterp_tablename man page.
+.\"
+.\" Copyright (C) 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_linterp_tablename 3 "10 December 2013" "Version 0.8.6" "GETDATA"
+.SH NAME
+gd_linterp_tablename \(em retrieve the pathname of a look-up table in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "char *gd_linterp_tablename(DIRFILE *" dirfile ", const char"
+.BI * field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_linterp_tablename ()
+function retrieves the pathname of the look-up table (LUT) used by the
+.B LINTERP
+field specified by
+.I field_code
+in the dirfile specified by
+.IR dirfile .
+If
+.I field_code
+contains a valid representation suffix, it will be ignored.
+
+Note: this function returns a fully canonicalised, absolute path.  The value of
+the
+.I table
+member in a
+.B gd_entry_t
+object (see
+.BR gd_entry (3))
+is the path which appears in the format specification on disk, which may be a
+path relative to the fragment directory.
+
+.SH RETURN VALUE
+On success,
+.BR gd_linterp_tablename ()
+returns the full pathname of the LUT associated with the specified field in a
+buffer allocated by
+.BR malloc (3).  
+Once no longer needed, the returned pointer should be passed to
+.BR free (3)
+to deallocate the associated memory.  On error, NULL is returned and the dirfile
+error is set to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The field specified by
+.I field_code
+was not a
+.B LINTERP
+field.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_entry (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile (5),
+.BR dirfile-format (5),
+.BR free (3),
+.BR malloc (3)
diff --git a/man/gd_madd_bit.3 b/man/gd_madd_bit.3
new file mode 100644
index 0000000..1bffc06
--- /dev/null
+++ b/man/gd_madd_bit.3
@@ -0,0 +1,334 @@
+.\" gd_madd_bit.3.  The gd_madd_bit man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_madd_bit 3 "30 September 2013" "Version 0.8.6" "GETDATA"
+.SH NAME
+gd_madd_bit, gd_madd_carray, gd_madd_clincom, gd_madd_const, gd_madd_cpolynom,
+gd_madd_crecip, gd_madd_divide, gd_madd_lincom, gd_madd_linterp,
+gd_madd_multiply, gd_madd_phase, gd_madd_polynom, gd_madd_recip, gd_madd_sbit,
+gd_madd_string
+\(em add a field to a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_madd_bit(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "const char *" in_field ", int " bitnum ", int " numbits );
+.HP
+.BI "int gd_madd_carray(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "gd_type_t " const_type ", size_t " array_len ", gd_type_t " data_type ,
+.BI "void *" value );
+.HP
+.BI "int gd_madd_clincom(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", int " n_fields ", const char **" in_fields ,
+.BI "const double complex *" cm ", const double complex *" cb );
+.HP
+.BI "int gd_madd_const(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "gd_type_t " const_type ", gd_type_t " data_type ", void *" value );
+.HP
+.BI "int gd_madd_cpolynom(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", int " poly_ord ", const char *" in_field ,
+.BI "const double complex *" ca );
+.HP
+.BI "int gd_madd_crecip(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", const char *" in_field ,
+.BI "double complex " cdividend ", int " fragment_index );
+.HP
+.BI "int gd_madd_divide(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI " const char *" in_field1 ", const char *" in_field2 );
+.HP
+.BI "int gd_madd_lincom(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", int " n_fields ", const char **" in_fields ,
+.BI "const double *" m ", const double *" b );
+.HP
+.BI "int gd_madd_linterp(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "const char *" in_field ", const char *" table );
+.HP
+.BI "int gd_madd_mplex(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "const char *" in_field ", const char *" count_field ,
+.BI "int " count_val ", int " period );
+.HP
+.BI "int gd_madd_multiply(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI " const char *" in_field1 ", const char *" in_field2 );
+.HP
+.BI "int gd_madd_polynom(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", int " poly_ord ", const char *" in_field ,
+.BI "const double *" a );
+.HP
+.BI "int gd_madd_phase(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "const char *" in_field ", gd_shift_t " shift );
+.HP
+.BI "int gd_madd_recip(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", const char *" in_field ,
+.BI "double " dividend ", int " fragment_index );
+.HP
+.BI "int gd_madd_sbit(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "const char *" in_field ", int " bitnum ", int " numbits );
+.HP
+.BI "int gd_madd_string(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", const char *" value );
+.HP
+.BI "int gd_madd_window(DIRFILE *" dirfile ,
+.BI "const char *" parent ", const char *" field_name ,
+.BI "const char *" in_field ", const char *" check_field ", gd_windop_t"
+.IB windop ", gd_triplet_t " threshold );
+.hy
+.ad n
+.SH DESCRIPTION
+These functions add a new metafield of the indicated type under the parent field
+given by
+.I parent
+in the dirfile specified by
+.IR dirfile .
+.PP
+In all of these calls,
+.I field_name
+indicates the name of the field to be added.  It should not be the full
+.IB <parent-field> / <meta-field>
+field code.  The meaning and valid types of other arguments may be obtained from
+the
+.BR gd_entry (3)
+and
+.BR dirfile-format (5)
+manual pages.
+
+The
+.BR gd_madd_clincom ()
+and
+.BR gd_madd_cpolynom ()
+functions are identical to
+.BR gd_madd_lincom ()
+and
+.BR gd_madd_polynom (),
+except they take complex scalar parameters, instead of purely real values.
+
+The
+.BR gd_madd_lincom ()
+and
+.BR gd_madd_clincom ()
+functions take pointers to three arrays of length
+.I n_fields
+containing the input field names
+.RI ( in_fields ),
+the gain factors
+.RI ( m " or " cm ),
+and the offset terms
+.RI ( b " or " cb ).
+Similarly,
+.BR gd_madd_polynom ()
+and
+.BR gd_madd_cpolynom ()
+take an array of length
+.I poly_ord
++ 1
+containing the polynomial co-efficients
+.RI ( a " or " ca ).
+
+The
+.BR gd_madd_string (),\~ gd_madd_carray ,
+and
+.BR gd_madd_const ()
+functions both add the field and set the value of the field to
+.IR value .
+For
+.BR gd_madd_const ()
+and
+.BR gd_madd_carray (),
+the
+.I const_type
+argument specifies the storage type for the const, while
+.I data_type
+specifies the data type of the value pointed to by
+.IR value .
+
+The
+.B gd_shift_t
+type is a signed 64-bit integer type.  The
+.B gd_triplet_t
+type is defined as:
+.PP
+.in +4n
+.nf
+.fam C
+typedef union {
+  gd_int64_t i;
+  gd_uint64_t u;
+  double r;
+} gd_triplet_t;
+.fam
+.fi
+.in
+.PP
+Which element of this
+.B gd_triplet_t
+union to set depends on the operator selected for the
+.B WINDOW
+field.  See
+.BR gd_entry (3)
+for details.
+.PP
+All fields added with this interface must contain numerical parameters.  Fields
+with scalar fields as parameters cannot be added with these functions.  Those
+fields must be added with
+.BR gd_madd (3)
+or
+.BR gd_madd_spec (3).
+See
+.BR gd_add_bit (3),
+&c. for an alternate way of adding metafields with explicit parameters.
+
+See
+.B NOTES
+below for information on using
+.BR gd_madd_clincom "(), " gd_madd_cpolynom (),
+and 
+.BR gd_madd_crecip ()
+in the C89 GetData API.
+
+.SH RETURN VALUE
+On success, any of these functions returns zero.   On error, -1 is returned and 
+the dirfile error is set to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The
+.IR field_name
+argument contained invalid characters. Alternately, the
+.I parent
+field code was not found, or was already a metafield.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_ENTRY
+One or more of the field parameters specified was invalid.
+.TP
+.B GD_E_BAD_TYPE
+The
+.IR data_type " or " const_type
+argument provided to
+.BR gd_madd_const ()
+or
+.BR gd_madd_carray ()
+was invalid.
+.TP
+.B GD_E_DUPLICATE
+The
+.IR field_name
+provided duplicated that of an already existing field.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment was protected from change.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH NOTES
+The C89 GetData API provides different prototypes for
+.BR gd_madd_clincom (),\~ gd_madd_cpolynom (),
+and
+.BR gd_madd_crecip ():
+.PP
+.B #define GD_C89_API
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_madd_clincom(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", int " n_fields ", const char **" in_fields ,
+.BI "const double *" cm ", const double *" cb );
+.HP
+.BI "int gd_madd_cpolynom(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", int " poly_ord ", const char *" in_field ,
+.BI "const double *" ca );
+.HP
+.BI "int gd_madd_crecip(DIRFILE *" dirfile ", const char *" parent ,
+.BI "const char *" field_name ", const char *" in_field ,
+.BI "double " cdividend\fR[2] ", int " fragment_index );
+.hy
+.ad n
+.PP
+In this case, the array pointers passed as
+.IR cm ", " cb
+or
+.IR ca
+should have twice as many (purely real) elements, consisting of alternating
+real and imaginary parts for the complex data.  That is, for example,
+.IR ca [0]
+should be the real part of the first co-efficient,
+.IR ca [1]
+the imaginary part of the first co-efficient,
+.IR ca [2]
+the real part of the second co-efficient,
+.IR ca [3]
+the imaginary part of the second co-efficient, and so on.  Similarly, the
+.I cdividend
+parameter becomes a double precision array of length two.
+.PP
+For
+.BR gd_madd_clincom ()
+and
+.BR gd_madd_cpolynom (),
+these are simply different (but equivalent) declarations of the C99 function
+entry point.  For
+.BR gd_madd_crecip (),
+however, a different entry point is needed (since the
+.I cdividend
+parameter is passed by reference instead of by value).  In the interests of
+portability, the C89 version of
+.BR gd_madd_crecip ()
+is always available, and may be accessed as
+.BR gd_madd_crecip89 (),
+with the C89 prototype, in both the C99 and C89 APIs.
+
+.SH SEE ALSO
+.BR gd_add_bit (3),
+.BR gd_add_const (3),
+.BR gd_add_divide (3),
+.BR gd_add_lincom (3),
+.BR gd_add_linterp (3),
+.BR gd_add_mplex (3),
+.BR gd_add_multiply (3),
+.BR gd_add_phase (3),
+.BR gd_add_polynom (3),
+.BR gd_add_recip (3),
+.BR gd_add_string (3),
+.BR gd_add_windop (3),
+.BR gd_entry (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_madd (3),
+.BR gd_madd_spec (3),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
diff --git a/man/gd_mcarrays.3 b/man/gd_mcarrays.3
new file mode 100644
index 0000000..edced73
--- /dev/null
+++ b/man/gd_mcarrays.3
@@ -0,0 +1,147 @@
+.\" gd_constants.3.  The gd_constants man page.
+.\"
+.\" Copyright (C) 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_mcarrays 3 "19 August 2011" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_constants \(em retrieve a list of CARRAY values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const gd_carray_t *gd_mcarrays(DIRFILE *" dirfile ", const char"
+.BI * parent ", gd_type_t " return_type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_mcarrays ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of values of the all
+.B CARRAY
+metafields for the supplied
+.I parent
+field, after type conversion to the data type specified by
+.IR return_type .
+For a list of valid symbols to use for
+.IR return_type ,
+see the
+.BR gd_get_carray (3)
+man page.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The array returned will be de-allocated by a call to
+.BR gd_close (3)
+and should not be de-allocated by the caller.  The list returned should not be
+assumed to be in any particular order, except that it is guaranteed to be in the
+same order as the list of
+.B CARRAY
+fields returned by
+.BR gd_mfield_list_by_type (3).
+The number of values in the array can be obtained from a call to
+.BR gd_nmfields_by_type (3).
+
+The caller may not modify any values in the array, nor the array itself.  Doing
+so may cause database corruption.  The pointer returned is guaranteed to be
+valid only until
+.BR gd_mcarrays ()
+is called again, or until the dirfile's metadata is modified (by adding,
+modifying or deleting an entry), or until the array is de-allocated by a call to
+.BR gd_close (3).
+
+A corresponding list of names for these fields may be obtained by calling
+.BR gd_field_list_by_type (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_mcarrays ()
+returns a pointer to an array of
+.B gd_carray_t
+objects containing the values of all the CARRAYs defined in the dirfile
+database.  The
+.B gd_carray_t
+is defined as:
+.PP
+.in +4n
+.nf
+.fam C
+typedef struct {
+  size_t       n;              /* array_len */
+  void        *d;              /* CARRAY data */
+} gd_carray_t;
+.fam
+.fi
+.in
+.PP
+where
+.I n
+specifies the length of the
+.B CARRAY
+data, and
+.I d
+is an array of the data values themselves.  The caller should cast the
+.B void
+pointer to a type appropriate for the
+.I return_type
+specified.  The list is terminated by an end-of-list marker consisting of a
+.B gd_carray_t
+item with
+.I n
+set to zero.
+
+If no CARRAYs are defined in the database, a list containing only the
+end-of-list marker is returned.  On error,
+.BR gd_mcarrays ()
+returns NULL and sets the dirfile error to a non-zero error value.  Possible
+error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The supplied parent field code was not found, or referred to a metafield itself.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_TYPE
+The
+.I return_type
+specified was invalid.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_carrays (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_get_carray (3),
+.BR gd_mfield_list_by_type (3),
+.BR gd_nmfields_by_type (3),
+.BR gd_open (3)
diff --git a/man/gd_mconstants.3 b/man/gd_mconstants.3
new file mode 100644
index 0000000..589d174
--- /dev/null
+++ b/man/gd_mconstants.3
@@ -0,0 +1,107 @@
+.\" gd_mconstants.3.  The gd_mconstants man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_mconstants 3 "17 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_mconstants \(em retrieve a list of constant values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const void *gd_mconstants(DIRFILE *" dirfile ", const char"
+.BI * parent ", gd_type_t " return_type );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_mconstants ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of values of the all
+.B CONST
+type metafields for the supplied
+.I parent
+field after type conversion to the data type specified by
+.IR return_type .
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The array returned will be de-allocated by a call to
+.BR gd_close (3)
+and should not be de-allocated by the caller.  The list returned should not be
+assumed to be in any particular order, although it is guaranteed to be in the
+same order as the list of
+.B CONST
+fields returned by
+.BR gd_mfield_list_by_type (3).
+The array is unterminated.  The number of values in the array can be obtained
+from a call to
+.BR gd_nmfields_by_type (3).
+
+The caller may not modify any values in the array, or the array itself.  Doing
+so may cause database corruption.  The pointer returned is guaranteed to be
+valid until
+.BR gd_mconstants ()
+is called again, or until the array is de-allocated by a call to
+.BR gd_close (3).
+
+A corresponding list of names for these fields may be obtained by calling
+.BR gd_mfield_list_by_type (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_mconstants ()
+returns a pointer to an array of values containing the values of all the
+.B CONST
+metafields for the supplied parent field.  If the parent field has no constant
+metafields, NULL is returned.  On error it returns NULL and sets the dirfile
+error to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The supplied parent field code was not found, or referred to a metafield itself.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_TYPE
+The
+.I return_type
+specified was invalid.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+GetData developers.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_field_list_by_type (3),
+.BR gd_nfields_by_type (3),
+.BR gd_mcarrays (3),
+.BR gd_open (3)
diff --git a/man/gd_metaflush.3 b/man/gd_metaflush.3
new file mode 100644
index 0000000..d9cd628
--- /dev/null
+++ b/man/gd_metaflush.3
@@ -0,0 +1,81 @@
+.\" gd_metaflush.3.  The gd_metaflush man page.
+.\"
+.\" Copyright (C) 2008, 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_metaflush 3 "15 March 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_metaflush \(em write modified dirfile metadata to disk
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_metaflush(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_metaflush ()
+function flushes all pending metadata changes in the dirfile specified by
+.I dirfile 
+to disk.  This is accomplished by re-writing the format specification fragments
+containing modified metadata, overwriting the existing files.  Format file
+fragments which are unchanged are not touched.
+.PP
+Metadata is written to disk using the current Standards Version as stored in the
+.I dirfile
+object.  See
+.BR gd_dirfile_standards (3)
+to change or report the current Standards Version.  If the dirfile metadata
+conforms to no known Standards Version, a Standards non-compliant fragment will
+be written.
+.PP
+This function flushes only metadata.  To flush the field data as well, call
+.BR gd_sync (3)
+instead.
+.SH RETURN VALUE
+On success, zero is returned.  On error, -1 is returned and the dirfile error is
+set to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The supplied dirfile was opened in read-only mode.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_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.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH BUGS
+When writing metadata using Standards Version 4 or earlier, the reference field
+may change, owing to the lack of a
+.B /REFERENCE
+directive.  A work-around is to upgrade to Standards Version 5 or later.
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_close (3),
+.BR gd_dirfile_standards (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_rewrite_fragment (3),
+.BR gd_sync (3)
diff --git a/man/gd_move.3 b/man/gd_move.3
new file mode 100644
index 0000000..c6c68e3
--- /dev/null
+++ b/man/gd_move.3
@@ -0,0 +1,143 @@
+.\" gd_move.3.  The gd_move man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_move 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_move, gd_move_alias \(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 );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_move ()
+function transfers the field specified by
+.IR field_code ,
+which should not have a representation suffix, defined in the dirfile
+specified by
+.IR dirfile
+from it's current format specification fragment to the fragment indexed by
+.IR new_fragment .
+If the field is already defined in the fragment index by
+.IR new_fragment ,
+this function does nothing.
+
+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 flag
+.I move_data
+is one, and
+.I field_code
+specifies a
+.B RAW
+field, the binary file associated with the field will be translated to account
+for the possibly different encoding, endianness, and frame offset of the
+new format specification fragment.  It will also be moved to a new directory, if
+necessary.  If
+.I move_data
+is zero, no changes will be made to the binary file.  If
+.I field_code
+specifies a field of type other than
+.BR RAW ,
+the
+.I move_data
+flag is ignored.
+
+If the binary file is translated, and the frame offset of the destination
+fragment is larger than that of the source fragment, this will result in
+permanent deletion of data from the database.  If the new frame offset is
+smaller than the old frame offset, the binary file will be padded at the front
+with zeroes.
+
+.SH RETURN VALUE
+On success,
+.BR gd_move ()
+returns zero.  On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+An attempt was made to move the immutable
+.I INDEX
+field.
+.TP
+.B GD_E_BAD_INDEX
+The
+.I new_fragment
+argument did not index a valid format specification fragment.
+.TP
+.B GD_E_PROTECTED
+The metadata of the source or destination format specification fragments was
+protected from change, or the binary data of the source or destination fragments
+was protected from change and binary file translation was requested.
+.TP
+.B GD_E_RAW_IO
+An I/O error occurred while attempting to translate a binary file.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the source or destination fragment is unknown.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the source or destination fragment does not support
+binary file translation.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+A binary file translation occurs out-of-place.  As a result, sufficient space
+must be present on the filesystem for both the binary file before translation
+and the binary file after translation.
+.SH SEE ALSO
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_mplex_lookback.3 b/man/gd_mplex_lookback.3
new file mode 100644
index 0000000..bc1be23
--- /dev/null
+++ b/man/gd_mplex_lookback.3
@@ -0,0 +1,124 @@
+.\" gd_mplex_lookback.3.  The gd_mplex_lookback man page.
+.\"
+.\" Copyright (C) 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_mplex_lookback 3 "3 April 2013" "Version 0.8.4" "GETDATA"
+.SH NAME
+gd_mplex_lookback \(em set the GetData lookback length for MPLEX fields.
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "void gd_mplex_lookback(DIRFILE *" dirfile ", int " lookback );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_mplex_lookback ()
+function controls how far GetData searches backwards for the initial value of
+a field when reading a
+.B MPLEX
+field from the dirfile(5) database specified by
+.IR dirfile .
+
+If the first sample returned of a
+.B MPLEX
+field does not contain the value of the field, because the index field does not
+take on the specified multiplex index value, GetData must search the field
+backwards to find the last time the field was updated, in order to propagate
+that value into the initial portion of the returned data.  (See
+.BR gd_getdata (3)
+for further discussion on the data returned for a
+.B MPLEX
+field).
+
+This function sets the amount of data GetData searches before giving up
+according to the value of
+.IR lookback .
+If
+.I lookback
+is zero, this search is disabled completely, and the start of the returned data
+will be padded (with zero or IEEE-754-conformant not-a-number) unless the first
+sample returned happens to contain the value of the field.  If
+.I lookback
+is the special symbol
+.BR GD_LOOKBACK_ALL ,
+GetData will exhaustively search all available data before the returned portion
+for an initial value.
+
+Otherwise,
+.I lookback
+should be a positive number specifying the number of
+.B MPLEX
+periods to search.  Each
+.B MPLEX
+field has its own period, measured in samples of the index field, which is
+defined as follows:
+.IP \(bu
+if the
+.B MPLEX
+field in question specifies an optional
+.I period
+positive parameter (see the
+.B MPLEX
+definition in
+.BR dirfile-format (5)),
+its period is that many samples;
+.IP \(bu
+otherwise, if the
+.B MPLEX
+field's
+.I count_val
+is at least five, its period is one more sample than twice that value;
+.IP \(bu
+otherwise, the period is ten samples.
+.PP
+So, given the following
+.B MPLEX
+definitions:
+.IP
+field1 \fBMPLEX\fR data_field index_field 7 12
+.br
+field2 \fBMPLEX\fR data_field index_field 2 6
+.br
+field3 \fBMPLEX\fR data_field index_field 7
+.br
+field4 \fBMPLEX\fR data_field index_field 2
+.PP
+.I field1
+has a period of 12 samples and
+.I field2
+a period of 6 samples (both the value of their
+.I period
+parameters);
+.I field3
+has a period of 15 samples (one more than twice it's
+.IR count_val ),
+and
+.I field4
+has a period of 10 samples (the default value, since its
+.I count_val
+is less than five).
+.PP
+The initial value of the
+.B MPLEX
+lookback is ten periods.  This value is provided in getdata.h as
+.BR GD_DEFAULT_LOOKBACK .
+
+This function always succeeds and returns no value.
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile-format (5),
+.BR gd_getdata (3).
diff --git a/man/gd_mstrings.3 b/man/gd_mstrings.3
new file mode 100644
index 0000000..db862c8
--- /dev/null
+++ b/man/gd_mstrings.3
@@ -0,0 +1,98 @@
+.\" gd_mstrings.3.  The gd_mstrings man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_mstrings 3 "19 October 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_mstrings \(em retrieve a list of string values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_mstrings(DIRFILE *" dirfile ", const char *" parent );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_mstrings ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of values of the all
+.B STRING
+type metafields for the supplied
+.I parent
+field.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The array returned will be de-allocated by a call to
+.BR gd_close (3)
+and should not be de-allocated by the caller.  The list returned should not be
+assumed to be in any particular order, although it is guaranteed to be in the
+same order as the list of
+.B STRING
+fields returned by
+.BR gd_mfield_list_by_type (3).
+The array is terminated by a NULL pointer.  The number of strings in the array
+can be obtained from a call to
+.BR gd_nmfields_by_type (3).
+
+The caller may not modify any strings in the array, or the array itself.  Doing
+so may cause database corruption.  The pointer returned is guaranteed to be
+valid until
+.BR gd_mstrings ()
+is called again with the same arguments, or until the array is de-allocated by
+a call to
+.BR gd_close (3).
+
+A corresponding list of names for these fields may be obtained by calling
+.BR gd_mfield_list_by_type (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_mstrings ()
+returns a pointer to an array of strings containing the values of all the
+.B STRING
+metafields for the specified parent field.  The array is terminated by a NULL
+pointer.  If no strings are defined in the database for the specified parent, an
+array consisting of only the NULL pointer is returned.  On error it returns NULL
+and sets the dirfile error to a non-zero error value.  Possible error values
+are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The supplied parent field code was not found, or referred to a metafield itself.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_mfield_list_by_type (3),
+.BR gd_nmfields_by_type (3),
+.BR gd_strings (3)
diff --git a/man/gd_naliases.3 b/man/gd_naliases.3
new file mode 100644
index 0000000..902cfa6
--- /dev/null
+++ b/man/gd_naliases.3
@@ -0,0 +1,62 @@
+.\" gd_naliases.3.  The gd_naliases man page.
+.\"
+.\" Copyright (C) 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_naliases 3 "1 October 2013" "Version 0.8.6" "GETDATA"
+.SH NAME
+gd_naliases \(em report the number of aliases of a field in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_naliases(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_naliases ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of aliases of the field specified by
+.IR field_code .
+
+The
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_naliases ()
+returns the number of aliases of the specified field code in the dirfile.  If
+successful, this count will be at least one.  On error, it returns zero and
+sets the dirfile error to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_BAD_CODE
+The supplied field code was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_aliases (3),
+.BR gd_alias_target (3)
diff --git a/man/gd_native_type.3 b/man/gd_native_type.3
new file mode 100644
index 0000000..0bb7bb6
--- /dev/null
+++ b/man/gd_native_type.3
@@ -0,0 +1,155 @@
+.\" gd_native_type.3.  The gd_native_type man page.
+.\"
+.\" Copyright (C) 2009, 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_native_type 3 "17 August 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_native_type \(em returns the native data type of a field in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_type_t gd_native_type(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_native_type ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the native data type of the field
+.IR field_code ,
+which may contain a representation suffix.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The native data type of a field of a given entry type is calculated as:
+.TP
+.BR BIT " or " INDEX " Entry:"
+.BR GD_UINT64 ;
+.TP
+.BR CONST " or " CARRAY " Entry:"
+the data type of the field;
+.TP
+.BR LINCOM " or " POLYNOM " Entry:"
+if any of the scalar parameters is complex valued, or if the native data type of
+any of the input fields is complex valued:
+.BR GD_COMPLEX128 ,
+otherwise:
+.BR GD_FLOAT64 ;
+.TP
+.BR LINTERP " Entry:"
+if the look-up table is complex valued:
+.BR GD_COMPLEX128 ,
+otherwise:
+.BR GD_FLOAT64 ;
+.TP
+.BR MPLEX " or " WINDOW " Entry:"
+the native data type of the data field;
+.TP
+.BR MULTIPLY " or " DIVIDE " Entry:"
+if either input field is complex valued:
+.BR GD_COMPLEX128 ,
+otherwise:
+.BR GD_FLOAT64 ;
+.BR 
+.TP
+.BR PHASE " Entry:"
+the native data type of the input field;
+.TP
+.BR RAW " Entry:"
+the data type of the raw data on disk;
+.TP
+.BR RECIP " Entry:"
+if the dividend or the native data type of the input field is complex valued:
+.BR GD_COMPLEX128 ,
+otherwise:
+.BR GD_FLOAT64 ;
+.TP
+.BR SBIT " Entry:"
+.BR GD_INT64 ;
+.TP
+.BR STRING " Entry:"
+.BR GD_NULL .
+.PP
+Furthermore, if the supplied
+.I field_code
+contains a representation suffix, and the native data type of the field is
+complex valued, the native type returned will be the corresponding real valued
+type.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_native_type ()
+returns the native data type of the field code specified.  This will be one of
+the symbols:
+.IP
+.nh
+.ad l
+.BR GD_NULL ", " GD_UINT8 ", " GD_INT8 ", " GD_UINT16 ", " GD_INT16 ,
+.BR GD_UINT32 ", " GD_INT32 ", " GD_FLOAT32 ", " GD_FLOAT64 ", " GD_COMPLEX64 ,
+.BR GD_COMPLEX128 .
+.ad n
+.hy
+.PP
+The meanings of these symbols are explained in the
+.BR gd_getdata (3)
+manual page.  On error, it returns
+.B GD_UNKNOWN
+and sets the dirfile error to a non-zero error value.  Possible error values
+are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+or one of the fields it uses as input was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_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
+An error occurred while trying to read a LINTERP table from disk.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_getdata (3),
+.BR gd_error (3),
+.BR gd_error_string (3)
diff --git a/man/gd_nentries.3 b/man/gd_nentries.3
new file mode 100644
index 0000000..5dd3b71
--- /dev/null
+++ b/man/gd_nentries.3
@@ -0,0 +1,194 @@
+.\" gd_nentries.3.  The gd_nentries man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_nentries 3 "28 June 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_nentries, gd_nfields, gd_nfields_by_type gd_nmfields, gd_nmfields_by_type,
+gd_nmvectors, gd_nvectors \(em count field entries in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_nentries(DIRFILE *" dirfile ", const char *" parent ,
+.BI "unsigned int " type ", unsigned int " flags );
+.HP
+.BI "unsigned int gd_nfields(DIRFILE *" dirfile );
+.HP
+.BI "unsigned int gd_nfields_by_type(DIRFILE *" dirfile ", gd_entype_t " type );
+.HP
+.BI "unsigned int gd_nmfields(DIRFILE *" dirfile ", const char *" parent );
+.HP
+.BI "unsigned int gd_nmfields_by_type(DIRFILE *" dirfile ,
+.BI "const char *" parent ", gd_entype_t " type );
+.HP
+.BI "unsigned int gd_nmvectors(DIRFILE *" dirfile ", const char *" parent );
+.HP
+.BI "unsigned int gd_nvectors(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nentries ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a count of metadata entries satisfying the supplied criteria.
+If
+.I parent
+is non-NULL, metafields under the field specified by
+.I parent
+are considered; otherwise, top-level fields are considered, and metafields
+ignored.
+
+The
+.I type
+argument should be one of the following symbols indicating an explicit entry
+type to count:
+.IP
+.nh
+.ad l
+.BR GD_BIT_ENTRY ", " GD_CARRAY_ENTRY ", " GD_CONST_ENTRY ", " GD_DIVIDE_ENTRY ,
+.BR GD_INDEX_ENTRY ", " GD_LINCOM_ENTRY ", " GD_LINTERP_ENTRY ,
+.BR GD_MPLEX_ENTRY ", " GD_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ,
+.BR GD_POLYNOM_ENTRY ", " GD_RAW_ENTRY ", " GD_RECIP_ENTRY ,
+.BR GD_SBIT_ENTRY ", " GD_STRING_ENTRY ", " GD_WINDOW_ENTRY .
+.ad n
+.hy
+.PP
+.RB ( GD_INDEX_ENTRY
+is a special field type for the implicit
+.I INDEX
+field) or else one of the following special symbols:
+.TP
+.B GD_ALL_ENTRIES \fR(= 0)
+Count entries of all types.
+.TP
+.B GD_ALIAS_ENTRIES
+Count only aliases.  This is the only way to get a count including aliases which
+do not point to valid field codes.
+.TP
+.B GD_SCALAR_ENTRIES
+Count only scalar field types
+.RB ( CONST ", " CARRAY ", " STRING ).
+.TP
+.B GD_VECTOR_ENTRIES
+Count only vector field types (all field types except the scalar field types
+listed above).
+.PP
+The
+.I flags
+argument should be zero or more of the following flags, bitwise or'd together:
+.TP
+.B GD_ENTRIES_HIDDEN
+Include hidden entries (see
+.BR gd_hidden (3))
+in the count: normally hidden entries are skipped;
+.TP
+.B GD_ENTRIES_NOALIAS
+Exclude aliases from the count: normally aliases are considered the same as
+their target (that is: a field with
+.I n
+aliases, plus its canonical name, will be counted
+.IR n +1
+times).
+.SS Special Cases
+The call
+.RS
+.BI gd_nfields( dirfile );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_nentries( dirfile ", NULL, GD_ALL_ENTRIES, 0);
+.RE
+.PP
+The call
+.RS
+.BI gd_nfields_by_type( dirfile ", " type );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_nentries( dirfile ", NULL, " type ", 0);"
+.RE
+.PP
+The call
+.RS
+.BI gd_nmfields( dirfile ", " parent );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_nentries( dirfile ", " parent ", GD_ALL_ENTRIES, 0);"
+.RE
+.PP
+The call
+.RS
+.BI gd_nmfields_by_type( dirfile ", " parent ", " type );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_nentries( dirfile ", " parent ", " type ", 0);"
+.RE
+.PP
+The call
+.RS
+.BI gd_nmvectors( dirfile ", " parent );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_nentries( dirfile ", " parent ", GD_VECTOR_ENTRIES, 0);"
+.RE
+.PP
+The call
+.RS
+.BI gd_nvectors( dirfile );
+.RE
+.PP
+is equivalent to
+.RS
+.BI gd_nentries( dirfile ", NULL, GD_VECTOR_ENTRIES, 0);"
+.RE
+
+.SH RETURN VALUE
+Upon successful completion, these functions return the number of entries in the
+database satisfying the supplied criteria.  On error, they return zero and sets
+the dirfile error to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_BAD_CODE
+The supplied parent field code was not found, or referred to a metafield itself.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_ENTRY
+The
+.I type
+parameter supplied was not one of the symbols listed above.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_entry_list (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_hidden (3)
diff --git a/man/gd_nfragments.3 b/man/gd_nfragments.3
new file mode 100644
index 0000000..5712dd1
--- /dev/null
+++ b/man/gd_nfragments.3
@@ -0,0 +1,63 @@
+.\" gd_nfragments.3.  The gd_nfragments man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_nfragments 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_nfragments \(em retrieve the number of format specification fragments in a
+dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_nfragments(const DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nfragments ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the total number of parsed format specification fragments in the
+database.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_nfragments ()
+returns the total number of format specification fragments which are present in
+the dirfile.  On error, 
+.BR gd_nfragments ()
+returns zero and sets the dirfile error to a non-zero value.  Possible error
+values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_fragmentname (3),
+.BR gd_include (3),
+.BR gd_open (3),
+.BR gd_parent_fragment (3)
diff --git a/man/gd_nframes.3 b/man/gd_nframes.3
new file mode 100644
index 0000000..9b86c71
--- /dev/null
+++ b/man/gd_nframes.3
@@ -0,0 +1,88 @@
+.\" gd_nframes.3.  The gd_nframes man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_nframes 3 "19 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_nframes \(em report the size of a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "off_t gd_nframes(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_nframes ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of frames in the database.  Since different fields may
+have differing number of frames, the Dirfile Standards (see
+.BR dirfile (5))
+dictate that the number of frames in the database is defined to be equal to the
+number of frames in the reference field defined by the
+.B /REFERENCE
+directive (see
+.BR dirfile-format (5))
+or, if no such reference field is defined, by the first raw field specified in
+the format specification.
+
+If no vector fields are defined in the database,
+.BR gd_nframes ()
+returns zero and succeeds.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_nframes ()
+returns the number of frames in the dirfile.  On error, it returns zero and sets
+the dirfile error to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_RAW_IO
+An attempt to determine the (unencoded) size of the data file associated with
+the reference field failed.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The size of the decoded data file associated with the reference field could not
+be not be determined because its encoding was not understood.
+.TP
+.B GD_E_UNSUPPORTED
+The size of the decoded data file associated with the reference field could not
+be not be determined because its encoding was not supported.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR gd_open (3),
+.BR gd_bof (3),
+.BR gd_eof (3),
+.BR gd_error (3),
+.BR gd_error_string (3)
diff --git a/man/gd_nframes64.3 b/man/gd_nframes64.3
new file mode 100644
index 0000000..e67a43a
--- /dev/null
+++ b/man/gd_nframes64.3
@@ -0,0 +1,54 @@
+.\" gd_nframes64.3.  The gd_nframes64 man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_nframes64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_nframes64 \(em report the size of a dirfile, with largefile support
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_off64_t gd_nframes64(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_nframes (3)
+uses a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+It is only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), this function will the same as
+.BR gd_nframes (3).
+Otherwise,
+.BR gd_nframes (3)
+will be a version of this function which uses a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_nframes (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_parent_fragment.3 b/man/gd_parent_fragment.3
new file mode 100644
index 0000000..53addf0
--- /dev/null
+++ b/man/gd_parent_fragment.3
@@ -0,0 +1,66 @@
+.\" gd_parent_fragment.3.  The gd_parent_fragment man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_parent_fragment 3 "21 April 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_parent_fragment \(em retrieve the parent fragment of a fragment in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_parent_fragment(DIRFILE *" dirfile ", int " fragment_index );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_parent_fragment ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the index of the fragment which contains the
+.B INCLUDE
+directive for the fragment indexed by
+.IR fragment_index .
+
+Since the primary format specification fragment is not included in any other
+fragment, passing zero for
+.I fragment_index
+will result in an error.
+
+.SH RETURN VALUE
+On success,
+.BR gd_parent_fragment ()
+returns the index of the specified fragment's parent.  On error,
+.BR gd_parent_fragment ()
+returns -1 and sets the dirfile error to a non-zero value.  Possible error
+values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range, or was equal to zero.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_include (3),
+.BR gd_open (3),
+.BR gd_fragmentname (3),
+.BR gd_nfragments (3)
diff --git a/man/gd_parser_callback.3 b/man/gd_parser_callback.3
new file mode 100644
index 0000000..a64c02c
--- /dev/null
+++ b/man/gd_parser_callback.3
@@ -0,0 +1,57 @@
+.\" gd_parser_callback.3.  The gd_parser_callback man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_parser_callback 3 "17 September 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_parser_callback \(em set the syntax error callback handler for a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "void gd_parser_callback(DIRFILE *" dirfile ", gd_parser_callback_t"
+.IB sehandler ", void *" extra );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_parser_callback ()
+function updates the syntax error callback function of the DIRFILE object
+.I dirfile
+to be
+.IR sehandler ,
+and the caller supplied extra pointer passed to the handler to be
+.IR extra ,
+discarding any syntax error handler and extra pointer which were previously
+registered for this DIRFILE.  If
+.I sehandler
+is NULL, the existing handler will be removed and the default behaviour (abort
+on error) restored.  See
+.BR gd_cbopen (3)
+for a discussion on the requirements for the syntax handler.
+
+Since parsing of an existing format specification occurs when the DIRFILE object
+is created, before this function can be called, this function is only useful to
+set or modify a callback function or its caller data before calling
+.BR gd_include (3),
+which will invoke the callback function if syntax errors are found in the
+included fragment.
+
+This function always succeeds, and has no return value.
+
+.SH SEE ALSO
+.BR gd_cbopen (3),
+.BR gd_include (3),
+.BR dirfile (5)
diff --git a/man/gd_protection.3 b/man/gd_protection.3
new file mode 100644
index 0000000..c2a61c2
--- /dev/null
+++ b/man/gd_protection.3
@@ -0,0 +1,70 @@
+.\" gd_protection.3.  The gd_protection man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_protection 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_protection \(em report the protection level of a dirfile fragment
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_protection(DIRFILE *" dirfile ", int " fragment_index );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_protection ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the advisory protection level for the fragment indexed by
+.IR fragment_index .
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_protection ()
+returns the advisory protection level of the specified fragment, which will be
+one of the following symbols.
+.IP
+.nh
+.ad l
+.BR GD_PROTECT_NONE ,\~ GD_PROTECT_FORMAT ,\~ GD_PROTECT_DATA ,\~
+.BR GD_PROTECT_ALL .
+.ad n
+.hy
+.PP
+The meaning of these symbols are explained in the
+.BR gd_alter_protection (3)
+man page.  On error, it returns -1 and sets the dirfile error to a non-zero
+error value.  Possible error values are:
+.TP 8
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied index was out of range.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_alter_protection (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_put_carray_slice.3 b/man/gd_put_carray_slice.3
new file mode 100644
index 0000000..2e18777
--- /dev/null
+++ b/man/gd_put_carray_slice.3
@@ -0,0 +1,213 @@
+.\" gd_put_carray_slice.3.  The gd_put_carray_slice man page.
+.\"
+.\" Copyright (C) 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_put_carray_slice 3 "4 July 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_put_carray, gd_put_carray_slice, gd_put_constant \(em write CONST or CARRAY
+data to a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_put_carray_slice(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "unsigned int " start ", size_t " len ", gd_type_t " data_type ,
+.BI "const void *" data_in );
+.HP
+.BI "int gd_put_carray(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_type_t " data_type ", const void *" data_in );
+.HP
+.BI "int gd_put_constant(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_type_t " data_type ", const void *" data_in );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_put_carray_slice ()
+function writes data to a dirfile(5) database specified by
+.I dirfile
+into the
+.B CARRAY
+scalar array
+.IR field_code .
+The data in the field is converted from the data type specified by
+.IR data_type ,
+and read from in the user-supplied buffer
+.IR data_in .
+The location of the first element of the field into which data is stored is
+given by
+.IR start ,
+and the number of elements stored is given by
+.IR len .
+
+The
+.BR gd_put_carray ()
+function behaves similarly, except the whole scalar array is written, as if
+.BR gd_put_carray_slice ()
+were called with
+.I start
+equal zero and
+.I len
+equal to the value returned by
+.BR gd_carray_len (3).
+The
+.BR gd_put_constant ()
+function is equivalent to calling
+.BR gd_put_carray_slice ()
+with
+.I start
+equal to zero and
+.I len
+equal to one.  None of these interfaces can write to field representations.
+
+The argument
+.I data_in
+must point to a valid memory location containing all the data to be written.
+The number of elements which will be stored by
+.BR gd_put_carray ()
+may be obtained by calling
+.BR gd_carray_len (3).
+Unlike
+.BR gd_putdata (3),
+writing data past the end of the field is not permitted.  To add data to a
+.BR CARRAY ,
+first increase its length by calling
+.BR gd_alter_carray (3),
+or another equivalent function.
+
+The 
+.I data_type
+argument should be one of the following symbols, which indicates the type
+of the data pointed to by
+.IR data_in :
+.RS
+.TP 11
+.B GD_UINT8
+unsigned 8-bit integer
+.TP
+.B GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.B GD_UINT16
+unsigned 16-bit integer
+.TP
+.B GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.B GD_UINT32
+unsigned 32-bit integer
+.TP
+.B GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.B GD_UINT64
+unsigned 64-bit integer
+.TP
+.B GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.B GD_FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.B GD_FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.B GD_COMPLEX64
+C99-conformant 64-bit single precision complex number
+.TP
+.B GD_COMPLEX128
+C99-conformant 128-bit double precision complex number
+.RE
+
+The type of the input data need not be the same as the storage type of the
+field.  Type conversion will be performed as necessary to return the requested
+type.  The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+.SH RETURN VALUE
+On success,
+.BR gd_put_carray ()
+and
+.BR gd_put_carray_slice ()
+return zero.  On error, they return -1 and set the dirfile error to a non-zero
+value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified
+.I dirfile
+was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+An invalid
+.I dirfile
+was supplied.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The supplied
+.I field_code
+was not a
+.B CONST
+nor a
+.BR CARRAY .
+The caller should use
+.BR gd_putdata (3),
+.BR gd_put_constant (3),
+or
+.BR gd_put_string (3)
+instead.
+.TP
+.B GD_E_BAD_REPR
+A representation suffix in the field definition was invalid, or an attempt was
+made to write to a representation, instead of the underlying field.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I data_type
+was specified.
+.TP
+.B GD_E_BOUNDS
+A request for data beyond the end of the field was made.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+maintainer.
+.TP
+.B GD_E_PROTECTED
+The fragment containing the constant was protected from change.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered may be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_carray_len (3),
+.BR gd_carrays (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_get_carray_slice (3),
+.BR gd_open (3),
+.BR gd_put_constant (3)
diff --git a/man/gd_put_string.3 b/man/gd_put_string.3
new file mode 100644
index 0000000..c6c3d41
--- /dev/null
+++ b/man/gd_put_string.3
@@ -0,0 +1,113 @@
+.\" gd_put_string.3.  The gd_put_string man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_put_string 3 "19 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_put_string \(em retrieve a string from a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_put_string(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "const char *" data_in );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_put_string ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and sets the
+.B STRING
+.I field_code ,
+which should not contain a representation suffix, to the value specified in
+.IR data_in .
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+Because string values are stored in the dirfile metadata, the new value of
+.I field_code
+won't be written to disk until the dirfile metadata is flushed with
+.BR gd_metaflush (3),
+or until the dirfile is closed.
+.SH RETURN VALUE
+On success,
+.BR gd_put_string ()
+returns the length of the string stored, including the trailing NUL character.
+On error, it returns 0 and sets the dirfile error to a non-zero value.  Possible
+error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified
+.I dirfile
+was opened read-only.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+An invalid
+.I dirfile
+was supplied.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The supplied
+.I field_code
+referred to a field of type other than
+.BR STRING .
+The caller should use
+.BR gd_putdata (3),
+.BR gd_put_carray (3),
+or
+.BR gd_put_constant (3)
+instead.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I data_type
+was specified.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+maintainer.
+.TP
+.B GD_E_PROTECTED
+The fragment containing the string was protected from change.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered may be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR gd_get_string (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_putdata (3)
diff --git a/man/gd_putdata.3 b/man/gd_putdata.3
new file mode 100644
index 0000000..f6d45fd
--- /dev/null
+++ b/man/gd_putdata.3
@@ -0,0 +1,267 @@
+.\" gd_putdata.3.  The gd_putdata man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_putdata 3 "21 April 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_putdata \(em write data to a dirfile database
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_putdata(DIRFILE *" dirfile ", const char *" field_code ", off_t"
+.IB first_frame ", off_t " first_sample ", size_t " num_frames ", size_t"
+.IB num_samples ", gd_type_t " data_type ", const void *" data_in );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_putdata ()
+function writes data to a dirfile(5) database specified by
+.I dirfile
+for the field
+.IR field_code ,
+which may not contain a representation suffix.  It writes
+.I num_frames
+frames plus
+.I num_samples
+samples to this field, starting 
+.I first_sample
+samples past frame
+.IR first_frame . 
+The data is read from the user-supplied buffer
+.IR data_in,
+which is has a data type specified by
+.IR data_type .
+This interface cannot write to field representations.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+Unless using
+.B GD_HERE 
+(see below), the first sample written will be
+.RS
+.IR first_frame " * " samples_per_frame " + " first_sample
+.RE
+as measured from the start of the dirfile, where
+.I samples_per_frame
+is the number of samples per frame as returned by
+.BR gd_spf (3).
+The number of samples which
+.BR gd_putdata ()
+attempts to write is, similarly,
+.RS
+.IR num_frames " * " samples_per_frame " + " num_samples .
+.RE
+Although calling
+.BR gd_putdata ()
+using both samples and frames is possible, the function is typically called
+with either
+.IR num_samples " and " first_sample ,
+or
+.IR num_frames " and " first_frames ,
+equal to zero.
+
+Instead of explicitly specifying the origin of the write, the caller may pass
+the special symbol
+.B GD_HERE
+as
+.IR first_frame .
+This will result in the write occurring at the current position of the I/O
+pointer for the field (see
+.BR gd_seek (3)
+for a discussion of I/O pointers).  In this case, the value of
+.I first_sample
+is ignored.
+
+The 
+.I data_type
+argument should be one of the following symbols, which indicates the type of
+the input data:
+.RS
+.TP 11
+.B GD_UINT8
+unsigned 8-bit integer
+.TP
+.B GD_INT8
+signed (two's complement) 8-bit integer
+.TP
+.B GD_UINT16
+unsigned 16-bit integer
+.TP
+.B GD_INT16
+signed (two's complement) 16-bit integer
+.TP
+.B GD_UINT32
+unsigned 32-bit integer
+.TP
+.B GD_INT32
+signed (two's complement) 32-bit integer
+.TP
+.B GD_UINT64
+unsigned 64-bit integer
+.TP
+.B GD_INT64
+signed (two's complement) 64-bit integer
+.TP
+.B GD_FLOAT32
+IEEE-754 standard 32-bit single precision floating point number
+.TP
+.B GD_FLOAT64
+IEEE-754 standard 64-bit double precision floating point number
+.TP
+.B GD_COMPLEX64
+C99-conformant 64-bit single precision complex number
+.TP
+.B GD_COMPLEX128
+C99-conformant 128-bit double precision complex number
+.RE
+
+The type of the input data need not be the same as the type of the data stored
+in the database.  Type conversion will be performed as necessary to write the
+appropriate type.  The argument
+.I data_in
+must point to a valid memory location of containing all the data to be written.
+
+Upon successful completion, the I/O pointer of the field will be on the sample
+immediately following the last sample written.  On error, the position of the
+I/O pointer is not specified.
+
+.SH RETURN VALUE
+In all cases,
+.BR gd_putdata ()
+returns the number of samples (not bytes) successfully written to the database,
+which may be zero if an error has occurred.
+
+If an error has occurred, the dirfile error
+will be set to a non-zero value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified
+.I dirfile
+was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.IR field_code ,
+or one of the fields it uses for input, was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+An invalid
+.I dirfile
+was supplied.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+Either the field specified by
+.IR field_code ,
+or one of the fields it uses for input, was of
+.B MULTIPLY
+or
+.B DIVIDE
+type, or
+.B LINCOM
+type with more than one input fields.  In this case, GetData has no knowledge on
+how to partition the input data.  Alternately, the caller may have attempted to
+write to the implicit INDEX field, which is not possible.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised, or an attempt was made to write to a field representation,
+instead of the underlying field.
+.TP
+.B GD_E_BAD_TYPE
+An invalid
+.I data_type
+was specified.
+.TP
+.B GD_E_DIMENSION
+The field specified by
+.I field_code
+was not a vector field.  The caller should use
+.BR gd_put_carray (3),
+.BR gd_put_constant (3),
+or
+.BR gd_put_string (3)
+instead.  Or, a scalar field was found where a vector field was expected in
+the definition of
+.IR field_code .
+.TP
+.B GD_E_DOMAIN
+An attempt was made to write to a
+.B LINTERP
+field with a look-up table which was not monotonic or not purely real.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+maintainer.
+.TP
+.B GD_E_OPEN_LINFILE
+An error occurred while trying to read a
+.B LINTERP
+table from disk.
+.TP
+.B GD_E_PROTECTED
+The data of the
+.B RAW
+field backing
+.I field_code
+was protected from change by a /PROTECT directive.
+.TP
+.B GD_E_RANGE
+An attempt was made to write data before the beginning-of-frame marker for
+.IR field_code ,
+or the raw field it depends on.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to open, read from, or write to a file on disk
+containing a raw field.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.TP
+.B GD_E_UNSUPPORTED
+Reading from dirfiles with the encoding scheme of the specified dirfile is not
+supported by the library.  See
+.BR dirfile-encoding (5)
+for details on dirfile encoding schemes.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_getdata (3),
+.BR gd_put_carray (3),
+.BR gd_put_constant (3),
+.BR gd_seek (3),
+.BR gd_spf (3),
+.BR GD_SIZE (3)
diff --git a/man/gd_putdata64.3 b/man/gd_putdata64.3
new file mode 100644
index 0000000..97eb6c4
--- /dev/null
+++ b/man/gd_putdata64.3
@@ -0,0 +1,57 @@
+.\" gd_putdata64.3.  The gd_putdata64 man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_putdata64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_putdata64 \(em write data to a dirfile database, with largefile support
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "size_t gd_putdata64(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_off64_t " first_frame ", gd_off64_t " first_sample ", size_t 
+.IB num_frames ", size_t " num_samples ", gd_type_t " data_type ,
+.BI "const void *" data_out );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_putdata (3)
+uses a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+It is only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), this function will the same as
+.BR gd_putdata (3).
+Otherwise,
+.BR gd_putdata (3)
+will be a version of this function which uses a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_putdata (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_raw_filename.3 b/man/gd_raw_filename.3
new file mode 100644
index 0000000..589d3b6
--- /dev/null
+++ b/man/gd_raw_filename.3
@@ -0,0 +1,92 @@
+.\" gd_raw_filename.3.  The gd_raw_filename man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_raw_filename 3 "10 December 2013" "Version 0.8.6" "GETDATA"
+.SH NAME
+gd_raw_filename \(em retrieve the pathname of a binary file in a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "char *gd_raw_filename(DIRFILE *" dirfile ", const char"
+.BI * field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_raw_filename ()
+function reports the pathname of the file backing the
+.B RAW
+field specified by
+.I field_code
+in the dirfile specified by
+.IR dirfile .
+If
+.I field_code
+contains a valid representation suffix, it will be ignored.
+
+.SH RETURN VALUE
+On success,
+.BR gd_raw_filename ()
+returns the full pathname of the binary file associated with the specified
+field in buffer allocated by
+.BR malloc (3).
+The returned pointer should be passed to
+.BR free (3)
+once the caller no longer needs it.  On error, NULL is returned and the dirfile
+error is set to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The field specified by
+.I field_code
+was not a
+.B RAW
+field.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the specified field could not be determined or was not
+understood by GetData.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_entry (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR dirfile-format (5),
+.BR free (3)
+.BR malloc (3)
diff --git a/man/gd_reference.3 b/man/gd_reference.3
new file mode 100644
index 0000000..0227d17
--- /dev/null
+++ b/man/gd_reference.3
@@ -0,0 +1,93 @@
+.\" gd_reference.3.  The gd_reference man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_reference 3 "20 July 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_reference \(em retrieve or set the reference field for a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char *gd_reference(DIRFILE *" dirfile ", const char"
+.BI * field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_reference ()
+function sets or retrieves the reference field (see 
+.BR dirfile (5))
+associated with the dirfile specified by
+.IR dirfile .
+If the
+.I field_code
+argument is non-NULL, the reference field for the dirfile will be set to the
+field specified.  If
+.I field_code
+is NULL, the reference field is not modified.  The field code should refer to
+a RAW field, and may not contain a representation suffix.
+
+.SH RETURN VALUE
+On success,
+.BR gd_reference ()
+returns the field code of the dirfile's reference field, which will be
+.IR field_code ,
+if
+.I field_code
+is non-NULL.   If no
+.B RAW
+fields are defined in the dirfile, this function will return NULL, without
+raising an error.  On error, NULL is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+The field specified by
+.I field_code
+was not a
+.B RAW
+field.
+.TP
+.B GD_E_PROTECTED
+The metadata of the primary format specification fragment (the file named
+.I format
+in the root dirfile directory) was protected from change.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_rename.3 b/man/gd_rename.3
new file mode 100644
index 0000000..c1ac341
--- /dev/null
+++ b/man/gd_rename.3
@@ -0,0 +1,122 @@
+.\" gd_rename.3.  The gd_rename man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_rename 3 "27 June 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_rename \(em change the name of a dirfile field or alias
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_rename(DIRFILE *" dirfile ", const char"
+.BI * old_code ", const char *" new_name ", unsigned int " flags );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_rename ()
+function changes the name of the field or alias specified by
+.IR old_code ,
+which should not contain a representation suffix, defined in the dirfile
+specified by
+.IR dirfile
+to
+.IR new_name .
+If the new name is the same as the old name, this function does nothing.
+
+When renaming a metafield, the metafield should be specified in
+.I old_code
+by its full (slashed) field code, while
+.I new_name
+should only contain the new name (without slash).
+
+The
+.I flags
+parameter should be zero or more of the following flags, bitwise or'd together:
+.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
+.I field_code
+specifies a field of type other than
+.BR RAW ,
+this flag is ignored.
+.TP
+.B GD_REN_UPDB
+Rename the field in any other field specifications which use this field as an
+input (either as a vector input field to a derived field, or else as a scalar
+field parameter).  Without this flag, fields which depend on the old name of
+this field are left unmodified.
+
+.SH RETURN VALUE
+On success,
+.BR gd_rename ()
+returns zero.  On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The specified dirfile was opened read-only.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I old_code
+was not found.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+An attempt was made to rename the immutable
+.I INDEX
+field.
+.TP
+.B GD_E_DUPLICATE
+The new name specified is already in use by another entry.
+.TP
+.B GD_E_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
+An I/O error occurred while attempting to rename the binary file.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of the specified field could not be determined or was not
+understood by GetData.
+.TP
+.B GD_E_UNSUPPORTED
+The encoding scheme of the field does not support binary file renaming.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_metaflush (3),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR dirfile (5),
+.BR dirfile-format (5)
diff --git a/man/gd_rewrite_fragment.3 b/man/gd_rewrite_fragment.3
new file mode 100644
index 0000000..aeb8d79
--- /dev/null
+++ b/man/gd_rewrite_fragment.3
@@ -0,0 +1,86 @@
+.\" gd_rewrite_fragment.3.  The gd_rewrite_fragment man page.
+.\"
+.\" Copyright (C) 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_rewrite_fragment 3 "19 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_rewrite_fragment \(em re-write a dirfile format specification fragment
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_rewrite_fragment(DIRFILE *" dirfile ", int " fragment );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_rewrite_fragment ()
+writes the format specification fragment specified by
+.I fragment
+to disk, regardless of whether it has changed or not, overwriting the existing
+file.
+.PP
+In addition to being simply a valid fragment index,
+.I fragment
+may also be the special value
+.BR GD_ALL_FRAGMENTS ,
+which indicates that all fragments should be rewritten.
+.PP
+Metadata is written to disk using the current Standards Version as stored in the
+.I dirfile
+object.  See
+.BR gd_dirfile_standards (3)
+to change or report the current Standards Version.  If the dirfile metadata
+conforms to no known Standards Version, a Standards non-compliant fragment will
+be written.
+.SH RETURN VALUE
+On success, zero is returned.  On error, -1 is returned and the dirfile error is
+set to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The supplied dirfile was opened in read-only mode.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied fragment index was out of range.
+.TP
+.B GD_E_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.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH BUGS
+When writing metadata using Standards Version 4 or earlier, the reference field
+may change, owing to the lack of a
+.B /REFERENCE
+directive.  A work-around is to upgrade to Standards Version 5 or later.
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_close (3),
+.BR gd_dirfile_standards (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_flush (3),
+.BR gd_metaflush (3)
+
diff --git a/man/gd_seek.3 b/man/gd_seek.3
new file mode 100644
index 0000000..d647c0f
--- /dev/null
+++ b/man/gd_seek.3
@@ -0,0 +1,212 @@
+.\" gd_getdata.3.  The gd_getdata man page.
+.\"
+.\" Copyright (C) 2011, 2012, 2013 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_seek 3 "12 March 2013" "Version 0.8.4" "GETDATA"
+.SH NAME
+gd_seek \(em reposition a dirfile field pointer
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "off_t gd_seek(DIRFILE *" dirfile ", const char *" field_code ", off_t"
+.IB frame_num ", off_t " sample_num ", int " flags );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_seek ()
+function changes the position of the I/O pointer associated with the field
+.I field_code
+in the dirfile(5) database specified by
+.IR dirfile .
+In normal operation,
+.BR gd_seek ()
+advances the field I/O pointer
+.I frame_num
+frames plus
+.I sample_num
+samples from the origin point specified in
+.IR flags ,
+which should contain one of
+.BR GD_SEEK_SET ", " GD_SEEK_CUR ,
+or
+.BR GD_SEEK_END ,
+indicating, respectively, sample zero, the current position of the
+field pointer, and the location of the end-of-field marker (see
+.BR gd_eof (3)).
+
+In addition to one of the symbols above, the
+.I flags
+parameter may also, optionally, be bitwise or'd with
+.BR GD_SEEK_WRITE ,
+which will result in the field being padded (with zero for integer types or a
+IEEE-754 conforming not-a-number otherwise) in the event of seeking past the
+end-of-field marker.  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
+.B 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.
+
+In general,
+.B GD_SEEK_WRITE
+should be used on
+.BR gd_seek ()
+calls before a write via
+.BR gd_putdata (3),
+while calls before a read via
+.BR gd_getdata (3)
+should omit the
+.B GD_SEEK_WRITE
+flag.  So the following:
+.IP
+.nh
+.ad l
+.BI "gd_seek(" dirfile ", " field_code ", " a ", " b ,
+.B GD_SEEK_SET | GD_SEEK_WRITE);
+.br
+.BI "gd_putdata(" dirfile ", "field_code ", GD_HERE, 0, " c ", " d ", " type ,
+.IB data );
+.ad n
+.hy
+.P
+is equivalent to:
+.IP
+.nh
+.ad l
+.BI "gd_putdata(" dirfile ", "field_code ", " a ", " b ", " c ", " d ", " type ,
+.IB data );
+.P
+and, similarly,
+.IP
+.nh
+.ad l
+.BI "gd_seek(" dirfile ", " field_code ", " a ", " b ", GD_SEEK_SET);"
+.br
+.BI "gd_getdata(" dirfile ", "field_code ", GD_HERE, 0, " c ", " d ", " type ,
+.IB data );
+.ad n
+.hy
+.P
+is equivalent to:
+.IP
+.nh
+.ad l
+.BI "gd_getdata(" dirfile ", "field_code ", " a ", " b ", " c ", " d ", " type ,
+.IB data );
+.P
+Only
+.B RAW
+fields (and the implicit
+.I INDEX
+field) have field I/O pointers associated with them.  Calling
+.BR gd_seek ()
+on a derived field will move the field pointers of all of the field's inputs.
+It is possible to create derived fields which simultaneously read from different
+places of the same input field.  Calling
+.BR gd_seek ()
+on such a field will result in an error.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_seek ()
+returns the field position of the specified field in samples.  On error, it
+returns -1 and set the dirfile error to a non-zero value.  Possible error values
+are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_ARGUMENT
+The
+.I flags
+parameter didn't contain exactly one of
+.BR GD_SEEK_SET ", " GD_SEEK_CUR ,
+or
+.BR GD_SEEK_END .
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.IR field_code ,
+or one of the fields it uses for input, was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_FIELD_TYPE
+An attempt was made to seek relative to
+.B GD_SEEK_END
+on the
+.I INDEX
+field, which has no end-of-field marker.
+.TP
+.B GD_E_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.
+.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
+An error occurred while trying to open or read from a file on disk containing
+a raw field.
+.TP
+.B GD_E_RANGE
+The request resulted an attempt to move the I/O pointer of the specified field
+or one of its inputs to a negative sample number.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of a RAW field could not be determined.  This may also
+indicate that the binary file associated with the RAW field could not be found.
+.TP
+.B GD_E_UNSUPPORTED
+Reading from dirfiles with the encoding scheme of the specified dirfile is not
+supported by the library.  See
+.BR dirfile-encoding (5)
+for details on dirfile encoding schemes.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_getdata (3),
+.BR gd_putdata (3),
+.BR gd_tell (3).
diff --git a/man/gd_seek64.3 b/man/gd_seek64.3
new file mode 100644
index 0000000..4a54605
--- /dev/null
+++ b/man/gd_seek64.3
@@ -0,0 +1,55 @@
+.\" gd_seek64.3.  The gd_seek64 man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_seek64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_seek64 \(em retrieve data from a dirfile database, with largefile support
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_off64_t gd_seek64(DIRFILE *" dirfile ", const char *" field_code ,
+.BI "gd_off64_t " frame_num ", gd_off64_t " sample_num ", int " flags );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_seek (3)
+uses a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+It is only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), this function will the same as
+.BR gd_seek (3).
+Otherwise,
+.BR gd_seek (3)
+will be a version of this function which uses a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_seek (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_spf.3 b/man/gd_spf.3
new file mode 100644
index 0000000..b8841c6
--- /dev/null
+++ b/man/gd_spf.3
@@ -0,0 +1,90 @@
+.\" gd_spf.3.  The gd_spf man page.
+.\"
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_spf 3 "1 April 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_spf \(em returns the samples per frame for a field in a
+dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "unsigned int gd_spf(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_spf ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns the number of samples per frame for the field
+.IR field_code .
+If
+.I field_code
+contains a valid representation suffix, it will be ignored.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_spf ()
+returns the number of samples per frame for the field specified.  On error, it
+returns zero and sets the dirfile error
+to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.TP
+.B GD_E_DIMENSION
+A scalar field was found where a vector field was expected.
+.TP
+.B GD_E_INTERNAL_ERROR
+An internal error occurred in the library while trying to perform the task.
+This indicates a bug in the library.  Please report the incident to the
+maintainer.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3)
diff --git a/man/gd_strings.3 b/man/gd_strings.3
new file mode 100644
index 0000000..d680b2d
--- /dev/null
+++ b/man/gd_strings.3
@@ -0,0 +1,95 @@
+.\" gd_strings.3.  The gd_strings man page.
+.\"
+.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_strings 3 "19 October 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_strings \(em retrieve a list of string values from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "const char **gd_strings(DIRFILE *" dirfile );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_strings ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and returns a read-only list of values of the all
+.B STRING
+type fields defined in the database.  Notably, this list does not include
+/META subfields.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+The array returned will be de-allocated by a call to
+.BR gd_close (3)
+and should not be de-allocated by the caller.  The list returned should not be
+assumed to be in any particular order, although it is guaranteed to be in the
+same order as the list of
+.B STRING
+fields returned by
+.BR gd_field_list_by_type (3).
+The array is terminated by a NULL pointer.  The number of strings in the array
+can be obtained from a call to
+.BR gd_nfields_by_type (3).
+
+The caller may not modify any strings in the array, or the array itself.  Doing
+so may cause database corruption.  The pointer returned is guaranteed to be
+valid until
+.BR gd_strings ()
+is called again with the same arguments, or until the array is de-allocated by
+a call to
+.BR gd_close (3).
+
+A corresponding list of names for these fields may be obtained by
+calling
+.BR gd_field_list_by_type (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_strings ()
+returns a pointer to an array of strings containing the values of all the
+.B STRING
+fields defined in the dirfile database.  The array is terminated by a NULL
+pointer.  If no strings are defined in the database, an array consisting of only
+the NULL pointer is returned.  On error it returns NULL and sets the dirfile
+error to a non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_field_list_by_type (3),
+.BR gd_mstrings (3),
+.BR gd_nfields_by_type (3),
+.BR gd_string (3)
diff --git a/man/gd_strtok.3 b/man/gd_strtok.3
new file mode 100644
index 0000000..9ead5d8
--- /dev/null
+++ b/man/gd_strtok.3
@@ -0,0 +1,97 @@
+.\" gd_strtok.3.  The gd_strtok man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_strtok 3 "28 June 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_strtok \(em tokenise a string using the GetData parser
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "char *gd_strtok(DIRFILE *" dirfile ", const char *" string );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_strtok ()
+function parses a string into a series of tokens according to the rules of the
+Dirfile metadata syntax (see dirfile-format(5)).  The first time
+.BR gd_strtok ()
+is called, the string to be parsed should be passed in
+.IR string .
+The first token will be returned.  In subsequent calls to parse the same string,
+.I string
+should be NULL (as with
+.BR strtok (3)).
+Each time 
+.BR gd_strtok ()
+is called like this, the next token is returned.
+
+Operation of the Dirfile tokeniser varies between Dirfile Standards Versions.
+The Standards Version used is the current Version of the loaded DIRFILE
+.IR dirfile .
+Use
+.BR gd_dirfile_standards (3)
+to retrieve or change this value.  Changing the Standards Version of
+.I dirfile
+while parsing a string will affect the parsing of subsequent tokens, but does
+not affect tokens already returned.  A copy of the string is cached in the
+.I dirfile
+object.  Calling
+.BR gd_strtok ()
+with different
+.IR dirfile s
+will parse different strings.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_strtok ()
+returns a copy of the first token (if
+.I string
+is non-NULL), or the subsequent token.  The token strings returned are each
+allocated with
+.BR malloc (3)
+and should be deallocated by the caller when no longer needed using
+.BR free (3).
+.PP
+If no more tokens are available, or if an error occurred, NULL is returned.
+If an error has occurred, it will also set the dirfile error a non-zero error
+value.  Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+A memory allocation error occurred.
+.TP
+.B GD_E_ARGUMENT
+There was no string to parse (i.e.
+.I string
+was NULL, but no previous call specified a string to parse).
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_FORMAT
+A syntax error was found in the string.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+
+.SH SEE ALSO
+.BR gd_dirfile_standards (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
diff --git a/man/gd_tell.3 b/man/gd_tell.3
new file mode 100644
index 0000000..df6fbe1
--- /dev/null
+++ b/man/gd_tell.3
@@ -0,0 +1,110 @@
+.\" gd_getdata.3.  The gd_getdata man page.
+.\"
+.\" Copyright (C) 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_tell 3 "14 October 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_tell \(em reposition a dirfile field pointer
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "off_t gd_tell(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_tell ()
+function reports the current position of the I/O pointer of the field
+.I field_code
+in the dirfile(5) database specified by
+.IR dirfile .
+.P
+Only
+.B RAW
+fields (and the implicit
+.I INDEX
+field) have field pointers associated with them.  Calling
+.BR gd_tell ()
+on a derived field will report the position of the I/O pointer of the derived
+field only if all of it's inputs are positioned the same.  Otherwise, an error
+results.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_tell ()
+returns the I/O position of the specified field in samples.  On error, it
+returns -1 and set the dirfile error to a non-zero value.  Possible error values
+are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_CODE
+The field specified by
+.IR field_code ,
+or one of the fields it uses for input, was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_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.
+.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
+An error occurred while trying to open or read from a file on disk containing
+a raw field.
+.TP
+.B GD_E_RECURSE_LEVEL
+Too many levels of recursion were encountered while trying to resolve
+.IR field_code .
+This usually indicates a circular dependency in field specification in the
+dirfile.
+.TP
+.B GD_E_UNKNOWN_ENCODING
+The encoding scheme of a RAW field could not be determined.  This may also
+indicate that the binary file associated with the RAW field could not be found.
+.TP
+.B GD_E_UNSUPPORTED
+Reading from dirfiles with the encoding scheme of the specified dirfile is not
+supported by the library.  See
+.BR dirfile-encoding (5)
+for details on dirfile encoding schemes.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR gd_open (3),
+.BR gd_getdata (3),
+.BR gd_putdata (3),
+.BR gd_seek (3).
diff --git a/man/gd_tell64.3 b/man/gd_tell64.3
new file mode 100644
index 0000000..828229a
--- /dev/null
+++ b/man/gd_tell64.3
@@ -0,0 +1,54 @@
+.\" gd_tell64.3.  The gd_tell64 man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_tell64 3 "25 May 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_tell64 \(em retrieve data from a dirfile database, with largefile support
+.SH SYNOPSIS
+.B #define GD_64BIT_API
+
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "gd_off64_t gd_tell64(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+This version of
+.BR gd_tell (3)
+uses a 64-bit offset type
+.RB ( gd_off64_t ),
+where one is available, regardless of the size of
+.BR off_t .
+It is only available if one defines
+.IR GD_64BIT_API
+or
+.IR _LARGEFILE64_SOURCE
+before including getdata.h.
+
+If
+.I off_t
+is a 64-bit type (possibly because
+.I _FILE_OFFSET_BITS
+has been defined to 64), this function will the same as
+.BR gd_tell (3).
+Otherwise,
+.BR gd_tell (3)
+will be a version of this function which uses a 32-bit
+.IR off_t .
+.SH SEE ALSO
+.BR gd_tell (3),
+.BR feature_test_macros (7)
diff --git a/man/gd_uninclude.3 b/man/gd_uninclude.3
new file mode 100644
index 0000000..d29311f
--- /dev/null
+++ b/man/gd_uninclude.3
@@ -0,0 +1,123 @@
+.\" gd_uninclude.3.  The gd_uninclude man page.
+.\"
+.\" Copyright (C) 2008, 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_uninclude 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_uninclude \(em remove a format specification fragment from a dirfile
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int *gd_uninclude(DIRFILE *" dirfile ", int " fragment_index ,
+.BI "int " del );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_uninclude ()
+removes the format specification fragment indexed by
+.I fragment_index
+from the specified dirfile, as well as any fragments the indicated fragment
+INCLUDEs.  Fields defined in the removed fragments will be removed from the
+dirfile.
+
+Before removing the specified fragment, all pending writes are flushed to
+.B RAW
+fields defined the the removed fragments.  If
+.I del
+is zero, metadata changes will also be written to the removed fragments.  If
+.I del
+is non-zero, the format specification fragments will be deleted from disk, if
+possible.  Regardless of the value of
+.IR del ,
+binary data files associated with
+.B RAW
+fields defined in the removed fragments will not be deleted.  To delete these
+binary files, use
+.BR gd_delete (3)
+before calling this function.
+
+The primary format specification (the fragment indexed by zero) cannot be
+removed from the dirfile.
+.SH RETURN VALUE
+On success,
+.BR gd_uninclude ()
+returns zero.  On error, -1 is returned and the dirfile error is set to a
+non-zero error value.  Possible error values are:
+.TP 8
+.B GD_E_ACCMODE
+The supplied dirfile was opened in read-only mode.
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_INDEX
+The supplied fragment index was out of range, or an attempt was made to remove
+the primary format specification.
+.TP
+.B GD_E_FLUSH
+A temporary file could not be opened into which to write the metadata of a
+modified, removed fragment, or renaming the temporary file over the original
+fragment failed.
+.TP
+.B GD_E_PROTECTED
+The metadata of the fragment which included the removed fragment was protected
+from change.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to flush or close a removed field.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+When finished with it, the DIRFILE object may be de-allocated with a call to
+.BR gd_close (3),
+even if the open failed.
+.SH NOTES
+This function re-arranges the remaining format specification fragments in some
+unspecified way, except for the primary fragment, which is guaranteed to remain
+at index zero.  Callers which cache format specification fragment indices must
+re-initialise their cache after calling this function.
+
+Unlike
+.BR gd_delete (3),
+fields which depend on fields removed by this function are not automatically
+updated, nor is any check made to ensure that this function does not leave
+fields with missing input fields.  Because of this, a fragment inclusion may be
+easily moved from one fragment to another with a combination of
+.BR gd_uninclude ()
+and
+.BR gd_include (3).
+However, if such checks are required, use
+.BR gd_delete (3)
+to delete the fields defined in the removed fragments first.
+.SH SEE ALSO
+.BR gd_delete (3),
+.BR gd_include (3),
+.BR gd_open (3),
+.BR gd_reference (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_fragmentname (3),
+.BR gd_nfragments (3),
+.BR dirfile (5),
+.BR dirfile-encoding (5),
+.BR dirfile-format (5)
diff --git a/man/gd_validate.3 b/man/gd_validate.3
new file mode 100644
index 0000000..07081fa
--- /dev/null
+++ b/man/gd_validate.3
@@ -0,0 +1,89 @@
+.\" gd_validate.3.  The gd_validate man page.
+.\"
+.\" Copyright (C) 2009, 2010, 2011 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_validate 3 "19 August 2011" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_validate \(em check a dirfile field code for validity
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_validate(DIRFILE *" dirfile ", const char *" field_code );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_validate ()
+function queries a dirfile(5) database specified by
+.I dirfile
+and checks whether
+.IR field_code ,
+which may contain a representation suffix, specifies a valid field.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+This function checks whether the field and its input fields (if any) are found,
+whether the representation suffix (if any) is valid, and also that all
+non-literal parameters specify valid scalar fields.
+
+.SH RETURN VALUE
+If all checks pass,
+.BR gd_validate ()
+returns zero.  On error, it returns -1 and sets the dirfile error to a non-zero
+error value.  Possible error values are:
+.TP 8
+.B GD_E_BAD_CODE
+The field specified by
+.I field_code
+or one of the fields it uses as input was not found in the database.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_BAD_REPR
+The representation suffix specified in
+.I field_code
+was not recognised.
+.TP
+.B GD_E_BAD_SCALAR
+A non-literal scalar used in the definition of the field or one of its inputs
+was not found, or was not a
+.B CONST
+or
+.B CARRAY
+field.
+.TP
+.B GD_E_DIMENSION
+A scalar field was found where a vector field was expected.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH NOTES
+It is not necessary to call this function before passing a field code to another
+GetData function: all functions which accept field codes perform these checks
+themselves.
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_getdata (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_open (3)
diff --git a/man/gd_verbose_prefix.3 b/man/gd_verbose_prefix.3
new file mode 100644
index 0000000..017084b
--- /dev/null
+++ b/man/gd_verbose_prefix.3
@@ -0,0 +1,82 @@
+.\" gd_verbose_prefix.3.  The gd_verbose_prefix man page.
+.\"
+.\" Copyright (C) 2012 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts.  A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_verbose_prefix 3 "1 April 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_verbose_prefix \(em set the prefix on error messages printed by GetData
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_verbose_prefix(DIRFILE *" dirfile ", const char *" prefix );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_verbose_prefix ()
+sets the prefix printed before error messages output by the GetData library
+for the dirfile(5) database specified by
+.IR dirfile .
+If
+.I prefix
+is NULL, the current prefix (if any) is deleted and no new prefix is saved.
+
+GetData only prints error messages for a given Dirfile if opened along with the
+.B GD_VERBOSE
+flag, or if the flag has been subsequently set on the dirfile using
+.BR gd_flags (3).
+If this flag is not set, this function still updates the prefix, but GetData
+does not use it.
+.PP
+If
+.B GD_VERBOSE
+is set, when the library encounters an error, it prints the supplied prefix (if
+any), followed immediately by the error message (which is the message returned
+by
+.BR gd_error_string (3)),
+followed by a newline.  All output goes to the standard error I/O stream
+.RB ( stderr (3))
+of the caller.
+
+The 
+.I dirfile
+argument must point to a valid DIRFILE object previously created by a call to
+.BR gd_open (3).
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_verbose_prefix ()
+returns the zero.  On error, it returns -1 and sets the dirfile error
+to a non-zero error value.  Possible error values are:
+.TP
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.PP
+The dirfile error may be retrieved by calling
+.BR gd_error (3).
+A descriptive error string for the last error encountered can be obtained from
+a call to
+.BR gd_error_string (3).
+.SH SEE ALSO
+.BR dirfile (5),
+.BR gd_flags (3),
+.BR gd_open (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR stderr (3).
diff --git a/missing b/missing
new file mode 100755
index 0000000..db98974
--- /dev/null
+++ b/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2013-10-28.13; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try '$0 --help' for more information"
+  exit 1
+fi
+
+case $1 in
+
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
+
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+
+Supported PROGRAM values:
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake at gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'autom4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
+    ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..b4bae92
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,177 @@
+# Copyright (C) 2008-2011 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+
+if CC_WALL
+WALL=-Wall
+endif
+
+if CC_WEXTRA
+WEXTRA=-Wextra
+endif
+
+if USE_SLIM
+if USE_MODULES
+LIBGETDATASLIM_LA=libgetdataslim.la
+DLOPEN_LIBGETDATASLIM_LA=-dlopen libgetdataslim.la
+else
+SLIM_C=slim.c
+endif
+endif
+
+if USE_GZIP
+if USE_MODULES
+LIBGETDATAGZIP_LA=libgetdatagzip.la
+DLOPEN_LIBGETDATAGZIP_LA=-dlopen libgetdatagzip.la
+else
+GZIP_C=gzip.c
+endif
+endif
+
+if USE_BZIP2
+if USE_MODULES
+LIBGETDATABZIP2_LA=libgetdatabzip2.la
+DLOPEN_LIBGETDATABZIP2_LA=-dlopen libgetdatabzip2.la
+else
+BZIP2_C=bzip.c
+endif
+endif
+
+if USE_LZMA
+if USE_MODULES
+LIBGETDATALZMA_LA=libgetdatalzma.la
+DLOPEN_LIBGETDATALZMA_LA=-dlopen libgetdatalzma.la
+else
+LZMA_C=lzma.c
+endif
+endif
+
+if USE_ZZIP
+if USE_MODULES
+LIBGETDATAZZIP_LA=libgetdatazzip.la
+DLOPEN_LIBGETDATAZZIP_LA=-dlopen libgetdatazzip.la
+else
+ZZIP_C=zzip.c
+endif
+endif
+
+if USE_ZZSLIM
+if USE_MODULES
+LIBGETDATAZZSLIM_LA=libgetdatazzslim.la
+DLOPEN_LIBGETDATAZZSLIM_LA=-dlopen libgetdatazzslim.la
+else
+ZZSLIM_C=zzslim.c
+endif
+endif
+
+if USE_MODULES
+EXPORT_DYNAMIC=-export-dynamic
+DGETDATA_MODULEDIR=-DGETDATA_MODULEDIR="\"$(moduledir)\""
+else
+EXTERNAL_CPPFLAGS=$(SLIM_CPPFLAGS) $(GZIP_CPPFLAGS) $(BZIP2_CPPFLAGS) \
+									$(LZMA_CPPFLAGS) $(ZZIP_CPPFLAGS)
+EXTERNAL_LDFLAGS=$(SLIM_LDFLAGS) $(GZIP_LDFLAGS) $(BZIP2_LDFLAGS) \
+								 $(LZMA_LDFLAGS) $(ZZIP_LDFLAGS)
+EXTERNAL_LIBS=$(SLIM_LIBS) $(GZIP_LIBS) $(BZIP2_LIBS) $(LZMA_LIBS) $(ZZIP_LIBS)
+endif
+
+if INCLUDE_LEGACY_API
+LEGACY_C = legacy.c
+GETDATA_LEGACY_H = getdata_legacy.h
+
+install-data-hook:
+	cd $(DESTDIR)$(includedir) && \
+		$(LN_S) -f getdata.h getdata_struct.h
+
+uninstall-hook:
+	cd $(DESTDIR)$(includedir) && rm -rf getdata_struct.h
+endif
+
+if GETDATA_DEBUG
+DEBUG_C = debug.c
+endif
+
+pkgconfigdir = @libdir@/pkgconfig
+AM_CFLAGS = ${WALL} ${WEXTRA} $(DGETDATA_MODULEDIR)
+AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS)
+
+BUILT_SOURCES = getdata.h
+
+nodist_include_HEADERS = getdata.h
+include_HEADERS = ${GETDATA_LEGACY_H}
+pkgconfig_DATA = getdata.pc
+
+lib_LTLIBRARIES = libgetdata.la
+module_LTLIBRARIES = ${LIBGETDATASLIM_LA} ${LIBGETDATAGZIP_LA} \
+									${LIBGETDATABZIP2_LA} ${LIBGETDATALZMA_LA} \
+									${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
+libgetdata_la_LDFLAGS = $(EXPORT_DYNAMIC) -export-symbols-regex '^[^_]' \
+												-version-info \
+												${GETDATA_IFACE_VERSION}:${GETDATA_IMPL_REVISION}:${GETDATA_IFACE_AGE} \
+												$(EXTERNAL_LDFLAGS) $(EXTERNAL_LIBS)
+libgetdata_la_LIBADD = $(LIBLTDL) $(DLOPEN_LIBGETDATASLIM_LA) \
+											 $(DLOPEN_LIBGETDATAGZIP_LA) 
+											 $(DLOPEN_LIBGETDATABZIP2_LA) \
+											 $(DLOPEN_LIBGETDATALZMA_LA) $(DLOPEN_LIBGETDATAZZIP_LA) \
+											 $(DLOPEN_LIBGETDATAZZSLIM_LA)
+
+libgetdataslim_la_SOURCES = slim.c
+libgetdataslim_la_LDFLAGS = $(SLIM_LDFLAGS) -release $(PACKAGE_VERSION) \
+														-module $(SLIM_LIBS)
+libgetdataslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS)
+
+libgetdatagzip_la_SOURCES = gzip.c
+libgetdatagzip_la_LDFLAGS = $(GZIP_LDFLAGS) -release $(PACKAGE_VERSION) \
+														-module $(GZIP_LIBS)
+libgetdatagzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(GZIP_CPPFLAGS)
+
+libgetdatabzip2_la_SOURCES = bzip.c
+libgetdatabzip2_la_LDFLAGS = $(BZIP2_LDFLAGS) -release $(PACKAGE_VERSION) \
+														 -module $(BZIP2_LIBS)
+libgetdatabzip2_la_CPPFLAGS = $(AM_CPPFLAGS) $(BZIP2_CPPFLAGS)
+
+libgetdatalzma_la_SOURCES = lzma.c
+libgetdatalzma_la_LDFLAGS = $(LZMA_LDFLAGS) -release $(PACKAGE_VERSION) \
+														 -module $(LZMA_LIBS)
+libgetdatalzma_la_CPPFLAGS = $(AM_CPPFLAGS) $(LZMA_CPPFLAGS)
+
+libgetdatazzip_la_SOURCES = zzip.c
+libgetdatazzip_la_LDFLAGS = $(ZZIP_LDFLAGS) -release $(PACKAGE_VERSION) \
+														 -module $(ZZIP_LIBS)
+libgetdatazzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZZIP_CPPFLAGS)
+
+libgetdatazzslim_la_SOURCES = zzslim.c
+libgetdatazzslim_la_LDFLAGS = $(SLIM_LDFLAGS) $(ZZIP_LDFLAGS) \
+														-release $(PACKAGE_VERSION) -module \
+														$(SLIM_LIBS) $(ZZIP_LIBS)
+libgetdatazzslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS) $(ZZIP_CPPFLAGS)
+
+clean-local:
+	rm -rf *~ getdata.pc
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..4227d69
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,1203 @@
+# 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 = src
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(srcdir)/gd_config.h.in $(srcdir)/getdata.h.in \
+	$(srcdir)/getdata.pc.in $(top_srcdir)/depcomp \
+	$(am__include_HEADERS_DIST)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/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_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(moduledir)" \
+	"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" \
+	"$(DESTDIR)$(includedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES) $(module_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE at am__DEPENDENCIES_2 =  \
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE@	libgetdataslim.la
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE at am__DEPENDENCIES_3 =  \
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE@	libgetdatagzip.la
+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
+ at USE_BZIP2_TRUE@@USE_MODULES_FALSE at am__objects_1 = bzip.lo
+ at GETDATA_DEBUG_TRUE@am__objects_2 = debug.lo
+ at USE_GZIP_TRUE@@USE_MODULES_FALSE at am__objects_3 = gzip.lo
+ at INCLUDE_LEGACY_API_TRUE@am__objects_4 = legacy.lo
+ at USE_LZMA_TRUE@@USE_MODULES_FALSE at am__objects_5 = lzma.lo
+ at USE_MODULES_FALSE@@USE_SLIM_TRUE at am__objects_6 = slim.lo
+ 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 =
+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)
+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@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libgetdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(libgetdata_la_LDFLAGS) $(LDFLAGS) -o $@
+libgetdatabzip2_la_LIBADD =
+am_libgetdatabzip2_la_OBJECTS = libgetdatabzip2_la-bzip.lo
+libgetdatabzip2_la_OBJECTS = $(am_libgetdatabzip2_la_OBJECTS)
+libgetdatabzip2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libgetdatabzip2_la_LDFLAGS) \
+	$(LDFLAGS) -o $@
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE at am_libgetdatabzip2_la_rpath =  \
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE@	-rpath $(moduledir)
+libgetdatagzip_la_LIBADD =
+am_libgetdatagzip_la_OBJECTS = libgetdatagzip_la-gzip.lo
+libgetdatagzip_la_OBJECTS = $(am_libgetdatagzip_la_OBJECTS)
+libgetdatagzip_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libgetdatagzip_la_LDFLAGS) $(LDFLAGS) \
+	-o $@
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE at am_libgetdatagzip_la_rpath = -rpath \
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE@	$(moduledir)
+libgetdatalzma_la_LIBADD =
+am_libgetdatalzma_la_OBJECTS = libgetdatalzma_la-lzma.lo
+libgetdatalzma_la_OBJECTS = $(am_libgetdatalzma_la_OBJECTS)
+libgetdatalzma_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libgetdatalzma_la_LDFLAGS) $(LDFLAGS) \
+	-o $@
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE at am_libgetdatalzma_la_rpath = -rpath \
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE@	$(moduledir)
+libgetdataslim_la_LIBADD =
+am_libgetdataslim_la_OBJECTS = libgetdataslim_la-slim.lo
+libgetdataslim_la_OBJECTS = $(am_libgetdataslim_la_OBJECTS)
+libgetdataslim_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libgetdataslim_la_LDFLAGS) $(LDFLAGS) \
+	-o $@
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE at am_libgetdataslim_la_rpath = -rpath \
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE@	$(moduledir)
+libgetdatazzip_la_LIBADD =
+am_libgetdatazzip_la_OBJECTS = libgetdatazzip_la-zzip.lo
+libgetdatazzip_la_OBJECTS = $(am_libgetdatazzip_la_OBJECTS)
+libgetdatazzip_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libgetdatazzip_la_LDFLAGS) $(LDFLAGS) \
+	-o $@
+ at USE_MODULES_TRUE@@USE_ZZIP_TRUE at am_libgetdatazzip_la_rpath = -rpath \
+ at USE_MODULES_TRUE@@USE_ZZIP_TRUE@	$(moduledir)
+libgetdatazzslim_la_LIBADD =
+am_libgetdatazzslim_la_OBJECTS = libgetdatazzslim_la-zzslim.lo
+libgetdatazzslim_la_OBJECTS = $(am_libgetdatazzslim_la_OBJECTS)
+libgetdatazzslim_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(libgetdatazzslim_la_LDFLAGS) \
+	$(LDFLAGS) -o $@
+ at USE_MODULES_TRUE@@USE_ZZSLIM_TRUE at am_libgetdatazzslim_la_rpath =  \
+ at USE_MODULES_TRUE@@USE_ZZSLIM_TRUE@	-rpath $(moduledir)
+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@
+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 = $(libgetdata_la_SOURCES) $(libgetdatabzip2_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;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+DATA = $(pkgconfig_DATA)
+am__include_HEADERS_DIST = getdata_legacy.h
+HEADERS = $(include_HEADERS) $(nodist_include_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+	$(LISP)gd_config.h.in getdata.ah
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008-2011 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+ at CC_WALL_TRUE@WALL = -Wall
+ at CC_WEXTRA_TRUE@WEXTRA = -Wextra
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE at LIBGETDATASLIM_LA = libgetdataslim.la
+ at USE_MODULES_TRUE@@USE_SLIM_TRUE at DLOPEN_LIBGETDATASLIM_LA = -dlopen libgetdataslim.la
+ at USE_MODULES_FALSE@@USE_SLIM_TRUE at SLIM_C = slim.c
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE at LIBGETDATAGZIP_LA = libgetdatagzip.la
+ at USE_GZIP_TRUE@@USE_MODULES_TRUE at DLOPEN_LIBGETDATAGZIP_LA = -dlopen libgetdatagzip.la
+ at USE_GZIP_TRUE@@USE_MODULES_FALSE at GZIP_C = gzip.c
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE at LIBGETDATABZIP2_LA = libgetdatabzip2.la
+ at USE_BZIP2_TRUE@@USE_MODULES_TRUE at DLOPEN_LIBGETDATABZIP2_LA = -dlopen libgetdatabzip2.la
+ at USE_BZIP2_TRUE@@USE_MODULES_FALSE at BZIP2_C = bzip.c
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE at LIBGETDATALZMA_LA = libgetdatalzma.la
+ at USE_LZMA_TRUE@@USE_MODULES_TRUE at DLOPEN_LIBGETDATALZMA_LA = -dlopen libgetdatalzma.la
+ at USE_LZMA_TRUE@@USE_MODULES_FALSE at LZMA_C = lzma.c
+ at USE_MODULES_TRUE@@USE_ZZIP_TRUE at LIBGETDATAZZIP_LA = libgetdatazzip.la
+ at USE_MODULES_TRUE@@USE_ZZIP_TRUE at DLOPEN_LIBGETDATAZZIP_LA = -dlopen libgetdatazzip.la
+ at USE_MODULES_FALSE@@USE_ZZIP_TRUE at ZZIP_C = zzip.c
+ at USE_MODULES_TRUE@@USE_ZZSLIM_TRUE at LIBGETDATAZZSLIM_LA = libgetdatazzslim.la
+ at USE_MODULES_TRUE@@USE_ZZSLIM_TRUE at DLOPEN_LIBGETDATAZZSLIM_LA = -dlopen libgetdatazzslim.la
+ at USE_MODULES_FALSE@@USE_ZZSLIM_TRUE at ZZSLIM_C = zzslim.c
+ at USE_MODULES_TRUE@EXPORT_DYNAMIC = -export-dynamic
+ at USE_MODULES_TRUE@DGETDATA_MODULEDIR = -DGETDATA_MODULEDIR="\"$(moduledir)\""
+ at USE_MODULES_FALSE@EXTERNAL_CPPFLAGS = $(SLIM_CPPFLAGS) $(GZIP_CPPFLAGS) $(BZIP2_CPPFLAGS) \
+ at USE_MODULES_FALSE@									$(LZMA_CPPFLAGS) $(ZZIP_CPPFLAGS)
+
+ at USE_MODULES_FALSE@EXTERNAL_LDFLAGS = $(SLIM_LDFLAGS) $(GZIP_LDFLAGS) $(BZIP2_LDFLAGS) \
+ at USE_MODULES_FALSE@								 $(LZMA_LDFLAGS) $(ZZIP_LDFLAGS)
+
+ at USE_MODULES_FALSE@EXTERNAL_LIBS = $(SLIM_LIBS) $(GZIP_LIBS) $(BZIP2_LIBS) $(LZMA_LIBS) $(ZZIP_LIBS)
+ at INCLUDE_LEGACY_API_TRUE@LEGACY_C = legacy.c
+ at INCLUDE_LEGACY_API_TRUE@GETDATA_LEGACY_H = getdata_legacy.h
+ at GETDATA_DEBUG_TRUE@DEBUG_C = debug.c
+pkgconfigdir = @libdir@/pkgconfig
+AM_CFLAGS = ${WALL} ${WEXTRA} $(DGETDATA_MODULEDIR)
+AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS)
+BUILT_SOURCES = getdata.h
+nodist_include_HEADERS = getdata.h
+include_HEADERS = ${GETDATA_LEGACY_H}
+pkgconfig_DATA = getdata.pc
+lib_LTLIBRARIES = libgetdata.la
+module_LTLIBRARIES = ${LIBGETDATASLIM_LA} ${LIBGETDATAGZIP_LA} \
+									${LIBGETDATABZIP2_LA} ${LIBGETDATALZMA_LA} \
+									${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
+
+libgetdata_la_LDFLAGS = $(EXPORT_DYNAMIC) -export-symbols-regex '^[^_]' \
+												-version-info \
+												${GETDATA_IFACE_VERSION}:${GETDATA_IMPL_REVISION}:${GETDATA_IFACE_AGE} \
+												$(EXTERNAL_LDFLAGS) $(EXTERNAL_LIBS)
+
+libgetdata_la_LIBADD = $(LIBLTDL) $(DLOPEN_LIBGETDATASLIM_LA) \
+											 $(DLOPEN_LIBGETDATAGZIP_LA) 
+
+libgetdataslim_la_SOURCES = slim.c
+libgetdataslim_la_LDFLAGS = $(SLIM_LDFLAGS) -release $(PACKAGE_VERSION) \
+														-module $(SLIM_LIBS)
+
+libgetdataslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS)
+libgetdatagzip_la_SOURCES = gzip.c
+libgetdatagzip_la_LDFLAGS = $(GZIP_LDFLAGS) -release $(PACKAGE_VERSION) \
+														-module $(GZIP_LIBS)
+
+libgetdatagzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(GZIP_CPPFLAGS)
+libgetdatabzip2_la_SOURCES = bzip.c
+libgetdatabzip2_la_LDFLAGS = $(BZIP2_LDFLAGS) -release $(PACKAGE_VERSION) \
+														 -module $(BZIP2_LIBS)
+
+libgetdatabzip2_la_CPPFLAGS = $(AM_CPPFLAGS) $(BZIP2_CPPFLAGS)
+libgetdatalzma_la_SOURCES = lzma.c
+libgetdatalzma_la_LDFLAGS = $(LZMA_LDFLAGS) -release $(PACKAGE_VERSION) \
+														 -module $(LZMA_LIBS)
+
+libgetdatalzma_la_CPPFLAGS = $(AM_CPPFLAGS) $(LZMA_CPPFLAGS)
+libgetdatazzip_la_SOURCES = zzip.c
+libgetdatazzip_la_LDFLAGS = $(ZZIP_LDFLAGS) -release $(PACKAGE_VERSION) \
+														 -module $(ZZIP_LIBS)
+
+libgetdatazzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZZIP_CPPFLAGS)
+libgetdatazzslim_la_SOURCES = zzslim.c
+libgetdatazzslim_la_LDFLAGS = $(SLIM_LDFLAGS) $(ZZIP_LDFLAGS) \
+														-release $(PACKAGE_VERSION) -module \
+														$(SLIM_LIBS) $(ZZIP_LIBS)
+
+libgetdatazzslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS) $(ZZIP_CPPFLAGS)
+all: $(BUILT_SOURCES) gd_config.h getdata.h
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+gd_config.h: stamp-h1
+	@test -f $@ || rm -f stamp-h1
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/gd_config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status src/gd_config.h
+$(srcdir)/gd_config.h.in:  $(am__configure_deps) 
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+	rm -f stamp-h1
+	touch $@
+
+getdata.h: stamp-h2
+	@test -f $@ || rm -f stamp-h2
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
+
+stamp-h2: getdata.ah $(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
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+getdata.pc: $(top_builddir)/config.status $(srcdir)/getdata.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+install-moduleLTLIBRARIES: $(module_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \
+	}
+
+uninstall-moduleLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \
+	done
+
+clean-moduleLTLIBRARIES:
+	-test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES)
+	@list='$(module_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libgetdata.la: $(libgetdata_la_OBJECTS) $(libgetdata_la_DEPENDENCIES) $(EXTRA_libgetdata_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdata_la_LINK) -rpath $(libdir) $(libgetdata_la_OBJECTS) $(libgetdata_la_LIBADD) $(LIBS)
+
+libgetdatabzip2.la: $(libgetdatabzip2_la_OBJECTS) $(libgetdatabzip2_la_DEPENDENCIES) $(EXTRA_libgetdatabzip2_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdatabzip2_la_LINK) $(am_libgetdatabzip2_la_rpath) $(libgetdatabzip2_la_OBJECTS) $(libgetdatabzip2_la_LIBADD) $(LIBS)
+
+libgetdatagzip.la: $(libgetdatagzip_la_OBJECTS) $(libgetdatagzip_la_DEPENDENCIES) $(EXTRA_libgetdatagzip_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdatagzip_la_LINK) $(am_libgetdatagzip_la_rpath) $(libgetdatagzip_la_OBJECTS) $(libgetdatagzip_la_LIBADD) $(LIBS)
+
+libgetdatalzma.la: $(libgetdatalzma_la_OBJECTS) $(libgetdatalzma_la_DEPENDENCIES) $(EXTRA_libgetdatalzma_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdatalzma_la_LINK) $(am_libgetdatalzma_la_rpath) $(libgetdatalzma_la_OBJECTS) $(libgetdatalzma_la_LIBADD) $(LIBS)
+
+libgetdataslim.la: $(libgetdataslim_la_OBJECTS) $(libgetdataslim_la_DEPENDENCIES) $(EXTRA_libgetdataslim_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdataslim_la_LINK) $(am_libgetdataslim_la_rpath) $(libgetdataslim_la_OBJECTS) $(libgetdataslim_la_LIBADD) $(LIBS)
+
+libgetdatazzip.la: $(libgetdatazzip_la_OBJECTS) $(libgetdatazzip_la_DEPENDENCIES) $(EXTRA_libgetdatazzip_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdatazzip_la_LINK) $(am_libgetdatazzip_la_rpath) $(libgetdatazzip_la_OBJECTS) $(libgetdatazzip_la_LIBADD) $(LIBS)
+
+libgetdatazzslim.la: $(libgetdatazzslim_la_OBJECTS) $(libgetdatazzslim_la_DEPENDENCIES) $(EXTRA_libgetdatazzslim_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgetdatazzslim_la_LINK) $(am_libgetdatazzslim_la_rpath) $(libgetdatazzslim_la_OBJECTS) $(libgetdatazzslim_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/common.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/compat.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/constant.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encoding.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/errors.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/field_list.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flimits.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fpos.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/getdata.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/globals.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatabzip2_la-bzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatagzip_la-gzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatalzma_la-lzma.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdataslim_la-slim.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatazzip_la-zzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgetdatazzslim_la-zzslim.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/native.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/putdata.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/raw.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/slim.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/string.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/types.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzslim.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 $@ $<
+
+libgetdatabzip2_la-bzip.lo: bzip.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatabzip2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatabzip2_la-bzip.lo -MD -MP -MF $(DEPDIR)/libgetdatabzip2_la-bzip.Tpo -c -o libgetdatabzip2_la-bzip.lo `test -f 'bzip.c' || echo '$(srcdir)/'`bzip.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatabzip2_la-bzip.Tpo $(DEPDIR)/libgetdatabzip2_la-bzip.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='bzip.c' object='libgetdatabzip2_la-bzip.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(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
+
+libgetdatagzip_la-gzip.lo: gzip.c
+ at 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
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatagzip_la-gzip.Tpo $(DEPDIR)/libgetdatagzip_la-gzip.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='gzip.c' object='libgetdatagzip_la-gzip.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatagzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatagzip_la-gzip.lo `test -f 'gzip.c' || echo '$(srcdir)/'`gzip.c
+
+libgetdatalzma_la-lzma.lo: lzma.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatalzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatalzma_la-lzma.lo -MD -MP -MF $(DEPDIR)/libgetdatalzma_la-lzma.Tpo -c -o libgetdatalzma_la-lzma.lo `test -f 'lzma.c' || echo '$(srcdir)/'`lzma.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatalzma_la-lzma.Tpo $(DEPDIR)/libgetdatalzma_la-lzma.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='lzma.c' object='libgetdatalzma_la-lzma.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatalzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatalzma_la-lzma.lo `test -f 'lzma.c' || echo '$(srcdir)/'`lzma.c
+
+libgetdataslim_la-slim.lo: slim.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdataslim_la-slim.lo -MD -MP -MF $(DEPDIR)/libgetdataslim_la-slim.Tpo -c -o libgetdataslim_la-slim.lo `test -f 'slim.c' || echo '$(srcdir)/'`slim.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdataslim_la-slim.Tpo $(DEPDIR)/libgetdataslim_la-slim.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='slim.c' object='libgetdataslim_la-slim.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdataslim_la-slim.lo `test -f 'slim.c' || echo '$(srcdir)/'`slim.c
+
+libgetdatazzip_la-zzip.lo: zzip.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatazzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatazzip_la-zzip.lo -MD -MP -MF $(DEPDIR)/libgetdatazzip_la-zzip.Tpo -c -o libgetdatazzip_la-zzip.lo `test -f 'zzip.c' || echo '$(srcdir)/'`zzip.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatazzip_la-zzip.Tpo $(DEPDIR)/libgetdatazzip_la-zzip.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='zzip.c' object='libgetdatazzip_la-zzip.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) $(libgetdatazzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatazzip_la-zzip.lo `test -f 'zzip.c' || echo '$(srcdir)/'`zzip.c
+
+libgetdatazzslim_la-zzslim.lo: zzslim.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatazzslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatazzslim_la-zzslim.lo -MD -MP -MF $(DEPDIR)/libgetdatazzslim_la-zzslim.Tpo -c -o libgetdatazzslim_la-zzslim.lo `test -f 'zzslim.c' || echo '$(srcdir)/'`zzslim.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatazzslim_la-zzslim.Tpo $(DEPDIR)/libgetdatazzslim_la-zzslim.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='zzslim.c' object='libgetdatazzslim_la-zzslim.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) $(libgetdatazzslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatazzslim_la-zzslim.lo `test -f 'zzslim.c' || echo '$(srcdir)/'`zzslim.c
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-pkgconfigDATA: $(pkgconfig_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+	done
+
+uninstall-pkgconfigDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
+install-includeHEADERS: $(include_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+	done
+
+uninstall-includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+install-nodist_includeHEADERS: $(nodist_include_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+	done
+
+uninstall-nodist_includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) gd_config.h \
+		getdata.h
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ at INCLUDE_LEGACY_API_FALSE@install-data-hook:
+ at INCLUDE_LEGACY_API_FALSE@uninstall-hook:
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
+	clean-moduleLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS install-moduleLTLIBRARIES \
+	install-nodist_includeHEADERS install-pkgconfigDATA
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+	uninstall-moduleLTLIBRARIES uninstall-nodist_includeHEADERS \
+	uninstall-pkgconfigDATA
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
+.MAKE: all check install install-am install-data-am install-strip \
+	uninstall-am
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool clean-local \
+	clean-moduleLTLIBRARIES cscopelist-am ctags ctags-am distclean \
+	distclean-compile distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-data-hook install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-includeHEADERS install-info install-info-am \
+	install-libLTLIBRARIES install-man install-moduleLTLIBRARIES \
+	install-nodist_includeHEADERS install-pdf install-pdf-am \
+	install-pkgconfigDATA install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-hook \
+	uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+	uninstall-moduleLTLIBRARIES uninstall-nodist_includeHEADERS \
+	uninstall-pkgconfigDATA
+
+
+ at INCLUDE_LEGACY_API_TRUE@install-data-hook:
+ at INCLUDE_LEGACY_API_TRUE@	cd $(DESTDIR)$(includedir) && \
+ at INCLUDE_LEGACY_API_TRUE@		$(LN_S) -f getdata.h getdata_struct.h
+
+ at INCLUDE_LEGACY_API_TRUE@uninstall-hook:
+ at INCLUDE_LEGACY_API_TRUE@	cd $(DESTDIR)$(includedir) && rm -rf getdata_struct.h
+											 $(DLOPEN_LIBGETDATABZIP2_LA) \
+											 $(DLOPEN_LIBGETDATALZMA_LA) $(DLOPEN_LIBGETDATAZZIP_LA) \
+											 $(DLOPEN_LIBGETDATAZZSLIM_LA)
+
+clean-local:
+	rm -rf *~ getdata.pc
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/add.c b/src/add.c
new file mode 100644
index 0000000..b0cd17e
--- /dev/null
+++ b/src/add.c
@@ -0,0 +1,2171 @@
+/* Copyright (C) 2008-2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+int _GD_InvalidEntype(gd_entype_t t) {
+  dtrace("0x%X", t);
+
+  if (t != GD_RAW_ENTRY && t != GD_LINCOM_ENTRY && t != GD_LINTERP_ENTRY &&
+      t != GD_BIT_ENTRY && t != GD_MULTIPLY_ENTRY && t != GD_PHASE_ENTRY &&
+      t != GD_CONST_ENTRY && t != GD_POLYNOM_ENTRY && t != GD_SBIT_ENTRY &&
+      t != GD_DIVIDE_ENTRY && t != GD_RECIP_ENTRY && t != GD_WINDOW_ENTRY &&
+      t != GD_MPLEX_ENTRY && t != GD_CARRAY_ENTRY && t != GD_STRING_ENTRY)
+  {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static gd_entry_t *_GD_FixName(DIRFILE *restrict D, char **restrict buffer,
+    const char *name, int frag, int *restrict offset)
+{
+  gd_entry_t *P;
+  char *ptr;
+
+  dtrace("%p, %p, \"%s\", %i, %p", D, buffer, name, frag, offset);
+
+  /* Check prefix and suffix */
+  if (_GD_CheckCodeAffixes(D, NULL, name, frag)) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+    
+  *buffer = ptr = _GD_Strdup(D, name);
+
+  if (ptr == NULL) {
+    free(ptr);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  P = _GD_CheckParent(D, &ptr, -1, 0);
+
+  if (D->error) {
+    free(*buffer);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (P) {
+    char *temp2;
+    /* make the new name -- this may be different because P may have been
+     * dealiased */
+
+    *offset = strlen(P->field) + 1;
+    temp2 = (char*)_GD_Malloc(D, *offset + strlen(ptr) + 1);
+    if (temp2 == NULL) {
+      free(*buffer);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    sprintf(temp2, "%s/%s", P->field, ptr);
+    free(*buffer);
+    *buffer = temp2;
+  } else
+    *offset = 0;
+
+  dreturn("%p (\"%s\", %i)", P, *buffer, *offset);
+  return P;
+}
+
+/* copy scalar entries from the user's entry; returns a mask of
+ * initialised scalars */
+static unsigned _GD_CopyScalars(DIRFILE *restrict D,
+    gd_entry_t *restrict E, const gd_entry_t *restrict entry, unsigned mask)
+{
+  unsigned mask_out = 0;
+  int i;
+
+  dtrace("%p, %p, %p, 0x%X", D, E, entry, mask);
+
+  /* copy scalars */
+  for (i = 0; i <= GD_MAX_POLYORD; ++i) {
+    if (!(mask & (1 << i)) || entry->scalar[i] == NULL ||
+        entry->scalar[i][0] == '\0')
+    {
+      E->scalar[i] = NULL;
+    } else {
+      if (_GD_CheckCodeAffixes(D, NULL, entry->scalar[i],
+            entry->fragment_index))
+      {
+        break;
+      }
+      E->scalar[i] = _GD_Strdup(D, entry->scalar[i]);
+      E->scalar_ind[i] = entry->scalar_ind[i];
+      mask_out |= (1 << i);
+    }
+  }
+
+  dreturn("0x%X", mask_out);
+  return mask_out;
+}
+
+/* add an entry - returns the added entry on success. */
+static gd_entry_t *_GD_Add(DIRFILE *restrict D,
+    const gd_entry_t *restrict entry, const char *restrict parent)
+{
+  char *temp_buffer;
+  int i, is_dot, offset;
+  void *new_list;
+  void *new_ref = NULL;
+  unsigned int u;
+  unsigned mask;
+  gd_entry_t *E;
+  gd_entry_t *P = NULL;
+
+  dtrace("%p, %p, \"%s\"", D, entry, parent);
+
+  _GD_ClearError(D);
+
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* check for include index out of range */
+  if (parent == NULL && (entry->fragment_index < 0 ||
+        entry->fragment_index >= D->n_fragment))
+  {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, entry->fragment_index, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* check parent */
+  if (parent != NULL) {
+    P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+    if (P == NULL) {
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, parent);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    /* make sure it's not a meta field already */
+    if (P->e->n_meta == -1) {
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, parent);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    /* make name */
+    offset = strlen(parent) + 1;
+    temp_buffer = (char *)_GD_Malloc(D, offset + strlen(entry->field) + 1);
+
+    if (temp_buffer == NULL) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    strcpy(temp_buffer, parent);
+    temp_buffer[offset - 1] = '/';
+    strcpy(temp_buffer + offset, entry->field);
+  } else {
+    /* this will check for affixes and take care of detecting Barth-style
+     * metafield definitions */
+    P = _GD_FixName(D, &temp_buffer, entry->field, entry->fragment_index,
+        &offset);
+
+    if (D->error) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  }
+
+  /* check for duplicate field */
+  if (_GD_FindField(D, temp_buffer, D->entry, D->n_entries, 0, &u)) {
+    _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, temp_buffer);
+    free(temp_buffer);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* check for bad field type */
+  if (_GD_InvalidEntype(entry->field_type)) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_TYPE, NULL, entry->field_type,
+        NULL);
+    free(temp_buffer);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* New entry */
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL) {
+    free(temp_buffer);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E, 0, sizeof(gd_entry_t));
+  if (P)
+    E->fragment_index = P->fragment_index;
+  else
+    E->fragment_index = entry->fragment_index;
+
+  /* check protection */
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+    free(E);
+    free(temp_buffer);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL) {
+    free(E);
+    free(temp_buffer);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+  E->e->calculated = 0;
+  E->field_type = entry->field_type;
+
+  E->field = temp_buffer;
+
+  /* Check */
+  if (_GD_ValidateField(E->field + offset, D->standards, 1, 0, &is_dot)) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, entry->field);
+    _GD_FreeE(D, E, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* Set meta indices */
+  if (P != NULL)
+    E->e->n_meta = -1;
+
+  /* Hidden */
+  if (entry->hidden)
+    E->hidden = 1;
+
+  /* Validate entry and add auxiliary data */
+  switch(entry->field_type)
+  {
+    case GD_RAW_ENTRY:
+      /* no METARAW fields allowed */
+      if (P != NULL) {
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_METARAW, NULL,
+            entry->field_type, NULL);
+        break;
+      }
+
+      /* check protection */
+      if (D->fragment[entry->fragment_index].protection & GD_PROTECT_DATA) {
+        _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0,
+            D->fragment[entry->fragment_index].cname);
+        break;
+      }
+
+      E->EN(raw,data_type) = entry->EN(raw,data_type);
+      E->e->u.raw.file[0].idata = E->e->u.raw.file[1].idata = -1;
+      E->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN;
+
+      E->e->u.raw.filebase = _GD_MungeCode(D, NULL,
+          D->fragment[entry->fragment_index].prefix,
+          D->fragment[entry->fragment_index].suffix, NULL, NULL, E->field,
+          &offset, 0);
+      if (D->error)
+        break;
+
+      mask = _GD_CopyScalars(D, E, entry, 0x1);
+
+      if (!(mask & 1) && (E->EN(raw,spf) = entry->EN(raw,spf)) == 0)
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_SPF, NULL, 0, NULL);
+      else if (E->EN(raw,data_type) & 0x40 || (E->e->u.raw.size =
+            GD_SIZE(E->EN(raw,data_type))) == 0)
+        _GD_SetError(D, GD_E_BAD_TYPE, entry->EN(raw,data_type), NULL, 0, NULL);
+      else if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0,
+            GD_FILE_WRITE | GD_FILE_TOUCH, 0))
+      {
+        ;
+      } else if (D->fragment[E->fragment_index].ref_name == NULL) {
+        /* This is the first raw field in this fragment */
+        new_ref = _GD_Strdup(D, E->field);
+      }
+      break;
+    case GD_LINCOM_ENTRY:
+      E->EN(lincom,n_fields) = entry->EN(lincom,n_fields);
+
+      if (E->EN(lincom,n_fields) < 1 || E->EN(lincom,n_fields) > GD_MAX_LINCOM)
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL,
+            E->EN(lincom,n_fields), NULL);
+      
+      for (i = 0; i < E->EN(lincom,n_fields); ++i)
+        _GD_CheckCodeAffixes(D, NULL, entry->in_fields[i],
+            entry->fragment_index);
+
+      if (D->error)
+        break;
+
+      _GD_CopyScalars(D, E, entry, 9 * ((1 << E->EN(lincom,n_fields)) - 1));
+
+      if (entry->comp_scal) {
+        int cs = 0;
+        memcpy(E->EN(lincom,cm), entry->EN(lincom,cm), sizeof(double) * 2 *
+            E->EN(lincom,n_fields));
+        memcpy(E->EN(lincom,cb), entry->EN(lincom,cb), sizeof(double) * 2 *
+            E->EN(lincom,n_fields));
+        for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+          E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]);
+          E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
+          if (cimag(E->EN(lincom,cm)[i]) || cimag(E->EN(lincom,cb)[i]))
+            cs = 1;
+        }
+        E->comp_scal = cs;
+      } else {
+        memcpy(E->EN(lincom,m), entry->EN(lincom,m), sizeof(double) *
+            E->EN(lincom,n_fields));
+        memcpy(E->EN(lincom,b), entry->EN(lincom,b), sizeof(double) *
+            E->EN(lincom,n_fields));
+        for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+          gd_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)
+        E->in_fields[i] = _GD_Strdup(D, entry->in_fields[i]);
+      break;
+    case GD_LINTERP_ENTRY:
+      E->e->u.linterp.table_len = -1;
+
+      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
+            entry->fragment_index))
+      {
+        break;
+      }
+
+      E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]);
+      E->EN(linterp,table) = _GD_Strdup(D, entry->EN(linterp,table));
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
+            entry->fragment_index) || _GD_CheckCodeAffixes(D, NULL,
+              entry->in_fields[1], entry->fragment_index))
+      {
+        break;
+      }
+
+      E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]);
+      E->in_fields[1] = _GD_Strdup(D, entry->in_fields[1]);
+      break;
+    case GD_RECIP_ENTRY:
+      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
+            entry->fragment_index))
+      {
+        break;
+      }
+
+      E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]);
+
+      _GD_CopyScalars(D, E, entry, 0x1);
+
+      if (entry->comp_scal) {
+        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;
+      } 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:
+    case GD_SBIT_ENTRY:
+      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))
+      {
+        break;
+      }
+
+      E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]);
+
+      mask = _GD_CopyScalars(D, E, entry, 0x3);
+
+      if (!(mask & 2) && E->EN(bit,numbits) < 1)
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NUMBITS, NULL,
+            entry->EN(bit,numbits), NULL);
+      else if (!(mask & 1) && E->EN(bit,bitnum) < 0)
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_BITNUM, NULL,
+            entry->EN(bit,bitnum), NULL);
+      else if (!(mask & 3) && E->EN(bit,bitnum) + E->EN(bit,numbits) - 1 > 63)
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_BITSIZE, NULL,
+            E->EN(bit,bitnum) + E->EN(bit,numbits) - 1, NULL);
+      break;
+    case GD_PHASE_ENTRY:
+      E->EN(phase,shift) = entry->EN(phase,shift);
+
+      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
+            entry->fragment_index))
+      {
+        break;
+      }
+
+      _GD_CopyScalars(D, E, entry, 0x1);
+
+      E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]);
+      break;
+    case GD_WINDOW_ENTRY:
+      E->EN(window,windop) = entry->EN(window,windop);
+      E->EN(window,threshold) = entry->EN(window,threshold);
+
+      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
+            entry->fragment_index) || _GD_CheckCodeAffixes(D, NULL,
+              entry->in_fields[1], entry->fragment_index))
+      {
+        break;
+      }
+
+      _GD_CopyScalars(D, E, entry, 0x1);
+
+      E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]);
+      E->in_fields[1] = _GD_Strdup(D, entry->in_fields[1]);
+      if (_GD_BadWindop(E->EN(window,windop)))
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_WINDOP, NULL,
+            entry->EN(window,windop), NULL);
+      break;
+    case GD_MPLEX_ENTRY:
+      E->EN(mplex,count_val) = entry->EN(mplex,count_val);
+      E->EN(mplex,period) = entry->EN(mplex,period);
+
+      if (_GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
+            entry->fragment_index) || _GD_CheckCodeAffixes(D, NULL,
+              entry->in_fields[1], entry->fragment_index))
+      {
+        break;
+      }
+
+      E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]);
+      E->in_fields[1] = _GD_Strdup(D, entry->in_fields[1]);
+      E->e->u.mplex.type = GD_NULL;
+
+      mask = _GD_CopyScalars(D, E, entry, 0x3);
+
+      if (!(mask & 2) && entry->EN(mplex,period) < 0)
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_PERIOD, NULL,
+            entry->EN(mplex,period), NULL);
+
+      break;
+    case GD_CONST_ENTRY:
+      E->EN(scalar,const_type) = entry->EN(scalar,const_type);
+      E->EN(scalar,array_len) = -1;
+
+      if (E->EN(scalar,const_type) & 0x40 || GD_SIZE(E->EN(scalar,const_type))
+          == 0)
+      {
+        _GD_SetError(D, GD_E_BAD_TYPE, E->EN(scalar,const_type), NULL, 0, NULL);
+      } else {
+        size_t size = GD_SIZE(_GD_ConstType(D, E->EN(scalar,const_type)));
+        if (!D->error)
+          E->e->u.scalar.d = _GD_Malloc(D, size);
+        if (E->e->u.scalar.d)
+          memset(E->e->u.scalar.d, 0, size);
+      }
+      break;
+    case GD_CARRAY_ENTRY:
+      E->EN(scalar,const_type) = entry->EN(scalar,const_type);
+      E->EN(scalar,array_len) = entry->EN(scalar,array_len);
+
+      if (E->EN(scalar,const_type) & 0x40 || GD_SIZE(E->EN(scalar,const_type))
+          == 0)
+      {
+        _GD_SetError(D, GD_E_BAD_TYPE, E->EN(scalar,const_type), NULL, 0, NULL);
+      } else if (E->EN(scalar,array_len) > GD_MAX_CARRAY_LENGTH)
+        _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
+      else {
+        size_t size = GD_SIZE(_GD_ConstType(D, E->EN(scalar,const_type))) *
+          E->EN(scalar,array_len);
+        if (!D->error)
+          E->e->u.scalar.d = _GD_Malloc(D, size);
+        if (E->e->u.scalar.d)
+          memset(E->e->u.scalar.d, 0, size);
+      }
+      break;
+    case GD_STRING_ENTRY:
+      E->e->u.string = _GD_Strdup(D, "");
+      break;
+    case GD_POLYNOM_ENTRY:
+      E->EN(polynom,poly_ord) = entry->EN(polynom,poly_ord);
+
+      if (E->EN(polynom,poly_ord) < 1 || E->EN(polynom,poly_ord) >
+          GD_MAX_POLYORD)
+      {
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL,
+            E->EN(polynom,poly_ord), NULL);
+      } else {
+        _GD_CheckCodeAffixes(D, NULL, entry->in_fields[0],
+            entry->fragment_index);
+        _GD_CheckCodeAffixes(D, NULL, entry->in_fields[1],
+            entry->fragment_index);
+      }
+
+      if (D->error)
+        break;
+
+      _GD_CopyScalars(D, E, entry, (1 << (E->EN(polynom,poly_ord) + 1)) - 1);
+
+      if (entry->comp_scal) {
+        int cs = 0;
+        memcpy(E->EN(polynom,ca), entry->EN(polynom,ca), sizeof(double) * 2 *
+            (E->EN(polynom,poly_ord) + 1));
+        for (i = 0; i <= E->EN(polynom,poly_ord); ++i) {
+          E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
+          if (cimag(E->EN(polynom,ca)[i]))
+            cs = 1;
+        }
+        E->comp_scal = cs;
+      } else {
+        memcpy(E->EN(polynom,a), entry->EN(polynom,a), sizeof(double) *
+            (E->EN(polynom,poly_ord) + 1));
+        for (i = 0; i <= E->EN(polynom,poly_ord); ++i)
+          gd_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]);
+      break;
+    case GD_ALIAS_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_NO_ENTRY:
+      _GD_InternalError(D); /* We've already verrified field_type is valid */
+      break;
+  }
+
+  if (D->error != GD_E_OK) {
+    free(new_ref);
+    _GD_FreeE(D, E, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  new_list = _GD_Realloc(D, D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*));
+  if (new_list == NULL) {
+    free(new_ref);
+    _GD_FreeE(D, E, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  D->entry = (gd_entry_t **)new_list;
+
+  if (is_dot) {
+    new_list = _GD_Realloc(D, D->dot_list, (D->n_dot + 1) *
+        sizeof(gd_entry_t*));
+    if (new_list == NULL) {
+      free(new_ref);
+      _GD_FreeE(D, E, 1);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+    D->dot_list = (gd_entry_t **)new_list;
+  }
+
+  if (P) {
+    void *ptr = _GD_Realloc(D, P->e->p.meta_entry, (P->e->n_meta + 1) *
+        sizeof(gd_entry_t*));
+    if (ptr == NULL) {
+      free(new_ref);
+      _GD_FreeE(D, E, 1);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    /* From here on, nothing may fail */
+
+    P->e->p.meta_entry = (gd_entry_t **)ptr;
+    P->e->p.meta_entry[P->e->n_meta] = E;
+    P->e->n_meta++;
+
+    P->e->value_list_validity = 0;
+    P->e->entry_list_validity = 0;
+  } else {
+    /* Invalidate the field lists */
+    D->value_list_validity = 0;
+    D->entry_list_validity = 0;
+  }
+
+
+  if (E->field_type == GD_RAW_ENTRY) {
+    if (new_ref != NULL) {
+      /* This is the first raw field in this fragment; propagate it upwards */
+      for (i = E->fragment_index; i != -1; i = D->fragment[i].parent) {
+        if (D->fragment[i].ref_name == NULL) {
+          D->fragment[i].ref_name = (char *)strdup((const char*)new_ref);
+          D->fragment[i].modified = 1;
+        } else
+          break;
+      }
+
+      if (D->reference_field == NULL)
+        D->reference_field = E;
+      free(new_ref);
+    }
+  }
+
+  /* add the entry to the dot list, if needed */
+  if (is_dot) {
+    D->dot_list[D->n_dot++] = E;
+    qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp);
+  }
+
+  /* add the entry and resort the entry list */
+  _GD_InsertSort(D, E, u);
+  D->n_entries++;
+  D->fragment[E->fragment_index].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+
+  /* Update aliases - no reason to do a reset: all we did was add a field */
+  _GD_UpdateAliases(D, 0);
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* add a META field by parsing a field spec */
+int gd_madd_spec(DIRFILE* D, const char* line, const char* parent) gd_nothrow
+{
+  char *outstring = NULL;
+  char *in_cols[MAX_IN_COLS];
+  const char *tok_pos = NULL;
+  int n_cols;
+  int me;
+  gd_entry_t* E = NULL;
+
+  dtrace("%p, \"%s\", \"%s\"", D, line, parent);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  /* Find parent -- we don't do code mungeing here because we don't know
+   * which fragment this is yet.  */
+  E = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+  if (E == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, parent);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  me = E->fragment_index;
+
+  /* check protection */
+  if (D->fragment[me].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[me].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* start parsing */
+  n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols,
+      "dirfile_madd_spec()", 0, D->standards, D->flags & GD_PERMISSIVE);
+
+  /* Directive parsing is skipped -- The Field Spec parser will add the field */
+  if (!D->error)
+    _GD_ParseFieldSpec(D, n_cols, in_cols, E, "dirfile_madd_spec()", 0, me,
+        D->standards, 1, GD_PEDANTIC, 1, &outstring, tok_pos);
+
+  free(outstring);
+
+  if (D->error) {
+    dreturn("%i", -1); /* parser threw an error */
+    return -1;
+  }
+
+  /* Update aliases */
+  _GD_UpdateAliases(D, 0);
+
+  D->fragment[me].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* add a field by parsing a field spec */
+int gd_add_spec(DIRFILE* D, const char* line, int fragment_index)
+{
+  char *outstring;
+  const char *tok_pos = NULL;
+  char *in_cols[MAX_IN_COLS];
+  int n_cols;
+
+  dtrace("%p, \"%s\", %i", D, line, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check for include index out of range */
+  if (fragment_index < 0 || fragment_index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check protection */
+  if (D->fragment[fragment_index].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[fragment_index].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  /* start parsing */
+  n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols,
+      "dirfile_add_spec()", 0, D->standards, D->flags & GD_PERMISSIVE);
+
+  /* Directive parsing is skipped -- The Field Spec parser will add the field */
+  if (!D->error)
+    _GD_ParseFieldSpec(D, n_cols, in_cols, NULL, "dirfile_add_spec()", 0,
+        fragment_index, D->standards, 1, GD_PEDANTIC, 1, &outstring, tok_pos);
+
+  free(outstring);
+
+  if (D->error) {
+    dreturn("%i", -1); /* parser threw an error */
+    return -1;
+  }
+
+  /* Update aliases */
+  _GD_UpdateAliases(D, 0);
+
+  D->fragment[fragment_index].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_add(DIRFILE* D, const gd_entry_t* entry)
+{
+  int ret;
+
+  dtrace("%p, %p", D, entry);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  ret = (_GD_Add(D, entry, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+/* add a RAW entry */
+int gd_add_raw(DIRFILE* D, const char* field_code, gd_type_t data_type,
+    unsigned int spf, int fragment_index)
+{
+  gd_entry_t R;
+  int error;
+
+  dtrace("%p, \"%s\", 0x%X, %i, %i", D, field_code, data_type, spf,
+      fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&R, 0, sizeof(gd_entry_t));
+  R.field = (char *)field_code;
+  R.field_type = GD_RAW_ENTRY;
+  R.EN(raw,spf) = spf;
+  R.EN(raw,data_type) = data_type;
+  R.fragment_index = fragment_index;
+  error = (_GD_Add(D, &R, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a LINCOM entry */
+int gd_add_lincom(DIRFILE* D, const char* field_code, int n_fields,
+    const char** in_fields, const double* m, const double* b,
+    int fragment_index) gd_nothrow
+{
+  int i, error;
+  gd_entry_t L;
+
+  dtrace("%p, \"%s\", %i, %p, %p, %p, %i", D, field_code, n_fields, in_fields,
+      m, b, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (n_fields < 1 || n_fields > GD_MAX_LINCOM) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&L, 0, sizeof(gd_entry_t));
+  L.field = (char *)field_code;
+  L.field_type = GD_LINCOM_ENTRY;
+  L.EN(lincom,n_fields) = n_fields;
+  L.comp_scal = 0;
+  L.fragment_index = fragment_index;
+
+  for (i = 0; i < n_fields; ++i) {
+    L.in_fields[i] = (char *)in_fields[i];
+    L.EN(lincom,m)[i] = m[i];
+    L.EN(lincom,b)[i] = b[i];
+  }
+  error = (_GD_Add(D, &L, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a LINCOM entry with complex scalars */
+int gd_add_clincom(DIRFILE* D, const char* field_code, int n_fields,
+    const char** in_fields, const GD_DCOMPLEXP(cm), const GD_DCOMPLEXP(cb),
+    int fragment_index) gd_nothrow
+{
+  int i, error;
+  gd_entry_t L;
+
+  dtrace("%p, \"%s\", %i, %p, %p, %p, %i", D, field_code, n_fields, in_fields,
+      cm, cb, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (n_fields < 1 || n_fields > GD_MAX_LINCOM) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&L, 0, sizeof(gd_entry_t));
+  L.field = (char *)field_code;
+  L.field_type = GD_LINCOM_ENTRY;
+  L.EN(lincom,n_fields) = n_fields;
+  L.comp_scal = 1;
+  L.fragment_index = fragment_index;
+
+  for (i = 0; i < n_fields; ++i) {
+    L.in_fields[i] = (char *)in_fields[i];
+    gd_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;
+}
+
+/* add a LINTERP entry */
+int gd_add_linterp(DIRFILE* D, const char* field_code, const char* in_field,
+    const char* table, int fragment_index) gd_nothrow
+{
+  gd_entry_t L;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, field_code, in_field, table,
+      fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&L, 0, sizeof(gd_entry_t));
+  L.field = (char *)field_code;
+  L.field_type = GD_LINTERP_ENTRY;
+  L.in_fields[0] = (char *)in_field;
+  L.EN(linterp,table) = (char *)table;
+  L.fragment_index = fragment_index;
+  error = (_GD_Add(D, &L, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a BIT entry */
+int gd_add_bit(DIRFILE* D, const char* field_code, const char* in_field,
+    int bitnum, int numbits, int fragment_index) gd_nothrow
+{
+  gd_entry_t B;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field, bitnum,
+      numbits, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&B, 0, sizeof(gd_entry_t));
+  B.field = (char *)field_code;
+  B.field_type = GD_BIT_ENTRY;
+  B.in_fields[0] = (char *)in_field;
+  B.EN(bit,bitnum) = bitnum;
+  B.EN(bit,numbits) = numbits;
+  B.fragment_index = fragment_index;
+  error = (_GD_Add(D, &B, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a SBIT entry */
+int gd_add_sbit(DIRFILE* D, const char* field_code, const char* in_field,
+    int bitnum, int numbits, int fragment_index) gd_nothrow
+{
+  gd_entry_t B;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field, bitnum,
+      numbits, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&B, 0, sizeof(gd_entry_t));
+  B.field = (char *)field_code;
+  B.field_type = GD_SBIT_ENTRY;
+  B.in_fields[0] = (char *)in_field;
+  B.EN(bit,bitnum) = bitnum;
+  B.EN(bit,numbits) = numbits;
+  B.fragment_index = fragment_index;
+  error = (_GD_Add(D, &B, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a MULTIPLY entry */
+int gd_add_multiply(DIRFILE* D, const char* field_code, const char* in_field1,
+    const char* in_field2, int fragment_index) gd_nothrow
+{
+  gd_entry_t M;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, field_code, in_field1, in_field2,
+      fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&M, 0, sizeof(gd_entry_t));
+  M.field = (char *)field_code;
+  M.field_type = GD_MULTIPLY_ENTRY;
+  M.in_fields[0] = (char *)in_field1;
+  M.in_fields[1] = (char *)in_field2;
+  M.fragment_index = fragment_index;
+  error = (_GD_Add(D, &M, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a DIVIDE entry */
+int gd_add_divide(DIRFILE* D, const char* field_code, const char* in_field1,
+    const char* in_field2, int fragment_index) gd_nothrow
+{
+  gd_entry_t E;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, field_code, in_field1, in_field2,
+      fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_DIVIDE_ENTRY;
+  E.in_fields[0] = (char *)in_field1;
+  E.in_fields[1] = (char *)in_field2;
+  E.fragment_index = fragment_index;
+  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a RECIP entry */
+int gd_add_recip(DIRFILE* D, const char* field_code, const char* in_field,
+    double dividend, int fragment_index) gd_nothrow
+{
+  gd_entry_t E;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", %g, %i", D, field_code, in_field, dividend,
+      fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_RECIP_ENTRY;
+  E.EN(recip,dividend) = dividend;
+  E.comp_scal = 0;
+  E.in_fields[0] = (char *)in_field;
+  E.fragment_index = fragment_index;
+  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+#ifndef GD_NO_C99_API
+int gd_add_crecip(DIRFILE* D, const char* field_code, const char* in_field,
+    double complex cdividend, int fragment_index) gd_nothrow
+{
+  int error;
+
+  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;
+
+  dreturn("%i", error);
+  return error;
+}
+#endif
+
+int gd_add_crecip89(DIRFILE* D, const char* field_code, const char* in_field,
+    const double cdividend[2], int fragment_index) gd_nothrow
+{
+  gd_entry_t E;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", [%g, %g], %i", D, field_code, in_field,
+      cdividend[0], cdividend[1], fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_RECIP_ENTRY;
+  gd_ra2cs_(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;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a POLYNOM entry */
+int gd_add_polynom(DIRFILE* D, const char* field_code, int poly_ord,
+    const char* in_field, const double* a, int fragment_index) gd_nothrow
+{
+  int i, error;
+  gd_entry_t E;
+
+  dtrace("%p, \"%s\", %i, \"%s\", %p, %i", D, field_code, poly_ord, in_field,
+      a, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (poly_ord < 1 || poly_ord > GD_MAX_LINCOM) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_POLYNOM_ENTRY;
+  E.EN(polynom,poly_ord) = poly_ord;
+  E.fragment_index = fragment_index;
+  E.comp_scal = 0;
+  E.in_fields[0] = (char *)in_field;
+
+  for (i = 0; i <= poly_ord; ++i)
+    E.EN(polynom,a)[i] = a[i];
+
+  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+int gd_add_cpolynom(DIRFILE* D, const char* field_code, int poly_ord,
+    const char* in_field, const GD_DCOMPLEXP(ca), int fragment_index) gd_nothrow
+{
+  int i, error;
+  gd_entry_t E;
+
+  dtrace("%p, \"%s\", %i, \"%s\", %p, %i", D, field_code, poly_ord, in_field,
+      ca, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (poly_ord < 1 || poly_ord > GD_MAX_LINCOM) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_POLYNOM_ENTRY;
+  E.EN(polynom,poly_ord) = poly_ord;
+  E.fragment_index = fragment_index;
+  E.comp_scal = 1;
+  E.in_fields[0] = (char *)in_field;
+
+  for (i = 0; i <= poly_ord; ++i)
+    gd_ca2cs_(E.EN(polynom,ca)[i], ca, i);
+
+  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a PHASE entry */
+int gd_add_phase(DIRFILE* D, const char* field_code, const char* in_field,
+    gd_shift_t shift, int fragment_index) gd_nothrow
+{
+  gd_entry_t P;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", %lli, %i", D, field_code, in_field,
+      (long long)shift, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&P, 0, sizeof(gd_entry_t));
+  P.field = (char *)field_code;
+  P.field_type = GD_PHASE_ENTRY;
+  P.in_fields[0] = (char *)in_field;
+  P.EN(phase,shift) = shift;
+  P.fragment_index = fragment_index;
+  error = (_GD_Add(D, &P, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a WINDOW entry */
+int gd_add_window(DIRFILE *D, const char *field_code, const char *in_field,
+    const char *check_field, gd_windop_t windop, gd_triplet_t threshold,
+    int fragment_index) gd_nothrow
+{
+  gd_entry_t E;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}, %i", D, field_code,
+      in_field, check_field, windop, threshold.r,
+      (unsigned long long)threshold.u, (long long)threshold.i, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_WINDOW_ENTRY;
+  E.EN(window,threshold) = threshold;
+  E.EN(window,windop) = windop;
+  E.in_fields[0] = (char *)in_field;
+  E.in_fields[1] = (char *)check_field;
+  E.fragment_index = fragment_index;
+  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a MPLEX entry */
+int gd_add_mplex(DIRFILE *D, const char *field_code, const char *in_field,
+    const char *count_field, int count_val, int period, int fragment_index)
+  gd_nothrow
+{
+  gd_entry_t E;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field,
+      count_field, count_val, period, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_MPLEX_ENTRY;
+  E.EN(mplex,count_val) = count_val;
+  E.EN(mplex,period) = period;
+  E.in_fields[0] = (char *)in_field;
+  E.in_fields[1] = (char *)count_field;
+  E.fragment_index = fragment_index;
+  error = (_GD_Add(D, &E, NULL) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a STRING entry */
+int gd_add_string(DIRFILE* D, const char* field_code, const char* value,
+    int fragment_index) gd_nothrow
+{
+  gd_entry_t *entry;
+  gd_entry_t S;
+
+  dtrace("%p, \"%s\", \"%s\", %i", D, field_code, value, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&S, 0, sizeof(gd_entry_t));
+  S.field = (char *)field_code;
+  S.field_type = GD_STRING_ENTRY;
+  S.fragment_index = fragment_index;
+  entry = _GD_Add(D, &S, NULL);
+
+  /* Actually store the string, now */
+  if (entry)
+    _GD_DoStringOut(D, entry, value);
+
+  dreturn("%i", D->error ? -1 : 0);
+  return D->error ? -1 : 0;
+}
+
+/* add a CONST entry */
+int gd_add_const(DIRFILE* D, const char* field_code, gd_type_t const_type,
+    gd_type_t data_type, const void* value, int fragment_index) gd_nothrow
+{
+  gd_entry_t *entry;
+  gd_entry_t C;
+
+  dtrace("%p, \"%s\", 0x%X, 0x%X, %p, %i", D, field_code, const_type, data_type,
+      value, fragment_index);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&C, 0, sizeof(gd_entry_t));
+  C.field = (char *)field_code;
+  C.field_type = GD_CONST_ENTRY;
+  C.EN(scalar,const_type) = const_type;
+  C.fragment_index = fragment_index;
+  entry = _GD_Add(D, &C, NULL);
+
+  /* Actually store the constant, now */
+  if (entry)
+    _GD_DoFieldOut(D, entry, 0, 0, 1, data_type, value);
+
+  dreturn("%i", D->error ? -1 : 0);
+  return D->error ? -1 : 0;
+}
+
+/* add a CARRAY entry */
+int gd_add_carray(DIRFILE* D, const char* field_code, gd_type_t const_type,
+    size_t array_len, gd_type_t data_type, const void* values,
+    int fragment_index) gd_nothrow
+{
+  gd_entry_t *entry;
+  gd_entry_t C;
+
+  dtrace("%p, \"%s\", 0x%X, %" PRNsize_t ", 0x%X, %p, %i", D, field_code,
+      const_type, array_len, data_type, values, fragment_index);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&C, 0, sizeof(gd_entry_t));
+  C.field = (char *)field_code;
+  C.field_type = GD_CARRAY_ENTRY;
+  C.EN(scalar,const_type) = const_type;
+  C.EN(scalar,array_len) = array_len;
+  C.fragment_index = fragment_index;
+  entry = _GD_Add(D, &C, NULL);
+
+  /* Actually store the carray, now */
+  if (entry)
+    _GD_DoFieldOut(D, entry, 0, 0, array_len, data_type, values);
+
+  dreturn("%i", D->error ? -1 : 0);
+  return D->error ? -1 : 0;
+}
+
+int gd_madd(DIRFILE* D, const gd_entry_t* entry, const char* parent) gd_nothrow
+{
+  int ret;
+
+  dtrace("%p, %p, \"%s\"", D, entry, parent);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  ret = (_GD_Add(D, entry, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+/* add a META LINCOM entry */
+int gd_madd_lincom(DIRFILE* D, const char* parent, const char* field_code,
+    int n_fields, const char** in_fields, const double* m, const double* b)
+  gd_nothrow
+{
+  int i, error;
+  gd_entry_t L;
+
+  dtrace("%p, \"%s\", \"%s\", %i, %p, %p, %p", D, field_code, parent,
+      n_fields, in_fields, m, b);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (n_fields < 1 || n_fields > GD_MAX_LINCOM) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&L, 0, sizeof(gd_entry_t));
+  L.field = (char *)field_code;
+  L.field_type = GD_LINCOM_ENTRY;
+  L.EN(lincom,n_fields) = n_fields;
+  L.comp_scal = 0;
+  L.fragment_index = 0;
+
+  for (i = 0; i < n_fields; ++i) {
+    L.in_fields[i] = (char *)in_fields[i];
+    L.EN(lincom,m)[i] = m[i];
+    L.EN(lincom,b)[i] = b[i];
+    L.scalar[i] = NULL;
+    L.scalar[i + GD_MAX_LINCOM] = NULL;
+  }
+  error = (_GD_Add(D, &L, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META LINCOM entry, with complex scalaras */
+int gd_madd_clincom(DIRFILE* D, const char* parent, const char* field_code,
+    int n_fields, const char** in_fields, const GD_DCOMPLEXP(cm),
+    const GD_DCOMPLEXP(cb)) gd_nothrow
+{
+  int i, error;
+  gd_entry_t L;
+
+  dtrace("%p, \"%s\", \"%s\", %i, %p, %p, %p", D, field_code, parent,
+      n_fields, in_fields, cm, cb);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (n_fields < 1 || n_fields > GD_MAX_LINCOM) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&L, 0, sizeof(gd_entry_t));
+  L.field = (char *)field_code;
+  L.field_type = GD_LINCOM_ENTRY;
+  L.EN(lincom,n_fields) = n_fields;
+  L.comp_scal = 1;
+  L.fragment_index = 0;
+
+  for (i = 0; i < n_fields; ++i) {
+    L.in_fields[i] = (char *)in_fields[i];
+    gd_ca2cs_(L.EN(lincom,cm)[i], cm, i);
+    gd_ca2cs_(L.EN(lincom,cb)[i], cb, i);
+    L.scalar[i] = NULL;
+    L.scalar[i + GD_MAX_LINCOM] = NULL;
+  }
+  error = (_GD_Add(D, &L, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META LINTERP entry */
+int gd_madd_linterp(DIRFILE* D, const char* parent,
+    const char* field_code, const char* in_field, const char* table) gd_nothrow
+{
+  gd_entry_t L;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\"", D, field_code, parent, in_field,
+      table);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&L, 0, sizeof(gd_entry_t));
+  L.field = (char *)field_code;
+  L.field_type = GD_LINTERP_ENTRY;
+  L.in_fields[0] = (char *)in_field;
+  L.EN(linterp,table) = (char *)table;
+  L.fragment_index = 0;
+  error = (_GD_Add(D, &L, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META BIT entry */
+int gd_madd_bit(DIRFILE* D, const char* parent, const char* field_code,
+    const char* in_field, 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);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&B, 0, sizeof(gd_entry_t));
+  B.field = (char *)field_code;
+  B.field_type = GD_BIT_ENTRY;
+  B.in_fields[0] = (char *)in_field;
+  B.EN(bit,bitnum) = bitnum;
+  B.EN(bit,numbits) = numbits;
+  B.fragment_index = 0;
+  B.scalar[0] = B.scalar[1] = NULL;
+  error = (_GD_Add(D, &B, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META SBIT entry */
+int gd_madd_sbit(DIRFILE* D, const char* parent, const char* field_code,
+    const char* in_field, 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);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&B, 0, sizeof(gd_entry_t));
+  B.field = (char *)field_code;
+  B.field_type = GD_SBIT_ENTRY;
+  B.in_fields[0] = (char *)in_field;
+  B.EN(bit,bitnum) = bitnum;
+  B.EN(bit,numbits) = numbits;
+  B.fragment_index = 0;
+  B.scalar[0] = B.scalar[1] = NULL;
+  error = (_GD_Add(D, &B, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META MULTIPLY entry */
+int gd_madd_multiply(DIRFILE* D, const char* parent, const char* field_code,
+    const char* in_field1, const char* in_field2) gd_nothrow
+{
+  gd_entry_t M;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\"", D, field_code, parent,
+      in_field1, in_field2);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&M, 0, sizeof(gd_entry_t));
+  M.field = (char *)field_code;
+  M.field_type = GD_MULTIPLY_ENTRY;
+  M.in_fields[0] = (char *)in_field1;
+  M.in_fields[1] = (char *)in_field2;
+  M.fragment_index = 0;
+  error = (_GD_Add(D, &M, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META PHASE entry */
+int gd_madd_phase(DIRFILE* D, const char* parent, const char* field_code,
+    const char* in_field, gd_shift_t shift) gd_nothrow
+{
+  int error;
+  gd_entry_t P;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %lli", D, field_code, parent, in_field,
+      (long long)shift);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&P, 0, sizeof(gd_entry_t));
+  P.field = (char *)field_code;
+  P.field_type = GD_PHASE_ENTRY;
+  P.in_fields[0] = (char *)in_field;
+  P.EN(phase,shift) = shift;
+  P.fragment_index = 0;
+  P.scalar[0] = NULL;
+  error = (_GD_Add(D, &P, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META POLYNOM entry */
+int gd_madd_polynom(DIRFILE* D, const char* parent, const char* field_code,
+    int poly_ord, const char* in_field, const double* a) gd_nothrow
+{
+  int i, error;
+  gd_entry_t E;
+
+  dtrace("%p, \"%s\", \"%s\", %i, \"%s\", %p", D, field_code, parent, poly_ord,
+      in_field, a);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (poly_ord < 1 || poly_ord > GD_MAX_POLYORD) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_POLYNOM_ENTRY;
+  E.EN(polynom,poly_ord) = poly_ord;
+  E.fragment_index = 0;
+  E.comp_scal = 0;
+  E.in_fields[0] = (char *)in_field;
+
+  for (i = 0; i <= poly_ord; ++i) {
+    E.EN(polynom,a)[i] = a[i];
+    E.scalar[i] = NULL;
+  }
+
+  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META POLYNOM entry */
+int gd_madd_cpolynom(DIRFILE* D, const char* parent, const char* field_code,
+    int poly_ord, const char* in_field, const GD_DCOMPLEXP(ca)) gd_nothrow
+{
+  int i, error;
+  gd_entry_t E;
+
+  dtrace("%p, \"%s\", \"%s\", %i, \"%s\", %p", D, field_code, parent, poly_ord,
+      in_field, ca);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (poly_ord < 1 || poly_ord > GD_MAX_POLYORD) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_POLYNOM_ENTRY;
+  E.EN(polynom,poly_ord) = poly_ord;
+  E.fragment_index = 0;
+  E.comp_scal = 1;
+  E.in_fields[0] = (char *)in_field;
+
+  for (i = 0; i <= poly_ord; ++i) {
+    gd_ca2cs_(E.EN(polynom,ca)[i], ca, i);
+    E.scalar[i] = NULL;
+  }
+
+  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META DIVIDE entry */
+int gd_madd_divide(DIRFILE* D, const char *parent, const char* field_code,
+    const char* in_field1, const char* in_field2) gd_nothrow
+{
+  int error;
+  gd_entry_t E;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\"", D, parent, field_code, in_field1,
+      in_field2);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_DIVIDE_ENTRY;
+  E.in_fields[0] = (char *)in_field1;
+  E.in_fields[1] = (char *)in_field2;
+  error = (_GD_Add(D, &E, parent) == 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,
+      dividend);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_RECIP_ENTRY;
+  E.EN(recip,dividend) = dividend;
+  E.comp_scal = 0;
+  E.in_fields[0] = (char *)in_field;
+  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+#ifndef GD_NO_C99_API
+int gd_madd_crecip(DIRFILE* D, const char *parent, const char* field_code, const
+    char* in_field, double complex cdividend)
+{
+  int error;
+
+  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;
+
+  dreturn("%i", error);
+  return error;
+}
+#endif
+
+int gd_madd_crecip89(DIRFILE* D, const char *parent, const char* field_code,
+    const char* in_field, const double cdividend[2]) gd_nothrow
+{
+  gd_entry_t E;
+  int error;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", [%g, %g]", D, parent, field_code,
+      in_field, cdividend[0], cdividend[1]);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_RECIP_ENTRY;
+  gd_ra2cs_(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;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META WINDOW entry */
+int gd_madd_window(DIRFILE *D, const char *parent, const char *field_code,
+    const char *in_field, const char *check_field, gd_windop_t windop,
+    gd_triplet_t threshold) gd_nothrow
+{
+  int error;
+  gd_entry_t E;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}", D, parent,
+      field_code, in_field, check_field, windop, threshold.r,
+      (unsigned long long)threshold.u, (long long)threshold.i);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_WINDOW_ENTRY;
+  E.EN(window,threshold) = threshold;
+  E.EN(window,windop) = windop;
+  E.in_fields[0] = (char *)in_field;
+  E.in_fields[1] = (char *)check_field;
+  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META MPLEX entry */
+int gd_madd_mplex(DIRFILE *D, const char *parent, const char *field_code,
+    const char *in_field, const char *count_field, int count_val, int period)
+  gd_nothrow
+{
+  int error;
+  gd_entry_t E;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\", %i, %i", D, parent, field_code,
+      in_field, count_field, count_val, period);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&E, 0, sizeof(gd_entry_t));
+  E.field = (char *)field_code;
+  E.field_type = GD_MPLEX_ENTRY;
+  E.EN(mplex,count_val) = count_val;
+  E.EN(mplex,period) = period;
+  E.in_fields[0] = (char *)in_field;
+  E.in_fields[1] = (char *)count_field;
+  error = (_GD_Add(D, &E, parent) == NULL) ? -1 : 0;
+
+  dreturn("%i", error);
+  return error;
+}
+
+/* add a META STRING entry */
+int gd_madd_string(DIRFILE* D, const char* parent,
+    const char* field_code, const char* value) gd_nothrow
+{
+  gd_entry_t *entry;
+  gd_entry_t S;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\"", D, parent, field_code, value);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&S, 0, sizeof(gd_entry_t));
+  S.field = (char *)field_code;
+  S.field_type = GD_STRING_ENTRY;
+  S.fragment_index = 0;
+  entry = _GD_Add(D, &S, parent);
+
+  /* Actually store the string, now */
+  if (entry)
+    _GD_DoStringOut(D, entry, value);
+
+  dreturn("%i", D->error ? -1 : 0);
+  return D->error ? -1 : 0;
+}
+
+/* add a META CONST entry */
+int gd_madd_const(DIRFILE* D, const char* parent, const char* field_code,
+    gd_type_t const_type, gd_type_t data_type, const void* value) gd_nothrow
+{
+  gd_entry_t *entry;
+  gd_entry_t C;
+
+  dtrace("%p, \"%s\", \"%s\", 0x%X, 0x%X, %p", D, parent, field_code,
+      const_type, data_type, value);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&C, 0, sizeof(gd_entry_t));
+  C.field = (char *)field_code;
+  C.field_type = GD_CONST_ENTRY;
+  C.EN(scalar,const_type) = const_type;
+  C.fragment_index = 0;
+  entry = _GD_Add(D, &C, parent);
+
+  /* Actually store the constant, now */
+  if (entry)
+    _GD_DoFieldOut(D, entry, 0, 0, 1, data_type, value);
+
+  dreturn("%i", D->error ? -1 : 0);
+  return D->error ? -1 : 0;
+}
+
+/* add a META CARRAY entry */
+int gd_madd_carray(DIRFILE* D, const char* parent, const char* field_code,
+    gd_type_t const_type, size_t array_len, gd_type_t data_type,
+    const void* values) gd_nothrow
+{
+  gd_entry_t *entry;
+  gd_entry_t C;
+
+  dtrace("%p, \"%s\", \"%s\", 0x%X, %" PRNsize_t ", 0x%X, %p", D, parent,
+      field_code, const_type, array_len, data_type, values);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&C, 0, sizeof(gd_entry_t));
+  C.field = (char *)field_code;
+  C.field_type = GD_CARRAY_ENTRY;
+  C.EN(scalar,const_type) = const_type;
+  C.EN(scalar,array_len) = array_len;
+  C.fragment_index = 0;
+  entry = _GD_Add(D, &C, parent);
+
+  /* Actually store the carray, now */
+  if (entry)
+    _GD_DoFieldOut(D, entry, 0, 0, array_len, data_type, values);
+
+  dreturn("%i", D->error ? -1 : 0);
+  return D->error ? -1 : 0;
+}
+
+/* add an alias */
+static int _GD_AddAlias(DIRFILE *restrict D, const char *restrict parent,
+    const char *restrict field_code, const char *restrict target,
+    int fragment_index)
+{
+  unsigned u;
+  int offset;
+  char *munged_code = NULL;
+  void *ptr;
+  gd_entry_t *E = NULL, *P = NULL;
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, parent, field_code, target,
+      fragment_index);
+
+  /* Early checks */
+  if (D->flags & GD_INVALID)
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+  else if ((D->flags & GD_ACCMODE) == GD_RDONLY)
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+  else if (fragment_index < 0 || fragment_index >= D->n_fragment)
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL);
+  else if (D->fragment[fragment_index].protection & GD_PROTECT_FORMAT)
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[fragment_index].cname);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  if (parent != NULL) {
+    /* look for parent */
+    P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+    if (P == NULL) {
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, parent);
+      goto add_alias_error;
+    }
+    fragment_index = P->fragment_index;
+
+    /* make sure it's not a meta field already */
+    if (P->e->n_meta == -1) {
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, parent);
+      goto add_alias_error;
+    }
+
+    offset = strlen(parent) + 1;
+    munged_code = (char *)_GD_Malloc(D, offset + strlen(field_code) + 1);
+    if (munged_code == NULL)
+      goto add_alias_error;
+
+    strcpy(munged_code, parent);
+    munged_code[offset - 1] = '/';
+    strcpy(munged_code + offset, field_code);
+  } else {
+    /* this will check for affixes and take care of detecting Barth-style
+     * metafield definitions */
+    P = _GD_FixName(D, &munged_code, field_code, fragment_index, &offset);
+
+    if (D->error)
+      goto add_alias_error;
+  }
+
+  /* check alias name */
+  if (_GD_ValidateField(munged_code + offset, D->standards, 1, 0, NULL))
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, field_code);
+  else if (_GD_FindField(D, munged_code, D->entry, D->n_entries, 0, &u))
+    _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, munged_code);
+  else
+    _GD_CheckCodeAffixes(D, NULL, target, fragment_index); /* check target */
+
+  if (D->error)
+    goto add_alias_error;
+
+  ptr = _GD_Realloc(D, D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*));
+  if (ptr == NULL)
+    goto add_alias_error;
+  D->entry = (gd_entry_t **)ptr;
+
+  /* create and store */
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL)
+    goto add_alias_error;
+
+  memset(E, 0, sizeof(gd_entry_t));
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL)
+    goto add_alias_error;
+
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+
+  E->field = munged_code;
+  E->fragment_index = fragment_index;
+  E->in_fields[0] = _GD_Strdup(D, target);
+  E->field_type = GD_ALIAS_ENTRY;
+  E->e->calculated = 1;
+
+  if (D->error) {
+    _GD_FreeE(D, E, 1);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* add the entry and resort the entry list */
+  _GD_InsertSort(D, E, u);
+  D->n_entries++;
+  D->fragment[fragment_index].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+
+  /* Invalidate the field lists */
+  if (P) {
+    P->e->value_list_validity = 0;
+    P->e->entry_list_validity = 0;
+  } else {
+    D->value_list_validity = 0;
+    D->entry_list_validity = 0;
+  }
+
+  /* Update aliases */
+  _GD_UpdateAliases(D, 0);
+
+  dreturn("%i", 0);
+  return 0;
+
+add_alias_error:
+  free(E);
+  free(munged_code);
+  dreturn("%i", -1);
+  return -1;
+}
+
+int gd_add_alias(DIRFILE *D, const char *alias_name, const char *target_code,
+    int fragment_index) gd_nothrow
+{
+  int ret;
+
+  dtrace("%p, \"%s\", \"%s\", %i", D, alias_name, target_code, fragment_index);
+
+  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);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_madd_alias(DIRFILE *D, const char *parent, const char *alias_name,
+    const char *target_code) gd_nothrow
+{
+  int ret;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\"", D, parent, alias_name, target_code);
+
+  _GD_ClearError(D);
+
+  ret = _GD_AddAlias(D, parent, alias_name, target_code, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
diff --git a/src/ascii.c b/src/ascii.c
new file mode 100644
index 0000000..d5ff21a
--- /dev/null
+++ b/src/ascii.c
@@ -0,0 +1,393 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* 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)
+{
+  dtrace("%i, %p, <unused>, %u", fd, file, mode);
+
+  if (!(mode & GD_FILE_TEMP)) {
+    if (file->mode & mode) {
+      dreturn("%i", 0);
+      return 0;
+    } else if (file->edata != NULL)
+      fclose((FILE*)file->edata);
+
+    file->idata = gd_OpenAt(file->D, fd, file->name, ((mode & GD_FILE_WRITE)
+          ? (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666);
+
+    if (file->idata < 0) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  } else
+    file->idata = fd;
+
+  file->edata = fdopen(file->idata, (mode & GD_FILE_WRITE) ? "rb+" : "rb");
+
+  if (file->edata == NULL) {
+    close(file->idata);
+    file->idata = -1;
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  file->mode = mode | GD_FILE_READ;
+  file->pos = 0;
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_AsciiSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type gd_unused_, unsigned int mode)
+{
+  char line[64];
+
+  dtrace("%p, %lli, <unused>, 0x%X", file, (long long)count, mode);
+
+  if (count < file->pos) {
+    rewind((FILE *)file->edata);
+    file->pos = 0;
+  }
+
+  for (; count > file->pos; ++file->pos)
+    if (fgets(line, 64, (FILE *)file->edata) == NULL)
+      break;
+
+  if (mode & GD_FILE_WRITE && count > file->pos) {
+    strcpy(line, "0\n");
+    for (; count > file->pos; ++file->pos)
+      fputs(line, (FILE *)file->edata);
+  }
+
+  dreturn("%lli", (long long)file->pos);
+  return file->pos;
+}
+
+static void _GD_ScanFormat(char* fmt, gd_type_t data_type)
+{
+  dtrace("%p, 0x%X", fmt, data_type);
+
+  switch(data_type) {
+    case GD_UINT8:
+#ifndef NO_8BIT_INT_PREFIX
+      strcpy(fmt, "%" SCNu8);
+      break;
+#endif
+    case GD_UINT16:
+      strcpy(fmt, "%" SCNu16);
+      break;
+    case GD_INT8:
+#ifndef NO_8BIT_INT_PREFIX
+      strcpy(fmt, "%" SCNi8);
+      break;
+#endif
+    case GD_INT16:
+      strcpy(fmt, "%" SCNi16);
+      break;
+    case GD_UINT32:
+      strcpy(fmt, "%" SCNu32);
+      break;
+    case GD_INT32:
+      strcpy(fmt, "%" SCNi32);
+      break;
+    case GD_UINT64:
+      strcpy(fmt, "%" SCNu64);
+      break;
+    case GD_INT64:
+      strcpy(fmt, "%" SCNi64);
+      break;
+    case GD_FLOAT32:
+      strcpy(fmt, "%f");
+      break;
+    case GD_FLOAT64:
+      strcpy(fmt, "%lf");
+      break;
+    case GD_COMPLEX64:
+      strcpy(fmt, "%f;%f");
+      break;
+    case GD_COMPLEX128:
+      strcpy(fmt, "%lf;%lf");
+      break;
+    default:
+      fmt[0] = 0;
+      break;
+  }
+
+  dreturn("[\"%s\"]", fmt);
+}
+
+ssize_t _GD_AsciiRead(struct gd_raw_file_ *restrict file, void *restrict ptr,
+    gd_type_t data_type, size_t nmemb)
+{
+  char fmt[50];
+  size_t n = 0;
+  ssize_t ret = 0;
+#ifdef NO_8BIT_INT_PREFIX
+  short int i16;
+#endif
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb);
+
+  _GD_ScanFormat(fmt, data_type);
+  if (data_type & GD_COMPLEX) {
+    for (n = 0; n < nmemb; ++n) {
+      if (feof((FILE *)file->edata))
+        break;
+
+      if (fscanf((FILE *)file->edata, fmt, (char *)ptr + GD_SIZE(data_type) * n,
+            (char *)ptr + GD_SIZE(data_type) * n + GD_SIZE(data_type) / 2) < 2)
+      {
+        if (!feof((FILE *)file->edata))
+          ret = -1;
+        break;
+      }
+      file->pos++;
+    }
+  } else {
+    for (n = 0; n < nmemb; ++n) {
+      if (feof((FILE *)file->edata))
+        break;
+
+
+#ifdef NO_8BIT_INT_PREFIX
+      if (GD_SIZE(data_type) == 1) {
+        if (fscanf((FILE *)file->edata, fmt, &i16) < 1) {
+          if (!feof((FILE *)file->edata))
+            ret = -1;
+          break;
+        }
+        if (data_type & GD_SIGNED)
+          *((int8_t *)ptr + GD_SIZE(data_type) * n) = (int8_t)i16;
+        else
+          *((uint8_t *)ptr + GD_SIZE(data_type) * n) = (uint8_t)i16;
+      } else
+#endif
+      {
+        if (fscanf((FILE *)file->edata, fmt, (char *)ptr + GD_SIZE(data_type) *
+              n) < 1)
+        {
+          if (!feof((FILE *)file->edata))
+            ret = -1;
+          break;
+        }
+      }
+      file->pos++;
+    }
+  }
+
+  dreturn("%li", (ret) ? (long)ret : (long)n);
+  return (ret) ? ret : (ssize_t)n;
+}
+
+ssize_t _GD_AsciiWrite(struct gd_raw_file_ *restrict file,
+    const void *restrict ptr, gd_type_t data_type, size_t nmemb)
+{
+  ssize_t ret = 0;
+  size_t n = 0;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb);
+
+  switch(data_type) {
+    case GD_UINT8:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%" PRIu8 "\n",
+              ((uint8_t *)ptr)[n]) < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_INT8:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%" PRIi8 "\n",
+              ((int8_t *)ptr)[n]) < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_UINT16:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%" PRIu16 "\n", ((uint16_t *)ptr)[n])
+            < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_INT16:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%" PRIi16 "\n", ((int16_t *)ptr)[n])
+            < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_UINT32:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%" PRIu32 "\n", ((uint32_t *)ptr)[n])
+            < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_INT32:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%" PRIi32 "\n", ((int32_t *)ptr)[n])
+            < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_UINT64:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%" PRIu64 "\n", ((uint64_t *)ptr)[n])
+            < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_INT64:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%" PRIi64 "\n", ((int64_t *)ptr)[n])
+            < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_FLOAT32:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%.7g\n", ((float *)ptr)[n]) < 0) {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_FLOAT64:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%.16lg\n", ((double *)ptr)[n]) < 0) {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_COMPLEX64:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%.16g;%.16g\n", ((float *)ptr)[n * 2],
+              (((float *)ptr)[n * 2 + 1])) < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    case GD_COMPLEX128:
+      for (n = 0; n < nmemb; ++n)
+        if (fprintf((FILE *)file->edata, "%.16lg;%.16lg\n",
+              ((double *)ptr)[n * 2], (((double *)ptr)[n * 2 + 1])) < 0)
+        {
+          ret = -1;
+          break;
+        }
+      break;
+    default:
+      ret = -1;
+      break;
+  }
+
+  dreturn("%li", (ret) ? (long)ret : (long)n);
+  return (ret) ? ret : (ssize_t)n;
+}
+
+int _GD_AsciiSync(struct gd_raw_file_ *file)
+{
+  int ret;
+
+  dtrace("%p", file);
+
+  ret = fflush((FILE *)file->edata);
+
+#ifndef __MSVCRT__
+  if (!ret)
+    ret = fsync(fileno((FILE *)file->edata));
+#endif
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int _GD_AsciiClose(struct gd_raw_file_* file)
+{
+  int ret;
+
+  dtrace("%p", file);
+
+  ret = fclose((FILE *)file->edata);
+  if (ret == EOF) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  file->idata = -1;
+  file->mode = 0;
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_AsciiSize(int dirfd, struct gd_raw_file_* file,
+    gd_type_t data_type gd_unused_, int swap gd_unused_)
+{
+  FILE* stream;
+  char *buffer = NULL;
+  size_t len = 0;
+  off64_t n = 0;
+  int fd;
+
+  dtrace("%i, %p, <unused>, <unused>", dirfd, file);
+
+  fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY, 0666);
+  if (fd < 0) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  stream = fdopen(fd, "rb");
+
+  if (stream == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  while (getdelim(&buffer, &len, '\n', stream) != -1)
+    n++;
+  free(buffer);
+
+  fclose(stream);
+
+  dreturn("%lli", (long long)n);
+  return n;
+}
diff --git a/src/bzip.c b/src/bzip.c
new file mode 100644
index 0000000..fe6c21c
--- /dev/null
+++ b/src/bzip.c
@@ -0,0 +1,286 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#ifdef HAVE_BZLIB_H
+#include <bzlib.h>
+#endif
+
+#ifdef USE_MODULES
+#define _GD_Bzip2Open libgetdatabzip2_LTX_GD_Bzip2Open
+#define _GD_Bzip2Seek libgetdatabzip2_LTX_GD_Bzip2Seek
+#define _GD_Bzip2Read libgetdatabzip2_LTX_GD_Bzip2Read
+#define _GD_Bzip2Close libgetdatabzip2_LTX_GD_Bzip2Close
+#define _GD_Bzip2Size libgetdatabzip2_LTX_GD_Bzip2Size
+#endif
+
+#if SIZEOF_INT < 4
+#define GD_BZIP_BUFFER_SIZE 32767
+#else
+#define GD_BZIP_BUFFER_SIZE 1000000
+#endif
+
+struct gd_bzdata {
+  BZFILE* bzfile;
+  FILE* stream;
+  int bzerror;
+  int stream_end;
+  int pos, end;
+  off64_t base;
+  char data[GD_BZIP_BUFFER_SIZE];
+};
+
+/* The bzip encoding scheme uses edata as a gd_bzdata pointer.  If a file is
+ * open, idata = 0 otherwise idata = -1. */
+
+static struct gd_bzdata *_GD_Bzip2DoOpen(int dirfd, struct gd_raw_file_* file)
+{
+  int fd;
+  struct gd_bzdata *ptr;
+
+  dtrace("%i, %p", dirfd, file);
+
+  if ((ptr = (struct gd_bzdata *)malloc(sizeof(struct gd_bzdata))) == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if ((fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY, 0666)) == -1) {
+    free(ptr);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if ((ptr->stream = fdopen(fd, "rb")) == NULL) {
+    close(fd);
+    free(ptr);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  ptr->bzerror = ptr->stream_end = 0;
+  ptr->bzfile = BZ2_bzReadOpen(&ptr->bzerror, ptr->stream, 0, 0, NULL, 0);
+
+  if (ptr->bzfile == NULL || ptr->bzerror != BZ_OK) {
+    fclose(ptr->stream);
+    free(ptr);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  ptr->pos = ptr->end = 0;
+  ptr->base = 0;
+
+  dreturn("%p", ptr);
+  return ptr;
+}
+
+int _GD_Bzip2Open(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
+    unsigned int mode gd_unused_)
+{
+  dtrace("%i, %p, <unused>, <unused>", dirfd, file);
+
+  file->edata = _GD_Bzip2DoOpen(dirfd, file);
+
+  if (file->edata == NULL) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  file->mode = GD_FILE_READ;
+  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);
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb);
+
+  while (nbytes > (unsigned long long)(ptr->end - ptr->pos)) {
+    int n;
+
+    memcpy(output, ptr->data + ptr->pos, ptr->end - ptr->pos);
+    output += ptr->end - ptr->pos;
+    nbytes -= ptr->end - ptr->pos;
+    ptr->pos = ptr->end;
+
+    if (ptr->stream_end) {
+      dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type)));
+      return nmemb - nbytes / GD_SIZE(data_type);
+    }
+
+    ptr->bzerror = 0;
+    n = BZ2_bzRead(&ptr->bzerror, ptr->bzfile, ptr->data,
+        GD_BZIP_BUFFER_SIZE);
+
+    if (ptr->bzerror == BZ_OK || ptr->bzerror == BZ_STREAM_END) {
+      ptr->base += ptr->end;
+      ptr->pos = 0;
+      ptr->end = n;
+    } else {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    /* eof */
+    if (ptr->bzerror != BZ_OK) {
+      ptr->stream_end = 1;
+      break;
+    }
+  }
+
+  if (nbytes > (unsigned long long)(ptr->end - ptr->pos)) {
+    memcpy(output, ptr->data + ptr->pos, ptr->end - ptr->pos);
+    ptr->pos = ptr->end;
+    nbytes -= ptr->end;
+  } else {
+    memcpy(output, ptr->data + ptr->pos, nbytes);
+    ptr->pos += nbytes;
+    nbytes = 0;
+  }
+
+  dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type)));
+  return nmemb - nbytes / GD_SIZE(data_type);
+}
+
+int _GD_Bzip2Close(struct gd_raw_file_ *file)
+{
+  struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata;
+  dtrace("%p", file);
+
+  ptr->bzerror = 0;
+  BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+  if (fclose(ptr->stream)) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  file->idata = -1;
+  file->mode = 0;
+  free(file->edata);
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_Bzip2Size(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
+    int swap gd_unused_)
+{
+  struct gd_bzdata *ptr;
+  off_t n;
+
+  dtrace("%i, %p, 0x%X, <unused>", dirfd, file, data_type);
+
+  ptr = _GD_Bzip2DoOpen(dirfd, file);
+
+  if (ptr == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* seek forward the slow way  to the end */
+  while (ptr->bzerror != BZ_STREAM_END) {
+    int n;
+
+    ptr->bzerror = 0;
+    n = BZ2_bzRead(&ptr->bzerror, ptr->bzfile, ptr->data,
+        GD_BZIP_BUFFER_SIZE);
+
+    if (ptr->bzerror == BZ_OK || ptr->bzerror == BZ_STREAM_END) {
+      ptr->base += ptr->end;
+      ptr->pos = 0;
+      ptr->end = n;
+    } else {
+      BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+      fclose(ptr->stream);
+      free(ptr);
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+  BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile);
+  fclose(ptr->stream);
+
+  n = (ptr->base + ptr->end) / GD_SIZE(data_type);
+  free(ptr);
+
+  dreturn("%lli", (long long)n);
+  return n;
+}
diff --git a/src/close.c b/src/close.c
new file mode 100644
index 0000000..25ac590
--- /dev/null
+++ b/src/close.c
@@ -0,0 +1,134 @@
+/* Copyright (C) 2008-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* _GD_FreeD: free the DIRFILE and its subordinates
+*/
+static void _GD_FreeD(DIRFILE *D, int keep_dirfile)
+{
+  unsigned int i;
+  int j;
+
+  dtrace("%p, %i", D, keep_dirfile);
+
+  for (i = 0; i < D->n_entries; ++i)
+    _GD_FreeE(D, D->entry[i], 1);
+
+  for (j = 0; j < D->n_fragment; ++j) {
+    free(D->fragment[j].enc_data);
+    free(D->fragment[j].prefix);
+    free(D->fragment[j].suffix);
+    free(D->fragment[j].bname);
+    free(D->fragment[j].cname);
+    free(D->fragment[j].ename);
+    free(D->fragment[j].sname);
+    free(D->fragment[j].ref_name);
+  }
+
+  free(D->entry);
+  free(D->tok_base);
+  free(D->dot_list);
+  free(D->error_prefix);
+  free(D->error_string);
+  free(D->error_file);
+  for (j = 0; j < GD_N_ENTRY_LISTS; ++j)
+    free(D->entry_list[j]);
+  free(D->string_value_list);
+  free(D->const_value_list);
+  if (D->carray_value_list)
+    for (i = 0; D->carray_value_list[i].n != 0; ++i)
+      free(D->carray_value_list[i].d);
+  free(D->carray_value_list);
+  free(D->fragment);
+  free(D->name);
+  for (i = 0; i < D->ndir; ++i)
+    free(D->dir[i].path);
+  free(D->dir);
+
+  if (!keep_dirfile)
+    free(D);
+
+  dreturnvoid();
+}
+
+int _GD_ShutdownDirfile(DIRFILE* D, int flush_meta, int keep_dirfile)
+{
+  unsigned int i;
+
+  dtrace("%p, %i, %i", D, flush_meta, keep_dirfile);
+
+  if (D == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  /* Flush */
+  if (flush_meta)
+    _GD_FlushMeta(D, GD_ALL_FRAGMENTS, 0);
+
+  for(i = 0; i < D->n_entries; ++i)
+    if (D->entry[i]->field_type == GD_RAW_ENTRY)
+      _GD_Flush(D, D->entry[i], 0, 1);
+
+  if (D->error) {
+    dreturn("%i", 1);
+    return -1;
+  }
+
+#ifndef GD_NO_DIR_OPEN
+  /* close the directory */
+  for (i = 0; i < (unsigned int)D->ndir; ++i)
+    close(D->dir[i].fd);
+#endif
+
+  _GD_FreeD(D, keep_dirfile);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_close(DIRFILE *D)
+{
+  int ret;
+
+  dtrace("%p", D);
+
+  ret = _GD_ShutdownDirfile(D, 1, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_discard(DIRFILE* D)
+{
+  int ret;
+
+  dtrace("%p", D);
+
+  ret = _GD_ShutdownDirfile(D, 0, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/common.c b/src/common.c
new file mode 100644
index 0000000..3b9dfdd
--- /dev/null
+++ b/src/common.c
@@ -0,0 +1,1425 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2012, 2014, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* This is defined on BSD */
+#ifndef MAXSYMLINKS
+#define MAXSYMLINKS 20
+#endif
+
+#ifdef GETDATA_DEBUG
+int gd_col_count = 0;
+char gd_debug_col[GD_COL_SIZE + 1] = "";
+#endif
+
+int _GD_EntryCmp(const void *a, const void *b)
+{
+  return strcmp((*(gd_entry_t**)a)->field, (*(gd_entry_t**)b)->field);
+}
+
+/* _GD_GetLine: read non-comment line from format file.  The line is newly
+ *      malloc'd.  Returns a pointer if successful, NULL if unsuccessful.
+ *      The length read is provided in *n.  Increments *linenum as appropriate;
+ */
+char *_GD_GetLine(FILE *restrict fp, size_t *restrict n, int *restrict linenum)
+{
+  ssize_t len;
+
+  char *line = NULL;
+
+  dtrace("%p, %p, %p", fp, n, linenum);
+
+  do {
+    errno = 0;
+    len = getdelim(&line, n, '\n', fp);
+    if (len == -1)
+      break;
+
+    (*linenum)++;
+  } while (line[0] == '#' || line[0] == 0 || line[0] == '\n');
+
+
+  if (len != -1) {
+    dreturn("\"%s\" (%" PRNsize_t ")", line, *n);
+    return line; /* a line was read */
+  }
+
+  free(line);
+  dreturn("%p", NULL);
+  return NULL;  /* there were no valid lines */
+}
+
+/* This function is needed outside the legacy API to handle old format files
+ */
+gd_type_t _GD_LegacyType(char c)
+{
+  switch (c) {
+    case 'n':
+      return GD_NULL;
+    case 'c':
+      return GD_UINT8;
+    case 'u':
+      return GD_UINT16;
+    case 's':
+      return GD_INT16;
+    case 'U':
+      return GD_UINT32;
+    case 'i':
+    case 'S':
+      return GD_INT32;
+    case 'f':
+      return GD_FLOAT32;
+    case 'd':
+      return GD_FLOAT64;
+  }
+
+  return GD_UNKNOWN;
+}
+
+/* Binary search to find the field */
+gd_entry_t *_GD_FindField(const DIRFILE *restrict D,
+    const char *restrict field_code, gd_entry_t *const *list, unsigned int u,
+    int dealias, unsigned int *restrict index)
+{
+  int c;
+  char *ptr;
+  gd_entry_t *E = NULL;
+  unsigned int i, l = 0;
+  const unsigned int ou = u;
+
+  dtrace("%p, \"%s\", %p, %u, %i, %p", D, field_code, list, u, dealias, index);
+
+  /* handle FILEFRAM */
+  if (D->standards < 6 && (D->flags & GD_PEDANTIC) &&
+      strcmp(field_code, "FILEFRAM") == 0)
+    field_code = "INDEX";
+
+  while (l < u) {
+    i = (l + u) / 2;
+    c = strcmp(field_code, list[i]->field);
+    if (c < 0)
+      u = i;
+    else if (c > 0)
+      l = i + 1;
+    else {
+      E = list[i];
+      if (dealias && E && E->field_type == GD_ALIAS_ENTRY)
+        E = E->e->entry[0];
+
+      if (index != NULL)
+        *index = i;
+
+      dreturn("%p", E);
+      return E;
+    }
+  }
+
+  if (index != NULL)
+    *index = u;
+
+  /* not found perhaps it's an subfield of an aliased field? */
+  if ((ptr = (char*)strchr(field_code, '/'))) {
+    char *new_code = strdup(field_code);
+    if (new_code) {
+      new_code[ptr - field_code] = '\0';
+      E = _GD_FindField(D, new_code, list, ou, 0, NULL);
+      free(new_code);
+
+      if (E && E->field_type == GD_ALIAS_ENTRY && E->e->entry[0]) {
+        size_t plen = strlen(E->e->entry[0]->field);
+        new_code = (char*)malloc(plen + strlen(ptr) + 2);
+        if (new_code) {
+          strcpy(new_code, E->e->entry[0]->field);
+          new_code[plen] = '/';
+          strcpy(new_code + plen + 1, ptr + 1);
+
+          E = _GD_FindField(D, new_code, list, ou, 1, NULL);
+
+          free(new_code);
+        }
+      } else
+        E = NULL;
+    }
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* Insertion sort the entry list */
+void _GD_InsertSort(DIRFILE *restrict D, gd_entry_t *restrict E, int u)
+  gd_nothrow
+{
+  dtrace("%p, %p, %i", D, E, u);
+
+  memmove(&D->entry[u + 1], &D->entry[u], sizeof(gd_entry_t*) *
+      (D->n_entries - u));
+
+  D->entry[u] = E;
+
+  dreturnvoid();
+}
+
+/* _GD_Alloc: allocate a buffer of the right type & size
+*/
+void* _GD_Alloc(DIRFILE* D, gd_type_t type, size_t n)
+{
+  void* ptr = NULL;
+
+  dtrace("%p, 0x%x, %" PRNsize_t, D, type, n);
+  if (n == 0) {
+    _GD_InternalError(D);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (type == GD_NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  else if (GD_SIZE(type) == 0) {
+    _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  ptr = _GD_Malloc(D, n * GD_SIZE(type));
+
+  dreturn("%p", ptr);
+  return ptr;
+}
+
+/* compute LUT table path -- this is used by _GD_Change, so e may not be E->e */
+int _GD_SetTablePath(DIRFILE *restrict D, const gd_entry_t *restrict E,
+    struct gd_private_entry_ *restrict e)
+{
+  char *temp_buffer;
+
+  dtrace("%p, %p, %p", D, E, e);
+
+  e->u.linterp.table_dirfd = _GD_GrabDir(D,
+      D->fragment[E->fragment_index].dirfd, E->EN(linterp,table));
+
+  temp_buffer = _GD_Strdup(D, E->EN(linterp,table));
+  if (temp_buffer == NULL) {
+    _GD_ReleaseDir(D, e->u.linterp.table_dirfd);
+    dreturn("%i", 1);
+    return 1;
+  }
+  e->u.linterp.table_file = _GD_Strdup(D, basename(temp_buffer));
+  if (e->u.linterp.table_file == NULL) {
+    _GD_ReleaseDir(D, e->u.linterp.table_dirfd);
+    free(temp_buffer);
+    dreturn("%i", 1);
+    return 1;
+  }
+  free(temp_buffer);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* LUT comparison function for qsort */
+static int lutcmp(const void* a, const void* b)
+{
+  double dx = ((struct gd_lut_ *)a)->x - ((struct gd_lut_ *)b)->x;
+  return (dx < 0) ? -1 : (dx > 0) ? 1 : 0;
+}
+
+/* _GD_ReadLinterpFile: Read in the linterp data for this field
+*/
+void _GD_ReadLinterpFile(DIRFILE *restrict D, gd_entry_t *restrict E)
+{
+  FILE *fp;
+  struct gd_lut_ *ptr;
+  int i, fd;
+  int dir = -1;
+  char *line;
+  size_t n = 0;
+  int linenum = 0;
+  double yr, yi;
+  int buf_len = 100;
+
+  dtrace("%p, %p", D, E);
+
+  if (E->e->u.linterp.table_file == NULL)
+    if (_GD_SetTablePath(D, E, E->e)) {
+      dreturnvoid();
+      return;
+    }
+
+  fd = gd_OpenAt(D, E->e->u.linterp.table_dirfd, E->e->u.linterp.table_file,
+      O_RDONLY, 0666);
+  if (fd == -1) {
+    _GD_SetError(D, GD_E_OPEN_LINFILE, GD_E_LINFILE_OPEN, NULL, 0,
+        E->EN(linterp,table));
+    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));
+    dreturnvoid();
+    return;
+  }
+
+  /* read the first line to see whether the table is complex valued */
+  if ((line = _GD_GetLine(fp, &n, &linenum))) {
+    char ystr[50];
+    if (sscanf(line, "%lg %49s", &yr, ystr) == 2)
+      E->e->u.linterp.complex_table = (strchr(ystr, ';') == NULL) ? 0 : 1;
+  } else {
+    if (errno == EOVERFLOW)
+      /* line too long */
+      _GD_SetError(D, GD_E_LINE_TOO_LONG, 0, E->EN(linterp,table), linenum,
+          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;
+  }
+
+  /* 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);
+    } else
+      sscanf(line, "%lg %lg", &(E->e->u.linterp.lut[i].x),
+          &(E->e->u.linterp.lut[i].y.r));
+
+    if (dir > -2 && i > 0 && E->e->u.linterp.lut[i].x !=
+        E->e->u.linterp.lut[i - 1].x)
+    {
+      if (dir == -1)
+        dir = (E->e->u.linterp.lut[i].x > E->e->u.linterp.lut[i - 1].x);
+      else if (dir != (E->e->u.linterp.lut[i].x > E->e->u.linterp.lut[i - 1].x))
+        dir = -2;
+    }
+
+    i++;
+    if (i >= buf_len) {
+      buf_len += 100;
+      ptr = (struct gd_lut_ *)_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;
+      }
+
+      E->e->u.linterp.lut = ptr;
+    }
+    free(line);
+  } while ((line = _GD_GetLine(fp, &n, &linenum)));
+
+  if (i < 2) {
+    free(E->e->u.linterp.lut);
+    _GD_SetError(D, GD_E_OPEN_LINFILE, GD_E_LINFILE_LENGTH, NULL, 0,
+        E->EN(linterp,table));
+    fclose(fp);
+    dreturnvoid();
+    return;
+  }
+
+  /* Free unused memory */
+  ptr = (struct gd_lut_ *)_GD_Realloc(D, E->e->u.linterp.lut, i
+      * sizeof(struct gd_lut_));
+
+  if (ptr == NULL) {
+    free(E->e->u.linterp.lut);
+    fclose(fp);
+    dreturnvoid();
+    return;
+  }
+
+  E->e->u.linterp.table_monotonic = -1;
+  E->e->u.linterp.lut = ptr;
+  E->e->u.linterp.table_len = i;
+
+  /* sort the LUT */
+  if (dir == -2)
+    qsort(E->e->u.linterp.lut, i, sizeof(struct gd_lut_), lutcmp);
+
+  fclose(fp);
+  dreturnvoid();
+}
+
+/* _GD_GetIndex: get LUT index.
+*/
+static size_t _GD_GetIndex(double x, const struct gd_lut_ *lut, size_t idx,
+    size_t n)
+{
+  dtrace("%g, %p, %" PRNsize_t ", %" PRNsize_t, x, lut, idx, n);
+
+  /* Just linearly search - we're probably right to start    */
+  /* increment until we are bigger */
+  while ((idx < n - 2) && (x > lut[idx].x))
+    idx++;
+
+  /* decrement until we are smaller */
+  while ((idx > 0) && (x < lut[idx].x))
+    idx--;
+
+  dreturn("%" PRNsize_t, idx);
+  return idx;
+}
+
+#ifdef GD_NO_C99_API
+#define CLINTERP(t) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      x = data_in[i]; \
+      idx = _GD_GetIndex(x, lut, idx, n_ln); \
+      ((t *)data)[i] = (t)(lut[idx].y.c[0] + \
+        (lut[idx + 1].y.c[0] - lut[idx].y.c[0]) / \
+        (lut[idx + 1].x - lut[idx].x) * (x - lut[idx].x)); \
+    } \
+  } while (0)
+
+#define LINTERPC(t) \
+  if (complex_table) CLINTERPC(t); else RLINTERPC(t)
+#else
+#define CLINTERP(t) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      x = data_in[i]; \
+      idx = _GD_GetIndex(x, lut, idx, n_ln); \
+      ((t *)data)[i] = (t)(lut[idx].y.c + (lut[idx + 1].y.c - lut[idx].y.c) / \
+        (lut[idx + 1].x - lut[idx].x) * (x - lut[idx].x)); \
+    } \
+  } while (0)
+
+#define LINTERPC(t) LINTERP(complex t)
+#endif
+
+#define RLINTERP(t) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      x = data_in[i]; \
+      idx = _GD_GetIndex(x, lut, idx, n_ln); \
+      ((t *)data)[i] = (t)(lut[idx].y.r + (lut[idx + 1].y.r - lut[idx].y.r) / \
+        (lut[idx + 1].x - lut[idx].x) * (x - lut[idx].x)); \
+    } \
+  } while (0)
+
+#define CLINTERPC(t) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      double tx, dx; \
+      x = data_in[i]; \
+      idx = _GD_GetIndex(x, lut, idx, n_ln); \
+      tx = lut[idx + 1].x - lut[idx].x; \
+      dx = x - lut[idx].x; \
+      ((t *)data)[2 * i] = (t)(lut[idx].y.c[0] + \
+        (lut[idx + 1].y.c[0] - lut[idx].y.c[0]) / tx * dx); \
+      ((t *)data)[2 * i + 1] = (t)(lut[idx].y.c[1] + \
+        (lut[idx + 1].y.c[1] - lut[idx].y.c[1]) / tx * dx); \
+    } \
+  } while (0)
+
+#define RLINTERPC(t) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      x = data_in[i]; \
+      idx = _GD_GetIndex(x, lut, idx, n_ln); \
+      ((t *)data)[2 * i] = (t)(lut[idx].y.r + \
+        (lut[idx + 1].y.r - lut[idx].y.r) / \
+        (lut[idx + 1].x - lut[idx].x) * (x - lut[idx].x)); \
+      ((t *)data)[2 * i + 1] = 0; \
+    } \
+  } while (0)
+
+#define LINTERP(t) \
+  if (complex_table) CLINTERP(t); else RLINTERP(t)
+
+/* _GD_LinterpData: calibrate data using lookup table lut
+*/
+void _GD_LinterpData(DIRFILE *restrict D, void *restrict data, gd_type_t type,
+    int complex_table, const double *restrict data_in, size_t npts,
+    const struct gd_lut_ *restrict lut, size_t n_ln)
+{
+  int idx = 0;
+  size_t i;
+  double x;
+
+  dtrace("%p, %p, 0x%x, %i, %p, %" PRNsize_t ", %p, %" PRNsize_t, D, data, type,
+      complex_table, data_in, npts, lut, n_ln);
+
+  switch (type) {
+    case GD_NULL:                          break;
+    case GD_INT8:       LINTERP(int8_t  ); break;
+    case GD_UINT8:      LINTERP(uint8_t ); break;
+    case GD_INT16:      LINTERP(int16_t ); break;
+    case GD_UINT16:     LINTERP(uint16_t); break;
+    case GD_INT32:      LINTERP(int32_t ); break;
+    case GD_UINT32:     LINTERP(uint32_t); break;
+    case GD_INT64:      LINTERP(int64_t ); break;
+    case GD_UINT64:     LINTERP(uint64_t); break;
+    case GD_FLOAT32:    LINTERP(float   ); break;
+    case GD_FLOAT64:    LINTERP(double  ); break;
+    case GD_COMPLEX64:  LINTERPC(float  ); break;
+    case GD_COMPLEX128: LINTERPC(double ); break;
+    default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+  }
+
+  dreturnvoid();
+}
+
+/* macros to reduce tangly code */
+#define LINCOM1(t) for (i = 0; i < n_read; i++) \
+                            ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0] + b[0])
+
+#define LINCOM2(t) for (i = 0; i < n_read; i++) \
+                            ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0] + \
+                              (data2[i * spf[1] / spf[0]] * m[1] + b[0] + b[1]))
+
+#define LINCOM3(t) for (i = 0; i < n_read; i++) \
+                            ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0] + \
+                              (data2[i * spf[1] / spf[0]] * m[1] + \
+                               data3[i * spf[2] / spf[0]] * m[2] + \
+                               b[0] + b[1] + b[2]))
+
+#ifdef GD_NO_C99_API
+#define LINCOMC1(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      ((t *)data1)[2 * i] = (t)(((t *)data1)[i] * m[0] + b[0]); \
+      ((t *)data1)[2 * i + 1] = 0; \
+    } \
+  } while (0)
+
+#define LINCOMC2(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      ((t *)data1)[2 * i] = (t)(((t *)data1)[i] * m[0] + \
+        (data2[i * spf[1] / spf[0]] * m[1] + b[0] + b[1])); \
+      ((t *)data1)[2 * i + 1] = 0; \
+    } \
+  } while (0)
+
+
+#define LINCOMC3(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      ((t *)data1)[2 * i] = (t)(((t *)data1)[i] * m[0] + \
+        (data2[i * spf[1] / spf[0]] * m[1] + \
+         data3[i * spf[2] / spf[0]] * m[2] + \
+         b[0] + b[1] + b[2])); \
+      ((t *)data1)[2 * i + 1] = 0; \
+    } \
+  } while (0)
+
+#define LINCOMC(t) \
+  switch (n) { \
+    case 1: LINCOMC1(t); break; \
+    case 2: LINCOMC2(t); break; \
+    case 3: LINCOMC3(t); break; \
+    default: _GD_InternalError(D); \
+  }
+#else
+#define LINCOMC(t) LINCOM(complex t)
+#endif
+
+#define LINCOM(t) \
+  switch (n) { \
+    case 1: LINCOM1(t); break; \
+    case 2: LINCOM2(t); break; \
+    case 3: LINCOM3(t); break; \
+    default: _GD_InternalError(D); \
+  }
+
+/* Compute a lincom, all at once */
+void _GD_LincomData(DIRFILE *restrict D, int n, void *restrict data1,
+    gd_type_t return_type, const double *restrict data2,
+    const double *restrict data3, const double *restrict m,
+    const double *restrict b, const unsigned int *restrict spf, size_t n_read)
+{
+  size_t i;
+
+  dtrace("%p, %i, %p, 0x%x, %p, %p, %p, %p, %p, %" PRNsize_t, D, n, data1,
+      return_type, data2, data3, m, b, spf, n_read);
+
+  switch(return_type) {
+    case GD_NULL:                         break;
+    case GD_UINT8:      LINCOM(uint8_t);  break;
+    case GD_INT8:       LINCOM(int8_t);   break;
+    case GD_UINT16:     LINCOM(uint16_t); break;
+    case GD_INT16:      LINCOM(int16_t);  break;
+    case GD_UINT32:     LINCOM(uint32_t); break;
+    case GD_INT32:      LINCOM(int32_t);  break;
+    case GD_UINT64:     LINCOM(uint64_t); break;
+    case GD_INT64:      LINCOM(int64_t);  break;
+    case GD_FLOAT32:    LINCOM(float);    break;
+    case GD_FLOAT64:    LINCOM(double);   break;
+    case GD_COMPLEX64:  LINCOMC(float);   break;
+    case GD_COMPLEX128: LINCOMC(double);  break;
+    default:            _GD_InternalError(D);
+  }
+
+  dreturnvoid();
+}
+
+#ifdef GD_NO_C99_API
+/* These must all be redefined in the absense of complex math. */
+#undef LINCOM1
+#undef LINCOM2
+#undef LINCOM3
+#undef LINCOMC1
+#undef LINCOMC2
+#undef LINCOMC3
+
+#define LINCOM1(t) for (i = 0; i < n_read; i++) \
+                            ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0][0] + \
+                              b[0][0])
+
+#define LINCOM2(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      const int i2 = 2 * (i * spf[1] / spf[0]); \
+      ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0][0] + \
+        (data2[i2] * m[1][0] - data2[i2 + 1] * m[1][1] + b[0][0] + b[1][0])); \
+    } \
+  } while (0)
+
+
+#define LINCOM3(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      const int i2 = 2 * (i * spf[1] / spf[0]); \
+      const int i3 = 2 * (i * spf[2] / spf[0]); \
+      ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0][0] + \
+        (data2[i2] * m[1][0] - data2[i2 + 1] * m[1][1] + \
+         data3[i3] * m[2][0] - data3[i3 + 1] * m[2][1] + \
+         b[0][0] + b[1][0] + b[2][0])); \
+    } \
+  } while (0)
+
+#define LINCOMC1(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      const t x = ((t *)data1)[2 * i]; \
+      const t y = ((t *)data1)[2 * i + 1]; \
+      ((t *)data1)[2 * i] = (t)(x * m[0][0] - y * m[0][1] + b[0][0]); \
+      ((t *)data1)[2 * i + 1] = (t)(x * m[0][1] + y * m[0][0] + b[0][1]); \
+    } \
+  } while (0)
+
+#define LINCOMC2(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      const int i2 = 2 * (i * spf[1] / spf[0]); \
+      const t x = ((t *)data1)[2 * i]; \
+      const t y = ((t *)data1)[2 * i + 1]; \
+      ((t *)data1)[2 * i] = (t)(x * m[0][0] - y * m[0][1] + \
+        data2[i2] * m[1][0] - data2[i2 + 1] * m[1][1] + b[0][0] + b[1][0]); \
+      ((t *)data1)[2 * i + 1] = (t)(x * m[0][1] + y * m[0][0] + \
+        data2[i2] * m[1][1] + data2[i2 + 1] * m[1][0] + b[0][1] + b[1][1]); \
+    } \
+  } while (0)
+
+
+#define LINCOMC3(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      const int i2 = 2 * (i * spf[1] / spf[0]); \
+      const int i3 = 2 * (i * spf[2] / spf[0]); \
+      const t x = ((t *)data1)[2 * i]; \
+      const t y = ((t *)data1)[2 * i + 1]; \
+      ((t *)data1)[2 * i] = (t)(x * m[0][0] - y * m[0][1] + \
+        data2[i2] * m[1][0] - data2[i2 + 1] * m[1][1] + \
+        data3[i3] * m[2][0] - data3[i3 + 1] * m[2][1] + \
+        b[0][0] + b[1][0] + b[2][0]); \
+      ((t *)data1)[2 * i + 1] = (t)(x * m[0][1] + y * m[0][0] + \
+        data2[i2] * m[1][1] + data2[i2 + 1] * m[1][0] + \
+        data3[i3] * m[2][1] + data3[i3 + 1] * m[2][0] + \
+        b[0][1] + b[1][1] + b[2][1]); \
+    } \
+  } while (0)
+#endif
+
+/* Compute a complex valued lincom, all at once */
+void _GD_CLincomData(DIRFILE *restrict D, int n, void *restrict data1,
+    gd_type_t return_type, const GD_DCOMPLEXP_t restrict data2,
+    const GD_DCOMPLEXP_t restrict data3, GD_DCOMPLEXV(m), GD_DCOMPLEXV(b),
+    const unsigned int *restrict spf, size_t n_read)
+{
+  size_t i;
+
+  dtrace("%p, %i, %p, 0x%x, %p, %p, %p, %p, %p, %" PRNsize_t, D, n, data1,
+      return_type, data2, data3, m, b, spf, n_read);
+
+  switch(return_type) {
+    case GD_NULL:                         break;
+    case GD_UINT8:      LINCOM(uint8_t);  break;
+    case GD_INT8:       LINCOM(int8_t);   break;
+    case GD_UINT16:     LINCOM(uint16_t); break;
+    case GD_INT16:      LINCOM(int16_t);  break;
+    case GD_UINT32:     LINCOM(uint32_t); break;
+    case GD_INT32:      LINCOM(int32_t);  break;
+    case GD_UINT64:     LINCOM(uint64_t); break;
+    case GD_INT64:      LINCOM(int64_t);  break;
+    case GD_FLOAT32:    LINCOM(float);    break;
+    case GD_FLOAT64:    LINCOM(double);   break;
+    case GD_COMPLEX64:  LINCOMC(float);   break;
+    case GD_COMPLEX128: LINCOMC(double);  break;
+    default:            _GD_InternalError(D);
+  }
+
+  dreturnvoid();
+}
+
+#ifdef GD_NO_C99_API
+#define INVERTC(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      const t d = ((t *)data)[2 * i] * ((t *)data)[2 * i] + \
+      ((t *)data)[2 * i + 1] * ((t *)data)[2 * i + 1]; \
+      ((t *)data)[2 * i] = (t)(dividend * ((t *)data)[2 * i] / d); \
+      ((t *)data)[2 * i + 1] = (t)(-dividend * ((t *)data)[2 * i + 1] / d); \
+    } \
+  } while (0)
+#else
+#define INVERTC(t) INVERT(complex t)
+#endif
+
+#define INVERT(t) for (i = 0; i < n_read; i++) \
+                           ((t *)data)[i] = (t)(dividend / ((t *)data)[i])
+
+/* Invert a vector */
+void _GD_InvertData(DIRFILE *restrict D, void *restrict data,
+    gd_type_t return_type, double dividend, size_t n_read)
+{
+  size_t i;
+
+  dtrace("%p, %p, 0x%x, %g, %" PRNsize_t, D, data, return_type, dividend,
+      n_read);
+
+  switch(return_type) {
+    case GD_NULL:                         break;
+    case GD_UINT8:      INVERT(uint8_t);  break;
+    case GD_INT8:       INVERT(int8_t);   break;
+    case GD_UINT16:     INVERT(uint16_t); break;
+    case GD_INT16:      INVERT(int16_t);  break;
+    case GD_UINT32:     INVERT(uint32_t); break;
+    case GD_INT32:      INVERT(int32_t);  break;
+    case GD_UINT64:     INVERT(uint64_t); break;
+    case GD_INT64:      INVERT(int64_t);  break;
+    case GD_FLOAT32:    INVERT(float);    break;
+    case GD_FLOAT64:    INVERT(double);   break;
+    case GD_COMPLEX64:  INVERTC(float);   break;
+    case GD_COMPLEX128: INVERTC(double);  break;
+    default:            _GD_InternalError(D);
+  }
+
+  dreturnvoid();
+}
+
+#ifdef GD_NO_C99_API
+#undef INVERTC
+#undef INVERT
+
+#define INVERTC(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      const t d = ((t *)data)[2 * i] * ((t *)data)[2 * i] + \
+      ((t *)data)[2 * i + 1] * ((t *)data)[2 * i + 1]; \
+      ((t *)data)[2 * i] = (t)((dividend[0] * ((t *)data)[2 * i] + \
+          dividend[1] * ((t *)data)[2 * i + 1]) / d); \
+      ((t *)data)[2 * i + 1] = (t)((dividend[1] * ((t *)data)[2 * i] - \
+          dividend[0] * ((t *)data)[2 * i]) / d); \
+    } \
+  } while (0)
+
+#define INVERT(t) \
+  do { \
+    for (i = 0; i < n_read; i++) { \
+      const t d = ((t *)data)[2 * i] * ((t *)data)[2 * i] + \
+      ((t *)data)[2 * i + 1] * ((t *)data)[2 * i + 1]; \
+      ((t *)data)[2 * i] = (t)((dividend[0] * ((t *)data)[2 * i] - \
+          dividend[1] * ((t *)data)[2 * i + 1]) / d); \
+    } \
+  } while (0)
+
+#endif
+
+/* Invert a vector */
+void _GD_CInvertData(DIRFILE *restrict D, void *restrict data,
+    gd_type_t return_type, GD_DCOMPLEXA(dividend), size_t n_read)
+{
+  size_t i;
+
+  dtrace("%p, %p, 0x%x, %g;%g, %" PRNsize_t, D, data, return_type,
+      creal(dividend), cimag(dividend), n_read);
+
+  switch(return_type) {
+    case GD_NULL:                         break;
+    case GD_UINT8:      INVERT(uint8_t);  break;
+    case GD_INT8:       INVERT(int8_t);   break;
+    case GD_UINT16:     INVERT(uint16_t); break;
+    case GD_INT16:      INVERT(int16_t);  break;
+    case GD_UINT32:     INVERT(uint32_t); break;
+    case GD_INT32:      INVERT(int32_t);  break;
+    case GD_UINT64:     INVERT(uint64_t); break;
+    case GD_INT64:      INVERT(int64_t);  break;
+    case GD_FLOAT32:    INVERT(float);    break;
+    case GD_FLOAT64:    INVERT(double);   break;
+    case GD_COMPLEX64:  INVERTC(float);   break;
+    case GD_COMPLEX128: INVERTC(double);  break;
+    default:            _GD_InternalError(D);
+  }
+
+  dreturnvoid();
+}
+
+int _GD_GetRepr(DIRFILE *restrict D, const char *restrict field_code_in,
+    char **restrict field_code, int err)
+{
+  int repr = GD_REPR_NONE;
+  const int field_code_len = strlen(field_code_in);
+
+  dtrace("%p, \"%s\", %p, %i", D, field_code_in, field_code, err);
+
+  /* find the representation, if any */
+  if (field_code_len > 2 && field_code_in[field_code_len - 2] == '.') {
+    switch (field_code_in[field_code_len - 1]) {
+      case 'r':
+        repr = GD_REPR_REAL;
+        break;
+      case 'i':
+        repr = GD_REPR_IMAG;
+        break;
+      case 'm':
+        repr = GD_REPR_MOD;
+        break;
+      case 'a':
+        repr = GD_REPR_ARG;
+        break;
+      default:
+        if (err)
+          _GD_SetError(D, GD_E_BAD_REPR, GD_E_REPR_UNKNOWN, NULL, 0,
+              field_code_in + field_code_len - 1);
+        dreturn("%i", 0);
+        return 0;
+    }
+
+    /* make a copy of the field code without the representation */
+    *field_code = _GD_Strdup(D, field_code_in);
+    if (*field_code)
+      (*field_code)[field_code_len - 2] = '\0';
+  } else
+    *field_code = (char *)field_code_in;
+
+  dreturn("%i", repr);
+  return repr;
+}
+
+/* Ensure that an input field has been identified (with error checking) */
+int _GD_BadInput(DIRFILE *D, const gd_entry_t *E, int i, int err)
+{
+  char *code;
+
+  dtrace("%p, %p, %i, %i", D, E, i, err);
+
+  if (E->e->entry[i] == NULL) {
+    E->e->entry[i] = _GD_FindFieldAndRepr(D, E->in_fields[i], &code,
+        &E->e->repr[i], NULL, 1, err);
+
+    if (E->e->entry[i] == NULL) {
+      dreturn("%i", 1);
+      return 1;
+    }
+
+    if (code != E->in_fields[i])
+      free(code);
+  }
+
+  /* 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;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* Find the entry and the representation */
+gd_entry_t *_GD_FindFieldAndRepr(DIRFILE *restrict D,
+    const char *restrict field_code_in, char **restrict field_code,
+    int *restrict repr, unsigned int *restrict index, int set, int err)
+{
+  gd_entry_t *E = NULL;
+
+  dtrace("%p, \"%s\", %p, %p, %p, %i, %i", D, field_code_in, field_code, repr,
+      index, set, err);
+
+  if (D->n_dot > 0)
+    E = _GD_FindField(D, field_code_in, D->dot_list, D->n_dot, 1, NULL);
+
+  if (E == NULL) {
+    *repr = _GD_GetRepr(D, field_code_in, field_code, err);
+
+    if (D->error) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  } else {
+    *repr = GD_REPR_NONE;
+    *field_code = (char *)field_code_in;
+  }
+
+  if (E == NULL || index != NULL)
+    E = _GD_FindField(D, *field_code, D->entry, D->n_entries, 1, index);
+
+  if (E == NULL && set) {
+    if (err)
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code_in);
+    if (field_code_in != *field_code)
+      free(*field_code);
+  }
+
+  dreturn("%p %i", E, *repr);
+  return E;
+}
+
+const char *_GD_DirName(const DIRFILE *D, int dirfd)
+{
+#ifndef GD_NO_DIR_OPEN
+  unsigned int i;
+#endif
+
+  dtrace("%p, %i", D, dirfd);
+
+#ifdef GD_NO_DIR_OPEN
+  /* in the non-POSIX case, dirfd is just the index in the dir list */
+  if (D->ndir > 0) {
+    dreturn("\"%s\"", D->dir[dirfd].path);
+    return D->dir[dirfd].path;
+  }
+#else
+  for (i = 0; i < D->ndir; ++i)
+    if (dirfd == D->dir[i].fd) {
+      dreturn("\"%s\"", D->dir[i].path);
+      return D->dir[i].path;
+    }
+#endif
+
+  /* we only get here in the early stages of opening a dirfile */
+  dreturn("\"%s\"", D->name);
+  return D->name;
+}
+
+/* This is mostly the POSIX.1 realpath(3) function, but with some
+ * optimisation due to the fact that we know that the front part of the
+ * path (car) has already been canonicalised */
+char *_GD_CanonicalPath(const char *car, const char *cdr)
+{
+  int last_element = 0;
+#if defined HAVE_READLINK && defined HAVE_LSTAT64
+  int loop_count = 0;
+#endif
+  size_t res_len, res_root, res_size, len;
+  char *res = NULL, *ptr, *work, *cur, *end;
+  dtrace("\"%s\", \"%s\"", car, cdr);
+
+  if (car && !_GD_AbsPath(cdr)) {
+    if (!_GD_AbsPath(car)) {
+      /* car is not abosulte -- don't bother trying to do anything fancy */
+      res = (char*)malloc(strlen(car) + strlen(cdr) + 2);
+      if (res == NULL) {
+        dreturn("%p", NULL);
+        return NULL;
+      }
+      sprintf(res, "%s%c%s", car, GD_DIRSEP, cdr);
+      dreturn("%s", res);
+      return res;
+    }
+    /* car is nonnull and cdr is not absolute: copy car into res and
+     * cdr into work */
+    res = strdup(car);
+    if (res == NULL) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+    res_size = (res_len = strlen(car)) + 1;
+    res_root = _GD_RootLen(res);
+
+    cur = work = strdup(cdr);
+    if (work == NULL) {
+      free(res);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  } else if (_GD_AbsPath(cdr)) {
+    /* cdr is absolute: make res "/" and copy cdr relative to / into work;
+     * ignore car */
+    res = (char*)malloc(res_size = PATH_MAX);
+    if (res == NULL) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+    _GD_Root(res, cdr, res_root);
+    res_len = res_root;
+
+    if (cdr[res_len] == '\0') {
+      dreturn("\"%s\"", res);
+      return res;
+    }
+
+    cur = work = strdup(cdr + res_len);
+    if (work == NULL) {
+      free(res);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  } else {
+    /* car is not present and cdr is relative: try to get the CWD; and make
+     * work CWD/cdr, relative to / if getcwd returned an absolute path.  If
+     * getcwd fails, just use cdr, and abandon hope of an absolute path.
+     */
+    res = (char*)malloc(res_size = PATH_MAX);
+    work = (char*)malloc(PATH_MAX);
+    if (res == NULL || work == NULL) {
+      free(res);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    if (gd_getcwd(work, PATH_MAX) == NULL) {
+      /* if getcwd fails, we're stuck with a relative path, oh well. */
+      free(work);
+      cur = work = strdup(cdr);
+      if (work == NULL) {
+        free(res);
+        dreturn("%p", NULL);
+        return NULL;
+      }
+      res[0] = '\0';
+      res_root = res_len = 0;
+    } else {
+      if ((len = strlen(work) + 2 + strlen(cdr)) < PATH_MAX) {
+        ptr = (char*)realloc(work, len);
+        if (ptr == NULL) {
+          free(res);
+          free(work);
+          dreturn("%p", NULL);
+          return NULL;
+        }
+        work = ptr;
+      }
+      ptr = work + strlen(work);
+      *(ptr++) = GD_DIRSEP;
+      strcpy(ptr, cdr);
+
+      if (_GD_AbsPath(work)) {
+        _GD_Root(res, work, res_root);
+        res_len = res_root;
+        cur = work + res_len;
+      } else {
+        res[0] = '\0';
+        res_root = res_len = 0;
+        cur = work;
+      }
+    }
+  }
+
+  /* now step through work, building up res as appropriate */
+  for (end = cur ; !last_element; cur = end) {
+    /* look for the next GD_DIRSEP or NUL */
+    for (; *end != '\0' && !_GD_IsDirSep(*end); ++end)
+      ;
+
+    /* end of string */
+    if (*end == '\0' && cur == end)
+      break;
+    else if (*end == '\0')
+      last_element = 1;
+    else
+      *(end++) = '\0';
+
+    if (cur[0] == '\0')
+      /* consecutive /s */
+      ;
+    else if (cur[0] == '.' && cur[1] == '\0') {
+      /* discard . */
+      continue;
+    } else if (cur[0] == '.' && cur[1] == '.' && cur[2] == '\0') {
+      /* don't strip the leading GD_DIRSEP */
+      if (res_len > res_root) {
+        /* find the last GD_DIRSEP, but don't strip the leading GD_DIRSEP */
+        for(ptr = res + res_len - 1;
+            !_GD_IsDirSep(*ptr) && ptr > res + res_root; --ptr)
+          ;
+
+        /* strip the .. if possible, otherwise append it */
+        *ptr = '\0';
+        res_len = ptr - res;
+      }
+    } else {
+      /* a path element, copy it to res */
+      len = strlen(cur) + 1;
+      if (res_len + len >= res_size) {
+        ptr = (char*)realloc(res, res_size += (len < 1000) ? 1000 : len);
+        if (ptr == NULL) {
+          free(res);
+          free(work);
+          dreturn("%p", NULL);
+          return NULL;
+        }
+        res = ptr;
+      }
+      if (res_len > 1 && !_GD_IsDirSep(res[res_len - 1]))
+        res[res_len++] = GD_DIRSEP;
+      strcpy(res + res_len, cur);
+      res_len += len - 1;
+#if defined HAVE_READLINK && defined HAVE_LSTAT64
+      {
+        gd_stat64_t statbuf;
+
+        /* check if it's a symlink */
+        if (lstat64(res, &statbuf)) {
+          if (errno == ENOENT) {
+            /* the thing doesn't exist.  I guess that means we're done;
+             * copy the rest of the work buffer onto the resul and call it a
+             * day. */
+            if (*end) {
+              len = strlen(end) + 1;
+              if (res_len + len >= res_size) {
+                ptr = (char*)realloc(res, res_size += len);
+                if (ptr == NULL) {
+                  free(res);
+                  free(work);
+                  dreturn("%p", NULL);
+                  return NULL;
+                }
+                res = ptr;
+              }
+              res[res_len++] = GD_DIRSEP;
+              strcpy(res + res_len, end);
+              res_len += len - 1;
+            }
+            goto _GD_CanonicalPath_DONE;
+          }
+          /* lstat error */
+          free(res);
+          free(work);
+          dreturn("%p", NULL);
+          return NULL;
+        }
+
+        if (S_ISLNK(statbuf.st_mode)) {
+          char target[PATH_MAX];
+          ssize_t slen;
+
+          /* check for symlink loop */
+          if (loop_count++ > MAXSYMLINKS) {
+            errno = ELOOP;
+            free(res);
+            free(work);
+            dreturn("%p", NULL);
+            return NULL;
+          }
+
+          /* get the link target */
+          slen = readlink(res, target, PATH_MAX - 1);
+          if (slen == -1) {
+            free(res);
+            free(work);
+            dreturn("%p", NULL);
+            return NULL;
+          }
+          target[slen] = 0;
+
+          /* now we have to start all over again */
+          ptr = target;
+          if (_GD_AbsPath(ptr)) {
+            _GD_Root(res, target, res_root);
+            res_len = res_root;
+            ptr += res_root;
+            slen -= res_root;
+          } else if (res_len > res_root) {
+            /* strip the symlink name from res */
+            char *rptr;
+            for (rptr = res + res_len - 1; !_GD_IsDirSep(*rptr); --rptr)
+              ;
+
+            /* don't strip the root /; but do strip a previous DIRSEP */
+            if ((size_t)(rptr - res) < res_root) {
+              *(rptr + 1) = '\0';
+              res_len = (rptr - res) + 1;
+            } else {
+              *rptr = '\0';
+              res_len = rptr - res;
+            }
+          }
+
+          /* now make a new work buffer of "target/remaining", asusming
+           * remaining is non-null, otherwise, just use target */
+          if (*end == '\0') {
+            last_element = 0;
+            free(work);
+            end = work = strdup(target);
+            if (work == NULL) {
+              free(res);
+              dreturn("%p", NULL);
+              return NULL;
+            }
+          } else {
+            char *new_work, slash[2] = { GD_DIRSEP, 0 };
+            len = strlen(end) + slen + 2;
+
+            if (_GD_IsDirSep(*(ptr + slen - 1))) {
+              slash[0] = '\0';
+              len--;
+            }
+
+            new_work = (char*)malloc(len);
+            if (new_work == NULL) {
+              free(res);
+              free(work);
+              dreturn("%p", NULL);
+              return NULL;
+            }
+            sprintf(new_work, "%s%s%s", ptr, slash, end);
+            free(work);
+            end = work = new_work;
+          }
+        }
+      }
+#endif
+    }
+  }
+
+#if defined HAVE_READLINK && defined HAVE_LSTAT64
+_GD_CanonicalPath_DONE:
+#endif
+  free(work);
+
+  /* trim */
+  ptr = (char*)realloc(res, res_len + 1);
+  if (ptr)
+    res = ptr;
+
+  dreturn("\"%s\"", res);
+  return res;
+}
+
+char *_GD_MakeFullPath(DIRFILE *D, int dirfd, const char *name, int seterr)
+{
+  const char *dir;
+  char *filepath;
+  dtrace("%p, %i, \"%s\", %i", D, dirfd, name, seterr);
+
+  if (dirfd >= 0) {
+    dir = _GD_DirName(D, dirfd);
+    if (dir == NULL) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  } else
+    dir = NULL;
+
+  filepath = _GD_CanonicalPath(dir, name);
+
+  if (seterr && filepath == NULL) {
+    if (errno == ENOMEM)
+      _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+    else {
+      /* a last ditch attempt */
+      if (dir) {
+        filepath = (char*)_GD_Malloc(D, strlen(dir) + strlen(name) + 2);
+        if (filepath)
+          sprintf(filepath, "%s%c%s", dir, GD_DIRSEP, name);
+      } else 
+        filepath = _GD_Strdup(D, name);
+    }
+  }
+
+  dreturn("\"%s\"", filepath);
+  return filepath;
+}
+
+char *_GD_MakeFullPathOnly(const DIRFILE *D, int dirfd, const char *name)
+{
+  char *filepath;
+
+  dtrace("%p, %i, \"%s\"", D, dirfd, name);
+
+  /* although we cast away the constness, seterr=0 ensures nothing gets
+   * modified
+   */
+  filepath = _GD_MakeFullPath((DIRFILE*)D, dirfd, name, 0);
+
+  dreturn("\"%s\"", filepath);
+  return filepath;
+}
+
+int _GD_GrabDir(DIRFILE *D, int dirfd, const char *name)
+{
+  unsigned int i;
+  char *path, *dir = NULL;
+  void *ptr;
+
+  dtrace("%p, %i, \"%s\"", D, dirfd, name);
+
+  path = _GD_MakeFullPath(D, dirfd, name, 1);
+
+  if (path == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dir = dirname(path);
+
+  for (i = 0; i < D->ndir; ++i)
+    if (strcmp(dir, D->dir[i].path) == 0) {
+      D->dir[i].rc++;
+      free(path);
+      dreturn("%i", D->dir[i].fd);
+      return D->dir[i].fd;
+    }
+
+  /* new one */
+  ptr = _GD_Realloc(D, D->dir, sizeof(struct gd_dir_t) * (D->ndir + 1));
+
+  if (ptr == NULL) {
+    free(path);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  D->dir = (struct gd_dir_t*)ptr;
+  D->dir[D->ndir].rc = 1;
+  D->dir[D->ndir].path = _GD_Strdup(D, dir);
+
+  if (D->dir[D->ndir].path == NULL) {
+    free(path);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+#ifdef GD_NO_DIR_OPEN
+  D->dir[D->ndir].fd = D->ndir;
+  free(path);
+#else
+  if (_GD_AbsPath(name)) {
+    D->dir[D->ndir].fd = open(dir, O_RDONLY);
+  } else {
+    free(path);
+    path = _GD_Strdup(D, name);
+    if (path == NULL) {
+      free(D->dir[D->ndir].path);
+      dreturn("%i", -1);
+      return -1;
+    }
+    D->dir[D->ndir].fd = gd_OpenAt(D, dirfd, dirname(path), O_RDONLY, 0666);
+  }
+  free(path);
+
+  if (D->dir[D->ndir].fd == -1) {
+    free(D->dir[D->ndir].path);
+    dreturn("%i", -1);
+    return -1;
+  }
+#endif
+  D->ndir++;
+
+  dreturn("%i", D->dir[D->ndir - 1].fd);
+  return D->dir[D->ndir - 1].fd;
+}
+
+void _GD_ReleaseDir(DIRFILE *D, int dirfd)
+{
+#ifndef GD_NO_DIR_OPEN
+  unsigned int i;
+#endif
+
+  dtrace("%p, %i", D, dirfd);
+
+#ifdef GD_NO_DIR_OPEN
+  if (--D->dir[dirfd].rc == 0) {
+    free(D->dir[dirfd].path);
+    D->dir[dirfd] = D->dir[--D->ndir];
+  }
+#else
+  for (i = 0; i < D->ndir; ++i)
+    if (D->dir[i].fd == dirfd) {
+      if (--D->dir[i].rc == 0) {
+        free(D->dir[i].path);
+        close(D->dir[i].fd);
+        D->dir[i] = D->dir[--D->ndir];
+      }
+      break;
+    }
+#endif
+
+  dreturnvoid();
+}
+
+/* allocation boilerplates */
+void *_GD_Malloc(DIRFILE *D, size_t size)
+{
+  void *ptr = malloc(size);
+  if (ptr == NULL)
+    _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+  return ptr;
+}
+
+void *_GD_Realloc(DIRFILE *restrict D, void *restrict old, size_t size)
+{
+  void *ptr = realloc(old, size);
+  if (ptr == NULL)
+    _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+  return ptr;
+}
+
+char *_GD_Strdup(DIRFILE *D, const char *s)
+{
+  char *ptr = strdup(s);
+  if (ptr == NULL)
+    _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+  return ptr;
+}
+
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/compat.c b/src/compat.c
new file mode 100644
index 0000000..486fea8
--- /dev/null
+++ b/src/compat.c
@@ -0,0 +1,469 @@
+/* Copyright (C) 2010, 2011, 2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* The MSVCRT gmtime() is threadsafe */
+#ifndef HAVE_GMTIME_R
+struct tm *gmtime_r(const time_t *restrict timep, struct tm *restrict result)
+{
+  struct tm *ptr;
+
+  dtrace("%p, %p", timep, result);
+
+  ptr = gmtime(timep);
+  if (!ptr)
+    return NULL;
+
+  memcpy(result, ptr, sizeof(struct tm));
+
+  dreturn("%p", result);
+  return result;
+}
+#endif
+
+/* ...at() functions for platforms lacking them.  These are originally Solaris
+ * extensions which have subsequently been included in POSIX.1-2008.
+ */
+#ifndef HAVE_OPENAT
+int gd_OpenAt(const DIRFILE *D, int dirfd, const char *name, int flags,
+    mode_t mode)
+{
+  int ret;
+  char *path;
+
+  dtrace("%p, %i, \"%s\", %x, 0%o", D, dirfd, name, flags, mode);
+
+  path = _GD_MakeFullPathOnly(D, dirfd, name);
+  ret = open(path, flags | O_BINARY, mode);
+  free(path);
+
+  dreturn("%i", ret);
+  return ret;
+}
+#endif
+
+#ifndef HAVE_RENAMEAT
+int gd_RenameAt(const DIRFILE *D, int olddirfd, const char *oldname,
+    int newdirfd, const char *newname)
+{
+  int ret;
+  char *oldpath, *newpath;
+
+  dtrace("%p, %i, \"%s\", %i, \"%s\"", D, olddirfd, oldname, newdirfd, newname);
+
+  newpath = _GD_MakeFullPathOnly(D, newdirfd, newname);
+#ifdef __MSVCRT__
+  if (unlink(newpath)) {
+    if (errno != ENOENT) {
+      free(newpath);
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+#endif
+
+  oldpath = _GD_MakeFullPathOnly(D, olddirfd, oldname);
+  ret = rename(oldpath, newpath);
+  free(newpath);
+  free(oldpath);
+
+  dreturn("%i", ret);
+  return ret;
+}
+#endif
+
+#ifndef HAVE_FSTATAT
+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);
+
+  path = _GD_MakeFullPathOnly(D, dirfd, name);
+#if defined(HAVE_LSTAT) && defined(AT_SYMLINK_NOFOLLOW)
+  if (flags & AT_SYMLINK_NOFOLLOW)
+    ret = lstat(path, buf);
+  else
+#endif
+    ret = stat(path, buf);
+  free(path);
+
+  dreturn("%i", ret);
+  return ret;
+}
+#endif
+
+#ifndef HAVE_FSTATAT64
+int gd_StatAt64(const DIRFILE* D, int dirfd, const char* name, gd_stat64_t* buf,
+    int flags gd_unused_)
+{
+  int ret;
+  char *path;
+
+  dtrace("%p, %i, \"%s\", %p, <unused>", D, dirfd, name, buf);
+
+  path = _GD_MakeFullPathOnly(D, dirfd, name);
+  ret = gd_stat64(path, buf);
+  free(path);
+
+  dreturn("%i", ret);
+  return ret;
+}
+#endif
+
+#ifndef HAVE_UNLINKAT
+int gd_UnlinkAt(const DIRFILE *D, int dirfd, const char *name,
+    int flags gd_unused_)
+{
+  int ret;
+  char *path;
+
+  dtrace("%p, %i, \"%s\", <unused>", D, dirfd, name);
+
+  path = _GD_MakeFullPathOnly(D, dirfd, name);
+  ret = unlink(path);
+  free(path);
+
+  dreturn("%i", ret);
+  return ret;
+}
+#endif
+
+/* Non-threadsafe version of strerror_r */
+#ifndef HAVE_STRERROR_R
+int strerror_r(int errnum, char *buf, size_t buflen)
+{
+  char *ptr;
+
+  dtrace("%i, %p, %" PRNsize_t, errnum, buf, buflen);
+
+  ptr = strerror(errnum);
+  strncpy(buf, ptr, buflen);
+
+  dreturn("%i", 0);
+  return 0;
+}
+#endif
+
+/* A getdelim() for platforms lacking it.  getdelim was originally a GNU
+ * extension and has subsequently been POSIXised in POSIX.1-2008.
+ */
+#ifndef HAVE_GETDELIM
+ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream)
+{
+  size_t nread;
+  ssize_t count = 0;
+  char *p, *q;
+  size_t len, new_len;
+  off64_t pos;
+
+  dtrace("%p, %p, '\\x%02x', %p", lineptr, n, (char)delim, stream);
+
+  /* create a new buffer, if necessary */
+  if (*lineptr == NULL || *n == 0) {
+    *lineptr = (char *)malloc(*n = 100);
+    if (*lineptr == NULL) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+  p = *lineptr;
+  len = *n;
+
+  /* apparently getdelim returns -1 if encountering EOF at the start of
+   * a read, so try reading some text before beginning the main loop */
+  pos = ftello64(stream);
+  nread = fread(p, 1, len, stream);
+
+  if (nread == 0) {
+    /* this is an error or EOF with no data read */
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  for (;;) {
+    /* look for delim */
+    q = (char *)memchr(p, delim, nread);
+    if (q) {
+#ifdef __MSVCRT__
+      int r;
+      off64_t new_pos;
+#endif
+
+      /* found delim */
+      count += (q - p) + 1;
+
+      /* make sure we have room for a terminating NUL */
+      new_len = count;
+      /* rewind */
+      pos += (q - p);
+#ifndef __MSVCRT__
+      pos++;
+#endif
+      fseeko64(stream, pos, SEEK_SET);
+#ifdef __MSVCRT__
+      /* Even when we open a text file in binary mode, fseek/ftell seem able
+       * to screw up.  So, do things the hard way. */
+      r = fgetc(stream);
+      new_pos = ftello64(stream);
+      while (r != EOF && (new_pos <= pos || r != '\n')) {
+        r = fgetc(stream);
+        new_pos = ftello64(stream);
+      }
+#endif
+    } else {
+      /* no delim, increase the buffer size */
+      count += nread;
+      p += nread;
+
+      if (count == GD_SSIZE_T_MAX) {
+        /* out of ssize_t room */
+        errno = EOVERFLOW;
+        dreturn("%i", -1);
+        return -1;
+      } else if (count >= GD_SSIZE_T_MAX / 2)
+        new_len = GD_SSIZE_T_MAX;
+      else
+        new_len = count * 2;
+      len = new_len - count;
+    }
+
+    /* realloc, if necessary */
+    if (*n < new_len) {
+      char *ptr = (char *)realloc(*lineptr, new_len);
+      if (!ptr) {
+        dreturn("%i", -1);
+        return -1;
+      }
+      *n = new_len;
+      p = ptr + (p - *lineptr);
+      *lineptr = ptr;
+    }
+
+    /* quit if there's no need to read more */
+    if (q)
+      break;
+
+    if (feof(stream)) {
+      q = p - 1;
+      break;
+    }
+
+    /* read some more */
+    pos = ftello64(stream);
+    nread = fread(p, 1, len, stream);
+  }
+  *(q + 1) = '\0';
+
+  dreturn("%li %li (\"%s\")", (long int)count, (long int)*n, *lineptr);
+  return count;
+}
+#endif
+
+#ifndef HAVE_BASENAME
+char *basename(char *path)
+{
+  char *last_elem, *ptr;
+
+  last_elem = path;
+
+  for (ptr = path; *ptr; ++ptr)
+    if ((*ptr == '/' || *ptr == GD_DIRSEP) && *(ptr + 1))
+      last_elem = ptr + 1;
+
+  return last_elem;
+}
+#endif
+
+/* emulate readdir_r(3) with non-threadsafe readdir(3) */
+#ifndef HAVE_READDIR_R
+int _GD_ReadDir(DIR *dirp, struct dirent *entry, struct dirent **result)
+{
+  struct dirent *local_entry;
+
+  dtrace("%p, %p, %p", dirp, entry, result);
+
+  errno = 0;
+  local_entry = readdir(dirp);
+  if (local_entry == NULL) {
+    *result = NULL;
+    if (errno) {
+      dreturn("%i", errno);
+      return errno;
+    }
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  *result = entry;
+  memcpy(entry, local_entry, sizeof(struct dirent));
+  dreturn("%i", 0);
+  return 0;
+}
+#endif
+
+/* the MSVCRT's strtod isn't POSIX compliant */
+#ifdef __MSVCRT__
+double gd_strtod(const char *nptr, char **endptr)
+{
+  const char *ptr = nptr;
+  double r = 0;
+  int sign = 0;
+
+  dtrace("\"%s\", %p", nptr, endptr);
+
+  /* the basic problem here is that MSVCRT's strtod() doesn't properly covert
+   * hexadecimal numbers, nor does it do the special values "INF" and "NAN".
+   */
+
+  /* skip sign */
+  if (*ptr == '+' || *ptr == '-') {
+    if (*ptr == '-')
+      sign = 0x80;
+    ptr++;
+  }
+
+  /* check for hex, either integer or floating point */
+  if (*ptr == '0' && (*(ptr + 1) | 0x20) == 'x') {
+    double fact = 1.;
+    /* we store the mantissa in r */
+    for (ptr += 2; *ptr; ++ptr) {
+      if ((*ptr >= '0' && *ptr <= '9') ||
+          ((*ptr | 0x20) >= 'a' && (*ptr | 0x20) <= 'f'))
+      {
+        if (fact == 1.)
+          r *= 16;
+        else if (fact == 0.)
+          fact = 1./16;
+        else
+          fact /= 16;
+
+        if (*ptr >= '0' && *ptr <= '9')
+          r += fact * (*ptr - '0');
+        else
+          r += fact * ((*ptr | 0x20) - 'a' + 10);
+      } else if (*ptr == '.' && fact == 1.)
+        fact = 0.;
+      else if ((*ptr | 0x20) == 'p') {
+        /* use strtol to get exponent, which is in decimal */
+        long exp = strtol(ptr + 1, endptr, 10);
+        r *= pow(2., exp);
+
+        /* to avoid setting it again */
+        endptr = NULL;
+        break;
+      } else
+        break;
+    }
+
+    if (endptr)
+      *endptr = (char*)ptr;
+
+    if (sign)
+      r = -r;
+
+    dreturn("%g (%c)", r, endptr ? **endptr : '-');
+    return r;
+  } else if ((*ptr | 0x20) == 'n') {
+    if (((*(ptr + 1) | 0x20) == 'a') && ((*(ptr + 2) | 0x20) == 'n')) {
+      /* an IEEE-754 double-precision quiet NaN:
+       *
+       * 1111 1111 1111 1111 1111 1111 1111 1111
+       * 1111 1111 1111 1111 1111 1111 1111 1111
+       * = 0xFFFFFFFFFFFFFFFF
+       *
+       * (a signalling NaN doesn't set the MSB of the mantissa)
+       *
+       * There are several of these; this one is nice because it's byte-sex
+       * independent, unlike INF below.
+       */
+      const union {
+        unsigned char x[8];
+        double d;
+      } nan_punning = {{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }};
+
+      if (endptr) {
+        *endptr = (char*)(ptr += 3);
+        /* a NaN may end with something in parentheses */
+        if (*ptr == '(') {
+          while (*++ptr) {
+            if (*ptr == ')') {
+              *endptr = (char*)(ptr + 1);
+              break;
+            }
+          }
+        }
+      }
+
+      /* return NaN */
+      dreturn("%g (%c)", nan_punning.d, endptr ? **endptr : '-');
+      return nan_punning.d;
+    }
+  } else if ((*ptr | 0x20) == 'i') {
+    if (((*(ptr + 1) | 0x20) == 'n') && ((*(ptr + 2) | 0x20) == 'f')) {
+      /* an IEEE-754 double-precision infinity (s is the sign bit):
+       *
+       * s111 1111 1111 1000 0000 0000 0000 0000
+       * 0000 0000 0000 0000 0000 0000 0000 0000
+       * = 0x7FF0000000000000 (+INF), or
+       *   0xFFF0000000000000 (-INF)
+       */
+      const union {
+        unsigned char x[8];
+        double d;
+      } inf_punning = {{
+#ifdef ARM_ENDIAN_DOUBLES
+        0x00, 0x00, 0xF0, 0x7F | sign, 0x00, 0x00, 0x00, 0x00
+#elif defined(FLOATS_BIGENDIAN)
+          0x7F | sign, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+#else
+          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F | sign
+#endif
+      }};
+
+      if (endptr) {
+        *endptr = (char*)(ptr += 3);
+        /* INF may also be INFINITY, disregarding case */
+        if (
+            ((*ptr | 0x20) == 'i') &&
+            ((*(ptr + 1) | 0x20) == 'n') &&
+            ((*(ptr + 2) | 0x20) == 'i') &&
+            ((*(ptr + 3) | 0x20) == 't') &&
+            ((*(ptr + 4) | 0x20) == 'y'))
+        {
+          *endptr += 5;
+        }
+      }
+
+      /* return signed infinity */
+      dreturn("%g (%c)", inf_punning.d, endptr ? **endptr : '-');
+      return inf_punning.d;
+    }
+  }
+
+  /* otherwise, just run strtod */
+  r = strtod(nptr, endptr);
+  dreturn("%g (%c)", r, endptr ? **endptr : '-');
+  return r;
+}
+#endif
diff --git a/src/constant.c b/src/constant.c
new file mode 100644
index 0000000..c7874a5
--- /dev/null
+++ b/src/constant.c
@@ -0,0 +1,303 @@
+/* Copyright (C) 2008-2010 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+int gd_get_carray_slice(DIRFILE* D, const char *field_code_in,
+    unsigned int start, size_t n, gd_type_t return_type, void *data_out)
+gd_nothrow
+{
+  gd_entry_t *entry;
+  char* field_code;
+  int repr;
+
+  dtrace("%p, \"%s\", %i, %" PRNsize_t ", 0x%x, %p", D, field_code_in,
+      (int)start, n, return_type, data_out);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (entry->field_type != GD_CARRAY_ENTRY &&
+      entry->field_type != GD_CONST_ENTRY)
+  {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+  } else if (start + n > ((entry->field_type == GD_CONST_ENTRY) ? 1 :
+      entry->EN(scalar,array_len)))
+  {
+    _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
+  } else if (!D->error)
+    _GD_DoField(D, entry, repr, start, n, return_type, data_out);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_get_carray(DIRFILE *D, const char *field_code_in, gd_type_t return_type,
+    void *data_out) gd_nothrow
+{
+  gd_entry_t *entry;
+  char* field_code;
+  int repr;
+
+  dtrace("%p, \"%s\", 0x%x, %p", D, field_code_in, return_type, data_out);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (entry->field_type != GD_CARRAY_ENTRY &&
+      entry->field_type != GD_CONST_ENTRY)
+  {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+  } else if (!D->error)
+    _GD_DoField(D, entry, repr, 0, (entry->field_type == GD_CONST_ENTRY) ? 1 :
+        entry->EN(scalar,array_len), return_type, data_out);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_get_constant(DIRFILE* D, const char *field_code_in,
+    gd_type_t return_type, void *data_out) gd_nothrow
+{
+  return gd_get_carray_slice(D, field_code_in, 0, 1, return_type, data_out);
+}
+
+size_t gd_carray_len(DIRFILE *D, const char *field_code_in) gd_nothrow
+{
+  gd_entry_t *entry;
+  char* field_code;
+  int repr;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  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);
+  }
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  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);
+}
+
+int gd_put_carray_slice(DIRFILE* D, const char *field_code_in,
+    unsigned int first, size_t n, gd_type_t data_type, const void *data_in)
+gd_nothrow
+{
+  int i;
+  gd_entry_t *entry;
+  int repr;
+  char* field_code;
+
+  dtrace("%p, \"%s\", %i, %" 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;
+  }
+
+  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);
+
+  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)))
+  {
+    _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL);
+  } else
+    _GD_DoFieldOut(D, entry, repr, first, n, data_type, data_in);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Flag all clients as needing recalculation */
+  for (i = 0; i < entry->e->u.scalar.n_client; ++i)
+    entry->e->u.scalar.client[i]->e->calculated = 0;
+
+  /* Clear the client list */
+  free(entry->e->u.scalar.client);
+  entry->e->u.scalar.client = NULL;
+  entry->e->u.scalar.n_client = 0;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_put_carray(DIRFILE* D, const char *field_code_in, gd_type_t data_type,
+    const void *data_in) gd_nothrow
+{
+  int i;
+  gd_entry_t *entry;
+  int repr;
+  char* field_code;
+
+  dtrace("%p, \"%s\", 0x%x, %p", D, field_code_in, data_type, data_in);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      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
+    _GD_DoFieldOut(D, entry, repr, 0,
+        (entry->field_type == GD_CONST_ENTRY) ? 1 : entry->EN(scalar,array_len),
+        data_type, data_in);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Flag all clients as needing recalculation */
+  for (i = 0; i < entry->e->u.scalar.n_client; ++i)
+    entry->e->u.scalar.client[i]->e->calculated = 0;
+
+  /* Clear the client list */
+  free(entry->e->u.scalar.client);
+  entry->e->u.scalar.client = NULL;
+  entry->e->u.scalar.n_client = 0;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_put_constant(DIRFILE* D, const char *field_code_in, 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);
+}
+
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/debug.c b/src/debug.c
new file mode 100644
index 0000000..5e5f0f4
--- /dev/null
+++ b/src/debug.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2008, 2010, 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+extern char gd_debug_col[GD_COL_SIZE + 1];
+extern int gd_col_count;
+
+const char* gd_colnil(void) {
+  return gd_debug_col;
+}
+
+const char* gd_coladd(void)
+{
+  if (gd_col_count < GD_COL_SIZE) {
+    gd_debug_col[gd_col_count++] = ':';
+    gd_debug_col[gd_col_count] = '\0';
+  }
+
+  return gd_colnil();
+}
+
+const char* gd_colsub(void)
+{
+  static char buffer[GD_COL_SIZE + 1];
+  strcpy(buffer, gd_colnil());
+
+  if (gd_col_count > 0)
+    gd_debug_col[--gd_col_count] = '\0';
+
+  return buffer;
+}
+
+void gd_colclear(void)
+{
+  gd_col_count = 0;
+  gd_debug_col[0] = '\0';
+}
diff --git a/src/del.c b/src/del.c
new file mode 100644
index 0000000..8f8659d
--- /dev/null
+++ b/src/del.c
@@ -0,0 +1,555 @@
+/* Copyright (C) 2008-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+static void _GD_ClearDerived(DIRFILE *restrict D, gd_entry_t *restrict E,
+    const gd_entry_t *restrict C, int check)
+{
+  int i;
+
+  dtrace("%p, %p, %p, %i", D, E, C, check);
+
+  switch(E->field_type) {
+    case GD_LINCOM_ENTRY:
+      for (i = 0; i < E->EN(lincom,n_fields); ++i)
+        if (strcmp(E->in_fields[i], C->field) == 0) {
+          if (check)
+            _GD_SetError(D, GD_E_DELETE, GD_E_DEL_DERIVED, E->field, 0,
+                C->field);
+          else
+            E->e->entry[i] = NULL;
+        }
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (strcmp(E->in_fields[1], C->field) == 0) {
+        if (check)
+          _GD_SetError(D, GD_E_DELETE, GD_E_DEL_DERIVED, E->field, 0,
+              C->field);
+        else
+          E->e->entry[1] = NULL;
+      }
+      break;
+      /* Fallthrough */
+    case GD_RECIP_ENTRY:
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+      if (strcmp(E->in_fields[0], C->field) == 0) {
+        if (check)
+          _GD_SetError(D, GD_E_DELETE, GD_E_DEL_DERIVED, E->field, 0,
+              C->field);
+        else
+          E->e->entry[0] = NULL;
+      }
+      break;
+    case GD_NO_ENTRY:
+    case GD_RAW_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+      break;
+    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;
+        }
+  }
+
+  dreturnvoid();
+}
+
+static int _GD_DeReferenceOne(DIRFILE *restrict D, gd_entry_t *restrict E,
+    gd_entry_t *restrict C, int check, int i, gd_type_t type,
+    void *restrict data)
+{
+  int repr;
+  char *field_code;
+
+  dtrace("%p, %p, %p, %i, %i, 0x%03x, %p", D, E, C, check, i, type, data);
+
+  if (E->scalar[i] != NULL) {
+    repr = _GD_GetRepr(D, E->scalar[i], &field_code, 1);
+
+    if (D->error) {
+      dreturn("%i", 1);
+      return 1;
+    }
+
+    if (strcmp(C->field, field_code) == 0) {
+      if (field_code != E->scalar[i])
+        free(field_code);
+
+      if (check) {
+        _GD_SetError(D, GD_E_DELETE, GD_E_DEL_CONST, E->field, 0, C->field);
+
+        dreturn("%i", 1);
+        return 1;
+      } else {
+        _GD_DoField(D, C, repr, (C->field_type == GD_CONST_ENTRY) ? 0 :
+            E->scalar_ind[i], 1, type, data);
+        free(E->scalar[i]);
+        E->scalar[i] = NULL;
+      }
+    } else if (field_code != E->scalar[i])
+      free(field_code);
+
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+static void _GD_DeReference(DIRFILE *restrict D, gd_entry_t *restrict E,
+    gd_entry_t *restrict C, int check)
+{
+  int i;
+
+  dtrace("%p, %p, %p, %i", D, E, C, check);
+
+  switch(E->field_type) {
+    case GD_RAW_ENTRY:
+      _GD_DeReferenceOne(D, E, C, check, 0, GD_UINT_TYPE, &E->EN(raw,spf));
+      break;
+    case GD_POLYNOM_ENTRY:
+      for (i = 0; i <= E->EN(polynom,poly_ord); ++i) {
+        if (_GD_DeReferenceOne(D, E, C, check, i, GD_COMPLEX128,
+              &E->EN(polynom,ca)[i]))
+          break;
+
+        if (!check)
+          E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
+      }
+      break;
+    case GD_LINCOM_ENTRY:
+      for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+        if (_GD_DeReferenceOne(D, E, C, check, i, GD_COMPLEX128,
+              &E->EN(lincom,cm)[i]))
+          break;
+
+        if (!check)
+          E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]);
+
+        if (_GD_DeReferenceOne(D, E, C, check, i + GD_MAX_LINCOM, GD_COMPLEX128,
+              &E->EN(lincom,cb)[i]))
+          break;
+
+        if (!check)
+          E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
+      }
+      break;
+    case GD_RECIP_ENTRY:
+      _GD_DeReferenceOne(D, E, C, check, 0, GD_COMPLEX128,
+          &E->EN(recip,cdividend));
+
+      if (!check)
+        E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      if (_GD_DeReferenceOne(D, E, C, check, 0, GD_INT_TYPE,
+            &E->EN(bit,bitnum)))
+        break;
+
+      _GD_DeReferenceOne(D, E, C, check, 1, GD_INT_TYPE, &E->EN(bit,numbits));
+      break;
+    case GD_PHASE_ENTRY:
+      _GD_DeReferenceOne(D, E, C, check, 0, GD_INT64, &E->EN(phase,shift));
+      break;
+    case GD_WINDOW_ENTRY:
+      switch (E->EN(window,windop)) {
+        case GD_WINDOP_EQ:
+        case GD_WINDOP_NE:
+          _GD_DeReferenceOne(D, E, C, check, 0, GD_INT64,
+              &E->EN(window,threshold.i));
+          break;
+        case GD_WINDOP_SET:
+        case GD_WINDOP_CLR:
+          _GD_DeReferenceOne(D, E, C, check, 0, GD_UINT64,
+              &E->EN(window,threshold.u));
+          break;
+        default:
+          _GD_DeReferenceOne(D, E, C, check, 0, GD_FLOAT64,
+              &E->EN(window,threshold.r));
+          break;
+      }
+      break;
+    case GD_MPLEX_ENTRY:
+      _GD_DeReferenceOne(D, E, C, check, 0, GD_INT_TYPE,
+          &E->EN(mplex,count_val));
+      _GD_DeReferenceOne(D, E, C, check, 1, GD_INT_TYPE,
+          &E->EN(mplex,period));
+      break;
+    case GD_NO_ENTRY:
+    case GD_LINTERP_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_ALIAS_ENTRY:
+      break;
+  }
+
+  dreturnvoid();
+}
+
+static int _GD_Delete(DIRFILE *restrict D, gd_entry_t *restrict E,
+    unsigned int index, unsigned int flags)
+{
+  unsigned int first, last = 0;
+  int n_del, i, len;
+  unsigned int j;
+  char **new_ref = NULL;
+  gd_entry_t *reference = NULL;
+  gd_entry_t **del_list;
+
+  dtrace("%p, %p, %u, 0x%X", D, E, index, flags);
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  len = strlen(E->field);
+
+  /* check protection */
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* If this field has metafields, and we weren't asked to delete those too,
+   * complain */
+  if (E->e->n_meta > 0 && ~flags & GD_DEL_META) {
+    _GD_SetError(D, GD_E_DELETE, GD_E_DEL_META, NULL, 0, E->field);
+    dreturn("%i", -1);
+    return -1;
+  } else if (E->e->n_meta > 0) {
+    /* find one of the meta fields -- it's not true that metafields are
+     * necessarily sorted directly after their parent */
+    if (_GD_FindField(D, E->e->p.meta_entry[0]->field, D->entry, D->n_entries,
+          0, &first) == NULL)
+    {
+      _GD_InternalError(D);
+      dreturn("%i", -1);
+      return -1;
+    }
+    last = first;
+
+    /* The remaining meta fields will be contiguous with this one, so just
+     * search linearly in both directions until we find something that isn't a
+     * meta field of our parent */
+    while (first > 0)
+      if (strncmp(D->entry[first - 1]->field, E->field, len) == 0 &&
+          D->entry[first - 1]->field[len] == '/')
+        first--;
+      else
+        break;
+
+    while (last < D->n_entries - 1)
+      if (strncmp(D->entry[last + 1]->field, E->field, len) == 0 &&
+          D->entry[last + 1]->field[len] == '/')
+        last++;
+      else
+        break;
+  }
+
+  /* gather a list of fields */
+  del_list = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*) *
+        (((E->e->n_meta == -1) ?  0 : E->e->n_meta) + 1));
+
+  if (del_list == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  del_list[0] = E;
+  n_del = 1;
+
+  for (i = 0; i < E->e->n_meta; ++i)
+    del_list[n_del++] = E->e->p.meta_entry[i];
+
+  /* Check for clients and derived fields */
+  if (~flags & GD_DEL_FORCE)
+    for (j = 0; j < D->n_entries; ++j)
+      for (i = 0; i < n_del; ++i) {
+        if ((del_list[i]->field_type == GD_CONST_ENTRY ||
+              del_list[i]->field_type == GD_CARRAY_ENTRY) &&
+            ~flags & GD_DEL_DEREF)
+          _GD_DeReference(D, D->entry[j], del_list[i], 1);
+        else if (del_list[i]->field_type != GD_STRING_ENTRY)
+          _GD_ClearDerived(D, D->entry[j], del_list[i], 1);
+
+        if (D->error) {
+          free(del_list);
+          dreturn("%i", -1);
+          return -1;
+        }
+      }
+
+  /* If this is a raw field, and we were asked to delete the data, do so */
+  if (E->field_type == GD_RAW_ENTRY && flags & GD_DEL_DATA) {
+    /* check protection */
+    if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA) {
+      _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0,
+          D->fragment[E->fragment_index].cname);
+      free(del_list);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_UNLINK)) {
+      free(del_list);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    if ((*gd_ef_[E->e->u.raw.file[0].subenc].name)(D,
+          (const char*)D->fragment[E->fragment_index].enc_data,
+          E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
+    {
+      free(del_list);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    if ((*gd_ef_[E->e->u.raw.file[0].subenc].unlink)(
+          D->fragment[E->fragment_index].dirfd, E->e->u.raw.file))
+    {
+      _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;
+    }
+  }
+
+  /* Fix up reference fields */
+  if (E->field_type == GD_RAW_ENTRY) {
+    new_ref = (char **)_GD_Malloc(D, sizeof(char*) * D->n_fragment);
+    if (new_ref == NULL) {
+      free(del_list);
+      dreturn("%i", -1);
+      return -1;
+    }
+    memset(new_ref, 0, sizeof(char*) * D->n_fragment);
+
+    for (i = 0; i < D->n_fragment; ++i)
+      if (D->fragment[i].ref_name != NULL &&
+          strcmp(D->fragment[i].ref_name, E->field) == 0)
+      {
+        /* Flag for replacement */
+        new_ref[i] = (char *)E;
+        /* Search for a replacement */
+        for (j = 0; j < D->n_entries; ++j)
+          if (j != index && D->entry[j]->field_type == GD_RAW_ENTRY) {
+            /* Is this field in scope? */
+            int in_scope = 0;
+            int f;
+            for (f = D->entry[j]->fragment_index; f != -1;
+                f = D->fragment[f].parent)
+              if (f == i) {
+                in_scope = 1;
+                break;
+              }
+
+            if (in_scope) {
+              new_ref[i] = _GD_Strdup(D, D->entry[j]->field);
+              if (new_ref[i] == NULL) {
+                for (f = 0; f < i; ++f)
+                  free(new_ref[f]);
+                free(new_ref);
+                free(del_list);
+                dreturn("%i", -1);
+                return -1;
+              }
+
+              if (i == 0)
+                reference = D->entry[j];
+
+              break;
+            }
+          }
+      }
+  }
+
+  /* Nothing from now on may fail */
+
+  /* Fix up reference fields */
+  if (reference != NULL)
+    D->reference_field = reference;
+
+  if (new_ref != NULL) {
+    for (i = 0; i < D->n_fragment; ++i)
+      if (new_ref[i] != NULL) {
+        free(D->fragment[i].ref_name);
+        D->fragment[i].ref_name = (new_ref[i] == (char *)E) ? NULL : new_ref[i];
+      }
+    free(new_ref);
+  }
+
+  /* Clear clients and derived fields */
+  for (j = 0; j < D->n_entries; ++j)
+    for (i = 0; i < n_del; ++i)
+      if ((del_list[i]->field_type == GD_CONST_ENTRY ||
+            del_list[i]->field_type == GD_CARRAY_ENTRY) && flags & GD_DEL_DEREF)
+        _GD_DeReference(D, D->entry[j], del_list[i], 0);
+      else if (del_list[i]->field_type != GD_STRING_ENTRY)
+        _GD_ClearDerived(D, D->entry[j], del_list[i], 0);
+
+  free(del_list);
+
+  /* Remove meta fields, if present */
+  if (E->e->n_meta >= 0) {
+    if (E->e->n_meta > 0) {
+      /* Remove all meta fields -- there are no RAW fields here */
+      for (j = first; j <= last; ++j)
+        _GD_FreeE(D, D->entry[j], 1);
+
+      memmove(D->entry + first, D->entry + last + 1,
+          sizeof(gd_entry_t*) * (D->n_entries - last - 1));
+      D->n_entries -= last - first + 1;
+    }
+
+    /* Invalidate the field lists */
+    D->entry_list_validity = 0;
+    D->value_list_validity = 0;
+  } else {
+    /* If this is a metafield, update its parent's lists */
+    struct gd_private_entry_ *Pe = E->e->p.parent->e;
+
+    /* search and destroy */
+    for (i = 0; i < Pe->n_meta; ++i)
+      if (Pe->p.meta_entry[i] == E) {
+        Pe->p.meta_entry[i] = Pe->p.meta_entry[Pe->n_meta - 1];
+        break;
+      }
+
+    /* Decrement entry count */
+    Pe->n_meta--;
+
+    /* Invalidate the field lists */
+    Pe->entry_list_validity = 0;
+    Pe->value_list_validity = 0;
+  }
+
+  /* Remove the entry from the list -- we need not worry about the way we've
+   * already modified D->entry, since E is guaranteed to be before the stuff
+   * we've already removed */
+  D->fragment[E->fragment_index].modified = 1;
+  _GD_FreeE(D, E, 1);
+
+  memmove(D->entry + index, D->entry + index + 1,
+      sizeof(gd_entry_t *) * (D->n_entries - index - 1));
+  D->n_entries--;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_delete(DIRFILE *D, const char *field_code_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
+{
+  unsigned index;
+  int ret;
+  gd_entry_t *E;
+
+  dtrace("%p, \"%s\", 0x%X", D, field_code, flags);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, &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);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  ret = _GD_Delete(D, E, index, flags);
+
+  dreturn("%i", ret);
+  return ret;
+}
diff --git a/src/encoding.c b/src/encoding.c
new file mode 100644
index 0000000..5d7f8d7
--- /dev/null
+++ b/src/encoding.c
@@ -0,0 +1,1022 @@
+/* Copyright (C) 2008-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#ifdef USE_MODULES
+#ifdef USE_PTHREAD
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+static pthread_mutex_t gd_mutex_ = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+static int framework_initialised = 0;
+#endif
+
+/* encoding schemas */
+#define GD_EF_NULL_SET 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
+#ifdef USE_MODULES
+#define GD_EXT_ENCODING_NULL(sc,ex,ec,af,ff) \
+{ sc,ex,ec,af,ff,GD_EF_PROVIDES,GD_EF_NULL_SET }
+#define GD_EXT_ENCODING_GEN(sc,ex,ec,af,ff) \
+{ sc,ex,ec,af,ff,GD_EF_PROVIDES,GD_EF_GENERIC_SET }
+#else
+#define GD_EXT_ENCODING(sc,ex,ec,af,ff) { sc,ex,ec,af,ff,0,GD_INT_FUNCS }
+#define GD_EXT_ENCODING_NULL GD_EXT_ENCODING
+#define GD_EXT_ENCODING_GEN GD_EXT_ENCODING
+#endif
+struct encoding_t gd_ef_[GD_N_SUBENCODINGS] = {
+  { GD_UNENCODED, "", GD_EF_ECOR, NULL, "none", 0,
+    &_GD_GenericName, &_GD_RawOpen, &_GD_RawClose, &_GD_RawSeek, &_GD_RawRead,
+    &_GD_RawSize, &_GD_RawWrite, &_GD_RawSync, &_GD_GenericMove,
+    &_GD_GenericUnlink
+  },
+
+#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
+#define GD_INT_FUNCS \
+  &_GD_GenericName, &_GD_GzipOpen, &_GD_GzipClose, &_GD_GzipSeek, \
+  &_GD_GzipRead, &_GD_GzipSize, &_GD_GzipWrite, &_GD_GzipSync, \
+  &_GD_GenericMove, &_GD_GenericUnlink
+#else
+#define GD_EF_PROVIDES 0
+#define GD_INT_FUNCS GD_EF_NULL_SET
+#endif
+  GD_EXT_ENCODING_GEN(GD_GZIP_ENCODED, ".gz", GD_EF_ECOR | GD_EF_OOP, "Gzip",
+      "gzip"),
+#undef GD_INT_FUNCS
+#undef GD_EF_PROVIDES
+
+
+#ifdef USE_BZIP2
+#define GD_EF_PROVIDES \
+    GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE
+#define GD_INT_FUNCS \
+  &_GD_GenericName, &_GD_Bzip2Open, &_GD_Bzip2Close, &_GD_Bzip2Seek, \
+  &_GD_Bzip2Read, &_GD_Bzip2Size, NULL /* WRITE */, NULL /* SYNC */, \
+  &_GD_GenericMove, &_GD_GenericUnlink
+#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"),
+#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
+#define GD_INT_FUNCS \
+  &_GD_GenericName, &_GD_SlimOpen, &_GD_SlimClose, &_GD_SlimSeek, \
+  &_GD_SlimRead, &_GD_SlimSize, NULL /* WRITE */, NULL /* SYNC */, \
+  &_GD_GenericMove, &_GD_GenericUnlink
+#else
+#define GD_INT_FUNCS GD_EF_NULL_SET
+#define GD_EF_PROVIDES 0
+#endif
+  GD_EXT_ENCODING_GEN(GD_SLIM_ENCODED, ".slm", GD_EF_ECOR, "Slim", "slim"),
+#undef GD_INT_FUNCS
+#undef GD_EF_PROVIDES
+
+
+#ifdef USE_LZMA
+#define GD_EF_PROVIDES \
+    GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE
+#define GD_INT_FUNCS \
+  &_GD_GenericName, &_GD_LzmaOpen, &_GD_LzmaClose, &_GD_LzmaSeek, \
+  &_GD_LzmaRead, &_GD_LzmaSize, NULL /* WRITE */, NULL /* SYNC */, \
+  &_GD_GenericMove, &_GD_GenericUnlink
+#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
+
+
+  { 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_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
+  },
+
+
+#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
+#define GD_INT_FUNCS \
+  &_GD_ZzipName, &_GD_ZzipOpen, &_GD_ZzipClose, &_GD_ZzipSeek, &_GD_ZzipRead, \
+  &_GD_ZzipSize, NULL /* WRITE */, NULL /* SYNC */, NULL /* MOVE */, \
+  NULL /* UNLINK */
+#else
+#define GD_INT_FUNCS NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+#define GD_EF_PROVIDES 0
+#endif
+  GD_EXT_ENCODING_NULL(GD_ZZIP_ENCODED, NULL, GD_EF_ECOR | GD_EF_EDAT, "Zzip",
+      "zzip"),
+#undef GD_INT_FUNCS
+#undef GD_EF_PROVIDES
+
+
+#ifdef USE_ZZSLIM
+#define GD_EF_PROVIDES \
+    GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE
+#define GD_INT_FUNCS \
+  &_GD_ZzslimName, &_GD_ZzslimOpen, &_GD_ZzslimClose, &_GD_ZzslimSeek, \
+  &_GD_ZzslimRead, &_GD_ZzslimSize, NULL /* WRITE */, NULL /* SYNC */, \
+  NULL /* MOVE */, NULL /* UNLINK */
+#else
+#define GD_INT_FUNCS NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+#define GD_EF_PROVIDES 0
+#endif
+  GD_EXT_ENCODING_NULL(GD_ZZSLIM_ENCODED, NULL, GD_EF_ECOR | GD_EF_EDAT,
+      "Zzslim", "zzslim"),
+#undef GD_INT_FUNCS
+#undef GD_EF_PROVIDES
+
+
+  { GD_ENC_UNSUPPORTED, NULL, 0, "", "", 0,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+  }
+};
+
+void _GD_InitialiseFramework(void)
+{
+  dtracevoid();
+#ifdef USE_MODULES
+#ifdef USE_PTHREAD
+  pthread_mutex_lock(&gd_mutex_);
+#endif
+  if (!framework_initialised) {
+    framework_initialised = 1;
+    lt_dlinit();
+  }
+#ifdef USE_PTHREAD
+  pthread_mutex_unlock(&gd_mutex_);
+#endif
+#endif
+  dreturnvoid();
+}
+
+#define _GD_EncodingUnderstood(encoding) \
+  ((encoding == GD_UNENCODED || encoding == GD_SLIM_ENCODED || \
+    encoding == GD_GZIP_ENCODED || encoding == GD_BZIP2_ENCODED || \
+    encoding == GD_TEXT_ENCODED || encoding == GD_LZMA_ENCODED || \
+    encoding == GD_SIE_ENCODED))
+
+#ifdef USE_MODULES
+static void *_GD_ResolveSymbol(lt_dlhandle lib, struct encoding_t *restrict enc,
+    const char *restrict name)
+{
+  void* func;
+  char symbol[100];
+
+  dtrace("%p, %p, \"%s\"", lib, enc, name);
+  /* create the symbol name */
+  sprintf(symbol, "libgetdata%s_LTX_GD_%s%s", enc->affix, enc->affix, name);
+  symbol[10] -= 'A' - 'a';
+  func = lt_dlsym(lib, symbol);
+
+  dreturn("%p", func);
+  return func;
+}
+#endif
+
+int _GD_MissingFramework(int encoding, unsigned int funcs)
+{
+  int ret;
+
+  dtrace("%i, 0x%X", encoding, funcs);
+
+#ifdef USE_MODULES
+#ifdef USE_PTHREAD
+  pthread_mutex_lock(&gd_mutex_);
+#endif
+
+  /* set up the encoding library if required */
+  if (gd_ef_[encoding].provides) {
+    char *library;
+    lt_dlhandle lib;
+
+    /* make the library name */
+    library = (char *)malloc(sizeof(GETDATA_MODULEDIR) +
+        strlen(gd_ef_[encoding].affix) + sizeof(PACKAGE_VERSION) + 13);
+    if (!library) {
+      gd_ef_[encoding].provides = 0;
+#ifdef USE_PTHREAD
+      pthread_mutex_unlock(&gd_mutex_);
+#endif
+      dreturn("%i", 1);
+      return 1;
+    }
+
+    strcat(strcat(strcpy(library, GETDATA_MODULEDIR "/libgetdata"),
+          gd_ef_[encoding].affix), "-" PACKAGE_VERSION);
+    library[sizeof(GETDATA_MODULEDIR) + 10] -= 'A' - 'a';
+
+    /* open */
+    if ((lib = lt_dlopenext(library)) == NULL) {
+      /* if that didn't work, look for it in the search path */
+      if ((lib = lt_dlopenext(library + sizeof(GETDATA_MODULEDIR))) == NULL)
+      {
+        free(library);
+        gd_ef_[encoding].provides = 0;
+#ifdef USE_PTHREAD
+        pthread_mutex_unlock(&gd_mutex_);
+#endif
+        dreturn("%i", 1);
+        return 1;
+      }
+    }
+    free(library);
+
+    /* Try to resolve the symbols */
+    if (gd_ef_[encoding].provides & GD_EF_NAME)
+      gd_ef_[encoding].name = (gd_ef_name_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Name");
+    if (gd_ef_[encoding].provides & GD_EF_OPEN)
+      gd_ef_[encoding].open = (gd_ef_open_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Open");
+    if (gd_ef_[encoding].provides & GD_EF_CLOSE)
+      gd_ef_[encoding].close = (gd_ef_close_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Close");
+    if (gd_ef_[encoding].provides & GD_EF_SEEK)
+      gd_ef_[encoding].seek = (gd_ef_seek_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Seek");
+    if (gd_ef_[encoding].provides & GD_EF_READ)
+      gd_ef_[encoding].read = (gd_ef_read_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Read");
+    if (gd_ef_[encoding].provides & GD_EF_SIZE)
+      gd_ef_[encoding].size = (gd_ef_size_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Size");
+    if (gd_ef_[encoding].provides & GD_EF_WRITE)
+      gd_ef_[encoding].write = (gd_ef_write_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Write");
+    if (gd_ef_[encoding].provides & GD_EF_SYNC)
+      gd_ef_[encoding].sync = (gd_ef_sync_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Sync");
+    if (gd_ef_[encoding].provides & GD_EF_UNLINK)
+      gd_ef_[encoding].unlink = (gd_ef_unlink_t)_GD_ResolveSymbol(lib,
+          gd_ef_ + encoding, "Unlink");
+
+    /* we tried our best, don't bother trying again */
+    gd_ef_[encoding].provides = 0;
+  }
+#ifdef USE_PTHREAD
+  pthread_mutex_unlock(&gd_mutex_);
+#endif
+#endif
+
+  ret =
+    (funcs & GD_EF_NAME    && gd_ef_[encoding].name    == NULL) ||
+    (funcs & GD_EF_OPEN    && gd_ef_[encoding].open    == NULL) ||
+    (funcs & GD_EF_CLOSE   && gd_ef_[encoding].close   == NULL) ||
+    (funcs & GD_EF_SEEK    && gd_ef_[encoding].seek    == NULL) ||
+    (funcs & GD_EF_READ    && gd_ef_[encoding].read    == NULL) ||
+    (funcs & GD_EF_SIZE    && gd_ef_[encoding].size    == NULL) ||
+    (funcs & GD_EF_WRITE   && gd_ef_[encoding].write   == NULL) ||
+    (funcs & GD_EF_SYNC    && gd_ef_[encoding].sync    == NULL) ||
+    (funcs & GD_EF_UNLINK  && gd_ef_[encoding].unlink  == NULL);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+static int _GD_MoveOver(DIRFILE *restrict D, int fragment,
+    struct gd_raw_file_ *restrict file)
+{
+  const int dirfd = D->fragment[fragment].dirfd;
+#ifdef HAVE_FCHMOD
+  int fd;
+  struct stat stat_buf;
+  mode_t mode;
+#endif
+  dtrace("%p, %i, %p", D, fragment, file);
+
+#ifdef HAVE_FCHMOD
+  if (gd_StatAt(D, dirfd, file[0].name, &stat_buf, 0))
+    mode = 0644;
+  else
+    mode = stat_buf.st_mode;
+#endif
+
+  if (gd_RenameAt(D, dirfd, file[1].name, dirfd, file[0].name)) {
+    int move_errno = errno;
+    if (gd_UnlinkAt(D, dirfd, file[1].name, 0) == 0) {
+      free(file[1].name);
+      file[1].name = NULL;
+    }
+    errno = move_errno;
+    _GD_SetError(D, GD_E_UNCLEAN_DB, 0, D->fragment[fragment].cname, 0, NULL);
+    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);
+#endif
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* Close a raw file, taking care of cleaning-up out-of-place writes, and
+ * discarding temporary files */
+int _GD_FiniRawIO(DIRFILE *D, const gd_entry_t *E, int fragment, int flags)
+{
+  const int clotemp = (flags & GD_FINIRAW_CLOTEMP) ? 1 : 0;
+  const int old_mode = E->e->u.raw.file[0].mode;
+  const int oop_write = ((gd_ef_[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP)
+      && (old_mode & GD_FILE_WRITE)) ? 1 : 0;
+  dtrace("%p, %p, %i, 0x%X", D, E, fragment, flags);
+
+  if ((E->e->u.raw.file[clotemp].idata >= 0) ||
+      (clotemp == 0 && oop_write && (E->e->u.raw.file[1].idata >= 0)))
+  {
+    /* close the secondary file in write mode (but not temp mode) */
+    if (oop_write && E->e->u.raw.file[1].idata >= 0) {
+      if (E->e->u.raw.file[0].idata >= 0) {
+        /* copy the rest of the input to the output */
+        char buffer[GD_BUFFER_SIZE];
+        int n_read, n_wrote, n_to_write;
+
+        do {
+          n_to_write = n_read = (*gd_ef_[E->e->u.raw.file[0].subenc].read)(
+              E->e->u.raw.file, buffer, E->EN(raw,data_type), GD_BUFFER_SIZE);
+          if (n_read < 0) {
+            _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+                NULL);
+            dreturn("%i", -1);
+            return -1;
+          } else while (n_to_write > 0) {
+            n_wrote = (*gd_ef_[E->e->u.raw.file[0].subenc].write)(
+                E->e->u.raw.file + 1, buffer, E->EN(raw,data_type), n_to_write);
+            if (n_wrote < 0) {
+              _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+                  NULL);
+              dreturn("%i", -1);
+              return -1;
+            }
+            n_to_write -= n_wrote;
+          }
+        } while (n_read == GD_BUFFER_SIZE);
+      }
+
+      if ((*gd_ef_[E->e->u.raw.file[0].subenc].close)(E->e->u.raw.file + 1)) {
+        dreturn("%i", -1);
+        return -1;
+      }
+    }
+
+    /* close the file */
+    if ((E->e->u.raw.file[clotemp].idata >= 0) &&
+      (*gd_ef_[E->e->u.raw.file[clotemp].subenc].close)(E->e->u.raw.file +
+          clotemp))
+    {
+      if (D->error == GD_E_OK)
+        _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[clotemp].name, errno,
+            NULL);
+      dreturn("%i", 1);
+      return 1;
+    }
+  }
+
+  if (flags & GD_FINIRAW_DEFER) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* take care of moving things into place */
+  if (oop_write || clotemp) {
+    if (flags & GD_FINIRAW_DISCARD) {
+      /* Throw away the temporary file */
+      if (E->e->u.raw.file[1].name != NULL &&
+          gd_UnlinkAt(D, D->fragment[fragment].dirfd, E->e->u.raw.file[1].name,
+            0))
+      {
+        if (D->error == GD_E_OK)
+          _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+              NULL);
+        dreturn("%i", -1);
+        return -1;
+      }
+    } else {
+      /* Move the old file over the new file */
+      if (_GD_MoveOver(D, fragment, E->e->u.raw.file)) {
+        dreturn("%i", -1);
+        return -1;
+      }
+    }
+
+    free(E->e->u.raw.file[1].name);
+    E->e->u.raw.file[1].name = NULL;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* Perform a RAW field write */
+ssize_t _GD_WriteOut(const gd_entry_t *E, const struct encoding_t *enc,
+    const void *ptr, gd_type_t type, size_t n, int temp)
+{
+  ssize_t n_wrote;
+
+  dtrace("%p, %p, %p, 0x%X, %" PRNsize_t ", %i", E, enc, ptr, type, n, temp);
+
+  if (temp)
+    n_wrote = (*enc->write)(E->e->u.raw.file + 1, ptr, type, n);
+  else {
+    if (enc->flags & GD_EF_OOP) {
+      n_wrote = (*enc->write)(E->e->u.raw.file + 1, ptr, type, n);
+
+      if (n_wrote > 0 && E->e->u.raw.file[0].idata >= 0) {
+        /* advance the read pointer by the appropriate amount */
+        if ((*enc->seek)(E->e->u.raw.file, E->e->u.raw.file[0].pos + n_wrote,
+              E->EN(raw,data_type), GD_FILE_READ) < 0)
+        {
+          n_wrote = -1;
+        }
+      }
+    } else 
+      n_wrote = (*enc->write)(E->e->u.raw.file, ptr, type, n);
+  }
+
+  dreturn("%" PRNssize_t, n_wrote);
+  return n_wrote;
+}
+
+/* Open a raw file, if necessary; also check for required functions */
+int _GD_InitRawIO(DIRFILE *D, const gd_entry_t *E, const char *filebase,
+    int fragment, const struct encoding_t *enc, unsigned int funcs,
+    unsigned int mode, int swap)
+{
+  int temp_fd = -1;
+  const int touch = mode & GD_FILE_TOUCH;
+  int oop_write = 0;
+
+  dtrace("%p, %p, \"%s\", %i, %p, 0x%X, 0x%X, %i", D, E, filebase, fragment,
+      enc, funcs, mode, swap);
+
+  if (mode & (GD_FILE_WRITE | GD_FILE_TOUCH))
+    funcs |= GD_EF_WRITE;
+
+  mode &= ~GD_FILE_TOUCH;
+
+  if (!(mode & GD_FILE_TEMP)) {
+    if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_OPEN | funcs)) {
+      dreturn("%i", 1);
+      return 1;
+    }
+
+    enc = gd_ef_ + E->e->u.raw.file[0].subenc;
+    oop_write = ((enc->flags & GD_EF_OOP) && mode == GD_FILE_WRITE) ? 1 : 0;
+
+    /* Do nothing, if possible */
+    if (!touch && (((mode & GD_FILE_READ) && (E->e->u.raw.file[0].idata >= 0)
+            && (E->e->u.raw.file[0].mode & GD_FILE_READ))
+          || ((mode & GD_FILE_WRITE) && (E->e->u.raw.file[oop_write].idata >= 0)
+            && (E->e->u.raw.file[0].mode & GD_FILE_WRITE))))
+    {
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    /* close the file, if necessary */
+    if ((E->e->u.raw.file[0].idata >= 0 || ((enc->flags & GD_EF_OOP)
+            && (E->e->u.raw.file[1].idata >= 0)))
+        && ((mode == GD_FILE_READ && (enc->flags & GD_EF_OOP)
+            && (E->e->u.raw.file[0].mode & GD_FILE_WRITE))
+          || (mode == GD_FILE_WRITE
+            && !(E->e->u.raw.file[0].mode & GD_FILE_WRITE))))
+    {
+      if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) {
+        dreturn("%i", 1);
+        return 1;
+      }
+    }
+  }
+
+  if (filebase == NULL)
+    filebase = E->e->u.raw.filebase;
+
+  if (fragment == -1)
+    fragment = E->fragment_index;
+
+  if (mode & GD_FILE_TEMP) {
+    /* create temporary file in file[1] */
+    if ((*enc->name)(D, (const char*)D->fragment[E->fragment_index].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)
+    {
+      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);
+      dreturn("%i", 1);
+      return 1;
+    }
+    /* The read file in OOP mode is flagged as RW. */
+    mode = GD_FILE_RDWR;
+  }
+
+  /* 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,
+          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))
+    {
+      /* 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);
+        dreturn("%i", 1);
+        return 1;
+      }
+      E->e->u.raw.file[0].mode = mode;
+    }
+  }
+
+  if (touch)
+    _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP);
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* Figure out the encoding scheme */
+static unsigned long _GD_ResolveEncoding(DIRFILE *restrict D,
+    const char *restrict name, const char *restrict enc_data,
+    unsigned long scheme, int dirfd, struct gd_raw_file_ *restrict file)
+{
+  char *candidate;
+  int i;
+  const size_t len = strlen(name);
+  struct stat statbuf;
+
+  dtrace("%p, \"%s\", \"%s\", 0x%08lx, %i, %p", D, name, enc_data, scheme,
+      dirfd, file);
+
+  for (i = 0; gd_ef_[i].scheme != GD_ENC_UNSUPPORTED; i++) {
+    if (scheme == GD_AUTO_ENCODED || scheme == gd_ef_[i].scheme) {
+      if (gd_ef_[i].ext) {
+        candidate = (char *)malloc(len + strlen(gd_ef_[i].ext) + 1);
+        if (!candidate)
+          continue;
+
+        strcat(strcpy(candidate, name), gd_ef_[i].ext);
+      } else {
+        if (_GD_MissingFramework(i, GD_EF_NAME))
+          continue;
+
+        if ((*gd_ef_[i].name)(D, enc_data, file, name, 0, 1))
+          continue;
+
+        candidate = file->name;
+        file->name = NULL;
+      }
+
+      if (gd_StatAt(D, dirfd, candidate, &statbuf, 0) == 0)
+        if (S_ISREG(statbuf.st_mode)) {
+          if (file != NULL)
+            file->subenc = i;
+          free(candidate);
+          dreturn("%08lx", gd_ef_[i].scheme);
+          return gd_ef_[i].scheme;
+        }
+      free(candidate);
+    }
+  }
+
+  if (scheme != 0 && file != NULL) {
+    for (i = 0; gd_ef_[i].scheme != GD_ENC_UNSUPPORTED; i++)
+      if (scheme == gd_ef_[i].scheme) {
+        file->subenc = i;
+        dreturn("0x%08lx", gd_ef_[i].scheme);
+        return gd_ef_[i].scheme;;
+      }
+  }
+
+  dreturn("%08lx", (unsigned long)GD_AUTO_ENCODED);
+  return GD_AUTO_ENCODED;
+}
+
+int _GD_Supports(DIRFILE *D, const gd_entry_t *E, unsigned int funcs)
+{
+  dtrace("%p, %p, 0x%X", D, E, funcs);
+
+  /* Figure out the dirfile encoding type, if required */
+  if (D->fragment[E->fragment_index].encoding == GD_AUTO_ENCODED) {
+    D->fragment[E->fragment_index].encoding =
+      _GD_ResolveEncoding(D, E->e->u.raw.filebase,
+          (const char*)D->fragment[E->fragment_index].enc_data, GD_AUTO_ENCODED,
+          D->fragment[E->fragment_index].dirfd, E->e->u.raw.file);
+  }
+
+  /* If the encoding scheme is unknown, complain */
+  if (D->fragment[E->fragment_index].encoding == GD_AUTO_ENCODED) {
+    _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Figure out the encoding subtype, if required */
+  if (E->e->u.raw.file[0].subenc == GD_ENC_UNKNOWN)
+    _GD_ResolveEncoding(D, E->e->u.raw.filebase,
+        (const char*)D->fragment[E->fragment_index].enc_data,
+        D->fragment[E->fragment_index].encoding,
+        D->fragment[E->fragment_index].dirfd, E->e->u.raw.file);
+
+  /* check for our function(s) */
+  if (_GD_MissingFramework(E->e->u.raw.file[0].subenc, funcs)) {
+    _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  dreturn("%i", 1);
+  return 1;
+}
+
+int _GD_GenericName(DIRFILE *restrict D,
+    const char *restrict enc_data gd_unused_,
+    struct gd_raw_file_ *restrict file, const char *restrict base, int temp,
+    int resolv gd_unused_)
+{
+  dtrace("%p, <unused>, %p, \"%s\", %i, <unused>", D, file, base, temp);
+
+  if (file->name == NULL) {
+    file->D = D;
+    file->name = (char *)_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);
+  }
+
+  dreturn("%i (%s)", 0, file->name);
+  return 0;
+}
+
+/* This function assumes that the new encoding has no fragment->enc_data. */
+static void _GD_RecodeFragment(DIRFILE* D, unsigned long encoding, int fragment,
+    int move)
+{
+  unsigned int i, n_raw = 0;
+
+  dtrace("%p, %lx, %i, %i", D, encoding, fragment, move);
+
+  /* check protection */
+  if (D->fragment[fragment].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[fragment].cname);
+    dreturnvoid();
+    return;
+  }
+
+  if (move && encoding != D->fragment[fragment].encoding) {
+    gd_entry_t **raw_entry = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*) *
+        D->n_entries);
+
+    if (raw_entry == NULL) {
+      dreturnvoid();
+      return;
+    }
+
+    /* Because it may fail, the move must occur out-of-place and then be copied
+     * back over the affected files once success is assured */
+    for (i = 0; i < D->n_entries; ++i)
+      if (D->entry[i]->fragment_index == fragment &&
+          D->entry[i]->field_type == GD_RAW_ENTRY)
+      {
+        if (!_GD_Supports(D, D->entry[i], GD_EF_UNLINK))
+          continue;
+
+        /* add this raw field to the list */
+        raw_entry[n_raw++] = D->entry[i];
+
+        if (_GD_MogrifyFile(D, D->entry[i], encoding,
+              D->fragment[D->entry[i]->fragment_index].byte_sex,
+              D->fragment[D->entry[i]->fragment_index].frame_offset, 0, -1,
+              NULL))
+          break;
+      }
+
+    /* If successful, move the temporary file over the old file, otherwise
+     * remove the temporary files */
+    if (D->error) {
+      for (i = 0; i < n_raw; ++i)
+        _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD |
+            GD_FINIRAW_CLOTEMP);
+    } else
+      for (i = 0; i < n_raw; ++i) {
+        struct gd_raw_file_ temp;
+        memcpy(&temp, raw_entry[i]->e->u.raw.file, sizeof(temp));
+
+        raw_entry[i]->e->u.raw.file[0].name = NULL;
+        raw_entry[i]->e->u.raw.file[0].subenc =
+          raw_entry[i]->e->u.raw.file[1].subenc;
+
+        /* discard the old file */
+        _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD);
+
+        if ((*gd_ef_[temp.subenc].name)(D,
+              (const char*)D->fragment[raw_entry[i]->fragment_index].enc_data,
+              raw_entry[i]->e->u.raw.file, raw_entry[i]->e->u.raw.filebase, 0,
+              0))
+        {
+          raw_entry[i]->e->u.raw.file[0].name = temp.name;
+          raw_entry[i]->e->u.raw.file[0].subenc = temp.subenc;
+        } else if (_GD_FiniRawIO(D, raw_entry[i], fragment,
+              GD_FINIRAW_KEEP | GD_FINIRAW_CLOTEMP))
+        {
+          raw_entry[i]->e->u.raw.file[0].name = temp.name;
+          raw_entry[i]->e->u.raw.file[0].subenc = temp.subenc;
+        } else if ((*gd_ef_[temp.subenc].unlink)(D->fragment[fragment].dirfd,
+              &temp))
+        {
+          _GD_SetError(D, GD_E_UNCLEAN_DB, 0,
+              D->fragment[D->entry[i]->fragment_index].cname, 0, NULL);
+          D->flags |= GD_INVALID;
+          raw_entry[i]->e->u.raw.file[0].name = temp.name;
+          raw_entry[i]->e->u.raw.file[0].subenc = temp.subenc;
+        } else
+          free(temp.name);
+      }
+
+    free(raw_entry);
+
+    if (D->error) {
+      dreturnvoid();
+      return;
+    }
+  } else {
+    for (i = 0; i < D->n_entries; ++i)
+      if (D->entry[i]->fragment_index == fragment &&
+          D->entry[i]->field_type == GD_RAW_ENTRY)
+      {
+        /* close the old file */
+        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;
+        }
+        /* reset encoding subscheme. */
+        D->entry[i]->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN;
+
+        /* delete name */
+        free(D->entry[i]->e->u.raw.file[0].name);
+        D->entry[i]->e->u.raw.file[0].name = NULL;
+      }
+  }
+
+  free(D->fragment[fragment].enc_data);
+  D->fragment[fragment].enc_data = NULL;
+  D->fragment[fragment].encoding = encoding;
+  D->fragment[fragment].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+
+  dreturnvoid();
+}
+
+int gd_alter_encoding(DIRFILE* D, unsigned long encoding, int fragment,
+    int move)
+{
+  int i;
+
+  dtrace("%p, %lu, %i, %i", D, (unsigned long)encoding, fragment, move);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment < GD_ALL_FRAGMENTS || fragment >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (!_GD_EncodingUnderstood(encoding)) {
+    _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_TARGET, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  if (fragment == GD_ALL_FRAGMENTS) {
+    for (i = 0; i < D->n_fragment; ++i) {
+      _GD_RecodeFragment(D, encoding, i, move);
+
+      if (D->error)
+        break;
+    }
+  } else
+    _GD_RecodeFragment(D, encoding, fragment, move);
+
+  dreturn("%i", (D->error) ? -1 : 0);
+  return (D->error) ? -1 : 0;
+}
+
+unsigned long gd_encoding(DIRFILE* D, int fragment) gd_nothrow
+{
+  unsigned long reported_encoding = GD_ENC_UNSUPPORTED;
+  unsigned int i;
+
+  dtrace("%p, %i", D, fragment);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (fragment < 0 || fragment >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  /* Attempt to figure out the encoding, if it's not known */
+  if (D->fragment[fragment].encoding == GD_AUTO_ENCODED) {
+    /* locate a RAW field in this fragment */
+    for (i = 0; i < D->n_entries; ++i)
+      if (D->entry[i]->fragment_index == fragment &&
+          D->entry[i]->field_type == GD_RAW_ENTRY)
+      {
+        D->fragment[fragment].encoding =
+          _GD_ResolveEncoding(D, D->entry[i]->e->u.raw.filebase,
+              (const char*)D->fragment[fragment].enc_data, GD_AUTO_ENCODED,
+              D->fragment[fragment].dirfd, D->entry[i]->e->u.raw.file);
+
+        if (D->fragment[fragment].encoding != GD_AUTO_ENCODED)
+          break;
+      }
+  }
+
+  if (D->fragment[fragment].encoding != GD_AUTO_ENCODED)
+    reported_encoding = D->fragment[fragment].encoding;
+
+  dreturn("%lx", (unsigned long)reported_encoding);
+  return reported_encoding;
+}
+
+/* This is basically the non-existant POSIX funcion mkstempat.  There are two
+ * approaches we could take here:
+ * 1) fchdir to dirfd, use mkstemp to grab a file descriptor; fchdir back to
+ *    cwd, but this isn't thread-safe, so we're stuck with:
+ * 2) use mktemp to generate a "unique" file name, and then try to openat it
+ *    exclusively; repeat as necessary.
+ */
+int _GD_MakeTempFile(const DIRFILE *D gd_unused_d, int dirfd, char *tmpl)
+{
+  int fd = -1;
+  char *tmp = strdup(tmpl);
+
+  dtrace("%p, %i, \"%s\"", D, dirfd, tmpl);
+
+  if (!tmp) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  do {
+    strcpy(tmpl, tmp);
+    mktemp(tmpl);
+    if (tmpl[0] == 0) {
+      free(tmp);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    fd = gd_OpenAt(D, dirfd, tmpl, O_RDWR | O_CREAT | O_EXCL, 0666);
+  } while (errno == EEXIST);
+
+  free(tmp);
+
+  dreturn("%i", fd);
+  return fd;
+}
+
+int _GD_GenericUnlink(int dirfd, struct gd_raw_file_* file)
+{
+  int r;
+
+  dtrace("%i, %p", dirfd, file);
+
+  r = gd_UnlinkAt(file->D, dirfd, file->name, 0);
+
+  dreturn("%i", r);
+  return r;
+}
+
+int _GD_GenericMove(int olddirfd, struct gd_raw_file_ *restrict file,
+    int newdirfd, char *restrict new_path)
+{
+  int r, rename_errno;
+
+  dtrace("%i, %p, %i, \"%s\"", olddirfd, file, newdirfd, new_path);
+
+  r = gd_RenameAt(file->D, olddirfd, file->name, newdirfd, new_path);
+
+  rename_errno = errno;
+
+  if (!r) {
+    free(file->name);
+    file->name = new_path;
+  } else
+    free(new_path);
+
+  errno = rename_errno;
+
+  dreturn("%i", r);
+  return r;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/endian.c b/src/endian.c
new file mode 100644
index 0000000..5f4dcff
--- /dev/null
+++ b/src/endian.c
@@ -0,0 +1,213 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+static void _GD_ByteSwapFragment(DIRFILE* D, unsigned long byte_sex,
+    int fragment, int move)
+{
+  unsigned int i, n_raw = 0;
+
+  dtrace("%p, %lx, %i, %i", D, (unsigned long)byte_sex, fragment, move);
+
+  byte_sex = (
+#ifdef WORDS_BIGENDIAN
+    (byte_sex & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN
+#else
+    (byte_sex & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN
+#endif
+    ) | (byte_sex & GD_ARM_FLAG);
+
+  /* check protection */
+  if (D->fragment[fragment].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[fragment].cname);
+    dreturnvoid();
+    return;
+  }
+
+  if (move && byte_sex != D->fragment[fragment].byte_sex) {
+    gd_entry_t **raw_entry = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*) *
+        D->n_entries);
+
+    if (raw_entry == NULL) {
+      dreturnvoid();
+      return;
+    }
+
+    /* Because it may fail, the move must occur out-of-place and then be copied
+     * back over the affected files once success is assured */
+    for (i = 0; i < D->n_entries; ++i)
+      if (D->entry[i]->fragment_index == fragment &&
+          D->entry[i]->field_type == GD_RAW_ENTRY)
+      {
+        /* determine encoding scheme */
+        if (!_GD_Supports(D, D->entry[i], 0))
+          break;
+
+        /* if the field's data type is one byte long, and no in-framework
+         * byte-swapping is required, do nothing */
+        if (D->entry[i]->e->u.raw.size == 1 &&
+            !(gd_ef_[D->entry[i]->e->u.raw.file[0].subenc].flags & GD_EF_SWAP))
+          continue;
+
+        /* add this raw field to the list */
+        raw_entry[n_raw++] = D->entry[i];
+
+        if (_GD_MogrifyFile(D, D->entry[i],
+              D->fragment[D->entry[i]->fragment_index].encoding, byte_sex,
+              D->fragment[D->entry[i]->fragment_index].frame_offset, 0, -1,
+              NULL))
+          break;
+      }
+
+    /* If successful, move the temporary file over the old file, otherwise
+     * remove the temporary files */
+    if (D->error) {
+      for (i = 0; i < n_raw; ++i)
+        _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD |
+            GD_FINIRAW_CLOTEMP);
+    } else {
+      for (i = 0; i < n_raw; ++i)
+        _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_KEEP |
+            GD_FINIRAW_CLOTEMP);
+    }
+
+    free(raw_entry);
+
+    if (D->error) {
+      dreturnvoid();
+      return;
+    }
+  }
+
+  D->fragment[fragment].byte_sex = byte_sex;
+  D->fragment[fragment].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+
+  dreturnvoid();
+}
+
+int gd_alter_endianness(DIRFILE* D, unsigned long byte_sex, int fragment,
+    int move)
+{
+  int i;
+
+  dtrace("%p, %lx, %i, %i", D, (unsigned long)byte_sex, fragment, move);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment < GD_ALL_FRAGMENTS || fragment >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (byte_sex != GD_BIG_ENDIAN && byte_sex != GD_LITTLE_ENDIAN) {
+    _GD_SetError(D, GD_E_ARGUMENT, GD_E_ARG_ENDIANNESS, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  if (fragment == GD_ALL_FRAGMENTS) {
+    for (i = 0; i < D->n_fragment; ++i) {
+      _GD_ByteSwapFragment(D, byte_sex, i, move);
+
+      if (D->error)
+        break;
+    }
+  } else
+    _GD_ByteSwapFragment(D, byte_sex, fragment, move);
+
+  dreturn("%i", (D->error) ? -1 : 0);
+  return (D->error) ? -1 : 0;
+}
+
+unsigned long gd_endianness(DIRFILE* D, int fragment) gd_nothrow
+{
+  dtrace("%p, %i", D, fragment);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (fragment < 0 || fragment >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  dreturn("0x%lx", (unsigned long)D->fragment[fragment].byte_sex);
+  return D->fragment[fragment].byte_sex;
+}
+
+void _GD_ArmEndianise(uint64_t* databuffer, int is_complex, size_t ns)
+{
+  uint64_t *p;
+  dtrace("%p, %i, %zi", databuffer, is_complex, ns);
+
+  if (is_complex)
+    ns *= 2;
+
+  for (p = databuffer; p < databuffer + ns; ++p)
+    *p = ((*p & 0xffffffff) << 32) | ((*p & 0xffffffff00000000ULL) >> 32);
+
+  dreturnvoid();
+}
+
+void _GD_FixEndianness(void* databuffer, size_t size, size_t ns)
+{
+  size_t i;
+
+  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;
+  }
+
+  dreturnvoid();
+}
diff --git a/src/entry.c b/src/entry.c
new file mode 100644
index 0000000..316a47a
--- /dev/null
+++ b/src/entry.c
@@ -0,0 +1,871 @@
+/* Copyright (C) 2008-2013, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+void _GD_FreeE(DIRFILE *restrict D, gd_entry_t *restrict entry, int priv)
+{
+  int i;
+
+  dtrace("%p, %p, %i", D, entry, priv);
+
+  if (!entry || entry->field_type == GD_NO_ENTRY) {
+    dreturnvoid();
+    return;
+  }
+
+  free(entry->field);
+
+  switch(entry->field_type) {
+    case GD_LINCOM_ENTRY:
+      for (i = 0; i < entry->EN(lincom,n_fields); ++i) {
+        free(entry->in_fields[i]);
+        free(entry->scalar[i]);
+        free(entry->scalar[i + GD_MAX_LINCOM]);
+      }
+      break;
+    case GD_LINTERP_ENTRY:
+      free(entry->in_fields[0]);
+      free(entry->EN(linterp,table));
+      if (priv) {
+        if (entry->e->u.linterp.table_dirfd > 0)
+          _GD_ReleaseDir(D, entry->e->u.linterp.table_dirfd);
+        free(entry->e->u.linterp.table_file);
+        free(entry->e->u.linterp.lut);
+      }
+      break;
+    case GD_DIVIDE_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+      free(entry->in_fields[1]);
+      free(entry->in_fields[0]);
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      free(entry->scalar[0]);
+      free(entry->scalar[1]);
+      free(entry->in_fields[0]);
+      break;
+    case GD_PHASE_ENTRY:
+    case GD_RECIP_ENTRY:
+      free(entry->scalar[0]);
+      free(entry->in_fields[0]);
+      break;
+    case GD_POLYNOM_ENTRY:
+      free(entry->in_fields[0]);
+      for (i = 0; i <= entry->EN(polynom,poly_ord); ++i)
+        free(entry->scalar[i]);
+      break;
+    case GD_STRING_ENTRY:
+      if (priv)
+        free(entry->e->u.string);
+      break;
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+      if (priv) {
+        free(entry->e->u.scalar.client);
+        free(entry->e->u.scalar.d);
+      }
+      break;
+    case GD_RAW_ENTRY:
+      free(entry->scalar[0]);
+      if (priv) {
+        free(entry->e->u.raw.filebase);
+        free(entry->e->u.raw.file[0].name);
+        free(entry->e->u.raw.file[1].name);
+      }
+      break;
+    case GD_WINDOW_ENTRY:
+      free(entry->scalar[0]);
+      free(entry->in_fields[0]);
+      free(entry->in_fields[1]);
+      break;
+    case GD_MPLEX_ENTRY:
+      free(entry->scalar[0]);
+      free(entry->scalar[1]);
+      free(entry->in_fields[0]);
+      free(entry->in_fields[1]);
+      break;
+    case GD_INDEX_ENTRY:
+    case GD_NO_ENTRY:
+      break;
+    default:
+      if (entry->field_type == GD_ALIAS_ENTRY)
+        free(entry->in_fields[0]);
+  }
+
+  if (priv) {
+    free(entry->e->alias_list);
+    for (i = 0; i < GD_N_ENTRY_LISTS; ++i)
+      free(entry->e->entry_list[i]);
+    free(entry->e->string_value_list);
+    free(entry->e->const_value_list);
+    if (entry->e->carray_value_list)
+      for (i = 0; entry->e->carray_value_list[i].n != 0; ++i)
+        free(entry->e->carray_value_list[i].d);
+    free(entry->e->carray_value_list);
+    if (entry->e->n_meta > -1)
+      free(entry->e->p.meta_entry);
+    free(entry->e);
+    free(entry);
+  }
+
+  dreturnvoid();
+  return;
+}
+
+gd_entry_t* gd_free_entry_strings(gd_entry_t* entry) gd_nothrow
+{
+  dtrace("%p", entry);
+
+  _GD_FreeE(NULL, entry, 0);
+
+  dreturn("%p", entry);
+  return entry;
+}
+
+static void _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;
+  char* field_code;
+  const char* scalar = E->scalar[i];
+  int index = E->scalar_ind[i];
+
+  dtrace("%p, %p, %i, %i, %p, %i", D, E, i, type, data, err);
+
+  if (scalar != NULL) {
+    C = _GD_FindFieldAndRepr(D, scalar, &field_code, &repr, NULL, 0, 1);
+
+    if (D->error) {
+      dreturnvoid();
+      return;
+    }
+
+    if (C == NULL) {
+      if (err)
+        _GD_SetError(D, GD_E_BAD_SCALAR, GD_E_SCALAR_CODE, E->field, 0,
+            field_code);
+    } else if (C->field_type != GD_CONST_ENTRY &&
+        C->field_type != GD_CARRAY_ENTRY)
+    {
+      if (err)
+        _GD_SetError(D, GD_E_BAD_SCALAR, GD_E_SCALAR_TYPE, E->field, 0,
+            field_code);
+    } else {
+      if (C->field_type == GD_CONST_ENTRY) {
+        index = 0;
+        E->scalar_ind[i] = -1;
+      } else if (index < 0) {
+        /* a CARRAY masquerading as a CONST; default to the first element */
+        index = E->scalar_ind[i] = 0;
+      }
+
+      if ((D->flags & GD_ACCMODE) == GD_RDWR)
+        ptr = _GD_Realloc(D, C->e->u.scalar.client,
+            (C->e->u.scalar.n_client + 1) * sizeof(gd_entry_t*));
+
+      /* err = 0 means we're only interested in initialising the client list */
+      if (err)
+        _GD_DoField(D, C, repr, index, 1, type, data);
+
+      if (ptr) {
+        C->e->u.scalar.client = (gd_entry_t **)ptr;
+        C->e->u.scalar.client[C->e->u.scalar.n_client++] = E;
+      }
+    }
+
+    if (field_code != scalar)
+      free(field_code);
+  }
+
+  dreturnvoid();
+}
+
+/* resolve non-literal scalars */
+int _GD_CalculateEntry(DIRFILE *restrict D, gd_entry_t *restrict E, int err)
+{
+  int i;
+
+  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);
+      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 (cimag(E->EN(polynom,ca)[i]))
+          E->comp_scal = 1;
+
+        if (D->error)
+          break;
+      }
+      break;
+    case GD_LINCOM_ENTRY:
+      E->comp_scal = 0;
+      for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+        _GD_GetScalar(D, E, i, GD_COMPLEX128, &E->EN(lincom,cm)[i], 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 (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;
+      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);
+      break;
+    case GD_PHASE_ENTRY:
+      _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);
+          break;
+        case GD_WINDOP_SET:
+        case GD_WINDOP_CLR:
+          _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);
+          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);
+      break;
+    case GD_NO_ENTRY:
+    case GD_LINTERP_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_ALIAS_ENTRY:
+      break;
+  }
+
+  if (!D->error)
+    E->e->calculated = 1;
+
+  dreturn("%i", E->e->calculated);
+  return E->e->calculated;
+}
+
+char* gd_raw_filename(DIRFILE* D, const char* field_code_in) gd_nothrow
+{
+  int repr;
+  char *field_code, *filename;
+  gd_entry_t *E;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* Check field */
+  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
+
+  if (D->error) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (E->field_type != GD_RAW_ENTRY) {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (E->e->u.raw.file[0].name == NULL) {
+    /* ensure encoding sybtype is known */
+    if (!_GD_Supports(D, E, GD_EF_NAME)) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    if (E->e->u.raw.file[0].subenc == GD_ENC_UNKNOWN) {
+      _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET, NULL, 0, NULL);
+      dreturn("%p", NULL);
+      return NULL;
+    } else if ((*gd_ef_[E->e->u.raw.file[0].subenc].name)(D,
+          (const char*)D->fragment[E->fragment_index].enc_data,
+          E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
+    {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  }
+
+  filename = _GD_MakeFullPath(D, D->fragment[E->fragment_index].dirfd,
+      E->e->u.raw.file->name, 1);
+
+  dreturn("%p", filename);
+  return filename;
+}
+
+int gd_entry(DIRFILE* D, const char* field_code_in, gd_entry_t* entry)
+  gd_nothrow
+{
+  int i, repr;
+  gd_entry_t *E;
+  char* field_code;
+
+  dtrace("%p, \"%s\", %p", D, field_code_in, entry);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  /* get rid of the represenation, if any */
+  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  /* Calculate the entry, if necessary */
+  if (!E->e->calculated)
+    _GD_CalculateEntry(D, E, 1);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* now copy to the user supplied buffer */
+  memcpy(entry, E, sizeof(gd_entry_t));
+  entry->e = NULL;
+
+  /* duplicate strings */
+  entry->field = strdup(E->field);
+
+  switch(E->field_type) {
+    case GD_LINCOM_ENTRY:
+      for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+        entry->in_fields[i] = strdup(E->in_fields[i]);
+        if (E->scalar[i])
+          entry->scalar[i] = strdup(E->scalar[i]);
+        if (E->scalar[i + GD_MAX_LINCOM])
+          entry->scalar[i + GD_MAX_LINCOM] = strdup(E->scalar[i +
+              GD_MAX_LINCOM]);
+      }
+      break;
+    case GD_LINTERP_ENTRY:
+      entry->in_fields[0] = strdup(E->in_fields[0]);
+      entry->EN(linterp,table) = strdup(E->EN(linterp,table));
+      break;
+    case GD_POLYNOM_ENTRY:
+      entry->in_fields[0] = strdup(E->in_fields[0]);
+      for (i = 0; i <= E->EN(polynom,poly_ord); ++i)
+        if (E->scalar[i])
+          entry->scalar[i] = strdup(E->scalar[i]);
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      entry->in_fields[0] = strdup(E->in_fields[0]);
+      entry->in_fields[1] = strdup(E->in_fields[1]);
+      break;
+    case GD_RECIP_ENTRY:
+    case GD_PHASE_ENTRY:
+      entry->in_fields[0] = strdup(E->in_fields[0]);
+      if (E->scalar[0])
+        entry->scalar[0] = strdup(E->scalar[0]);
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      entry->in_fields[0] = strdup(E->in_fields[0]);
+      if (E->scalar[0])
+        entry->scalar[0] = strdup(E->scalar[0]);
+      if (E->scalar[1])
+        entry->scalar[1] = strdup(E->scalar[1]);
+      break;
+    case GD_RAW_ENTRY:
+      if (E->scalar[0])
+        entry->scalar[0] = strdup(E->scalar[0]);
+      break;
+    case GD_WINDOW_ENTRY:
+      entry->in_fields[0] = strdup(E->in_fields[0]);
+      entry->in_fields[1] = strdup(E->in_fields[1]);
+      if (E->scalar[0])
+        entry->scalar[0] = strdup(E->scalar[0]);
+      break;
+    case GD_MPLEX_ENTRY:
+      entry->in_fields[0] = strdup(E->in_fields[0]);
+      entry->in_fields[1] = strdup(E->in_fields[1]);
+      if (E->scalar[0])
+        entry->scalar[0] = strdup(E->scalar[0]);
+      if (E->scalar[1])
+        entry->scalar[1] = strdup(E->scalar[1]);
+      break;
+    case GD_INDEX_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+      break;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+const char *gd_alias_target(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  gd_entry_t *E;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL);
+
+  if (E == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (E->field_type != GD_ALIAS_ENTRY) {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  dreturn("\"%s\"", E->in_fields[0]);
+  return E->in_fields[0];
+}
+
+const char **gd_aliases(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  gd_entry_t *E;
+  int n, j = 1;
+  unsigned u;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  n = gd_naliases(D, field_code) + 1;
+
+  if (D->error) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
+
+  if (E == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E->e->alias_list = (const char**)_GD_Realloc(D, E->e->alias_list,
+      sizeof(const char *) * n);
+
+  if (D->error) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E->e->alias_list[0] = E->field;
+
+  for (u = 0; u < D->n_entries; ++u)
+    if (D->entry[u]->field_type == GD_ALIAS_ENTRY &&
+        D->entry[u]->e->entry[0] == E)
+    {
+      E->e->alias_list[j++] = D->entry[u]->field;
+    }
+
+  /* terminate */
+  E->e->alias_list[j] = NULL;
+
+  dreturn("%p", E->e->alias_list);
+  return E->e->alias_list;
+}
+
+int gd_naliases(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  gd_entry_t *E;
+  int n = 1;
+  unsigned u;
+
+  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;
+  }
+
+  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;
+  }
+
+  for (u = 0; u < D->n_entries; ++u)
+    if (D->entry[u]->field_type == GD_ALIAS_ENTRY &&
+        D->entry[u]->e->entry[0] == E)
+    {
+      n++;
+    }
+
+  dreturn("%i", n);
+  return n;
+}
+
+gd_entype_t gd_entry_type(DIRFILE* D, const char* field_code_in) gd_nothrow
+{
+  gd_entry_t* E;
+  char* field_code;
+  int repr;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", GD_NO_ENTRY);
+    return GD_NO_ENTRY;
+  }
+
+  _GD_ClearError(D);
+
+  /* get rid of the represenation, if any */
+  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
+
+  if (D->error) {
+    dreturn("%i", GD_NO_ENTRY);
+    return GD_NO_ENTRY;
+  }
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  dreturn("%i", E->field_type);
+  return E->field_type;
+}
+
+int gd_fragment_index(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  gd_entry_t *E;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL);
+
+  if (E == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", E->fragment_index);
+  return E->fragment_index;
+}
+
+int gd_hide(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  gd_entry_t *E;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  } else if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL);
+
+  if (D->error) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (!E->hidden) {
+    E->hidden = 1;
+    D->fragment[E->fragment_index].modified = 1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_hidden(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  gd_entry_t *E;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL);
+
+  if (D->error) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", E->hidden);
+  return E->hidden;
+}
+
+int gd_unhide(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  gd_entry_t *E;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  } else if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL);
+
+  if (D->error) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (E->hidden) {
+    E->hidden = 0;
+    D->fragment[E->fragment_index].modified = 1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_validate(DIRFILE *D, const char *field_code_in) gd_nothrow
+{
+  int i, repr;
+  gd_entry_t* E;
+  char *field_code;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  /* get rid of the representation, if any */
+  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  /* calculate scalars */
+  if (!E->e->calculated)
+    _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);
+      break;
+    case GD_DIVIDE_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      _GD_BadInput(D, E, 1, 1);
+      /* fallthrough */
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_RECIP_ENTRY:
+      _GD_BadInput(D, E, 0, 1);
+      /* Fallthrough */
+    case GD_RAW_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+      break;
+  }
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+char *gd_linterp_tablename(DIRFILE *D, const char *field_code_in) gd_nothrow
+{
+  int repr;
+  gd_entry_t *E;
+  char *field_code, *table;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, 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);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* initialise */
+  if (E->e->u.linterp.table_file == NULL)
+    if (_GD_SetTablePath(D, E, E->e)) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+  table = _GD_MakeFullPath(D, E->e->u.linterp.table_dirfd,
+      E->e->u.linterp.table_file, 1);
+
+  dreturn("%s", table);
+  return table;
+}
diff --git a/src/errors.c b/src/errors.c
new file mode 100644
index 0000000..110ff69
--- /dev/null
+++ b/src/errors.c
@@ -0,0 +1,364 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* Error strings. */
+static const struct {
+  int error;
+  int suberror; /* 0 = any */
+  const char* format; /* 1 = suberror, 2 = file, 3 = line, 4 = string */
+  int adderr; /* 1 = append strerror(line), 2 = append sterror(suberror) */
+} error_string[] = {
+  /* GD_E_OPEN: 1 = suberror, 2 = filename */
+  { GD_E_OPEN, GD_E_OPEN_NOT_DIRFILE, "Not a dirfile: {2}", 0 },
+  { GD_E_OPEN, GD_E_OPEN_NO_ACCESS,
+    "Cannot open dirfile {2}: permission denied", 0 },
+  { GD_E_OPEN, GD_E_OPEN_NOT_EXIST, "Dirfile does not exist: {2}", 0 },
+  { GD_E_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 },
+  { GD_E_FORMAT, GD_E_FORMAT_BAD_SPF,
+    "Samples per frame out of range on line {3} of {2}: {4}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_N_FIELDS,
+    "LINCOM field count out of range on line {3} of {2}: {4}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_N_TOK, "Missing token on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_NUMBITS,
+    "Numbits out of range on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_BITNUM,
+    "Starting bit out of range on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_BITSIZE,
+    "End of bitfield out of bounds on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_CHARACTER,
+    "Invalid character on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_BAD_LINE, "Line {3} of {2} indecipherable", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_RES_NAME,
+    "Field name is reserved on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_ENDIAN,
+    "Unrecognised endianness on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_BAD_NAME,
+    "Bad field name on line {3} of {2}: {4}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_UNTERM,
+    "Unterminated token on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_METARAW,
+    "Invalid metafield type on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_NO_FIELD,
+    "Field code not found on line {3} of {2}: {4}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_DUPLICATE,
+    "Field code on line {3} of {2} already defined: {4}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_LOCATION,
+    "META in a different file than parent ({4}) on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_PROTECT,
+    "Bad protection level on line {3} of {2}: {4}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_LITERAL,
+    "Unexpected characters in scalar literal ({4}) on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_WINDOP,
+    "Unrecognised operator ({4}) on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_META_META,
+    "Cannot attach meta field to meta field {4} on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_ALIAS,
+    "Cannot use alias {4} as parent to a meta field on line {3} of {2}", 0 },
+  { GD_E_FORMAT, GD_E_FORMAT_MPLEXVAL,
+    "Bad MPLEX period ({4}) on line {3} of {2}", 0 },
+  /* GD_E_TRUNC: 1 = suberror, 2 = filename. 3 = errno */
+  { GD_E_TRUNC, 0, "Error truncating {2}: ", 1 },
+  /* GD_E_CREAT: 1 = suberror, 2 = filename, 3 = errno */
+  { GD_E_CREAT, GD_E_CREAT_DIR, "Unable to create directory {2}: ", 1 },
+  { GD_E_CREAT, GD_E_CREAT_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_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_INTERNAL_ERROR: 2 = source file, 3 = line */
+  { GD_E_INTERNAL_ERROR, 0, "Internal error at [{2},{3}]; "
+    "please report to " PACKAGE_BUGREPORT , 0 },
+  /* GD_E_ALLOC: (nothing) */
+  { GD_E_ALLOC, 0, "Memory allocation error", 0 },
+  /* GD_E_RANGE: (nothing) */
+  { GD_E_RANGE, GD_E_OUT_OF_RANGE, "Request out of range", 0 },
+  { GD_E_RANGE, GD_E_SINGULAR_RANGE, "Singular range", 0 },
+  /* GD_E_OPEN_LINFILE: 1 = suberror, 2 = errno, 4 = lutfile */
+  { GD_E_OPEN_LINFILE, GD_E_LINFILE_LENGTH, "LINTERP table {4} too short", 0 },
+  { GD_E_OPEN_LINFILE, 0, "Error opening LINTERP table {4}: ", 2 },
+  /* GD_E_RECURSE_LEVEL: 2 = file; 3 = line; 4 = name */
+  { GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE,
+    "Recursion too deep resolving field {4}", 0 },
+  { GD_E_RECURSE_LEVEL, GD_E_RECURSE_INCLUDE,
+    "Recursion too deep including {4} on line {3} of {2}", 0 },
+  /* GD_E_BAD_DIRFILE: (nothing) */
+  { GD_E_BAD_DIRFILE, 0, "Invalid dirfile", 0 },
+  /* GD_E_BAD_FIELD_TYPE: 4 = fieldcode */
+  { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, "No method to write field {4}", 0 },
+  { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, "Invalid field type for {4}", 0 },
+  { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_MATCH, "Field type mismatch for {4}", 0 },
+  /* GD_E_ACCMODE: (nothing) */
+  { GD_E_ACCMODE, 0, "Dirfile has been opened read-only", 0 },
+  /* GD_E_UNSUPPORTED: (nothing) */
+  { GD_E_UNSUPPORTED, 0, "Operation not supported by current encoding scheme",
+    0 },
+  /* GD_E_UNKNOWN_ENCODING: (nothing) */
+  { GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET,
+    "Unable to determine encoding scheme", 0 },
+  { GD_E_UNKNOWN_ENCODING, GD_E_UNENC_TARGET, "Unknown ouput encoding scheme",
+    0 },
+  /* GD_E_BAD_ENTRY: 3 = parameter */
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_TYPE, "Invalid entry type: {3}", 0 },
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_SPF, "Samples per frame out of range: {3}", 0 },
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, "LINCOM field count out of range: {3}",
+    0 },
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_BITNUM, "Starting bit out of range: {3}", 0 },
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_NUMBITS, "Numbits out of range: {3}", 0 },
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_BITSIZE, "End of bitfield out of range: {3}", 0},
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_METARAW, "Invalid metafield type: {3}", 0 },
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, "POLYNOM order out of range: {3}", 0 },
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_WINDOP, "Unrecognised WINDOW operator: {3}", 0 },
+  { GD_E_BAD_ENTRY, GD_E_ENTRY_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 },
+  /* GD_E_DIMENSION: 2 = parent field (if any), 4 = field code */
+  { GD_E_DIMENSION, GD_E_DIM_FORMAT, "Scalar field {4} found where vector "
+    "field expected in definition of {2}", 0 },
+  { GD_E_DIMENSION, GD_E_DIM_CALLER,
+    "Vector field expected, but scalar field given: {4}", 0 },
+  /* GD_E_BAD_INDEX: 3 = index */
+  { GD_E_BAD_INDEX, 0, "Invalid fragment index: {3}", 0 },
+  /* GD_E_BAD_SCALAR: 2 = parent field, 4 = scalar field */
+  { GD_E_BAD_SCALAR, GD_E_SCALAR_CODE,
+    "Scalar field {4} not found in definition of {2}", 0 },
+  { GD_E_BAD_SCALAR, GD_E_SCALAR_TYPE,
+    "Scalar field {4} has wrong type in definition of {2}", 0 },
+  /* GD_E_BAD_REFERENCE: 4 = field name */
+  { GD_E_BAD_REFERENCE, GD_E_REFERENCE_CODE,
+    "REFERENCE field code not found: {4}", 0 },
+  { GD_E_BAD_REFERENCE, GD_E_REFERENCE_TYPE,
+    "Bad field type for REFERENCE field: {4}", 0 },
+  /* GD_E_PROTECTED: 4 = fragment name */
+  { GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, "Fragment is protected: {4}", 0 },
+  { GD_E_PROTECTED, GD_E_PROTECTED_DATA, "Data for fragment is protected: {4}",
+    0 },
+  /* GD_E_DELETE: 2 = client field, 4 = deleted field */
+  { GD_E_DELETE, GD_E_DEL_META, "Cannot delete field {4} with metafields", 0 },
+  { GD_E_DELETE, GD_E_DEL_CONST,
+    "Cannot delete field {4} used in definiton of field {2}", 0 },
+  { GD_E_DELETE, GD_E_DEL_DERIVED,
+    "Cannot delete field {4} used as input to field {2}", 0 },
+  { GD_E_DELETE, GD_E_DEL_ALIAS, "Cannot delete field {4} with aliases", 0 },
+  /* GD_E_ARGUMENT: (nothing) */
+  { GD_E_ARGUMENT, GD_E_ARG_WHENCE, "Invalid origin specified", 0 },
+  { GD_E_ARGUMENT, GD_E_ARG_ENDIANNESS, "Invalid endianness specified", 0 },
+  { GD_E_ARGUMENT, GD_E_ARG_PROTECTION, "Invalid protection level specified",
+    0 },
+  { GD_E_ARGUMENT, GD_E_ARG_NODATA, "No data", 0 },
+  { GD_E_ARGUMENT, GD_E_ARG_NO_VERS, "Dirfile conforms to no Standards Version",
+    0 },
+  { GD_E_ARGUMENT, GD_E_ARG_BAD_VERS,
+    "Dirfile does not conform to specified Standards Version", 0 },
+  { GD_E_ARGUMENT, 0, "Bad argument", 0 },
+  /* GD_E_CALLBACK: 3 = response */
+  { GD_E_CALLBACK, 0, "Unrecognised response from callback function: {3}", 0 },
+  /* GD_E_ExISTS: (nothing) */
+  { GD_E_EXISTS, 0, "Dirfile exists", 0 },
+  /* GD_E_UNCLEAN_DB: 3 = fragment */
+  { GD_E_UNCLEAN_DB, 0,
+    "Unexpected system error processing {3}; database unclean", 0 },
+  /* GD_E_DOMAIN: (nothing) */
+  { GD_E_DOMAIN, GD_E_DOMAIN_COMPLEX, "Improper domain: complex valued", 0 },
+  { GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, "Improper domain: empty set", 0 },
+  { GD_E_DOMAIN, GD_E_DOMAIN_ANTITONIC, "Improper domain: not monotonic", 0 },
+  { GD_E_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_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)
+{
+  dtrace("%p, %i, %i, \"%s\", %i, \"%s\"", D, error, suberror, format_file,
+      line, token);
+
+  D->error = error;
+  if (error != GD_E_OK)
+    D->n_error++;
+  D->suberror = suberror;
+  D->error_line = line;
+  if (format_file != NULL) {
+    free(D->error_file);
+    D->error_file = strdup(format_file);
+  }
+  if (token != NULL) {
+    free(D->error_string);
+    D->error_string = strdup(token);
+  }
+
+  if (D->flags & GD_VERBOSE) {
+    char *error_string = gd_error_string(D, NULL, 0);
+    fprintf(stderr, "%slibgetdata: %s\n",
+        D->error_prefix ? D->error_prefix : "", error_string);
+    free(error_string);
+  }
+
+  dreturnvoid();
+}
+
+/* Return the error */
+int gd_error(const DIRFILE* D) gd_nothrow
+{
+  dtrace("%p", D);
+
+  dreturn("%i", D->error);
+
+  return D->error;
+}
+
+/* Write a descriptive message in the supplied buffer describing the last
+ * library error.  The message may be truncated but will be null terminated.
+ * Returns buffer, or NULL if buflen < 1.
+ */
+#define UNKNOWN "Unknown error %i:%i. Please report to " PACKAGE_BUGREPORT
+char* gd_error_string(const DIRFILE* D, char* buffer, size_t buflen) gd_nothrow
+{
+  const char* ip;
+  char* op;
+  char* bufend;
+  int i, s = -1;
+
+  dtrace("%p, %p, %" PRNsize_t, D, buffer, buflen);
+
+  /* Sanity check */
+  if (D == NULL || (buffer && buflen < 1)) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* Find the error message */
+  for (i = 0; error_string[i].error; ++i)
+    if ((error_string[i].error == D->error) && ((error_string[i].suberror == 0)
+          || (error_string[i].suberror == D->suberror))) {
+      s = i;
+      break;
+    }
+
+  if (D->error == 0)
+    s = i;
+
+  if (buffer == NULL) {
+    /* computer buffer length */
+    if (s == -1) {
+      /* a 64-bit int is 20 decimal digits, the %i takes up two characters,
+       * so at most 18 more are needed for each integer */
+      buflen = sizeof(UNKNOWN) + 2 * 18 + 1;
+    } else {
+      /* again, space for two 64-bit ints - "{n}" = 17 */
+      buflen = strlen(error_string[s].format) + 2 * 17 + 1;
+      if (D->error_file)
+        buflen += strlen(D->error_file);
+      if (D->error_string)
+        buflen += strlen(D->error_string);
+      if (error_string[s].adderr)
+        /* hmmm... how long is our strerror string?  Really, the only way to
+         * find out is to run strerror_r with increasingly long buffers until
+         * we don't get ERANGE anymore.  Um, let's just guess. */
+        buflen += GD_MAX_LINE_LENGTH;
+    }
+
+    buffer = (char *)malloc(buflen);
+    if (buffer == NULL) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  }
+  op = buffer;
+  bufend = buffer + buflen;
+
+  if (s == -1) /* Unhandled error */
+    snprintf(buffer, buflen, UNKNOWN, D->error, D->suberror);
+  else {
+    for (ip = error_string[s].format; *ip != '\0' && op < bufend - 1; ++ip) {
+      if (*ip == '{') {
+        ip++;
+        if (*ip == '1')
+          op += snprintf(op, bufend - op, "%02x", D->suberror);
+        else if (*ip == '2')
+          op += snprintf(op, bufend - op, "%s", D->error_file);
+        else if (*ip == '3')
+          op += snprintf(op, bufend - op, "%i", D->error_line);
+        else if (*ip == '4')
+          op += snprintf(op, bufend - op, "%s", D->error_string);
+        ip++;
+      } else
+        *(op++) = *ip;
+    }
+
+    *op = '\0';
+    if (op < bufend - 1 && error_string[s].adderr) {
+#ifdef STRERROR_R_CHAR_P
+      char *ptr = strerror_r((error_string[s].adderr == 2) ? D->suberror :
+          D->error_line, op, bufend - op);
+      if (ptr != op)
+        strncpy(op, ptr, bufend - op);
+#else
+      strerror_r((error_string[s].adderr == 2) ? D->suberror : D->error_line,
+          op, bufend - op);
+#endif
+    }
+  }
+
+  dreturn("\"%s\"", buffer);
+  return buffer;
+}
+
+int gd_error_count(DIRFILE *D) gd_nothrow
+{
+  int count;
+
+  dtrace("%p", D);
+  count = D->n_error;
+  D->n_error = 0;
+
+  dreturn("%i", count);
+
+  return count;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/field_list.c b/src/field_list.c
new file mode 100644
index 0000000..90ea137
--- /dev/null
+++ b/src/field_list.c
@@ -0,0 +1,662 @@
+/* Copyright (C) 2008-2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* zero length lists */
+static const char* zero_list[1] = { NULL };
+static const gd_carray_t zero_carrays[1] = { {0, NULL} };
+
+gd_static_inline_ int _GD_EntryIndex(unsigned int t)
+{
+  int i;
+
+  dtrace("%u", t);
+  switch(t) {
+    case GD_RAW_ENTRY:
+      i = 0;
+      break;
+    case GD_LINCOM_ENTRY:
+      i = 1;
+      break;
+    case GD_LINTERP_ENTRY:
+      i = 2;
+      break;
+    case GD_BIT_ENTRY:
+      i = 3;
+      break;
+    case GD_MULTIPLY_ENTRY:
+      i = 4;
+      break;
+    case GD_PHASE_ENTRY:
+      i = 5;
+      break;
+    case GD_INDEX_ENTRY:
+      i = 6;
+      break;
+    case GD_POLYNOM_ENTRY:
+      i = 7;
+      break;
+    case GD_SBIT_ENTRY:
+      i = 8;
+      break;
+    case GD_DIVIDE_ENTRY:
+      i = 9;
+      break;
+    case GD_RECIP_ENTRY:
+      i = 10;
+      break;
+    case GD_WINDOW_ENTRY:
+      i = 11;
+      break;
+    case GD_MPLEX_ENTRY:
+      i = 12;
+      break;
+    case GD_CONST_ENTRY:
+      i = 13;
+      break;
+    case GD_CARRAY_ENTRY:
+      i = 14;
+      break;
+    case GD_STRING_ENTRY:
+      i = 15;
+      break;
+    case GD_VECTOR_ENTRIES:
+      i = 16;
+      break;
+    case GD_SCALAR_ENTRIES:
+      i = 17;
+      break;
+    case GD_ALIAS_ENTRY:
+      i = 18;
+      break;
+    case GD_ALL_ENTRIES:
+      i = 19;
+      break;
+    default:
+      i = -1;
+      break;
+  }
+
+  dreturn("%i", i);
+  return i;
+}
+
+/* returns true if E a member of the given list */
+int _GD_ListEntry(const gd_entry_t *E, int meta, int hidden, int noalias,
+    int special, gd_entype_t type)
+{
+  dtrace("%p{%s}, %i, %i, %i, %i, 0x%X", E, E->field, meta, hidden, noalias,
+      special, type);
+
+  /* check hidden */
+  if (!hidden && E->hidden) {
+    dreturn("%i (hidden)", 0);
+    return 0;
+  }
+
+  /* check meta */
+  if (!meta && E->e->n_meta == -1) {
+    dreturn("%i (meta)", 0);
+    return 0;
+  }
+
+  /* aliases */
+  if (E->field_type == GD_ALIAS_ENTRY) {
+    int ret = 0;
+
+    if (noalias) {
+      dreturn("%i (alias)", 0);
+      return 0;
+    }
+
+    /* that's right: GD_ALIAS_ENTRY + noalias gets you what you deserve */
+    if (special == GD_ALIAS_ENTRIES) {
+      dreturn("%i (aliases)", 1);
+      return 1;
+    }
+      
+    if (E->e->entry[0])
+      ret = _GD_ListEntry(E->e->entry[0], meta, hidden, 0, special, type);
+    dreturn("%i", ret);
+    return ret;
+  }
+
+  /* type check */
+  if (special == GD_VECTOR_ENTRIES && (E->field_type & GD_SCALAR_ENTRY_BIT)) {
+    dreturn("%i (vector)", 0);
+    return 0;
+  } else if (special == GD_SCALAR_ENTRIES &&
+      !(E->field_type & GD_SCALAR_ENTRY_BIT))
+  {
+    dreturn("%i (scalar)", 0);
+    return 0;
+  } else if (special == GD_ALIAS_ENTRIES) { /* we weeded out aliases earlier */
+    dreturn("%i (aliases)", 0);
+    return 0;
+  } else if (type && E->field_type != type) {
+    dreturn("%i (type)", 0);
+    return 0;
+  }
+
+  dreturn("%i", 1);
+  return 1;
+}
+
+static const char **_GD_EntryList(DIRFILE *D, struct gd_private_entry_ *p,
+    size_t offs, int type, unsigned int flags) gd_nothrow
+{
+  char** el;
+  int i, index;
+  unsigned int u, n = 0;
+  const int special = (type & GD_SPECIAL_ENTRY_BIT) ? type : 0;
+  const gd_entype_t ctype = (type & GD_SPECIAL_ENTRY_BIT) ? GD_NO_ENTRY :
+    (gd_entype_t)type;
+  const int hidden = (flags & GD_ENTRIES_HIDDEN);
+  const int noalias = (flags & GD_ENTRIES_NOALIAS);
+
+  dtrace("%p, %p, %" PRNsize_t ", 0x%X, 0x%X", D, p, offs, type, flags);
+
+  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);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (p) {
+    if (p->entry_list_validity & (1 << index) &&
+      p->entry_list_flags[index] == flags)
+    {
+      /* list already made */
+      dreturn("%p", p->entry_list[index]);
+      return p->entry_list[index];
+    }
+  } else if (D->entry_list_validity & (1 << index) &&
+      D->entry_list_flags[index] == flags)
+  {
+    /* list already made */
+    dreturn("%p", D->entry_list[index]);
+    return D->entry_list[index];
+  }
+
+  n = _GD_NEntries(D, p, type, flags);
+
+  if (D->error) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (n == 0) {
+    dreturn("%p", zero_list);
+    return zero_list;
+  }
+
+  el = (char **)_GD_Malloc(D, sizeof(const char*) * (n + 1));
+
+  if (el == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  n = 0;
+  if (p) {
+    for (i = 0; i < p->n_meta; ++i)
+      if (_GD_ListEntry(p->p.meta_entry[i], 1, hidden, noalias, special, ctype))
+        el[n++] = p->p.meta_entry[i]->field + offs;
+
+    free(p->entry_list[index]);
+    p->entry_list[index] = (const char **)el;
+    p->entry_list_flags[index] = flags;
+    p->entry_list_validity |= 1 << index;
+  } else {
+    for (u = 0; u < D->n_entries; ++u)
+      if (_GD_ListEntry(D->entry[u], 0, hidden, noalias, special, ctype))
+        el[n++] = D->entry[u]->field;
+
+    free(D->entry_list[index]);
+    D->entry_list[index] = (const char **)el;
+    D->entry_list_flags[index] = flags;
+    D->entry_list_validity |= 1 << index;
+  }
+  el[n] = NULL;
+
+  dreturn("%p", (const char **)el);
+  return (const char **)el;
+}
+
+const char **gd_entry_list(DIRFILE* D, const char *parent, int type,
+    unsigned int flags) gd_nothrow
+{
+  const char **el;
+  size_t offs = 0;
+  struct gd_private_entry_ *p = NULL;
+
+  dtrace("%p, \"%s\", %i, %u", D, parent, type, flags);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%u", 0);
+    return 0;
+  }
+
+  if (parent) {
+    gd_entry_t *P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+
+    if (P == NULL || P->e->n_meta == -1) {
+      _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING,
+          NULL, 0, parent);
+      dreturn("%u", 0);
+      return 0;
+    }
+    p = P->e;
+    offs = strlen(P->field) + 1;
+  }
+
+  _GD_ClearError(D);
+
+  el = _GD_EntryList(D, p, offs, type, flags);
+  dreturn("%p", el);
+  return el;
+}
+
+const void *gd_constants(DIRFILE* D, gd_type_t return_type) gd_nothrow
+{
+  unsigned int i, n;
+  char* fl;
+
+  dtrace("%p, 0x%x", D, return_type);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  if ((n = _GD_NEntries(D, NULL, GD_CONST_ENTRY, 0)) == 0) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fl = (char *)_GD_Alloc(D, return_type, n);
+
+  if (fl == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  for (i = n = 0; i < D->n_entries; ++i) {
+    if (_GD_ListEntry(D->entry[i], 0, 0, 0, 0, GD_CONST_ENTRY))
+      if (_GD_DoField(D, D->entry[i], 0, 0, 1, return_type,
+            fl + n++ * GD_SIZE(return_type)) != 1)
+        break;
+  }
+
+  free(D->const_value_list);
+  D->const_value_list = fl;
+
+  dreturn("%p", D->error ? NULL : D->const_value_list);
+  return D->error ? NULL : D->const_value_list;
+}
+
+const gd_carray_t *gd_carrays(DIRFILE* D, gd_type_t return_type) gd_nothrow
+{
+  unsigned int i, n;
+  gd_carray_t* fl;
+
+  dtrace("%p, 0x%x", D, return_type);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  if ((n = _GD_NEntries(D, NULL, GD_CARRAY_ENTRY, 0)) == 0) {
+    dreturn("%p", zero_carrays);
+    return zero_carrays;
+  }
+
+  fl = (gd_carray_t *)_GD_Malloc(D, sizeof(gd_carray_t) * (n + 1));
+
+  if (fl == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  memset(fl, 0, sizeof(gd_carray_t) * (n + 1));
+
+  for (i = n = 0; i < D->n_entries; ++i) {
+    if (_GD_ListEntry(D->entry[i], 0, 0, 0, 0, GD_CARRAY_ENTRY)) {
+      fl[n].n = D->entry[i]->EN(scalar,array_len);
+      fl[n].d = _GD_Alloc(D, return_type, fl[n].n);
+      if (D->error || _GD_DoField(D, D->entry[i], 0, 0, fl[n].n, return_type,
+            fl[n].d) < 1)
+        break;
+      n++;
+    }
+  }
+  fl[n].n = 0;
+
+  if (D->carray_value_list)
+    for (i = 0; D->carray_value_list[i].n != 0; ++i)
+      free(D->carray_value_list[i].d);
+  free(D->carray_value_list);
+  D->carray_value_list = fl;
+
+  dreturn("%p", D->error ? NULL : fl);
+  return D->error ? NULL : fl;
+}
+
+const char **gd_strings(DIRFILE* D) gd_nothrow
+{
+  unsigned int i, n;
+  char** fl;
+
+  dtrace("%p", D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  if ((n = _GD_NEntries(D, NULL, GD_STRING_ENTRY, 0)) == 0) {
+    dreturn("%p", zero_list);
+    return zero_list;
+  }
+
+  if (D->value_list_validity & GD_LIST_VALID_STRING_VALUE) {
+    /* list already made */
+    dreturn("%p", D->string_value_list);
+    return D->string_value_list;
+  }
+
+  fl = (char **)_GD_Malloc(D, sizeof(const char*) * (n + 1));
+
+  if (fl == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  for (i = n = 0; i < D->n_entries; ++i) {
+    if (_GD_ListEntry(D->entry[i], 0, 0, 0, 0, GD_STRING_ENTRY))
+      fl[n++] = D->entry[i]->e->u.string;
+  }
+  fl[n] = NULL;
+
+  free(D->string_value_list);
+  D->string_value_list = (const char **)fl;
+  D->value_list_validity |= GD_LIST_VALID_STRING_VALUE;
+
+  dreturn("%p", D->string_value_list);
+  return D->string_value_list;
+}
+
+const char **gd_field_list_by_type(DIRFILE* D, gd_entype_t type) gd_nothrow
+{
+  const char** el;
+  dtrace("%p, 0x%X", D, type);
+
+  el = gd_entry_list(D, NULL, type, 0);
+  dreturn("%p", el);
+  return el;
+}
+
+const char **gd_vector_list(DIRFILE* D) gd_nothrow
+{
+  const char **el;
+  dtrace("%p", D);
+
+  el = gd_entry_list(D, NULL, GD_VECTOR_ENTRIES, 0);
+  dreturn("%p", el);
+  return el;
+}
+
+const char **gd_field_list(DIRFILE* D) gd_nothrow
+{
+  const char **el;
+
+  dtrace("%p", D);
+
+  el = gd_entry_list(D, NULL, GD_ALL_ENTRIES, 0);
+  dreturn("%p", el);
+  return el;
+}
+
+const void *gd_mconstants(DIRFILE* D, const char* parent,
+    gd_type_t return_type) gd_nothrow
+{
+  int i, n;
+  char* fl;
+  gd_entry_t *P;
+  struct gd_private_entry_ *e;
+
+  dtrace("%p, \"%s\", 0x%x", D, parent, return_type);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+
+  if (P == NULL || P->e->n_meta == -1) {
+    _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING,
+        NULL, 0, parent);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  e = P->e;
+
+  if ((n = gd_nmfields_by_type(D, parent, GD_CONST_ENTRY)) == 0) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  fl = (char *)_GD_Alloc(D, return_type, n);
+
+  if (fl == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* DoField will implicitly choose GD_REPR_AUTO for complex data being returned
+   * as purely real */
+  for (i = n = 0; i < e->n_meta; ++i) {
+    if (_GD_ListEntry(e->p.meta_entry[i], 1, 0, 0, 0, GD_CONST_ENTRY))
+      if (_GD_DoField(D, e->p.meta_entry[i], 0, 0, 1, return_type,
+            fl + n++ * GD_SIZE(return_type)) != 1)
+        break;
+  }
+
+  free(e->const_value_list);
+  e->const_value_list = fl;
+
+  dreturn("%p", e->const_value_list);
+  return e->const_value_list;
+}
+
+const gd_carray_t *gd_mcarrays(DIRFILE* D, const char* parent,
+    gd_type_t return_type) gd_nothrow
+{
+  int i, n;
+  gd_carray_t *fl;
+  gd_entry_t *P;
+  struct gd_private_entry_ *e;
+
+  dtrace("%p, \"%s\", 0x%x", D, parent, return_type);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+
+  if (P == NULL || P->e->n_meta == -1) {
+    _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING,
+        NULL, 0, parent);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  e = P->e;
+
+  if ((n = gd_nmfields_by_type(D, parent, GD_CARRAY_ENTRY)) == 0) {
+    dreturn("%p", zero_carrays);
+    return zero_carrays;
+  }
+
+  fl = (gd_carray_t *)_GD_Malloc(D, sizeof(gd_carray_t) * (n + 1));
+
+  if (fl == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* DoField will implicitly choose GD_REPR_AUTO for complex data being returned
+   * as purely real */
+  for (i = n = 0; i < e->n_meta; ++i) {
+    if (_GD_ListEntry(e->p.meta_entry[i], 1, 0, 0, 0, GD_CARRAY_ENTRY)) {
+      fl[n].n = e->p.meta_entry[i]->EN(scalar,array_len);
+      fl[n].d = _GD_Alloc(D, return_type, fl[n].n);
+      if (D->error || _GD_DoField(D, e->p.meta_entry[i], 0, 0, fl[n].n,
+            return_type, fl[n].d) < 1)
+        break;
+      n++;
+    }
+  }
+  fl[n].n = 0;
+
+  if (e->carray_value_list)
+    for (i = 0; e->carray_value_list[i].n != 0; ++i)
+      free(e->carray_value_list[i].d);
+  free(e->carray_value_list);
+
+  e->carray_value_list = fl;
+
+  dreturn("%p", D->error ? NULL : fl);
+  return D->error ? NULL : fl;
+}
+
+const char **gd_mstrings(DIRFILE* D, const char* parent) gd_nothrow
+{
+  int i, n;
+  char** fl;
+  gd_entry_t *P;
+  struct gd_private_entry_ *e;
+
+  dtrace("%p, \"%s\"", D, parent);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+
+  if (P == NULL || P->e->n_meta == -1) {
+    _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING,
+        NULL, 0, parent);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  e = P->e;
+
+  if ((n = gd_nmfields_by_type(D, parent, GD_STRING_ENTRY)) == 0) {
+    dreturn("%p", zero_list);
+    return zero_list;
+  }
+
+  fl = (char **)_GD_Realloc(D, (char **)e->string_value_list,
+      sizeof(const char*) * (n + 1));
+
+  if (fl == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  for (i = n = 0; i < e->n_meta; ++i)
+    if (_GD_ListEntry(e->p.meta_entry[i], 1, 0, 0, 0, GD_STRING_ENTRY))
+      fl[n++] = e->p.meta_entry[i]->e->u.string;
+  fl[n] = NULL;
+
+  e->string_value_list = (const char **)fl;
+
+  dreturn("%p", e->string_value_list);
+  return e->string_value_list;
+}
+
+const char **gd_mfield_list_by_type(DIRFILE* D, const char* parent,
+    gd_entype_t type) gd_nothrow
+{
+  const char **el;
+  dtrace("%p, \"%s\", 0x%X", D, parent, type);
+
+  el = gd_entry_list(D, parent, type, 0);
+  dreturn("%p", el);
+  return el;
+}
+
+const char **gd_mvector_list(DIRFILE* D, const char* parent) gd_nothrow
+{
+  const char **el;
+  dtrace("%p, \"%s\"", D, parent);
+
+  el = gd_entry_list(D, parent, GD_VECTOR_ENTRIES, 0);
+  dreturn("%p", el);
+  return el;
+}
+
+const char **gd_mfield_list(DIRFILE* D, const char* parent) gd_nothrow
+{
+  const char **el;
+  dtrace("%p, \"%s\"", D, parent);
+
+  el = gd_entry_list(D, parent, GD_ALL_ENTRIES, 0);
+  dreturn("%p", el);
+  return el;
+}
diff --git a/src/flimits.c b/src/flimits.c
new file mode 100644
index 0000000..0b9f526
--- /dev/null
+++ b/src/flimits.c
@@ -0,0 +1,585 @@
+/* Copyright (C) 2008-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+static void _GD_ShiftFragment(DIRFILE* D, off64_t offset, int fragment,
+    int move)
+{
+  unsigned int i, n_raw = 0;
+
+  dtrace("%p, %lli, %i, %i", D, (long long)offset, fragment, move);
+
+  /* check protection */
+  if (D->fragment[fragment].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[fragment].cname);
+    dreturnvoid();
+    return;
+  }
+
+  if (move && offset != D->fragment[fragment].frame_offset) {
+    gd_entry_t **raw_entry = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*) *
+        D->n_entries);
+
+    if (raw_entry == NULL) {
+      dreturnvoid();
+      return;
+    }
+
+    /* Because it may fail, the move must occur out-of-place and then be copied
+     * back over the affected files once success is assured */
+    for (i = 0; i < D->n_entries; ++i)
+      if (D->entry[i]->fragment_index == fragment &&
+          D->entry[i]->field_type == GD_RAW_ENTRY)
+      {
+        /* determine encoding scheme */
+        if (!_GD_Supports(D, D->entry[i], 0))
+          break;
+
+        /* add this raw field to the list */
+        raw_entry[n_raw++] = D->entry[i];
+
+        if (_GD_MogrifyFile(D, D->entry[i],
+              D->fragment[D->entry[i]->fragment_index].encoding,
+              D->fragment[D->entry[i]->fragment_index].byte_sex, offset, 0, -1,
+              NULL))
+          break;
+      }
+
+    /* If successful, move the temporary file over the old file, otherwise
+     * remove the temporary files */
+    if (D->error) {
+      for (i = 0; i < n_raw; ++i)
+        _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD |
+            GD_FINIRAW_CLOTEMP);
+    } else {
+      for (i = 0; i < n_raw; ++i)
+        _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_KEEP |
+            GD_FINIRAW_CLOTEMP);
+    }
+
+    free(raw_entry);
+
+    if (D->error) {
+      dreturnvoid();
+      return;
+    }
+  }
+
+  D->fragment[fragment].frame_offset = offset;
+  D->fragment[fragment].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+
+  dreturnvoid();
+}
+
+int gd_alter_frameoffset64(DIRFILE* D, off64_t offset, int fragment, int move)
+{
+  int i;
+
+  dtrace("%p, %lli, %i, %i", D, (long long)offset, fragment, move);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment < GD_ALL_FRAGMENTS || fragment >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (offset < 0) {
+    _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  if (fragment == GD_ALL_FRAGMENTS) {
+    for (i = 0; i < D->n_fragment; ++i) {
+      _GD_ShiftFragment(D, offset, i, move);
+
+      if (D->error)
+        break;
+    }
+  } else
+    _GD_ShiftFragment(D, offset, fragment, move);
+
+  dreturn("%i", (D->error) ? -1 : 0);
+  return (D->error) ? -1 : 0;
+}
+
+off64_t gd_frameoffset64(DIRFILE* D, int fragment)
+{
+  dtrace("%p, %i", D, fragment);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment < 0 || fragment >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  dreturn("%lli", (long long)D->fragment[fragment].frame_offset);
+  return D->fragment[fragment].frame_offset;
+}
+
+/* 32(ish)-bit wrappers for the 64-bit versions, when needed */
+int gd_alter_frameoffset(DIRFILE* D, off_t offset, int fragment, int move)
+{
+  return gd_alter_frameoffset64(D, offset, fragment, move);
+}
+
+off_t gd_frameoffset(DIRFILE* D, int fragment) gd_nothrow
+{
+  return gd_frameoffset64(D, fragment);
+}
+
+off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
+    const char *restrict parent, int *restrict is_index)
+{
+  off64_t ns = -1, ns1;
+  unsigned int spf0, spf1;
+  int i, is_index1;
+
+  dtrace("%p, %p, \"%s\", %p", D, E, parent, is_index);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    D->recurse_level--;
+    dreturn("%i ?", -1);
+    return -1;
+  }
+
+  *is_index = 0;
+  switch (E->field_type) {
+    case GD_RAW_ENTRY:
+      if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_SIZE))
+        break;
+
+      if ((*gd_ef_[E->e->u.raw.file[0].subenc].name)(D,
+            (const char*)D->fragment[E->fragment_index].enc_data,
+            E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
+      {
+        break;
+      }
+
+      ns = (*gd_ef_[E->e->u.raw.file[0].subenc].size)(
+          D->fragment[E->fragment_index].dirfd, E->e->u.raw.file,
+          E->EN(raw,data_type), _GD_FileSwapBytes(D, E->fragment_index));
+
+      if (ns < 0) {
+        _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+        ns = -1;
+        break;
+      }
+
+      ns += D->fragment[E->fragment_index].frame_offset * E->EN(raw,spf);
+      break;
+    case GD_BIT_ENTRY:
+    case GD_LINTERP_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_RECIP_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1))
+        break;
+
+      ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
+      break;
+    case GD_DIVIDE_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1))
+        break;
+
+      ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
+
+      if (D->error)
+        break;
+
+      spf0 = _GD_GetSPF(D, E->e->entry[0]);
+
+      if (D->error) {
+        ns = -1;
+        break;
+      }
+
+      ns1 = _GD_GetEOF(D, E->e->entry[1], E->field, &is_index1);
+
+      if (D->error) {
+        ns = -1;
+        break;
+      }
+
+      if (!is_index1) {
+        spf1 = _GD_GetSPF(D, E->e->entry[1]);
+
+        if (D->error) {
+          ns = -1;
+          break;
+        }
+
+        ns1 = ns1 * spf0 / spf1;
+        if (*is_index || ns1 < ns) {
+          *is_index = is_index1;
+          ns = ns1;
+        }
+      }
+      break;
+    case GD_LINCOM_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1))
+        break;
+
+      ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
+
+      if (D->error) {
+        ns = -1;
+        break;
+      }
+
+      if (E->EN(lincom,n_fields) == 1)
+        break;
+
+      spf0 = _GD_GetSPF(D, E->e->entry[0]);
+
+      if (D->error) {
+        ns = -1;
+        break;
+      }
+
+      for (i = 1; i < E->EN(lincom,n_fields); ++i) {
+        if (_GD_BadInput(D, E, i, 1)) {
+          ns = -1;
+          break;
+        }
+
+        ns1 = _GD_GetEOF(D, E->e->entry[i], E->field, &is_index1);
+
+        if (D->error) {
+          ns = -1;
+          break;
+        }
+
+        if (!is_index1) {
+          spf1 = _GD_GetSPF(D, E->e->entry[i]);
+
+          if (D->error) {
+            ns = -1;
+            break;
+          }
+
+          ns1 = ns1 * spf0 / spf1;
+          if (*is_index || ns1 < ns) {
+            *is_index = is_index1;
+            ns = ns1;
+          }
+        }
+      }
+      break;
+    case GD_PHASE_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1))
+        break;
+
+      ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index);
+      if (!*is_index && !D->error)
+        ns -= E->EN(phase,shift);
+
+      /* The EOF may never be negative. */
+      if (ns < 0)
+        ns = 0;
+
+      break;
+    case GD_INDEX_ENTRY:
+      *is_index = 1;
+      break;
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+      if (parent)
+        _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_FORMAT, parent, 0, E->field);
+      else
+        _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, E->field);
+      break;
+    case GD_NO_ENTRY:
+      _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, E->field);
+      break;
+    case GD_ALIAS_ENTRY:
+      _GD_InternalError(D);
+      break;
+  }
+
+  D->recurse_level--;
+
+  dreturn("%lli %i", (unsigned long long)ns, *is_index);
+  return ns;
+}
+
+off64_t gd_eof64(DIRFILE* D, const char *field_code_in)
+{
+  off64_t ns;
+  gd_entry_t *entry;
+  int repr, is_index;
+  char* field_code;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  ns = _GD_GetEOF(D, entry, NULL, &is_index);
+
+  if (is_index)
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  dreturn("%lli", (unsigned long long)ns);
+  return ns;
+}
+
+/* 32(ish)-bit wrapper for the 64-bit version, when needed */
+off_t gd_eof(DIRFILE* D, const char *field_code)
+{
+  return (off_t)gd_eof64(D, field_code);
+}
+
+static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E,
+    const char *restrict parent, unsigned int *restrict spf,
+    long long *restrict ds)
+{
+  off64_t bof = -1, bof1;
+  unsigned int spf1;
+  long long ds1;
+  int i;
+
+  dtrace("%p, %p, \"%s\", %p, %p", D, E, parent, spf, ds);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    D->recurse_level--;
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  switch (E->field_type) {
+    case GD_RAW_ENTRY:
+      bof = D->fragment[E->fragment_index].frame_offset;
+      *spf = E->EN(raw,spf);
+      *ds = 0;
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_LINTERP_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_RECIP_ENTRY:
+      if (_GD_BadInput(D, E, 0, 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))
+        break;
+
+      bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
+
+      if (!D->error) {
+        *ds -= E->EN(phase,shift);
+
+        while (*ds < 0) {
+          *ds += *spf;
+          bof--;
+        }
+
+        while (*ds >= *spf) {
+          *ds -= *spf;
+          bof++;
+        }
+
+        /* The beginning-of-frame may not be before frame zero */
+        if (bof < 0)
+          bof = *ds = 0;
+      }
+
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1))
+        break;
+
+      bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
+
+      if (D->error) {
+        bof = -1;
+        break;
+      }
+
+      bof1 = _GD_GetBOF(D, E->e->entry[1], E->field, &spf1, &ds1);
+
+      if (D->error) {
+        bof = -1;
+        break;
+      }
+
+      if (bof1 > bof ||
+          (bof1 == bof && (double)ds1 / spf1 > (double)*ds / *spf))
+      {
+        bof = bof1;
+        *ds = ds1 * *spf / spf1;
+      }
+      break;
+    case GD_LINCOM_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1))
+        break;
+
+      bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds);
+
+      if (D->error) {
+        bof = -1;
+        break;
+      }
+
+      for (i = 1; i < E->EN(lincom,n_fields); ++i) {
+        if (_GD_BadInput(D, E, i, 1)) {
+          bof = -1;
+          break;
+        }
+
+        bof1 = _GD_GetBOF(D, E->e->entry[i], E->field, &spf1, &ds1);
+
+        if (D->error) {
+          bof = -1;
+          break;
+        }
+
+        if (bof1 > bof ||
+            (bof1 == bof && (double)ds1 / spf1 > (double)*ds / *spf))
+        {
+          bof = bof1;
+          *ds = ds1 * *spf / spf1;
+        }
+      }
+      break;
+    case GD_INDEX_ENTRY:
+      bof = 0;
+      *spf = 1;
+      *ds = 0;
+      break;
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+      if (parent)
+        _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_FORMAT, parent, 0, E->field);
+      else
+        _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, E->field);
+      break;
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+      _GD_InternalError(D);
+      break;
+  }
+
+  D->recurse_level--;
+
+  dreturn("%llu %lu %lli", (unsigned long long)bof, (unsigned long)*spf, *ds);
+  return bof;
+}
+
+off64_t gd_bof64(DIRFILE* D, const char *field_code_in) gd_nothrow
+{
+  off64_t bof;
+  gd_entry_t *entry;
+  int repr;
+  char *field_code;
+  unsigned int spf;
+  long long ds;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  bof = _GD_GetBOF(D, entry, NULL, &spf, &ds);
+
+  if (bof != -1)
+    bof = bof * spf + ds;
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  dreturn("%lli", (unsigned long long)bof);
+  return bof;
+}
+
+/* 32(ish)-bit wrapper for the 64-bit version, when needed */
+off_t gd_bof(DIRFILE* D, const char *field_code) gd_nothrow
+{
+  return (off_t)gd_bof64(D, field_code);
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/flush.c b/src/flush.c
new file mode 100644
index 0000000..f0c3a24
--- /dev/null
+++ b/src/flush.c
@@ -0,0 +1,1207 @@
+/* Copyright (C) 2008-2012, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#define GD_MAX_PRETTY_FIELD_WIDTH 80
+
+void _GD_Flush(DIRFILE *D, gd_entry_t *E, int syn, int clo)
+{
+  int i;
+
+  dtrace("%p, %p, %i, %i", D, E, syn, clo);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    D->recurse_level--;
+    dreturnvoid();
+    return;
+  }
+
+  switch(E->field_type) {
+    case GD_RAW_ENTRY:
+      if (E->e->u.raw.file[0].idata >= 0 ||
+          ((gd_ef_[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP) &&
+           (E->e->u.raw.file[1].idata >= 0)))
+      {
+        if (syn && (D->flags & GD_ACCMODE) == GD_RDWR &&
+            (E->e->u.raw.file[0].mode & GD_FILE_WRITE) &&
+            gd_ef_[E->e->u.raw.file[0].subenc].sync != NULL &&
+            (*gd_ef_[E->e->u.raw.file[0].subenc].sync)(E->e->u.raw.file))
+        {
+          _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
+              NULL);
+        } 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);
+        }
+      }
+      break;
+    case GD_LINCOM_ENTRY:
+      for (i = 0; i < E->EN(lincom,n_fields); ++i)
+        _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);
+      /* fallthrough */
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_RECIP_ENTRY:
+      _GD_Flush(D, E->e->entry[0], syn, clo);
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_INDEX_ENTRY:
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+      break;
+  }
+
+  D->recurse_level--;
+  dreturnvoid();
+}
+
+static const char* _GD_TypeName(DIRFILE* D, gd_type_t data_type)
+{
+  const char* ptr;
+
+  dtrace("%p, 0x%X", D, data_type);
+
+  switch(data_type) {
+    case GD_UINT8:
+      ptr = "UINT8";
+      break;
+    case GD_INT8:
+      ptr = "INT8";
+      break;
+    case GD_UINT16:
+      ptr = "UINT16";
+      break;
+    case GD_INT16:
+      ptr = "INT16";
+      break;
+    case GD_UINT32:
+      ptr = "UINT32";
+      break;
+    case GD_INT32:
+      ptr = "INT32";
+      break;
+    case GD_UINT64:
+      ptr = "UINT64";
+      break;
+    case GD_INT64:
+      ptr = "INT64";
+      break;
+    case GD_FLOAT32:
+      ptr = "FLOAT32";
+      break;
+    case GD_FLOAT64:
+      ptr = "FLOAT64";
+      break;
+    case GD_COMPLEX64:
+      ptr = "COMPLEX64";
+      break;
+    case GD_COMPLEX128:
+      ptr = "COMPLEX128";
+      break;
+    default:
+      _GD_InternalError(D);
+      ptr = "";
+      break;
+  }
+
+  dreturn("\"%s\"", ptr);
+  return ptr;
+}
+
+static const char* _GD_OldTypeName(DIRFILE* D, gd_type_t data_type)
+{
+  const char* ptr;
+
+  dtrace("%p, 0x%X", D, data_type);
+
+  switch(data_type) {
+    case GD_UINT8:
+      ptr = "c";
+      break;
+    case GD_UINT16:
+      ptr = "u";
+      break;
+    case GD_INT16:
+      ptr = "s";
+      break;
+    case GD_UINT32:
+      ptr = "U";
+      break;
+    case GD_INT32:
+      ptr = "S";
+      break;
+    case GD_FLOAT32:
+      ptr = "f";
+      break;
+    case GD_FLOAT64:
+      ptr = "d";
+      break;
+    default:
+      _GD_InternalError(D);
+      ptr = "";
+      break;
+  }
+
+  dreturn("\"%s\"", ptr);
+  return ptr;
+}
+
+static const char *_GD_WindopName(DIRFILE *D, gd_windop_t op)
+{
+  const char *ptr;
+
+  dtrace("%p, %i", D, op);
+
+  switch(op) {
+    case GD_WINDOP_EQ:
+      ptr = "EQ";
+      break;
+    case GD_WINDOP_GE:
+      ptr = "GE";
+      break;
+    case GD_WINDOP_GT:
+      ptr = "GT";
+      break;
+    case GD_WINDOP_LE:
+      ptr = "LE";
+      break;
+    case GD_WINDOP_LT:
+      ptr = "LT";
+      break;
+    case GD_WINDOP_NE:
+      ptr = "NE";
+      break;
+    case GD_WINDOP_SET:
+      ptr = "SET";
+      break;
+    case GD_WINDOP_CLR:
+      ptr = "CLR";
+      break;
+    default:
+      _GD_InternalError(D);
+      ptr = "";
+      break;
+  }
+
+  dreturn("\"%s\"", ptr);
+  return ptr;
+}
+
+static size_t _GD_StringEscapeise(FILE *stream, const char *in, int meta,
+    int permissive, int standards)
+{
+  const char* HexDigit = "0123456789ABCDEF";
+  size_t len = 0;
+
+  dtrace("%p, \"%s\", %i, %i", stream, in, permissive, standards);
+
+  if (in == NULL || in[0] == '\0') {
+    fputs("\"\"", stream);
+    dreturn("%i", 2);
+    return 2;
+  }
+
+  if (!permissive && standards < 6) {
+    fputs(in, stream);
+    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 == ' ') {
+      fputc('\\', stream);
+      fputc(*in, stream);
+      len += 2;
+    } else if (*in < 0x20
+#if CHAR_MIN != 0
+        && *in >= 0x00
+#endif
+        ) {
+      fputs("\\x", stream);
+      fputc(HexDigit[*in >> 4], stream);
+      fputc(HexDigit[*in & 0xF], stream);
+      len += 4;
+    } else if (meta && *in == '/')
+      break;
+    else {
+      fputc(*in, stream);
+      len++;
+    }
+  }
+
+  dreturn("%" PRNsize_t, len);
+  return len;
+}
+
+/* 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)
+{
+  int dummy;
+  size_t len;
+  char *ptr;
+
+  dtrace("%p, %p, %i, \"%s\", %i, %i", D, stream, me, code, permissive,
+      standards);
+
+  ptr = _GD_MungeCode(D, NULL, D->fragment[me].prefix, D->fragment[me].suffix,
+      NULL, NULL, code, &dummy, 0);
+
+  len = _GD_StringEscapeise(stream, ptr, 0, permissive, standards);
+
+  free(ptr);
+
+  dreturn("%" PRNsize_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)
+{
+  size_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);
+  }
+
+  dreturnvoid();
+}
+
+/* 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)
+{
+  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 (index == -1)
+      fprintf(stream, "%s", postamble);
+    else
+      fprintf(stream, "<%i>%s", index, postamble);
+  }
+  else if (type == GD_UINT64)
+    fprintf(stream, "%" PRIu64 "%s", *(uint64_t *)value, postamble);
+  else if (type == GD_INT64)
+    fprintf(stream, "%" PRIi64 "%s", *(int64_t *)value, postamble);
+  else if (type == GD_UINT32)
+    fprintf(stream, "%" PRIu32 "%s", *(uint32_t *)value, postamble);
+  else if (type == GD_INT32)
+    fprintf(stream, "%" PRIi32 "%s", *(int32_t *)value, postamble);
+  else if (type == GD_UINT16)
+    fprintf(stream, "%" PRIu16 "%s", *(uint16_t *)value, postamble);
+  else if (type == GD_INT16)
+    fprintf(stream, "%" PRIi16 "%s", *(int16_t *)value, postamble);
+  else if (type == GD_FLOAT64)
+    fprintf(stream, "%.15g%s", *(double *)value, postamble);
+  else if (type == GD_COMPLEX128)
+    fprintf(stream, "%.15g;%.15g%s", *(double *)value, ((double *)value)[1],
+      postamble);
+  else
+    _GD_InternalError(D);
+
+  dreturnvoid();
+}
+
+/* Write a field specification line */
+static void _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;
+
+  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;
+  }
+
+  /* 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);
+  } 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);
+      ptr = strchr(E->field, '/') + 1;
+    }
+
+    /* field name */
+    _GD_PadField(D, stream, me, ptr, max_len, permissive, D->standards);
+
+    switch(E->field_type) {
+      case GD_RAW_ENTRY:
+        fprintf(stream, " RAW%s %s ", pretty ? "     " : "",
+            (permissive || D->standards >= 5) ?  _GD_TypeName(D,
+              E->EN(raw,data_type)) : _GD_OldTypeName(D, E->EN(raw,data_type)));
+        _GD_WriteConst(D, stream, me, permissive, GD_UINT_TYPE, &E->EN(raw,spf),
+            E->scalar[0], E->scalar_ind[0], "\n");
+        break;
+      case GD_LINCOM_ENTRY:
+        fprintf(stream, " LINCOM%s %i", pretty ? "  " : "",
+            E->EN(lincom,n_fields));
+        for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+          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], "");
+          } 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], "");
+          }
+        }
+        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);
+        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");
+        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);
+        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");
+        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);
+        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");
+        break;
+      case GD_POLYNOM_ENTRY:
+        fprintf(stream, " POLYNOM%s ", pretty ? " " : "");
+        _GD_WriteFieldCode(D, stream, me, E->in_fields[0], permissive,
+            D->standards);
+        fputc(' ', stream);
+        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" : " ");
+        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");
+        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)));
+        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");
+            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");
+            break;
+          default:
+            _GD_WriteConst(D, stream, me, permissive, GD_FLOAT64,
+                &E->EN(window,threshold.r), E->scalar[0], E->scalar_ind[0],
+                "\n");
+            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);
+        break;
+      case GD_CONST_ENTRY:
+        fprintf(stream, " CONST%s %s ", pretty ? "   " : "", _GD_TypeName(D,
+              E->EN(scalar,const_type)));
+        if (E->EN(scalar,const_type) & GD_SIGNED)
+          fprintf(stream, "%" PRIi64 "\n", *(int64_t*)E->e->u.scalar.d);
+        else if (E->EN(scalar,const_type) & GD_IEEE754)
+          fprintf(stream, "%.15g\n", *(double*)E->e->u.scalar.d);
+        else if (E->EN(scalar,const_type) & GD_COMPLEX)
+          fprintf(stream, "%.15g;%.15g\n", *(double*)E->e->u.scalar.d,
+              *((double*)E->e->u.scalar.d + 1));
+        else
+          fprintf(stream, "%" PRIu64 "\n", *(uint64_t*)E->e->u.scalar.d);
+        break;
+      case GD_CARRAY_ENTRY:
+        fprintf(stream, " CARRAY%s %s", pretty ? "  " : "", _GD_TypeName(D,
+              E->EN(scalar,const_type)));
+        if (E->EN(scalar,const_type) & GD_SIGNED)
+          for (z = 0; z < E->EN(scalar,array_len); ++z)
+            fprintf(stream, " %" PRIi64, ((int64_t*)E->e->u.scalar.d)[z]);
+        else if (E->EN(scalar,const_type) & GD_IEEE754)
+          for (z = 0; z < E->EN(scalar,array_len); ++z)
+            fprintf(stream, " %.15g", ((double*)E->e->u.scalar.d)[z]);
+        else if (E->EN(scalar,const_type) & GD_COMPLEX)
+          for (z = 0; z < E->EN(scalar,array_len); ++z)
+            fprintf(stream, " %.15g;%.15g", ((double*)E->e->u.scalar.d)[2 * z],
+                ((double*)E->e->u.scalar.d)[2 * z + 1]);
+        else
+          for (z = 0; z < E->EN(scalar,array_len); ++z)
+            fprintf(stream, " %" PRIu64, ((uint64_t*)E->e->u.scalar.d)[z]);
+        fputc('\n', stream);
+        break;
+      case GD_STRING_ENTRY:
+        fprintf(stream, " STRING%s ", pretty ? "  " : "");
+        _GD_StringEscapeise(stream, E->e->u.string, 0, permissive,
+            D->standards);
+        fputc('\n', stream);
+        break;
+      case GD_INDEX_ENTRY:
+      case GD_ALIAS_ENTRY:
+      case GD_NO_ENTRY:
+        _GD_InternalError(D);
+        break;
+    }
+  }
+
+  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);
+  }
+
+  dreturnvoid();
+}
+
+static void _GD_FlushFragment(DIRFILE* D, int i, int permissive)
+{
+  int j;
+  FILE* stream;
+  char buffer[GD_MAX_LINE_LENGTH];
+  char temp_file[] = "format_XXXXXX";
+  char* ptr;
+  struct tm now;
+  int fd, dummy;
+  int pretty = 0;
+  size_t max_len = 0;
+  unsigned int u;
+#ifdef HAVE_FCHMOD
+  mode_t mode;
+#endif
+  struct stat stat_buf;
+  time_t t;
+  int dirfd = D->fragment[i].dirfd;
+
+  dtrace("%p, %i, %i", D, i, permissive);
+
+#ifdef HAVE_FCHMOD
+  /* get the permissions of the old file */
+  if (stat(D->fragment[i].cname, &stat_buf))
+    mode = 0644;
+  else
+    mode = stat_buf.st_mode;
+#endif
+
+  /* open a temporary file */
+  fd = _GD_MakeTempFile(D, dirfd, temp_file);
+  if (fd == -1) {
+    _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_MKTMP, NULL, errno, temp_file);
+    dreturnvoid();
+    return;
+  }
+  stream = fdopen(fd, "wb+");
+  if (stream == NULL) {
+    _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_OPEN, NULL, errno, temp_file);
+    dreturnvoid();
+    return;
+  }
+
+  if (D->flags & GD_PRETTY_PRINT) {
+    size_t t = 0;
+    size_t m = 0;
+    int n = 0;
+    pretty = 1;
+    for (u = 0; u < D->n_entries; ++u)
+      if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) {
+        size_t l = strlen(D->entry[u]->field);
+        if (m < l)
+          m = l;
+        t += l;
+        n++;
+      }
+    max_len = (n == 0) ? 0: 2 * t / n;
+    if (max_len > m)
+      max_len = m;
+    if (max_len > GD_MAX_PRETTY_FIELD_WIDTH)
+      max_len = GD_MAX_PRETTY_FIELD_WIDTH;
+  }
+
+  /* Introit */
+  t = time(NULL);
+  strftime(buffer, GD_MAX_LINE_LENGTH, "%c", gmtime_r(&t, &now));
+
+  fprintf(stream, "# This is a dirfile format file.\n"
+      "# It was written using version %s of the GetData Library.\n"
+      "# Written on %s UTC", PACKAGE_VERSION, buffer);
+
+  if ((ptr = getenv("LOGNAME")) != NULL) {
+    fprintf(stream, " by %s", ptr);
+    if ((ptr = getenv("HOSTNAME")) != NULL)
+      fprintf(stream, "@%s", ptr);
+  }
+  fputs(".\n\n", stream);
+
+  if (permissive)
+    fprintf(stream, "# WARNING: This fragment may not conform to any "
+        "Dirfile Standards Version.\n");
+  else if (D->standards >= 5)
+    fprintf(stream, "/VERSION %i\n", D->standards);
+  else
+    fprintf(stream, "# This fragment conforms to "
+        "Dirfile Standards Version %i.\n", D->standards);
+
+  /* Byte Sex */
+  if (permissive || D->standards >= 5)
+    fprintf(stream, "/ENDIAN %s%s\n",
+        (D->fragment[i].byte_sex & GD_LITTLE_ENDIAN) ? "little" : "big",
+        ((permissive || D->standards >= 8) &&
+         (D->fragment[i].byte_sex & GD_ARM_FLAG) == GD_ARM_ENDIAN) ? " arm" :
+        "");
+
+  if (permissive || D->standards >= 6) {
+    if (D->fragment[i].protection == GD_PROTECT_NONE)
+      fputs("/PROTECT none\n", stream);
+    else if (D->fragment[i].protection == GD_PROTECT_FORMAT)
+      fputs("/PROTECT format\n", stream);
+    else if (D->fragment[i].protection == GD_PROTECT_DATA)
+      fputs("/PROTECT data\n", stream);
+    else
+      fputs("/PROTECT all\n", stream);
+  }
+
+  if (permissive || D->standards >= 1)
+    if (D->fragment[i].frame_offset != 0)
+      fprintf(stream, "%sFRAMEOFFSET %llu\n", (D->standards >= 5) ? "/" : "",
+          (unsigned long long)D->fragment[i].frame_offset);
+
+  if (permissive || D->standards >= 6) {
+    switch(D->fragment[i].encoding) {
+      case GD_UNENCODED:
+        fputs("/ENCODING none\n", stream);
+        break;
+      case GD_BZIP2_ENCODED:
+        fputs("/ENCODING bzip2\n", stream);
+        break;
+      case GD_GZIP_ENCODED:
+        fputs("/ENCODING gzip\n", stream);
+        break;
+      case GD_LZMA_ENCODED:
+        fputs("/ENCODING lzma\n", stream);
+        break;
+      case GD_SLIM_ENCODED:
+        fputs("/ENCODING slim\n", stream);
+        break;
+      case GD_TEXT_ENCODED:
+        fputs("/ENCODING text\n", stream);
+        break;
+      case GD_SIE_ENCODED:
+        fputs("/ENCODING sie\n", stream);
+        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);
+        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);
+        break;
+      case GD_AUTO_ENCODED: /* an unresolved, auto-encoded fragment */
+        break;
+      default:
+        fprintf(stream, "/ENCODING unknown # (%lx)\n", D->fragment[i].encoding);
+        break;
+    }
+  }
+
+  /* The includes */
+  if (permissive || D->standards >= 3)
+    for (j = 0; j < D->n_fragment; ++j)
+      if (D->fragment[j].parent == i) {
+        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);
+        if (prefix || suffix) {
+          fputc(' ', stream);
+          _GD_StringEscapeise(stream, prefix, 0, permissive, D->standards);
+          free(prefix);
+        }
+
+        if (suffix) {
+          fputc(' ', stream);
+          _GD_StringEscapeise(stream, suffix, 0, permissive, D->standards);
+          free(suffix);
+        }
+        fputc('\n', stream);
+      }
+
+  /* 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 (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);
+    }
+
+  /* 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);
+    }
+
+  /* That's all; flush, sync, and close */
+  fflush(stream);
+  fsync(fd);
+#ifdef HAVE_FCHMOD
+  fchmod(fd, mode);
+#endif
+  fclose(stream);
+
+  /* If no error was encountered, move the temporary file over the
+   * old format file, otherwise abort */
+
+  /* Only assume we've synced the file if the rename succeeds */
+  if (D->error != GD_E_OK)
+    gd_UnlinkAt(D, dirfd, temp_file, 0);
+  else if (gd_RenameAt(D, dirfd, temp_file, dirfd, D->fragment[i].bname)) {
+    _GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_RENAME, NULL, errno,
+        D->fragment[i].cname);
+    gd_UnlinkAt(D, dirfd, temp_file, 0);
+  } else
+    D->fragment[i].modified = 0;
+
+  /* update mtime, if successful */
+  if (!D->error && gd_StatAt(D, dirfd, D->fragment[i].bname, &stat_buf, 0) == 0)
+    D->fragment[i].mtime = stat_buf.st_mtime;
+
+  dreturnvoid();
+}
+
+void _GD_FlushMeta(DIRFILE* D, int fragment, int force)
+{
+  int i;
+
+  dtrace("%p, %i, %i", D, fragment, force);
+
+  if (fragment == GD_ALL_FRAGMENTS) {
+    for (i = 0; i < D->n_fragment; ++i)
+      if (force || D->fragment[i].modified)
+        _GD_FlushFragment(D, i, D->flags & GD_PERMISSIVE);
+  } else if (force || D->fragment[fragment].modified)
+    _GD_FlushFragment(D, fragment, D->flags & GD_PERMISSIVE);
+
+  dreturnvoid();
+}
+
+int gd_metaflush(DIRFILE* D)
+{
+  dtrace("%p", D);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_FlushMeta(D, GD_ALL_FRAGMENTS, 0);
+
+  dreturn("%i", (D->error == GD_E_OK) ? 0 : -1);
+  return (D->error == GD_E_OK) ? 0 : -1;
+}
+
+int gd_rewrite_fragment(DIRFILE* D, int fragment)
+{
+  dtrace("%p, %i", D, fragment);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 1);
+    return -1;
+  }
+
+  if (fragment < GD_ALL_FRAGMENTS || fragment >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_FlushMeta(D, fragment, 1);
+
+  dreturn("%i", (D->error == GD_E_OK) ? 0 : -1);
+  return (D->error == GD_E_OK) ? 0 : -1;
+}
+
+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);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) /* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+  else if (field_code == NULL) {
+    _GD_FlushMeta(D, GD_ALL_FRAGMENTS, 0);
+    if (!D->error)
+      for (i = 0; i < D->n_entries; ++i)
+        if (D->entry[i]->field_type == GD_RAW_ENTRY)
+          _GD_Flush(D, D->entry[i], syn, clo);
+  } else {
+    /* discard representation */
+    E = _GD_FindFieldAndRepr(D, field_code, &simple_field_code, &repr, 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);
+  return (D->error == GD_E_OK) ? 0 : -1;
+}
+
+int gd_sync(DIRFILE *D, const char *field_code)
+{
+  int ret;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  ret = _GD_SyncOrClose(D, field_code, 1, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_raw_close(DIRFILE *D, const char *field_code)
+{
+  int ret;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  ret = _GD_SyncOrClose(D, field_code, 0, 1);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_flush(DIRFILE *D, const char *field_code)
+{
+  int ret;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  ret = _GD_SyncOrClose(D, field_code, 1, 1);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+#define GD_VERS_GE_1  0xFFFFFFFEUL
+#define GD_VERS_GE_2  0xFFFFFFFCUL
+#define GD_VERS_GE_3  0xFFFFFFF8UL
+#define GD_VERS_GE_4  0xFFFFFFF0UL
+#define GD_VERS_GE_5  0xFFFFFFE0UL
+#define GD_VERS_GE_6  0xFFFFFFC0UL
+#define GD_VERS_GE_7  0xFFFFFF80UL
+#define GD_VERS_GE_8  0xFFFFFF00UL
+#define GD_VERS_GE_9  0xFFFFFE00UL
+
+#define GD_VERS_LE_0  0x00000001UL
+#define GD_VERS_LE_1  0x00000003UL
+#define GD_VERS_LE_2  0x00000007UL
+#define GD_VERS_LE_3  0x0000000fUL
+#define GD_VERS_LE_4  0x0000001fUL
+#define GD_VERS_LE_5  0x0000003fUL
+#define GD_VERS_LE_6  0x0000007fUL
+#define GD_VERS_LE_7  0x000000ffUL
+#define GD_VERS_LE_8  0x000001ffUL
+#define GD_VERS_LE_9  0x000003ffUL
+
+uint64_t _GD_FindVersion(DIRFILE *D)
+{
+  unsigned int i;
+  char* ptr;
+  dtrace("%p", D);
+
+  D->av = (1 << (1 + GD_DIRFILE_STANDARDS_VERSION)) - 1;
+
+  if (D->n_fragment > 1)
+    D->av &= GD_VERS_GE_3;
+
+  for (i = 0; D->av && i < (unsigned int)D->n_fragment; ++i) {
+    if (D->fragment[i].prefix || D->fragment[i].suffix)
+      D->av &= GD_VERS_GE_9;
+    else if (D->fragment[i].byte_sex & GD_ARM_FLAG)
+      /* on an arm-endian platform, the arm flag is set by /ENDIAN directives
+       * missing an "arm" token, but it's absense might mean either an "arm"
+       * token was present, or else there was no /ENDIAN directive at all */
+#ifdef ARM_ENDIAN_DOUBLES
+      D->av &= GD_VERS_GE_5;
+#else
+    D->av &= GD_VERS_GE_8;
+    else
+#endif
+      if ((D->fragment[i].encoding != GD_UNENCODED &&
+            D->fragment[i].encoding != GD_AUTO_ENCODED) ||
+          D->fragment[i].protection)
+        D->av &= GD_VERS_GE_6;
+      else if (D->fragment[i].byte_sex &
+#ifdef WORDS_BIGENDIAN
+          GD_LITTLE_ENDIAN
+#else
+          GD_BIG_ENDIAN
+#endif
+          )
+        D->av &= GD_VERS_GE_5;
+      else if (D->fragment[i].frame_offset > 0)
+        D->av &= GD_VERS_GE_1;
+  }
+
+  for (i = 0; D->av && i < D->n_entries; ++i) {
+    if (D->entry[i]->hidden)
+      D->av &= GD_VERS_GE_9;
+    else
+      switch (D->entry[i]->field_type) {
+        case GD_RAW_ENTRY:
+          switch (D->entry[i]->EN(raw,data_type)) {
+            case GD_COMPLEX128:
+            case GD_COMPLEX64:
+              D->av &= GD_VERS_GE_7;
+              break;
+            case GD_INT8:
+            case GD_INT64:
+            case GD_UINT64:
+              D->av &= GD_VERS_GE_5;
+              break;
+            default:
+              break;
+          }
+          break;
+        case GD_DIVIDE_ENTRY:
+        case GD_RECIP_ENTRY:
+        case GD_CARRAY_ENTRY:
+          D->av &= GD_VERS_GE_8;
+          break;
+        case GD_MULTIPLY_ENTRY:
+          D->av &= GD_VERS_GE_2;
+          break;
+        case GD_PHASE_ENTRY:
+          D->av &= GD_VERS_GE_4;
+          break;
+        case GD_POLYNOM_ENTRY:
+        case GD_SBIT_ENTRY:
+          D->av &= GD_VERS_GE_7;
+          break;
+        case GD_CONST_ENTRY:
+          if (D->entry[i]->EN(scalar,const_type) & GD_COMPLEX128)
+            D->av &= GD_VERS_GE_7;
+          else
+            D->av &= GD_VERS_GE_6;
+          break;
+        case GD_STRING_ENTRY:
+          D->av &= GD_VERS_GE_6;
+          break;
+        case GD_BIT_ENTRY:
+          if (D->entry[i]->EN(bit,numbits) > 1)
+            D->av &= GD_VERS_GE_1;
+          else if (D->entry[i]->EN(bit,bitnum) + D->entry[i]->EN(bit,numbits)
+              - 1 > 32)
+          {
+            D->av &= GD_VERS_GE_5;
+          }
+          break;
+        case GD_ALIAS_ENTRY:
+        case GD_WINDOW_ENTRY:
+        case GD_MPLEX_ENTRY:
+          D->av &= GD_VERS_GE_9;
+          break;
+        case GD_LINTERP_ENTRY:
+        case GD_LINCOM_ENTRY:
+        case GD_INDEX_ENTRY:
+        case GD_NO_ENTRY:
+          break;
+      }
+
+    if (D->av & GD_VERS_GE_1 && strcmp(D->entry[i]->field, "FRAMEOFFSET") == 0)
+      D->av &= (GD_VERS_LE_0 | GD_VERS_GE_8);
+    else if (D->av & GD_VERS_GE_3 && strcmp(D->entry[i]->field, "INCLUDE") == 0)
+      D->av &= (GD_VERS_LE_2 | GD_VERS_GE_8);
+    else if (D->av & GD_VERS_GE_5 && (strcmp(D->entry[i]->field, "VERSION") == 0
+          || strcmp(D->entry[i]->field, "ENDIAN") == 0))
+      D->av &= (GD_VERS_LE_4 | GD_VERS_GE_8);
+    else if (D->av & GD_VERS_GE_6 &&
+        (strcmp(D->entry[i]->field, "ENCODING") == 0
+         || strcmp(D->entry[i]->field, "META") == 0
+         || strcmp(D->entry[i]->field, "PROTECT") == 0
+         || strcmp(D->entry[i]->field, "REFERENCE") == 0))
+      D->av &= (GD_VERS_LE_5 | GD_VERS_GE_8);
+    else if (D->av & GD_VERS_LE_5 &&
+        strcmp(D->entry[i]->field, "FILEFRAM") == 0)
+      D->av &= GD_VERS_GE_6;
+
+    for (ptr = D->entry[i]->field; *ptr != 0 && D->av; ++ptr)
+      switch(*ptr) {
+        case '/': /* a metafield */
+        case '#':
+        case ' ':
+          D->av &= GD_VERS_GE_6;
+          break;
+        case '.':
+          D->av &= GD_VERS_LE_5;
+          break;
+        case '&':
+        case ';':
+        case '<':
+        case '>':
+        case '\\':
+        case '|':
+          D->av &= GD_VERS_LE_4;
+          break;
+      }
+  }
+
+  D->flags |= GD_HAVE_VERSION;
+  dreturn("0x%04" PRIx64, D->av);
+  return D->av;
+}
+
+int gd_dirfile_standards(DIRFILE *D, int vers) gd_nothrow
+{
+  /* log2(n) lut */
+  static const char ln2[] = { -1,
+    0,
+    1, 1,
+    2, 2, 2, 2,
+    3, 3, 3, 3, 3, 3, 3, 3,
+    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+  };
+
+  /* some magic numbers */
+  static const char earliest_magic[] = {64,  0,  1, 39,  2, 15, 40, 23,  3, 12,
+    16, 59, 41, 19, 24, 54,  4,  0, 13, 10, 17, 62, 60, 28, 42, 30, 20, 51, 25,
+    44, 55, 47,  5, 32,  0, 38, 14, 22, 11, 58, 18, 53, 63,  9, 61, 27, 29, 50,
+    43, 46, 31, 37, 21, 57, 52,  8, 26, 49, 45, 36, 56,  7, 48, 35,  6, 34, 33};
+
+  dtrace("%p, %i", D, vers);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (~D->flags & GD_HAVE_VERSION)
+    _GD_FindVersion(D);
+
+  if (vers == GD_VERSION_CURRENT)
+    vers = D->standards;
+  else if (vers == GD_VERSION_LATEST) {
+    uint32_t a, b;
+    if ((b = D->av >> 16))
+      vers = (a = b >> 8) ? 24 + ln2[a] : 16 + ln2[b];
+    else
+      vers = (a = D->av >> 8) ? 8 + ln2[a] : ln2[D->av];
+  } else if (vers == GD_VERSION_EARLIEST)
+    vers = earliest_magic[(~(D->av - 1) & D->av) % 67];
+
+  if (vers < 0 || vers > GD_DIRFILE_STANDARDS_VERSION ||
+      ~D->av & (1ULL << vers))
+  {
+    _GD_SetError(D, GD_E_ARGUMENT, (D->av == 0) ? GD_E_ARG_NO_VERS :
+        GD_E_ARG_BAD_VERS, NULL, vers, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  D->standards = vers;
+  dreturn("%i", vers);
+  return vers;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/fpos.c b/src/fpos.c
new file mode 100644
index 0000000..628c9dc
--- /dev/null
+++ b/src/fpos.c
@@ -0,0 +1,402 @@
+/* Copyright (C) 2011-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+off64_t _GD_GetFilePos(DIRFILE *D, gd_entry_t *E, off64_t index_pos)
+{
+  int i;
+  off64_t pos = -1, pos2;
+
+  dtrace("%p, %p, %lli", D, E, (long long)index_pos);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    dreturn("%u", 0);
+    D->recurse_level--;
+    return 0;
+  }
+
+  switch (E->field_type) {
+    case GD_RAW_ENTRY:
+      /* We must open the file to know its starting offset */
+      if (E->e->u.raw.file[0].idata < 0)
+        if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, 0))
+          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))
+        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)) {
+            pos = -1;
+            break;
+          }
+          pos2 = _GD_GetFilePos(D, E->e->entry[i], pos);
+          if (pos2 != pos) {
+            _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_MULTIPOS, NULL, 0, NULL);
+            pos = -1;
+            break;
+          }
+        }
+      break;
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_RECIP_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1))
+          break;
+      pos = _GD_GetFilePos(D, E->e->entry[0], -1);
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1))
+          break;
+      pos = _GD_GetFilePos(D, E->e->entry[0], -1);
+      if (D->error)
+        break;
+      pos2 = _GD_GetFilePos(D, E->e->entry[1], pos);
+      if (!D->error && pos != pos2) {
+        _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_MULTIPOS, NULL, 0, NULL);
+        pos = -1;
+      }
+      break;
+    case GD_PHASE_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1))
+        break;
+      pos = _GD_GetFilePos(D, E->e->entry[0], -1);
+      if (pos >= 0)
+        pos += E->EN(phase,shift);
+      break;
+    case GD_INDEX_ENTRY:
+      if (index_pos == -1)
+        pos = E->e->u.index_pos;
+      else
+        pos = index_pos;
+      break;
+    case GD_NO_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_ALIAS_ENTRY:
+      _GD_InternalError(D);
+  }
+
+  D->recurse_level--;
+  dreturn("%lli", (long long)pos);
+  return pos;
+}
+
+/* Get the current I/O position of the given field
+*/
+off64_t gd_tell64(DIRFILE *D, const char *field_code_in) gd_nothrow
+{
+  off64_t pos = -1;
+  gd_entry_t* entry;
+  char* field_code;
+  int repr;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%u", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%u", 0);
+    return 0;
+  }
+
+  if (entry->field_type & GD_SCALAR_ENTRY_BIT)
+    _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code);
+  else
+    pos = _GD_GetFilePos(D, entry, -1);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  dreturn("%lli", (long long)pos);
+  return pos;
+}
+
+off_t gd_tell(DIRFILE *D, const char *field_code) gd_nothrow
+{
+  return (off_t)gd_tell64(D, field_code);
+}
+
+off64_t _GD_WriteSeek(DIRFILE *D, gd_entry_t *E, const struct encoding_t *enc,
+    off64_t offset, unsigned int mode)
+{
+  off64_t pos = 0;
+  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 && 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) {
+        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) {
+          dreturn("%i", -1);
+          return -1;
+        }
+        offset -= n_wrote;
+        pos += n_wrote;
+      } else if (n_read < 0) {
+        dreturn("%i", -1);
+        return -1;
+      }
+    }
+  }
+
+  pos += (*enc->seek)(E->e->u.raw.file + which, offset, E->EN(raw,data_type),
+      mode);
+
+  dreturn("%lli", (long long)pos);
+  return pos;
+}
+
+int _GD_Seek(DIRFILE *D, gd_entry_t *E, off64_t offset, unsigned int mode)
+{
+  int i;
+
+  dtrace("%p, %p, %lli, 0x%X", D, E, (long long)offset, mode);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    D->recurse_level--;
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  if (offset < 0) {
+    _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL);
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  switch (E->field_type) {
+    case GD_RAW_ENTRY:
+      /* open/create the file, if necessary */
+      if (_GD_InitRawIO(D, E, NULL, 0, NULL, GD_EF_SEEK, mode, 0))
+        break;
+
+      /* The requested offset is before the start of the file, so I guess
+       * pretend we've repositioned it...
+       */
+      if (E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset >
+          offset) {
+        E->e->u.raw.file[0].pos = offset - E->EN(raw,spf) *
+          D->fragment[E->fragment_index].frame_offset;
+        break;
+      }
+
+      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);
+      }
+      break;
+    case GD_LINCOM_ENTRY:
+      for (i = 0; i < E->EN(lincom,n_fields); ++i)
+        if (!_GD_BadInput(D, E, i, 1))
+          _GD_Seek(D, E->e->entry[i], offset, mode);
+        else
+          break;
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (_GD_BadInput(D, E, 1, 1))
+        break;
+      if (_GD_Seek(D, E->e->entry[1], offset, mode))
+        break;
+      /* fallthrough */
+    case GD_LINTERP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_RECIP_ENTRY:
+      if (!_GD_BadInput(D, E, 0, 1))
+        _GD_Seek(D, E->e->entry[0], offset, mode);
+      break;
+    case GD_PHASE_ENTRY:
+      if (!_GD_BadInput(D, E, 0, 1))
+        _GD_Seek(D, E->e->entry[0], offset - E->EN(phase,shift), mode);
+      break;
+    case GD_INDEX_ENTRY:
+      E->e->u.index_pos = offset;
+      break;
+    case GD_NO_ENTRY:
+    case GD_CONST_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_ALIAS_ENTRY:
+      _GD_InternalError(D);
+  }
+
+  D->recurse_level--;
+  dreturn("%i", (D->error == 0) ? 0 : 1);
+  return (D->error == 0) ? 0 : 1;
+}
+
+/* Set the I/O position of the given field
+ */
+off64_t gd_seek64(DIRFILE *D, const char *field_code_in, 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;
+  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,
+      (long long)sample_num, whence);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%u", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (entry->field_type & GD_SCALAR_ENTRY_BIT) {
+    _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code);
+    if (field_code != field_code_in)
+      free(field_code);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (frame_num) {
+    spf = _GD_GetSPF(D, entry);
+
+    if (D->error) {
+      if (field_code != field_code_in)
+        free(field_code);
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+
+  sample_num += frame_num * spf;
+
+  whence &= (GD_SEEK_SET | GD_SEEK_CUR | GD_SEEK_END);
+  if (whence == GD_SEEK_SET)
+    pos = 0;
+  else if (whence == GD_SEEK_CUR)
+    pos = _GD_GetFilePos(D, entry, -1);
+  else if (whence == GD_SEEK_END) {
+    pos = _GD_GetEOF(D, entry, NULL, &is_index);
+    if (is_index)
+      _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+  } else
+    _GD_SetError(D, GD_E_ARGUMENT, GD_E_ARG_WHENCE, NULL, 0, NULL);
+
+  if (!D->error)
+    _GD_Seek(D, entry, sample_num + pos, mode);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error)
+    pos = -1;
+  else
+    pos = _GD_GetFilePos(D, entry, -1);
+
+  dreturn("%lli", (long long)pos);
+  return pos;
+}
+
+off_t gd_seek(DIRFILE *D, const char *field_code, off_t frame_num,
+    off_t sample_num, int whence)
+{
+  return (off_t)gd_seek64(D, field_code, frame_num, sample_num, whence);
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/fragment.c b/src/fragment.c
new file mode 100644
index 0000000..ae375df
--- /dev/null
+++ b/src/fragment.c
@@ -0,0 +1,411 @@
+/* Copyright (C) 2008, 2010, 2011, 2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+const char *gd_fragmentname(DIRFILE* D, int index) gd_nothrow
+{
+  dtrace("%p, %i", D, index);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (index < 0 || index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  dreturn("\"%s\"", D->fragment[index].cname);
+  return D->fragment[index].cname;
+}
+
+int gd_fragment_affixes(DIRFILE *D, int index, char **prefix, char **suffix)
+  gd_nothrow
+{
+  char *p = NULL, *s = NULL;
+  dtrace("%p, %i, %p, %p", D, index, prefix, suffix);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (index < 0 || index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (D->fragment[index].prefix)
+    p = _GD_Strdup(D, D->fragment[index].prefix);
+  if (D->fragment[index].suffix)
+    s = _GD_Strdup(D, D->fragment[index].suffix);
+
+  if (D->error) {
+    free(p);
+    free(s);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  *prefix = p;
+  *suffix = s;
+  dreturn("%i", 0);
+  return 0;
+}
+
+static char **_GD_CheckAffixes(DIRFILE *D, int i, const char *prefix,
+    const char *suffix, char **codes, unsigned *n)
+{
+  int j, dummy;
+  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));
+  if (!ptr) {
+    dreturn("%p (%i)", codes, *n);
+    return codes;
+  }
+  new_codes = ptr;
+
+  /* push the new prefix and suffix onto the code stack */
+  new_codes[nn++] = prefix ? _GD_Strdup(D, prefix) : NULL;
+  new_codes[nn++] = suffix ? _GD_Strdup(D, suffix) : NULL;
+  *n = nn;
+
+  if (D->error) {
+    dreturn("%p (%i)", new_codes, *n);
+    return new_codes;
+  }
+
+  /* Propagate changes downward */
+  for (j = 0; j < D->n_fragment; ++j)
+    if (D->fragment[j].parent == i) {
+      char *subprefix = _GD_MungeCode(D, NULL, 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);
+      if (D->error) {
+        free(subprefix);
+        dreturn("%p (%i)", new_codes, *n);
+        return new_codes;
+      }
+
+      new_codes = _GD_CheckAffixes(D, j, subprefix, subsuffix, new_codes, n);
+      free(subprefix);
+      free(subsuffix);
+      nn = *n;
+
+      if (D->error) {
+        dreturn("%p (%i)", new_codes, *n);
+        return new_codes;
+      }
+    }
+
+  /* Check for namespace clashes in our files */
+  for (u = 0; u < D->n_entries; ++u)
+    if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) {
+      ptr = (char**)_GD_Realloc(D, new_codes, sizeof(char*) * ++nn);
+      if (ptr) {
+        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);
+
+        /* 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))
+        {
+          _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0,
+              new_codes[nn - 1]);
+        }
+      } else
+        nn--;
+
+      if (D->error)
+        break;
+    }
+
+  *n = nn;
+  dreturn("%p (%i)", new_codes, *n);
+  return new_codes;
+}
+
+static int _GD_ChangeAffixes(DIRFILE *D, int i, char **codes, int *resort)
+{
+  int j;
+  unsigned u, n = 2;
+
+  dtrace("%p, %i, %p, %p", D, i, codes, resort);
+
+  free(D->fragment[i].prefix);
+  free(D->fragment[i].suffix);
+  D->fragment[i].prefix = codes[0];
+  D->fragment[i].suffix = codes[1];
+
+  /* Propagate changes downward */
+  for (j = 0; j < D->n_fragment; ++j)
+    if (D->fragment[j].parent == i)
+      n += _GD_ChangeAffixes(D, j, codes + n, resort);
+
+  /* rename all the fields */
+  for (u = 0; u < D->n_entries; ++u)
+    if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) {
+      *resort = 1;
+      free(D->entry[u]->field);
+      D->entry[u]->field = codes[n++];
+    }
+
+  dreturn("%i", n);
+  return n;
+}
+
+int gd_alter_affixes(DIRFILE *D, int index, const char *prefix,
+    const char *suffix) gd_nothrow
+{
+  unsigned u, n = 0;
+  char **new_codes;
+  int resort = 0;
+  dtrace("%p, %i, \"%s\", \"%s\"", D, index, prefix, suffix);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (index <= 0 || index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (D->fragment[D->fragment[index].parent].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[D->fragment[index].parent].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* affixes to keep */
+  if (!prefix)
+    prefix = D->fragment[index].prefix;
+
+  if (!suffix)
+    suffix = D->fragment[index].suffix;
+
+  /* nothing to do */
+  if (strcmp(prefix, D->fragment[index].prefix) == 0 &&
+      strcmp(suffix, D->fragment[index].suffix) == 0)
+  {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  new_codes = _GD_CheckAffixes(D, index, prefix, suffix, NULL, &n);
+
+  if (D->error) {
+    for (u = 0; u < n; ++u)
+      free(new_codes[u]);
+    free(new_codes);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ChangeAffixes(D, index, new_codes, &resort);
+
+  free(new_codes);
+
+  if (resort) {
+    /* resort */
+    qsort(D->entry, D->n_entries, sizeof(gd_entry_t*), _GD_EntryCmp);
+    qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp);
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_nfragments(DIRFILE* D) gd_nothrow
+{
+  dtrace("%p", D);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  dreturn("%i", D->n_fragment);
+  return D->n_fragment;
+}
+
+int gd_parent_fragment(DIRFILE* D, int fragment_index) gd_nothrow
+{
+  dtrace("%p, %i", D, fragment_index);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment_index <= 0 || fragment_index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", D->fragment[fragment_index].parent);
+  return D->fragment[fragment_index].parent;
+}
+
+/* returns non-zero if the metadata has changed on disk since the dirfile was
+ * opened and, optionally, re-opens the dirfile.
+ */
+int gd_desync(DIRFILE *D, unsigned int flags)
+{
+  int changed = 0, i;
+  struct stat statbuf;
+
+  dtrace("%p, 0x%x", D, flags);
+
+  /* if we can't open directories, we're stuck with the full path method */
+#ifdef GD_NO_DIR_OPEN
+  flags |= GD_DESYNC_PATHCHECK;
+#endif
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  for (i = 0; i < D->n_fragment; ++i) {
+    if (flags & GD_DESYNC_PATHCHECK) {
+      /* stat the file via it's path relative to the original filedir */
+      char *buffer;
+      if (D->fragment[i].sname) {
+        buffer = (char*)_GD_Malloc(D, strlen(D->name) +
+            strlen(D->fragment[i].bname) + strlen(D->fragment[i].sname) + 3);
+        if (buffer == NULL) {
+          dreturn("%i", -1);
+          return -1;
+        }
+        sprintf(buffer, "%s%c%s%c%s", D->name, GD_DIRSEP, D->fragment[i].sname,
+            GD_DIRSEP, D->fragment[i].bname);
+      } else {
+        buffer = (char*)_GD_Malloc(D, strlen(D->name) +
+            strlen(D->fragment[i].bname) + 2);
+        if (buffer == NULL) {
+          dreturn("%i", -1);
+          return -1;
+        }
+        sprintf(buffer, "%s%c%s", D->name, GD_DIRSEP, D->fragment[i].bname);
+      }
+      if (stat(buffer, &statbuf)) {
+        _GD_SetError(D, GD_E_RAW_IO, 0, buffer, errno, NULL);
+        free(buffer);
+        dreturn("%i", -1);
+        return -1;
+      }
+      free(buffer);
+    } else
+      /* stat the file based on it's name and our cached dirfd */
+      if (gd_StatAt(D, D->fragment[i].dirfd, D->fragment[i].bname, &statbuf, 0))
+      {
+        _GD_SetError(D, GD_E_RAW_IO, 0, D->fragment[i].cname, errno, NULL);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+    if (statbuf.st_mtime != D->fragment[i].mtime) {
+      changed = 1;
+      break;
+    }
+  }
+
+  if (changed && flags & GD_DESYNC_REOPEN) {
+    /* reopening is easy: just delete everything and start again.  In the
+     * non-PATHCHECK case, we also have to cache the dirfd to the root directory
+     */
+
+    /* remember how we were called */
+    char *name = D->name;
+    gd_parser_callback_t sehandler = D->sehandler;
+    void *extra = D->sehandler_extra;
+    unsigned long int flags = D->open_flags;
+    int dirfd = -1;
+
+    if (!(flags & GD_DESYNC_PATHCHECK)) {
+      dirfd = dup(D->fragment[0].dirfd);
+      if (dirfd == -1) {
+        _GD_SetError(D, GD_E_RAW_IO, 0, D->name, errno, NULL);
+        dreturn("%i", -1);
+        return -1;
+      }
+    }
+
+    D->name = NULL; /* so FreeD doesn't delete it */
+    if (_GD_ShutdownDirfile(D, 0, 1)) {
+      D->name = name;
+      dreturn("%i", -1);
+      return -1;
+    }
+    _GD_Open(D, dirfd, name, flags, sehandler, extra);
+    free(name);
+
+    if (D->error)
+      changed = -1;
+  }
+
+  dreturn("%i", changed);
+  return changed;
+}
diff --git a/src/gd_config.h.in b/src/gd_config.h.in
new file mode 100644
index 0000000..f23235d
--- /dev/null
+++ b/src/gd_config.h.in
@@ -0,0 +1,725 @@
+/* src/gd_config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Define to 1 if your processor stores double-precision floats in the old ARM
+   middle-endian format */
+#undef ARM_ENDIAN_DOUBLES
+
+/* Define to the full path to the `bunzip2' binary */
+#undef BUNZIP2
+
+/* Define to the full path to the `bzip2' binary */
+#undef BZIP2
+
+/* Define to 1 if your C++ compiler doesn't accept -c and -o together. */
+#undef CXX_NO_MINUS_C_MINUS_O
+
+/* Define to dummy `main' function (if any) required to link to the Fortran
+   libraries. */
+#undef F77_DUMMY_MAIN
+
+/* Define to a macro mangling the given C identifier (in lower and upper
+   case), which must not contain underscores, for linking with Fortran. */
+#undef F77_FUNC
+
+/* As F77_FUNC, but for C identifiers containing underscores. */
+#undef F77_FUNC_
+
+/* Define to 1 if your Fortran compiler doesn't accept -c and -o together. */
+#undef F77_NO_MINUS_C_MINUS_O
+
+/* Define if F77 and FC dummy `main' functions are identical. */
+#undef FC_DUMMY_MAIN_EQ_F77
+
+/* Define to 1 if your Fortran compiler doesn't accept -c and -o together. */
+#undef FC_NO_MINUS_C_MINUS_O
+
+/* Define to 1 if your processor stores double-precision floats in big-endian
+   order */
+#undef FLOATS_BIGENDIAN
+
+/* The directory separator between path elements */
+#undef GD_DIRSEP
+
+/* Define to 1 if restrict can used on pointer arrays */
+#undef GD_RESTRICT_ARRAY_OK
+
+/* Define to enable debugging messages */
+#undef GETDATA_DEBUG
+
+/* The major version number */
+#undef GETDATA_MAJOR
+
+/* The minor version number */
+#undef GETDATA_MINOR
+
+/* The revision number */
+#undef GETDATA_REVISION
+
+/* Other qualifiers on the version number triplet (if any) */
+#undef GETDATA_VERSION_SUFFIX
+
+/* Define to the full path to the `gunzip' binary */
+#undef GUNZIP
+
+/* Define to the full path to the `gzip' binary */
+#undef GZIP
+
+/* Define to 1 if you have the <asm/unaligned.h> header file. */
+#undef HAVE_ASM_UNALIGNED_H
+
+/* Define to 1 if you have the <Availability.h> header file. */
+#undef HAVE_AVAILABILITY_H
+
+/* Define to 1 if you have the `basename' function. */
+#undef HAVE_BASENAME
+
+/* Define to 1 if you have the <byteswap.h> header file. */
+#undef HAVE_BYTESWAP_H
+
+/* Define to 1 if you have the <bzlib.h> header file. */
+#undef HAVE_BZLIB_H
+
+/* Define to 1 if you have the `cabs' function. */
+#undef HAVE_CABS
+
+/* Define to 1 if you have the <complex.h> header file. */
+#undef HAVE_COMPLEX_H
+
+/* Define to 1 if you have the declaration of `bswap16', and to 0 if you
+   don't. */
+#undef HAVE_DECL_BSWAP16
+
+/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you
+   don't. */
+#undef HAVE_DECL_BSWAP_16
+
+/* Define to 1 if you have the declaration of `get_unaligned', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GET_UNALIGNED
+
+/* Define to 1 if you have the declaration of `isfinite', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ISFINITE
+
+/* Define to 1 if you have the declaration of `OSSwapInt16', and to 0 if you
+   don't. */
+#undef HAVE_DECL_OSSWAPINT16
+
+/* Define to 1 if you have the declaration of `put_unaligned', and to 0 if you
+   don't. */
+#undef HAVE_DECL_PUT_UNALIGNED
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRERROR_R
+
+/* Define to 1 if you have the <direct.h> header file. */
+#undef HAVE_DIRECT_H
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+   */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `fchmod' function. */
+#undef HAVE_FCHMOD
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `fdopendir' function. */
+#undef HAVE_FDOPENDIR
+
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define to 1 if you have the `fpathconf' function. */
+#undef HAVE_FPATHCONF
+
+/* Define to 1 if you have the `fseeko' function. */
+#undef HAVE_FSEEKO
+
+/* Define to 1 if you have the `fseeko64' function. */
+#undef HAVE_FSEEKO64
+
+/* Define to 1 if you have the `fstat64' function. */
+#undef HAVE_FSTAT64
+
+/* Define to 1 if you have the `fstatat' function. */
+#undef HAVE_FSTATAT
+
+/* Define to 1 if you have the `fstatat64' function. */
+#undef HAVE_FSTATAT64
+
+/* Define to 1 if you have the `fsync' function. */
+#undef HAVE_FSYNC
+
+/* Define to 1 if you have the `ftello' function. */
+#undef HAVE_FTELLO
+
+/* Define to 1 if you have the `ftello64' function. */
+#undef HAVE_FTELLO64
+
+/* Define to 1 if you have the `ftruncate' function. */
+#undef HAVE_FTRUNCATE
+
+/* Define to 1 if you have the `ftruncate64' function. */
+#undef HAVE_FTRUNCATE64
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define to 1 if you have the `getdelim' function. */
+#undef HAVE_GETDELIM
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#undef HAVE_GMTIME_R
+
+/* Define to 1 if you have the <idl_export.h> header file. */
+#undef HAVE_IDL_EXPORT_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
+/* Define to 1 if you have the `isnan' function. */
+#undef HAVE_ISNAN
+
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+#undef HAVE_LIBBZ2
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_H
+
+/* Define to 1 if you have the <libkern/OSByteOrder.h> header file. */
+#undef HAVE_LIBKERN_OSBYTEORDER_H
+
+/* Define to 1 if you have the `lzma' library (-llzma). */
+#undef HAVE_LIBLZMA
+
+/* Define to 1 if you have the `slim' library (-lslim). */
+#undef HAVE_LIBSLIM
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the `zzip' library (-lzzip). */
+#undef HAVE_LIBZZIP
+
+/* Define to 1 if you have the `lseek64' function. */
+#undef HAVE_LSEEK64
+
+/* Define to 1 if you have the `lstat' function. */
+#undef HAVE_LSTAT
+
+/* Define to 1 if you have the `lstat64' function. */
+#undef HAVE_LSTAT64
+
+/* Define to 1 if you have the <ltdl.h> header file. */
+#undef HAVE_LTDL_H
+
+/* Define to 1 if you have the <lzma.h> header file. */
+#undef HAVE_LZMA_H
+
+/* Define to 1 if you have the <math.h> header file. */
+#undef HAVE_MATH_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mkfifo' function. */
+#undef HAVE_MKFIFO
+
+/* Define to 1 if you have the `nan' function. */
+#undef HAVE_NAN
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <numpy/arrayobject.h> header file. */
+#undef HAVE_NUMPY_ARRAYOBJECT_H
+
+/* Define to 1 if the system has the type `off64_t'. */
+#undef HAVE_OFF64_T
+
+/* Define to 1 if you have the `openat' function. */
+#undef HAVE_OPENAT
+
+/* Define to 1 if you have the `pathconf' function. */
+#undef HAVE_PATHCONF
+
+/* 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
+
+/* Define to 1 if you have the `readlink' function. */
+#undef HAVE_READLINK
+
+/* Define to 1 if you have the `renameat' function. */
+#undef HAVE_RENAMEAT
+
+/* Define to 1 if you have the `slimdopen' function. */
+#undef HAVE_SLIMDOPEN
+
+/* 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
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strtoll' function. */
+#undef HAVE_STRTOLL
+
+/* Define to 1 if you have the `strtoq' function. */
+#undef HAVE_STRTOQ
+
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
+/* Define to 1 if you have the `strtouq' function. */
+#undef HAVE_STRTOUQ
+
+/* Define to 1 if the system has the type `struct stat64'. */
+#undef HAVE_STRUCT_STAT64
+
+/* Define to 1 if the system has the type `struct _stat64'. */
+#undef HAVE_STRUCT__STAT64
+
+/* Define to 1 if the system has the type `struct __stat64'. */
+#undef HAVE_STRUCT___STAT64
+
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+   */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/endian.h> header file. */
+#undef HAVE_SYS_ENDIAN_H
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+   */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `unlinkat' function. */
+#undef HAVE_UNLINKAT
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* Define to 1 if you have the <zzip/lib.h> header file. */
+#undef HAVE_ZZIP_LIB_H
+
+/* Define to 1 if you have the `_chsize' function. */
+#undef HAVE__CHSIZE
+
+/* Define to 1 if you have the `_chsize_s' function. */
+#undef HAVE__CHSIZE_S
+
+/* Define to 1 if you have the `_commit' function. */
+#undef HAVE__COMMIT
+
+/* Define to 1 if the system has the type `_Complex double'. */
+#undef HAVE__COMPLEX_DOUBLE
+
+/* Define to 1 if the system has the type `_Complex float'. */
+#undef HAVE__COMPLEX_FLOAT
+
+/* Define to 1 if you have the `_fdopen' function. */
+#undef HAVE__FDOPEN
+
+/* Define to 1 if you have the `_finite' function. */
+#undef HAVE__FINITE
+
+/* Define to 1 if you have the `_fstat' function. */
+#undef HAVE__FSTAT
+
+/* Define to 1 if you have the `_fstat64' function. */
+#undef HAVE__FSTAT64
+
+/* Define to 1 if you have the `_getcwd' function. */
+#undef HAVE__GETCWD
+
+/* Define to 1 if you have the `_isnan' function. */
+#undef HAVE__ISNAN
+
+/* Define to 1 if you have the `_lseeki64' function. */
+#undef HAVE__LSEEKI64
+
+/* Define to 1 if you have the `_mkdir' function. */
+#undef HAVE__MKDIR
+
+/* Define to 1 if you have the `_open' function. */
+#undef HAVE__OPEN
+
+/* Define to 1 if you have the `_read' function. */
+#undef HAVE__READ
+
+/* Define to 1 if you have the `_rmdir' function. */
+#undef HAVE__RMDIR
+
+/* Define to 1 if you have the `_snprintf' function. */
+#undef HAVE__SNPRINTF
+
+/* Define to 1 if you have the `_stat64' function. */
+#undef HAVE__STAT64
+
+/* Define to 1 if you have the `_strtoi64' function. */
+#undef HAVE__STRTOI64
+
+/* Define to 1 if you have the `_strtoui64' function. */
+#undef HAVE__STRTOUI64
+
+/* Define to 1 if you have the `_unlink' function. */
+#undef HAVE__UNLINK
+
+/* Define to 1 if you have the `_write' function. */
+#undef HAVE__WRITE
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#undef LT_OBJDIR
+
+/* Define to 1 if the `mkdir' function takes only one argument. */
+#undef MKDIR_NO_MODE
+
+/* Define to the full Win32 path to the `sh.exe' binary */
+#undef MSYS_SHELL
+
+/* Define to disable assertions */
+#undef NDEBUG
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long int', as computed by sizeof. */
+#undef SIZEOF_LONG_INT
+
+/* The size of `long long int', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG_INT
+
+/* The size of `off_t', as computed by sizeof. */
+#undef SIZEOF_OFF_T
+
+/* The size of `short int', as computed by sizeof. */
+#undef SIZEOF_SHORT_INT
+
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* The size of `unsigned int', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_INT
+
+/* The size of `unsigned long int', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG_INT
+
+/* The size of `unsigned long long int', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG_LONG_INT
+
+/* The size of `unsigned short int', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_SHORT_INT
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* Define to the full path to the `slim' binary */
+#undef SLIM
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if strerror_r returns char *. */
+#undef STRERROR_R_CHAR_P
+
+/* Define to enable bzip2 tests */
+#undef TEST_BZIP2
+
+/* Define to enable gzip tests */
+#undef TEST_GZIP
+
+/* Define to enable lzma tests */
+#undef TEST_LZMA
+
+/* Define to enable slim tests */
+#undef TEST_SLIM
+
+/* Define to enable zzip tests */
+#undef TEST_ZZIP
+
+/* Define to 1 if the platform supports fast unaligned memory access */
+#undef UNALIGNED_ACCESS_OK
+
+/* Define to the full path to the `unslim' binary */
+#undef UNSLIM
+
+/* Define to the full path to the `unzip' binary */
+#undef UNZIP
+
+/* Define to enable bzip2 support */
+#undef USE_BZIP2
+
+/* Define to enable gzip support */
+#undef USE_GZIP
+
+/* Define to enable lzma support */
+#undef USE_LZMA
+
+/* 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
+
+/* Define to enable slim support */
+#undef USE_SLIM
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define to enable zzip support */
+#undef USE_ZZIP
+
+/* Define to enable zzslim support */
+#undef USE_ZZSLIM
+
+/* Version number of package */
+#undef VERSION
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to the full path to the `xz' binary */
+#undef XZ
+
+/* Define to the full path to the `zip' binary */
+#undef ZIP
+
+/* 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
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT8_T
+
+/* If compiling aginst the MSVCRT, define to 0x601 */
+#undef __MSVCRT_VERSION__
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int16_t
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int32_t
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int64_t
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+   a type exists and the standard includes do not define it. */
+#undef int8_t
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+   nothing if this is not supported.  Do not define if restrict is
+   supported directly.  */
+#undef restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+   __restrict__, even though the corresponding Sun C compiler ends up with
+   "#define restrict _Restrict" or "#define restrict __restrict__" in the
+   previous line.  Perhaps some future version of Sun C++ will work with
+   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint16_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint64_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint8_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
diff --git a/src/getdata.c b/src/getdata.c
new file mode 100644
index 0000000..34f3906
--- /dev/null
+++ b/src/getdata.c
@@ -0,0 +1,2083 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#include "nan.h"
+
+#define EXTRACT_REPR(it,ot,f) \
+  for (i = 0; i < n; ++i) ((ot *)rdata)[i] = (ot)f(((it *)cdata)[i])
+
+#ifdef GD_NO_C99_API
+#define fargs(x) (((x) < 0) ? M_PI : 0)
+#define fargu(x) (((x) & (1 << sizeof((x)))) ? M_PI : 0)
+
+#define EXTRACT_REPRC(it,ot,f) \
+  for (i = 0; i < n; ++i) ((ot *)rdata)[i] = (ot)f((it *)cdata + 2 * i)
+
+#define EXTRACT_REPRC2(it,ot) \
+  switch (repr) { \
+    case GD_REPR_REAL: EXTRACT_REPRC(it,ot,creal); break; \
+    case GD_REPR_IMAG: EXTRACT_REPRC(it,ot,cimag); break; \
+    case GD_REPR_MOD:  EXTRACT_REPRC(it,ot,cabs); break; \
+    case GD_REPR_ARG:  EXTRACT_REPRC(it,ot,carg); break; \
+  }
+
+#define EXTRACT_REPRR2(it,ot,f) \
+  switch (repr) { \
+    case GD_REPR_REAL: EXTRACT_REPR(it,ot,); break; \
+    case GD_REPR_IMAG: EXTRACT_REPR(it,ot,0 *); break; \
+    case GD_REPR_MOD:  EXTRACT_REPR(it,ot,fabs); break; \
+    case GD_REPR_ARG:  EXTRACT_REPR(it,ot,f); break; \
+  }
+
+#define EXTRACT_REPRS(ot) \
+  switch (in_type) { \
+    case GD_UINT8:      EXTRACT_REPRR2(       uint8_t, ot,fargu); break; \
+    case GD_INT8:       EXTRACT_REPRR2(        int8_t, ot,fargs); break; \
+    case GD_UINT16:     EXTRACT_REPRR2(      uint16_t, ot,fargu); break; \
+    case GD_INT16:      EXTRACT_REPRR2(       int16_t, ot,fargs); break; \
+    case GD_UINT32:     EXTRACT_REPRR2(      uint32_t, ot,fargu); break; \
+    case GD_INT32:      EXTRACT_REPRR2(       int32_t, ot,fargs); break; \
+    case GD_UINT64:     EXTRACT_REPRR2(      uint64_t, ot,fargu); break; \
+    case GD_INT64:      EXTRACT_REPRR2(       int64_t, ot,fargs); break; \
+    case GD_FLOAT32:    EXTRACT_REPRR2(         float, ot,fargs); break; \
+    case GD_FLOAT64:    EXTRACT_REPRR2(        double, ot,fargs); break; \
+    case GD_COMPLEX64:  EXTRACT_REPRC2(        float, ot); break; \
+    case GD_COMPLEX128: EXTRACT_REPRC2(       double, ot); break; \
+    case GD_NULL: \
+      break; \
+    default: \
+      _GD_SetError(D, GD_E_BAD_TYPE, in_type, NULL, 0, NULL); \
+  }
+#else
+#define EXTRACT_REPR2(it,ot) \
+  switch (repr) { \
+    case GD_REPR_REAL: EXTRACT_REPR(it,ot,creal); break; \
+    case GD_REPR_IMAG: EXTRACT_REPR(it,ot,cimag); break; \
+    case GD_REPR_MOD:  EXTRACT_REPR(it,ot,cabs); break; \
+    case GD_REPR_ARG:  EXTRACT_REPR(it,ot,carg); break; \
+  }
+
+#define EXTRACT_REPRS(ot) \
+  switch (in_type) { \
+    case GD_UINT8:      EXTRACT_REPR2(       uint8_t, ot); break; \
+    case GD_INT8:       EXTRACT_REPR2(        int8_t, ot); break; \
+    case GD_UINT16:     EXTRACT_REPR2(      uint16_t, ot); break; \
+    case GD_INT16:      EXTRACT_REPR2(       int16_t, ot); break; \
+    case GD_UINT32:     EXTRACT_REPR2(      uint32_t, ot); break; \
+    case GD_INT32:      EXTRACT_REPR2(       int32_t, ot); break; \
+    case GD_UINT64:     EXTRACT_REPR2(      uint64_t, ot); break; \
+    case GD_INT64:      EXTRACT_REPR2(       int64_t, ot); break; \
+    case GD_FLOAT32:    EXTRACT_REPR2(         float, ot); break; \
+    case GD_FLOAT64:    EXTRACT_REPR2(        double, ot); break; \
+    case GD_COMPLEX64:  EXTRACT_REPR2( complex float, ot); break; \
+    case GD_COMPLEX128: EXTRACT_REPR2(complex double, ot); break; \
+    case GD_NULL: \
+      break; \
+    default: \
+      _GD_SetError(D, GD_E_BAD_TYPE, in_type, NULL, 0, NULL); \
+  }
+#endif
+
+
+static void _GD_ExtractRepr(DIRFILE *restrict D, const void *restrict cdata,
+    gd_type_t in_type, void *restrict rdata, gd_type_t type, size_t n, int repr)
+{
+  size_t i;
+
+  dtrace("%p, %p, 0x%X, %p, 0x%X, %" PRNsize_t ", %i", D, cdata, in_type, rdata,
+      type, n, repr);
+
+  switch (type) {
+    case GD_UINT8:      EXTRACT_REPRS(       uint8_t); break;
+    case GD_INT8:       EXTRACT_REPRS(        int8_t); break;
+    case GD_UINT16:     EXTRACT_REPRS(      uint16_t); break;
+    case GD_INT16:      EXTRACT_REPRS(       int16_t); break;
+    case GD_UINT32:     EXTRACT_REPRS(      uint32_t); break;
+    case GD_INT32:      EXTRACT_REPRS(       int32_t); break;
+    case GD_UINT64:     EXTRACT_REPRS(      uint64_t); break;
+    case GD_INT64:      EXTRACT_REPRS(       int64_t); break;
+    case GD_FLOAT32:    EXTRACT_REPRS(         float); break;
+    case GD_FLOAT64:    EXTRACT_REPRS(        double); break;
+#ifdef GD_NO_C99_API
+#undef EXTRACT_REPRC
+#undef EXTRACT_REPR
+#define EXTRACT_REPRC(it,ot,f) \
+  do { \
+    for (i = 0; i < n; ++i) { \
+      ((ot *)rdata)[2 * i] = (ot)f((it *)cdata + 2 * i); \
+      ((ot *)rdata)[2 * i + 1] = 0; \
+    } \
+  } while(0)
+
+#define EXTRACT_REPR(it,ot,f) \
+  do { \
+    for (i = 0; i < n; ++i) { \
+      ((ot *)rdata)[2 * i] = (ot)f(((it *)cdata)[i]); \
+      ((ot *)rdata)[2 * i + 1] = 0; \
+    } \
+  } while(0)
+
+    case GD_COMPLEX64:  EXTRACT_REPRS(         float); break;
+    case GD_COMPLEX128: EXTRACT_REPRS(        double); break;
+#else
+    case GD_COMPLEX64:  EXTRACT_REPRS( float complex); break;
+    case GD_COMPLEX128: EXTRACT_REPRS(double complex); break;
+#endif
+    case GD_NULL:                                      break;
+    default:
+      _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+      break;
+  }
+
+  dreturnvoid();
+}
+
+/* _GD_FillFileFrame: fill dataout with frame indices
+*/
+static void _GD_FillFileFrame(void *dataout, gd_type_t rtype, off64_t s0,
+    size_t n)
+{
+  size_t i;
+
+  dtrace("%p, 0x%X, %lli, %" PRNsize_t, dataout, rtype, (long long)s0, n);
+
+  switch (rtype) {
+    case GD_INT8:
+      for (i = 0; i < n; i++)
+        ((int8_t *)dataout)[i] = (int8_t)(i + s0);
+      break;
+    case GD_UINT8:
+      for (i = 0; i < n; i++)
+        ((uint8_t *)dataout)[i] = (uint8_t)(i + s0);
+      break;
+    case GD_INT16:
+      for (i = 0; i < n; i++)
+        ((int16_t *)dataout)[i] = (int16_t)(i + s0);
+      break;
+    case GD_UINT16:
+      for (i = 0; i < n; i++)
+        ((uint16_t *)dataout)[i] = (uint16_t)(i + s0);
+      break;
+    case GD_INT32:
+      for (i = 0; i < n; i++)
+        ((int32_t *)dataout)[i] = (int32_t)(i + s0);
+      break;
+    case GD_UINT32:
+      for (i = 0; i < n; i++)
+        ((uint32_t *)dataout)[i] = (uint32_t)(i + s0);
+      break;
+    case GD_INT64:
+      for (i = 0; i < n; i++)
+        ((int64_t *)dataout)[i] = (int64_t)(i + s0);
+      break;
+    case GD_UINT64:
+      for (i = 0; i < n; i++)
+        ((uint64_t *)dataout)[i] = (uint64_t)(i + s0);
+      break;
+    case GD_FLOAT32:
+      for (i = 0; i < n; i++)
+        ((float *)dataout)[i] = (float)(i + s0);
+      break;
+    case GD_FLOAT64:
+      for (i = 0; i < n; i++)
+        ((double *)dataout)[i] = (double)(i + s0);
+      break;
+    case GD_COMPLEX64:
+      for (i = 0; i < n; i++)
+        gd_rs2ca_(dataout, i, i + s0, float);
+      break;
+    case GD_COMPLEX128:
+      for (i = 0; i < n; i++)
+        gd_rs2ca_(dataout, i, i + s0, double);
+      break;
+    default:
+      break;
+  }
+
+  dreturnvoid();
+}
+
+/* _GD_FillZero: fill data buffer with zero/NaN of the appropriate type.
+ */
+static int _GD_FillZero(void *databuffer, gd_type_t type, size_t nz)
+{
+  size_t i;
+  const double NaN = NAN;
+
+  dtrace("%p, 0x%X, %" PRNsize_t, databuffer, type, nz);
+
+  if (type & GD_IEEE754) {
+    if (type == GD_FLOAT32)
+      for (i = 0; i < nz; ++i)
+        *((float *)databuffer + i) = (float)NaN;
+    else
+      for (i = 0; i < nz; ++i)
+        *((double *)databuffer + i) = (double)NaN;
+  } else if (type & GD_COMPLEX) {
+    if (type == GD_COMPLEX64)
+      for (i = 0; i < 2 * nz; ++i)
+        *((float *)databuffer + i) = (float)NaN;
+    else
+      for (i = 0; i < 2 * nz; ++i)
+        *((double *)databuffer + i) = (double) NaN;
+  } else
+    memset(databuffer, 0, nz * GD_SIZE(type));
+
+  dreturn("%" PRNsize_t, nz);
+
+  return (nz);
+}
+
+/* _GD_DoRaw:  Read from a raw.  Returns number of samples read.
+*/
+static size_t _GD_DoRaw(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t s0,
+    size_t ns, gd_type_t return_type, void *restrict data_out)
+{
+  size_t n_read = 0;
+  ssize_t samples_read;
+  char *databuffer;
+  size_t zero_pad = 0;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p)", D, E, (long long)s0, ns,
+      return_type, data_out);
+
+  if (s0 < E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset)
+    zero_pad = E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset -
+      s0;
+  else
+    s0 -= E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset;
+
+  databuffer = (char *)_GD_Malloc(D, ns * E->e->u.raw.size);
+  if (databuffer == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (zero_pad > 0) {
+    /* frame offset in samples */
+    off64_t foffs = E->EN(raw,spf) *
+      D->fragment[E->fragment_index].frame_offset;
+
+    n_read = _GD_FillZero(databuffer, E->EN(raw,data_type),
+        (zero_pad > ns) ? ns : zero_pad);
+    ns -= n_read;
+
+    /* 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 */
+      _GD_Seek(D, E, foffs, GD_SEEK_SET);
+    else 
+      E->e->u.raw.file[0].pos = s0 + n_read - 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))
+    {
+      free(databuffer);
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    if ((*gd_ef_[E->e->u.raw.file[0].subenc].seek)(E->e->u.raw.file, s0,
+          E->EN(raw,data_type), GD_FILE_READ) == -1)
+    {
+      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      free(databuffer);
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    samples_read =
+      (*gd_ef_[E->e->u.raw.file[0].subenc].read)(E->e->u.raw.file,
+          databuffer + n_read * E->e->u.raw.size, E->EN(raw,data_type), ns);
+
+    if (samples_read == -1) {
+      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      free(databuffer);
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    if (gd_ef_[E->e->u.raw.file[0].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);
+      }
+    }
+
+    n_read += samples_read;
+  }
+  _GD_ConvertType(D, databuffer, E->EN(raw,data_type), data_out, return_type,
+      n_read);
+
+  free(databuffer);
+
+  dreturn("%" PRNsize_t, (D->error == GD_E_OK) ? n_read : (size_t)0);
+  return (D->error == GD_E_OK) ? n_read : (size_t)0;
+}
+
+/* Macros to reduce tangly code */
+#define POLYNOM5(t,npts) \
+  for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \
+      ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] \
+      * ((t*)data)[i] * ((t*)data)[i] * a[5] \
+      + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[4] \
+      + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[3] \
+      + ((t*)data)[i] * ((t*)data)[i] * a[2] \
+      + ((t*)data)[i] * a[1] + a[0] \
+      )
+
+#define POLYNOM4(t,npts) \
+  for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \
+      ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[4] \
+      + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[3] \
+      + ((t*)data)[i] * ((t*)data)[i] * a[2] \
+      + ((t*)data)[i] * a[1] + a[0] \
+      )
+
+#define POLYNOM3(t,npts) \
+  for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \
+      ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[3] \
+      + ((t*)data)[i] * ((t*)data)[i] * a[2] \
+      + ((t*)data)[i] * a[1] + a[0] \
+      )
+
+#define POLYNOM2(t,npts) \
+  for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \
+      ((t*)data)[i] * ((t*)data)[i] * a[2] \
+      + ((t*)data)[i] * a[1] + a[0] \
+      )
+
+#ifdef GD_NO_C99_API
+#define POLYNOMC(t) \
+  switch (n) { \
+    case 2: POLYNOMC2(t,npts); break; \
+    case 3: POLYNOMC3(t,npts); break; \
+    case 4: POLYNOMC4(t,npts); break; \
+    case 5: POLYNOMC5(t,npts); break; \
+    default: _GD_InternalError(D); \
+  }
+
+#define POLYNOMC5(t,npts) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      const double x = ((t*)data)[2 * i]; \
+      const double x2 = x * x; \
+      const double x3 = x2 * x; \
+      const double x4 = x3 * x; \
+      const double x5 = x4 * x; \
+      const double y = ((t*)data)[2 * i + 1]; \
+      const double y2 = y * y; \
+      const double y3 = y2 * y; \
+      const double y4 = y3 * y; \
+      const double y5 = y4 * y; \
+      ((t*)data)[2 * i] = (t)( \
+        a[5] * (x5 - 10 * x3 * y2 + 5 * x * y4) \
+        - a[4] * (x4 - 6 * x2 * y2 + y4) - a[3] * (x3 - 3 * x * y2) \
+        + a[2] * (x2 - y2) + a[1] * x + a[0] \
+        ); \
+      ((t*)data)[2 * i + 1] = (t)( \
+        a[5] * (5 * x4 * y - 10 * x3 * y2 + y5) \
+        + a[4] * (4 * x3 * y - 4 * x * y3) + a[3] * (3 * x2 * y - y3) \
+        + a[2] * 2 * x * y + a[1] * y \
+        ); \
+    } \
+  } while (0)
+
+#define POLYNOMC4(t,npts) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      const double x = ((t*)data)[2 * i]; \
+      const double x2 = x * x; \
+      const double x3 = x2 * x; \
+      const double x4 = x3 * x; \
+      const double y = ((t*)data)[2 * i + 1]; \
+      const double y2 = y * y; \
+      const double y3 = y2 * y; \
+      const double y4 = y3 * y; \
+      ((t*)data)[2 * i] = (t)( \
+        a[4] * (x4 - 6 * x2 * y2 + y4) + a[3] * (x3 - 3 * x * y2) \
+        + a[2] * (x2 - y2) + a[1] * x + a[0] \
+        ); \
+      ((t*)data)[2 * i + 1] = (t)( \
+        a[4] * (4 * x3 * y - 4 * x * y3) + a[3] * (3 * x2 * y - y3) \
+        + a[2] * 2 * x * y + a[1] * y \
+        ); \
+    } \
+  } while (0)
+
+#define POLYNOMC3(t,npts) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      const double x = ((t*)data)[2 * i]; \
+      const double x2 = x * x; \
+      const double x3 = x2 * x; \
+      const double y = ((t*)data)[2 * i + 1]; \
+      const double y2 = y * y; \
+      const double y3 = y2 * y; \
+      ((t*)data)[2 * i] = (t)( \
+        a[3] * (x3 - 3 * x * y2) + a[2] * (x2 - y2) + a[1] * x + a[0] \
+        ); \
+      ((t*)data)[2 * i + 1] = (t)( \
+        a[3] * (3 * x2 * y - y3) + a[2] * 2 * x * y + a[1] * y \
+        ); \
+    } \
+  } while (0)
+
+#define POLYNOMC2(t,npts) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      const double x = ((t*)data)[2 * i]; \
+      const double x2 = x * x; \
+      const double y = ((t*)data)[2 * i + 1]; \
+      const double y2 = y * y; \
+      ((t*)data)[2 * i] = (t)(a[2] * (x2 - y2) + a[1] * x + a[0]); \
+      ((t*)data)[2 * i + 1] = (t)(a[2] * 2 * x * y + a[1] * y); \
+    } \
+  } while (0)
+#else
+#define POLYNOMC(t) POLYNOM(complex t)
+#endif
+
+#define POLYNOM(t) \
+  switch (n) { \
+    case 2: POLYNOM2(t,npts); break; \
+    case 3: POLYNOM3(t,npts); break; \
+    case 4: POLYNOM4(t,npts); break; \
+    case 5: POLYNOM5(t,npts); break; \
+    default: _GD_InternalError(D); \
+  }
+
+/* _GD_PolynomData: Compute data = Sum(i=0..n; data**i * a[i]), for scalar a,
+ * and integer 2 <= n < GD_MAX_POLYORD
+ */
+static void _GD_PolynomData(DIRFILE *restrict D, void *restrict data,
+    gd_type_t type, size_t npts, int n, const double *restrict a)
+{
+  size_t i;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t ", %i, %p", D, data, type, npts, n, a);
+
+  if (n == 1) {
+    /* no need to duplicate this case */
+    _GD_LincomData(D, 1, data, type, NULL, NULL, a + 1, a, NULL, npts);
+  } else {
+    switch (type) {
+      case GD_NULL:                          break;
+      case GD_INT8:       POLYNOM(  int8_t); break;
+      case GD_UINT8:      POLYNOM( uint8_t); break;
+      case GD_INT16:      POLYNOM( int16_t); break;
+      case GD_UINT16:     POLYNOM(uint16_t); break;
+      case GD_INT32:      POLYNOM( int32_t); break;
+      case GD_UINT32:     POLYNOM(uint32_t); break;
+      case GD_INT64:      POLYNOM( int64_t); break;
+      case GD_UINT64:     POLYNOM(uint64_t); break;
+      case GD_FLOAT32:    POLYNOM(   float); break;
+      case GD_FLOAT64:    POLYNOM(  double); break;
+      case GD_COMPLEX64:  POLYNOMC(  float); break;
+      case GD_COMPLEX128: POLYNOMC( double); break;
+      default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                          break;
+    }
+  }
+
+  dreturnvoid();
+}
+
+#ifdef GD_NO_C99_API
+#undef POLYNOMC5
+#undef POLYNOMC4
+#undef POLYNOMC3
+#undef POLYNOMC2
+#undef POLYNOMC1
+
+#define POLYNOMC5(t,npts) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      const double x = ((t*)data)[2 * i]; \
+      const double x2 = x * x; \
+      const double x3 = x2 * x; \
+      const double x4 = x3 * x; \
+      const double x5 = x4 * x; \
+      const double y = ((t*)data)[2 * i + 1]; \
+      const double y2 = y * y; \
+      const double y3 = y2 * y; \
+      const double y4 = y3 * y; \
+      const double y5 = y4 * y; \
+      ((t*)data)[2 * i] = (t)( \
+        a[5][0] * (x5 - 10 * x3 * y2 + 5 * x * y4) - \
+        a[5][1] * (5 * x4 * y - 10 * x3 * y2 + y5) + \
+        a[4][0] * (x4 - 6 * x2 * y2 + y4) - \
+        a[4][1] * (4 * x3 * y - 4 * x * y3) + \
+        a[3][0] * (x3 - 3 * x * y2) - a[3][1] * (3 * x2 * y - y3) + \
+        a[2][0] * (x2 - y2) - a[2][1] * 2 * x * y + \
+        a[1][0] * x - a[1][1] * y + a[0][0] \
+        ); \
+      ((t*)data)[2 * i + 1] = (t)( \
+        a[5][1] * (x5 - 10 * x3 * y2 + 5 * x * y4) + \
+        a[5][0] * (5 * x4 * y - 10 * x3 * y2 + y5) + \
+        a[4][1] * (x4 - 6 * x2 * y2 + y4) + \
+        a[4][0] * (4 * x3 * y - 4 * x * y3) + \
+        a[3][1] * (x3 - 3 * x * y2) + a[3][0] * (3 * x2 * y - y3) + \
+        a[2][1] * (x2 - y2) + a[2][0] * 2 * x * y + \
+        a[1][1] * x + a[1][0] * y + a[0][1] \
+        ); \
+    } \
+  } while (0)
+
+#define POLYNOMC4(t,npts) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      const double x = ((t*)data)[2 * i]; \
+      const double x2 = x * x; \
+      const double x3 = x2 * x; \
+      const double x4 = x3 * x; \
+      const double y = ((t*)data)[2 * i + 1]; \
+      const double y2 = y * y; \
+      const double y3 = y2 * y; \
+      const double y4 = y3 * y; \
+      ((t*)data)[2 * i] = (t)( \
+        a[4][0] * (x4 - 6 * x2 * y2 + y4) - \
+        a[4][1] * (4 * x3 * y - 4 * x * y3) + \
+        a[3][0] * (x3 - 3 * x * y2) - a[3][1] * (3 * x2 * y - y3) + \
+        a[2][0] * (x2 - y2) - a[2][1] * 2 * x * y + \
+        a[1][0] * x - a[1][1] * y + a[0][0] \
+        ); \
+      ((t*)data)[2 * i + 1] = (t)( \
+        a[4][1] * (x4 - 6 * x2 * y2 + y4) + \
+        a[4][0] * (4 * x3 * y - 4 * x * y3) + \
+        a[3][1] * (x3 - 3 * x * y2) + a[3][0] * (3 * x2 * y - y3) + \
+        a[2][1] * (x2 - y2) + a[2][0] * 2 * x * y + \
+        a[1][1] * x + a[1][0] * y + a[0][1] \
+        ); \
+    } \
+  } while (0)
+
+#define POLYNOMC3(t,npts) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      const double x = ((t*)data)[2 * i]; \
+      const double x2 = x * x; \
+      const double x3 = x2 * x; \
+      const double y = ((t*)data)[2 * i + 1]; \
+      const double y2 = y * y; \
+      const double y3 = y2 * y; \
+      ((t*)data)[2 * i] = (t)( \
+        a[3][0] * (x3 - 3 * x * y2) - a[3][1] * (3 * x2 * y - y3) + \
+        a[2][0] * (x2 - y2) - a[2][1] * 2 * x * y + \
+        a[1][0] * x - a[1][1] * y + a[0][0] \
+        ); \
+      ((t*)data)[2 * i + 1] = (t)( \
+        a[3][1] * (x3 - 3 * x * y2) + a[3][0] * (3 * x2 * y - y3) + \
+        a[2][1] * (x2 - y2) + a[2][0] * 2 * x * y + \
+        a[1][1] * x + a[1][0] * y + a[0][1] \
+        ); \
+    } \
+  } while (0)
+
+#define POLYNOMC2(t,npts) \
+  do { \
+    for (i = 0; i < npts; i++) { \
+      const double x = ((t*)data)[2 * i]; \
+      const double x2 = x * x; \
+      const double y = ((t*)data)[2 * i + 1]; \
+      const double y2 = y * y; \
+      ((t*)data)[2 * i] = (t)( \
+        a[2][0] * (x2 - y2) - a[2][1] * 2 * x * y + \
+        a[1][0] * x - a[1][1] * y + a[0][0] \
+        ); \
+      ((t*)data)[2 * i + 1] = (t)( \
+        a[2][1] * (x2 - y2) + a[2][0] * 2 * x * y + \
+        a[1][1] * x + a[1][0] * y + a[0][1] \
+        ); \
+    } \
+  } while (0)
+#endif
+
+
+/* _GD_CPolynomData: Compute data = Sum(i=0..n; data**i * a[i]), for complex
+ * scalar a, and integer 2 <= n < GD_MAX_POLYORD
+ */
+static void _GD_CPolynomData(DIRFILE *restrict D, void *restrict data,
+    gd_type_t type, size_t npts, int n, GD_DCOMPLEXV(a))
+{
+  size_t i;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t ", %i, %p", D, data, type, npts, n, a);
+
+  if (n == 1) {
+    /* no need to duplicate this case */
+    _GD_CLincomData(D, 1, data, type, NULL, NULL, a + 1, a, NULL, npts);
+  } else {
+    switch (type) {
+      case GD_NULL:                          break;
+      case GD_INT8:
+      case GD_UINT8:
+      case GD_INT16:
+      case GD_UINT16:
+      case GD_INT32:
+      case GD_UINT32:
+      case GD_INT64:
+      case GD_UINT64:
+      case GD_FLOAT32:
+      case GD_FLOAT64: _GD_InternalError(D); break;
+      case GD_COMPLEX64:  POLYNOMC(  float); break;
+      case GD_COMPLEX128: POLYNOMC( double); break;
+      default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                          break;
+    }
+  }
+
+  dreturnvoid();
+}
+
+#ifdef GD_NO_C99_API
+#define MULTIPLYC(t) \
+  do { \
+    for (i = 0; i < n; i++) { \
+      ((t*)A)[2 * i] = (t)(((t*)A)[2 * i] * B[i * spfB / spfA]); \
+      ((t*)A)[2 * i + 1] = (t)(((t*)A)[2 * i + 1] * B[i * spfB / spfA]); \
+    } \
+  } while (0)
+#else
+#define MULTIPLYC(t) MULTIPLY(complex t)
+#endif
+
+#define MULTIPLY(t) \
+  for (i = 0; i < n; i++) ((t*)A)[i] = (t)(((t*)A)[i] * B[i * spfB / spfA])
+
+/* MultiplyData: Multiply A by 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)
+{
+  size_t i;
+
+  dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n);
+
+  switch (type) {
+    case GD_NULL:                           break;
+    case GD_UINT8:      MULTIPLY( uint8_t); break;
+    case GD_INT8:       MULTIPLY(  int8_t); break;
+    case GD_UINT16:     MULTIPLY(uint16_t); break;
+    case GD_INT16:      MULTIPLY( int16_t); break;
+    case GD_UINT32:     MULTIPLY(uint32_t); break;
+    case GD_INT32:      MULTIPLY( int32_t); break;
+    case GD_UINT64:     MULTIPLY(uint64_t); break;
+    case GD_INT64:      MULTIPLY( int64_t); break;
+    case GD_FLOAT32:    MULTIPLY(   float); break;
+    case GD_FLOAT64:    MULTIPLY(  double); break;
+    case GD_COMPLEX64:  MULTIPLYC(  float); break;
+    case GD_COMPLEX128: MULTIPLYC( double); break;
+    default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                        break;
+  }
+
+  dreturnvoid();
+}
+
+#ifdef GD_NO_C99_API
+#undef MULTIPLY
+#undef MULTIPLYC
+
+#define MULTIPLYC(t) \
+  do { \
+    for (i = 0; i < n; i++) { \
+      const int i2 = 2 * (i * spfB / spfA); \
+      const t x = ((t*)A)[2 * i]; \
+      const t y = ((t*)A)[2 * i + 1]; \
+      ((t*)A)[2 * i] = (t)(x * B[i2] - y * B[i2 + 1]); \
+      ((t*)A)[2 * i + 1] = (t)(y * B[i2] + x * B[i2 + 1]); \
+    } \
+  } while (0)
+
+#define MULTIPLY(t) \
+  for (i = 0; i < n; i++) ((t*)A)[i] = (t)(((t*)A)[i] * \
+      B[2 * (i * spfB / spfA)])
+
+#endif
+
+/* CMultiplyData: Multiply A by B.  B is complex.
+*/
+static void _GD_CMultiplyData(DIRFILE *restrict D, void *restrict A,
+    unsigned int spfA, GD_DCOMPLEXP(B), unsigned int spfB, gd_type_t type,
+    size_t n)
+{
+  size_t i;
+
+  dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n);
+
+  switch (type) {
+    case GD_NULL:                           break;
+    case GD_UINT8:      MULTIPLY( uint8_t); break;
+    case GD_INT8:       MULTIPLY(  int8_t); break;
+    case GD_UINT16:     MULTIPLY(uint16_t); break;
+    case GD_INT16:      MULTIPLY( int16_t); break;
+    case GD_UINT32:     MULTIPLY(uint32_t); break;
+    case GD_INT32:      MULTIPLY( int32_t); break;
+    case GD_UINT64:     MULTIPLY(uint64_t); break;
+    case GD_INT64:      MULTIPLY( int64_t); break;
+    case GD_FLOAT32:    MULTIPLY(   float); break;
+    case GD_FLOAT64:    MULTIPLY(  double); break;
+    case GD_COMPLEX64:  MULTIPLYC(  float); break;
+    case GD_COMPLEX128: MULTIPLYC( double); break;
+    default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                        break;
+  }
+
+  dreturnvoid();
+}
+
+#ifdef GD_NO_C99_API
+#define DIVIDEC(t) \
+  do { \
+    for (i = 0; i < n; i++) { \
+      ((t*)A)[2 * i] = (t)(((t*)A)[2 * i] / B[i * spfB / spfA]); \
+      ((t*)A)[2 * i + 1] = (t)(((t*)A)[2 * i + 1] / B[i * spfB / spfA]); \
+    } \
+  } while(0)
+#else
+#define DIVIDEC(t) DIVIDE(complex t)
+#endif
+
+#define DIVIDE(t) \
+  for (i = 0; i < n; i++) ((t*)A)[i] = (t)(((t*)A)[i] / B[i * spfB / spfA])
+
+/* DivideData: Divide B by A.  B is unchanged.
+*/
+static void _GD_DivideData(DIRFILE *restrict D, void *restrict A,
+    unsigned int spfA, double *restrict B, unsigned int spfB, gd_type_t type,
+    size_t n)
+{
+  size_t i;
+
+  dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n);
+
+  switch (type) {
+    case GD_NULL:                         break;
+    case GD_UINT8:      DIVIDE( uint8_t); break;
+    case GD_INT8:       DIVIDE(  int8_t); break;
+    case GD_UINT16:     DIVIDE(uint16_t); break;
+    case GD_INT16:      DIVIDE( int16_t); break;
+    case GD_UINT32:     DIVIDE(uint32_t); break;
+    case GD_INT32:      DIVIDE( int32_t); break;
+    case GD_UINT64:     DIVIDE(uint64_t); break;
+    case GD_INT64:      DIVIDE( int64_t); break;
+    case GD_FLOAT32:    DIVIDE(   float); break;
+    case GD_FLOAT64:    DIVIDE(  double); break;
+    case GD_COMPLEX64:  DIVIDEC(  float); break;
+    case GD_COMPLEX128: DIVIDEC( double); break;
+    default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                        break;
+  }
+
+  dreturnvoid();
+}
+
+#ifdef GD_NO_C99_API
+#undef DIVIDE
+#undef DIVIDEC
+
+#define DIVIDEC(t) \
+  do { \
+    for (i = 0; i < n; i++) { \
+      const int i2 = 2 * (i * spfB / spfA); \
+      const t x = ((t*)A)[2 * i]; \
+      const t y = ((t*)A)[2 * i + 1]; \
+      const double d = B[i2] * B[i2] + B[i2 + 1] * B[i2 + 1]; \
+      ((t*)A)[2 * i] = (t)((x * B[i2] + y * B[i2 + 1]) / d); \
+      ((t*)A)[2 * i + 1] = (t)((y * B[i2] - x * B[i2 + 1]) / d); \
+    } \
+  } while (0)
+
+#define DIVIDE(t) \
+  for (i = 0; i < n; i++) ((t*)A)[i] = (t)(((t*)A)[i] / \
+      B[2 * (i * spfB / spfA)])
+
+#endif
+
+/* CDivideData: Divide A by B.  B is complex.
+*/
+static void _GD_CDivideData(DIRFILE *restrict D, void *restrict A,
+    unsigned int spfA, GD_DCOMPLEXP(B), unsigned int spfB, gd_type_t type,
+    size_t n)
+{
+  size_t i;
+
+  dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n);
+
+  switch (type) {
+    case GD_NULL:                         break;
+    case GD_UINT8:      DIVIDE( uint8_t); break;
+    case GD_INT8:       DIVIDE(  int8_t); break;
+    case GD_UINT16:     DIVIDE(uint16_t); break;
+    case GD_INT16:      DIVIDE( int16_t); break;
+    case GD_UINT32:     DIVIDE(uint32_t); break;
+    case GD_INT32:      DIVIDE( int32_t); break;
+    case GD_UINT64:     DIVIDE(uint64_t); break;
+    case GD_INT64:      DIVIDE( int64_t); break;
+    case GD_FLOAT32:    DIVIDE(   float); break;
+    case GD_FLOAT64:    DIVIDE(  double); break;
+    case GD_COMPLEX64:  DIVIDEC(  float); break;
+    case GD_COMPLEX128: DIVIDEC( double); break;
+    default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                        break;
+  }
+
+  dreturnvoid();
+}
+
+#define WINDOP(ot,ct,bo,op,tt,z) \
+  for (i = 0; i < n; i++) \
+    if (!((bo(((ct*)B)[i * spfB / spfA])) op threshold.tt)) \
+      ((ot*)A)[i] = (ot)(z)
+
+#define WINDOPC(ot,ct,bo,op,tt,z) \
+  for (i = 0; i < n; i++) \
+    if (!((bo(((ct*)B)[i * spfB / spfA])) op threshold.tt)) \
+      ((ot*)A)[i * 2] = ((ot*)A)[i * 2 + 1] = (ot)(z)
+
+#define WINDOW(t,z) \
+  switch (op) { \
+    case GD_WINDOP_EQ:  WINDOP(t, int64_t, ,==,i,z); break; \
+    case GD_WINDOP_GE:  WINDOP(t,  double, ,>=,r,z); break; \
+    case GD_WINDOP_GT:  WINDOP(t,  double, ,> ,r,z); break; \
+    case GD_WINDOP_LE:  WINDOP(t,  double, ,<=,r,z); break; \
+    case GD_WINDOP_LT:  WINDOP(t,  double, ,< ,r,z); break; \
+    case GD_WINDOP_NE:  WINDOP(t, int64_t, ,!=,i,z); break; \
+    case GD_WINDOP_SET: WINDOP(t,uint64_t, ,& ,u,z); break; \
+    case GD_WINDOP_CLR: WINDOP(t,uint64_t,~,& ,u,z); break; \
+    default: \
+      _GD_InternalError(D); \
+  }
+
+#define WINDOWC(t,z) \
+  switch (op) { \
+    case GD_WINDOP_EQ:  WINDOPC(t, int64_t, ,==,i,z); break; \
+    case GD_WINDOP_GE:  WINDOPC(t,  double, ,>=,r,z); break; \
+    case GD_WINDOP_GT:  WINDOPC(t,  double, ,> ,r,z); break; \
+    case GD_WINDOP_LE:  WINDOPC(t,  double, ,<=,r,z); break; \
+    case GD_WINDOP_LT:  WINDOPC(t,  double, ,< ,r,z); break; \
+    case GD_WINDOP_NE:  WINDOPC(t, int64_t, ,!=,i,z); break; \
+    case GD_WINDOP_SET: WINDOPC(t,uint64_t, ,& ,u,z); break; \
+    case GD_WINDOP_CLR: WINDOPC(t,uint64_t,~,& ,u,z); break; \
+    default: \
+      _GD_InternalError(D); \
+  }
+
+/* WindowData: Zero data in A where the condition is false.  B is unchanged.
+*/
+static void _GD_WindowData(DIRFILE *restrict D, void *restrict A,
+    unsigned int spfA, void *restrict B, unsigned int spfB, gd_type_t type,
+    gd_windop_t op, gd_triplet_t threshold, size_t n)
+{
+  size_t i;
+  const double NaN = NAN;
+
+  dtrace("%p, %p, %u, %p, %u, 0x%X, %i, {%g,%llx,%lli}, %" PRNsize_t, D, A,
+      spfA, B, spfB, type, op, threshold.r, (unsigned long long)threshold.u,
+      (long long)threshold.i, n);
+
+  switch (type) {
+    case GD_NULL:                            break;
+    case GD_UINT8:      WINDOW( uint8_t,  0) break;
+    case GD_INT8:       WINDOW(  int8_t,  0) break;
+    case GD_UINT16:     WINDOW(uint16_t,  0) break;
+    case GD_INT16:      WINDOW( int16_t,  0) break;
+    case GD_UINT32:     WINDOW(uint32_t,  0) break;
+    case GD_INT32:      WINDOW( int32_t,  0) break;
+    case GD_UINT64:     WINDOW(uint64_t,  0) break;
+    case GD_INT64:      WINDOW( int64_t,  0) break;
+    case GD_FLOAT32:    WINDOW(   float,NaN) break;
+    case GD_FLOAT64:    WINDOW(  double,NaN) break;
+    case GD_COMPLEX64:  WINDOWC(  float,NaN) break;
+    case GD_COMPLEX128: WINDOWC( double,NaN) break;
+    default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                        break;
+  }
+
+  dreturnvoid();
+}
+
+#define MPLEX(t) \
+  do { \
+    t last = *(t*)start; \
+    for (i = 0; i < n; i++) {\
+      if (B[i * spfB / spfA] == val) \
+        last = ((t*)A)[i]; \
+      else \
+        ((t*)A)[i] = last; \
+    } \
+  } while(0)
+
+#define MPLEXC(t) \
+  do { \
+    t rlast, ilast; \
+    rlast = *(t*)start; \
+    ilast = ((t*)start)[1]; \
+    for (i = 0; i < n; i++) \
+      if (B[i * spfB / spfA] == val) { \
+        rlast = ((t*)A)[i * 2]; \
+        ilast = ((t*)A)[i * 2 + 1]; \
+      } else { \
+        ((t*)A)[i * 2] = rlast; \
+        ((t*)A)[i * 2 + 1] = ilast; \
+      } \
+  } while(0)
+
+/* demultiplex data */
+static void _GD_MplexData(DIRFILE *restrict D, void *restrict A,
+    unsigned int spfA, const int *restrict B, unsigned int spfB, gd_type_t type,
+    int val, void *restrict start, size_t n)
+{
+  size_t i;
+
+  dtrace("%p, %p, %u, %p, %u, 0x%X, %i, %p, %" PRNsize_t, D, A, spfA, B, spfB,
+      type, val, start, n);
+
+  switch (type) {
+    case GD_NULL:                        break;
+    case GD_UINT8:      MPLEX( uint8_t); break;
+    case GD_INT8:       MPLEX(  int8_t); break;
+    case GD_UINT16:     MPLEX(uint16_t); break;
+    case GD_INT16:      MPLEX( int16_t); break;
+    case GD_UINT32:     MPLEX(uint32_t); break;
+    case GD_INT32:      MPLEX( int32_t); break;
+    case GD_UINT64:     MPLEX(uint64_t); break;
+    case GD_INT64:      MPLEX( int64_t); break;
+    case GD_FLOAT32:    MPLEX(   float); break;
+    case GD_FLOAT64:    MPLEX(  double); break;
+    case GD_COMPLEX64:  MPLEXC(  float); break;
+    case GD_COMPLEX128: MPLEXC( double); break;
+    default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                        break;
+  }
+
+  dreturnvoid();
+}
+
+/* _GD_DoLincom:  Read from a lincom.  Returns number of samples read.
+*/
+static size_t _GD_DoLincom(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  unsigned int spf[GD_MAX_LINCOM];
+  size_t n_read;
+  int i;
+  void *tmpbuf2 = NULL;
+  void *tmpbuf3 = NULL;
+  const gd_type_t ntype = (return_type & GD_COMPLEX) ? GD_COMPLEX128
+    : GD_FLOAT64;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  /* input field checks */
+  for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+    if (_GD_BadInput(D, E, i, 1)) {
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    spf[i] = _GD_GetSPF(D, E->e->entry[i]);
+    if (D->error != GD_E_OK) {
+      dreturn("%i", 0);
+      return 0;
+    }
+  }
+
+  /* read the first field and record the number of samples returned -- we can
+   * safely store this in the output buffer, with the correct return type as
+   * it will not aversely affect our later math */
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      return_type, data_out);
+
+  if (D->error) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Nothing to lincomise */
+  if (n_read == 0) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Some dirfiles use "bar LINCOM foo 1 0" to rename <foo> to <bar>.  I
+   * recommend using "bar PHASE foo 0" in this case, but we'll accomodate them
+   * as much as we can.  Suggested by MDT. */
+  if (E->EN(lincom,n_fields) == 1 && gd_ccmpl_(E->EN(lincom,cm)[0],1,0) &&
+      gd_ccmpl_(E->EN(lincom,cb)[0],0,0))
+  {
+    dreturn("%" PRNsize_t, n_read);
+    return n_read;
+  }
+
+  /* Read the second field, if present */
+  if (E->EN(lincom,n_fields) > 1) {
+    /* calculate the first sample, type and number of samples to read of the
+     * second field */
+    size_t n_read2;
+    size_t num_samp2 = (int)ceil((double)n_read * spf[1] / spf[0]);
+    off64_t first_samp2 = first_samp * spf[1] / spf[0];
+
+    /* Allocate a temporary buffer for the next field */
+    tmpbuf2 = _GD_Alloc(D, ntype, num_samp2);
+    if (D->error) {
+      free(tmpbuf2);
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    /* read the second field */
+    n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2,
+        num_samp2, ntype, tmpbuf2);
+    if (D->error || n_read2 == 0) {
+      free(tmpbuf2);
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    /* adjust n_read for a short read from field two */
+    if (n_read2 * spf[0] != n_read * spf[1])
+      n_read = n_read2 * spf[0] / spf[1];
+
+    /* Do the same for the third field, if needed */
+    if (E->EN(lincom,n_fields) > 2) {
+      size_t n_read3;
+      size_t num_samp3 = (int)ceil((double)n_read * spf[2] / spf[0]);
+      off64_t first_samp3 = first_samp * spf[2] / spf[0];
+
+      tmpbuf3 = _GD_Alloc(D, ntype, num_samp3);
+      if (D->error) {
+        free(tmpbuf2);
+        free(tmpbuf3);
+        dreturn("%i", 0);
+        return 0;
+      }
+
+      n_read3 = _GD_DoField(D, E->e->entry[2], E->e->repr[2], first_samp3,
+          num_samp3, ntype, tmpbuf3);
+      if (D->error || n_read3 == 0) {
+        free(tmpbuf2);
+        free(tmpbuf3);
+        dreturn("%i", 0);
+        return 0;
+      }
+
+      if (n_read3 * spf[0] != n_read * spf[2])
+        n_read = n_read3 * spf[0] / spf[2];
+    }
+  }
+
+  /* Compute everything at once */
+  if (E->comp_scal)
+    _GD_CLincomData(D, E->EN(lincom,n_fields), data_out, return_type,
+        (GD_DCOMPLEXP_t)tmpbuf2, (GD_DCOMPLEXP_t)tmpbuf3, E->EN(lincom,cm),
+        E->EN(lincom,cb), spf, n_read);
+  else
+    _GD_LincomData(D, E->EN(lincom,n_fields), data_out, return_type,
+        (double *)tmpbuf2, (double *)tmpbuf3, E->EN(lincom,m), E->EN(lincom,b),
+        spf, n_read);
+
+  /* free temporary buffers */
+  free(tmpbuf2);
+  free(tmpbuf3);
+
+  if (D->error)
+    n_read = 0;
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoMultiply:  Read from a multiply.  Returns number of samples read.
+*/
+static size_t _GD_DoMultiply(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  void *tmpbuf = NULL;
+  unsigned int spf1, spf2;
+  size_t n_read, n_read2, num_samp2;
+  off64_t first_samp2;
+  gd_type_t type2;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  /* Check input fields */
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (_GD_BadInput(D, E, 1, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* find the samples per frame of the first field */
+  spf1 = _GD_GetSPF(D, E->e->entry[0]);
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the first field and record the number of samples returned */
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      return_type, data_out);
+
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Nothing to multiply */
+  if (n_read == 0) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* find the samples per frame of the second field */
+  spf2 = _GD_GetSPF(D, E->e->entry[1]);
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* calculate the first sample and number of samples to read of the
+   * second field */
+  num_samp2 = (int)ceil((double)n_read * spf2 / spf1);
+  first_samp2 = first_samp * spf2 / spf1;
+
+  /* find the native type of the second field */
+  type2 = (_GD_NativeType(D, E->e->entry[1], E->e->repr[1]) & GD_COMPLEX) ?
+    GD_COMPLEX128 : GD_FLOAT64;
+
+  /* Allocate a temporary buffer for the second field */
+  tmpbuf = _GD_Alloc(D, type2, num_samp2);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the second field */
+  n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2,
+      num_samp2, type2, tmpbuf);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (n_read2 > 0 && n_read2 * spf1 < n_read * spf2)
+    n_read = n_read2 * spf1 / spf2;
+
+  if (type2 & GD_COMPLEX)
+    _GD_CMultiplyData(D, data_out, spf1, (GD_DCOMPLEXP_t)tmpbuf, spf2,
+        return_type, n_read);
+  else
+    _GD_MultiplyData(D, data_out, spf1, (double *)tmpbuf, spf2, return_type,
+        n_read);
+
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoRecip:  Read from a recip.  Returns number of samples read.
+*/
+static size_t _GD_DoRecip(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  size_t n_read;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  /* Check input fields */
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the first field and record the number of samples returned */
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      return_type, data_out);
+
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Nothing to divide */
+  if (n_read == 0) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Compute a reciprocal */
+  if (E->comp_scal)
+    _GD_CInvertData(D, data_out, return_type, E->EN(recip,cdividend), num_samp);
+  else
+    _GD_InvertData(D, data_out, return_type, E->EN(recip,dividend), num_samp);
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoDivide:  Read from a divide.  Returns number of samples read.
+*/
+static size_t _GD_DoDivide(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  void *tmpbuf = NULL;
+  unsigned int spf1, spf2;
+  size_t n_read, n_read2, num_samp2;
+  off64_t first_samp2;
+  gd_type_t type2;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  /* Check input fields */
+  if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the first field and record the number of samples returned */
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      return_type, data_out);
+
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Nothing to divide */
+  if (n_read == 0) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* compute a division */
+  /* find the samples per frame of the dividend */
+  spf1 = _GD_GetSPF(D, E->e->entry[0]);
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* find the samples per frame of the second field */
+  spf2 = _GD_GetSPF(D, E->e->entry[1]);
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* calculate the first sample and number of samples to read of the
+   * second field */
+  num_samp2 = (int)ceil((double)n_read * spf2 / spf1);
+  first_samp2 = first_samp * spf2 / spf1;
+
+  /* find the native type of the second field */
+  type2 = (_GD_NativeType(D, E->e->entry[1], E->e->repr[1]) & GD_COMPLEX) ?
+    GD_COMPLEX128 : GD_FLOAT64;
+
+  /* Allocate a temporary buffer for the second field */
+  tmpbuf = _GD_Alloc(D, type2, num_samp2);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the second field */
+  n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2,
+      num_samp2, type2, tmpbuf);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (n_read2 > 0 && n_read2 * spf1 < n_read * spf2)
+    n_read = n_read2 * spf1 / spf2;
+
+  if (type2 & GD_COMPLEX)
+    _GD_CDivideData(D, data_out, spf1, (GD_DCOMPLEXP_t)tmpbuf, spf2,
+        return_type, n_read);
+  else
+    _GD_DivideData(D, data_out, spf1, (double *)tmpbuf, spf2, return_type,
+        n_read);
+
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoBit:  Read from a bitfield.  Returns number of samples read.
+ *             This is used by both BIT and SBIT (is_signed distinguishes)
+ */
+static size_t _GD_DoBit(DIRFILE *restrict D, gd_entry_t *restrict E,
+    int is_signed, off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  void *tmpbuf;
+  size_t i;
+  size_t n_read;
+  const uint64_t mask = (E->EN(bit,numbits) == 64) ? 0xffffffffffffffffULL :
+    ((uint64_t)1 << E->EN(bit,numbits)) - 1;
+
+  dtrace("%p, %p, %i, %lli, %" PRNsize_t ", 0x%X, %p", D, E, is_signed,
+      (long long)first_samp, num_samp, return_type, data_out);
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (is_signed)
+    tmpbuf = (int64_t *)_GD_Malloc(D, num_samp * sizeof(int64_t));
+  else
+    tmpbuf = (uint64_t *)_GD_Malloc(D, num_samp * sizeof(uint64_t));
+  if (tmpbuf == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      (is_signed) ? GD_INT64 : GD_UINT64, tmpbuf);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* extract bits */
+  if (is_signed) {
+    uint64_t sign = -1LL << (E->EN(bit,numbits) - 1);
+    for (i = 0; i < n_read; i++)
+      ((int64_t *)tmpbuf)[i] =
+        (((((uint64_t *)tmpbuf)[i] >> E->EN(bit,bitnum)) & mask) + sign) ^ sign;
+  } else
+    for (i = 0; i < n_read; i++)
+      ((uint64_t *)tmpbuf)[i] = (((uint64_t *)tmpbuf)[i] >> E->EN(bit,bitnum))
+        & mask;
+
+  _GD_ConvertType(D, tmpbuf, (is_signed) ? GD_INT64 : GD_UINT64, data_out,
+      return_type, n_read);
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoPhase:  Read from a phase.  Returns number of samples read.
+*/
+static size_t _GD_DoPhase(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  size_t n_read;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp +
+      E->EN(phase,shift), num_samp, return_type, data_out);
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoLinterp:  Read from a linterp.  Returns number of samples read.
+*/
+static size_t _GD_DoLinterp(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  size_t n_read = 0;
+  double* data_in;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  if (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)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* allocate a temporary buffer */
+  data_in = (double *)_GD_Alloc(D, GD_FLOAT64, num_samp);
+
+  if (D->error) {
+    free(data_in);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      GD_FLOAT64, data_in);
+
+  if (D->error != GD_E_OK) {
+    free(data_in);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_LinterpData(D, data_out, return_type, E->e->u.linterp.complex_table,
+      data_in, n_read, E->e->u.linterp.lut, E->e->u.linterp.table_len);
+
+  free(data_in);
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoPolynom:  Read from a polynom.  Returns number of samples read.
+*/
+static size_t _GD_DoPolynom(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  size_t n_read;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the input field */
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      return_type, data_out);
+
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Nothing to polynomise */
+  if (n_read == 0) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (E->comp_scal)
+    _GD_CPolynomData(D, data_out, return_type, n_read, E->EN(polynom,poly_ord),
+        E->EN(polynom,ca));
+  else
+    _GD_PolynomData(D, data_out, return_type, n_read, E->EN(polynom,poly_ord),
+        E->EN(polynom,a));
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoWindow:  Read from a window.  Returns number of samples read.
+*/
+static size_t _GD_DoWindow(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  void *tmpbuf = NULL;
+  unsigned int spf1, spf2;
+  size_t n_read, n_read2, num_samp2;
+  off64_t first_samp2;
+  gd_type_t type2;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  /* Check input fields */
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (_GD_BadInput(D, E, 1, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* find the samples per frame of the input field */
+  spf1 = _GD_GetSPF(D, E->e->entry[0]);
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the input field and record the number of samples returned */
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      return_type, data_out);
+
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Nothing to window */
+  if (n_read == 0) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* find the samples per frame of the check field */
+  spf2 = _GD_GetSPF(D, E->e->entry[1]);
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* calculate the first sample and number of samples to read of the
+   * check field */
+  num_samp2 = (int)ceil((double)n_read * spf2 / spf1);
+  first_samp2 = first_samp * spf2 / spf1;
+
+  switch(E->EN(window,windop)) {
+    case GD_WINDOP_EQ:
+    case GD_WINDOP_NE:
+      type2 = GD_INT64;
+      break;
+    case GD_WINDOP_SET:
+    case GD_WINDOP_CLR:
+      type2 = GD_UINT64;
+      break;
+    default:
+      type2 = GD_FLOAT64;
+      break;
+  }
+
+  /* Allocate a temporary buffer for the check field */
+  tmpbuf = _GD_Alloc(D, type2, num_samp2);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the check field */
+  n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2,
+      num_samp2, type2, tmpbuf);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (n_read2 > 0 && n_read2 * spf1 < n_read * spf2)
+    n_read = n_read2 * spf1 / spf2;
+
+  _GD_WindowData(D, data_out, spf1, tmpbuf, spf2, return_type,
+      E->EN(window,windop), E->EN(window,threshold), n_read);
+
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoMplex:  Read from an mplex.  Returns number of samples read.
+*/
+static size_t _GD_DoMplex(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  char start[16];
+  int *tmpbuf = NULL;
+  unsigned int spf1, spf2;
+  size_t n_read, n_read2, num_samp2;
+  const size_t size = GD_SIZE(return_type);
+  off64_t first_samp2;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, return_type, data_out);
+
+  /* Check input fields */
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (_GD_BadInput(D, E, 1, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* find the samples per frame of the input field */
+  spf1 = _GD_GetSPF(D, E->e->entry[0]);
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* set the start value */
+  _GD_FillZero(start, return_type, 1);
+
+  /* read the input field and record the number of samples returned */
+  n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp,
+      return_type, data_out);
+
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Nothing to mplex */
+  if (n_read == 0) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* find the samples per frame of the count field -- it's probably weird if
+   * this isn't the same, but who am I to judge?  (It's extra weird if it's
+   * larger.) */
+  spf2 = _GD_GetSPF(D, E->e->entry[1]);
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* calculate the first sample and number of samples to read of the
+   * count field */
+  num_samp2 = (int)ceil((double)n_read * spf2 / spf1);
+  first_samp2 = first_samp * spf2 / spf1;
+
+  /* Allocate a temporary buffer for the count field */
+  tmpbuf = (int*)_GD_Alloc(D, GD_INT_TYPE, num_samp2);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the count field */
+  n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2,
+      num_samp2, GD_INT_TYPE, tmpbuf);
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Check whether we've saved the last sample */
+  if (return_type == E->e->u.mplex.type && first_samp == E->e->u.mplex.sample)
+    memcpy(start, E->e->u.mplex.d, size);
+  /* Otherwise, check whether the caller was lucky/clever */
+  else if (tmpbuf[0] != E->EN(mplex,count_val) && D->lookback) {
+    /* It wasn't -- do a look-back to find the start value.  On a, say, gzipped
+     * field this is expensive since it involves a rewind.  Hmm... */
+    size_t lb_cycle = E->EN(mplex,period);
+    off64_t chunk_start = first_samp2, lb_start, lb_sample = -1;
+
+    /* if period is zero, use a period of GD_MPLEX_CYCLE or
+     * 2 * count_val + 1, whichever is larger */
+    if (lb_cycle == 0) {
+      lb_cycle = 2 * E->EN(mplex,count_val) + 1;
+      if (lb_cycle < GD_MPLEX_CYCLE)
+        lb_cycle = GD_MPLEX_CYCLE;
+    }
+
+    /* the first sample we're willing to consider */
+    lb_start = (D->lookback == GD_LOOKBACK_ALL) ? 0 :
+      first_samp2 - D->lookback * lb_cycle;
+    if (lb_start < 0)
+      lb_start = 0;
+
+    /* stop if we're at the start of the lookback or we found the value */
+    while (lb_sample == -1 && chunk_start > lb_start) {
+      /* the size of the next chunk */
+      size_t i, n_read3, chunk_size = chunk_start - lb_start;
+      int *tmpbuf2;
+      if (chunk_size > GD_BUFFER_SIZE)
+        chunk_size = GD_BUFFER_SIZE;
+
+      /* the start of the next chunk */
+      chunk_start -= chunk_size;
+
+      tmpbuf2 = (int*)_GD_Alloc(D, GD_INT_TYPE, chunk_size);
+      if (D->error) {
+        free(tmpbuf);
+        dreturn("%i", 0);
+        return 0;
+      }
+
+      n_read3 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], chunk_start,
+          chunk_size, GD_INT_TYPE, tmpbuf2);
+
+      if (D->error) {
+        free(tmpbuf2);
+        free(tmpbuf);
+        dreturn("%i", 0);
+        return 0;
+      }
+
+      /* find the sample */
+      i = n_read3 - 1;
+      do {
+        if (tmpbuf2[i] == E->EN(mplex,count_val)) {
+          lb_sample = chunk_start + i;
+          break;
+        }
+      } while (i-- != 0);
+      free(tmpbuf2);
+    }
+
+    /* read the value of the start, if found */
+    if (lb_sample >= 0) {
+      _GD_DoField(D, E->e->entry[0], E->e->repr[0], lb_sample * spf1 / spf2, 1,
+          return_type, start);
+
+      if (D->error) {
+        free(tmpbuf);
+        dreturn("%i", 0);
+        return 0;
+      }
+    }
+
+    /* now go and put the I/O pointers back where they belong, sigh */
+    _GD_Seek(D, E->e->entry[0], first_samp + n_read, GD_SEEK_SET);
+    _GD_Seek(D, E->e->entry[1], first_samp2 + n_read2, GD_SEEK_SET);
+  }
+
+  if (n_read2 > 0 && n_read2 * spf1 < n_read * spf2)
+    n_read = n_read2 * spf1 / spf2;
+
+  _GD_MplexData(D, data_out, spf1, tmpbuf, spf2, return_type,
+      E->EN(mplex,count_val),  start, n_read);
+
+  /* Cache the last sample read */
+  if (n_read > 0) {
+    E->e->u.mplex.type = return_type;
+    E->e->u.mplex.sample = first_samp + n_read;
+    memcpy(E->e->u.mplex.d, (char*)data_out + size * (n_read - 1), size);
+  }
+
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* _GD_DoConst:  Read from a const.  Returns number of samples read (ie. 1).
+*/
+static size_t _GD_DoConst(DIRFILE *restrict D, const gd_entry_t *restrict E,
+    off64_t first, size_t len, gd_type_t return_type, void *restrict data_out)
+{
+  gd_type_t type;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first, len,
+      return_type, data_out);
+
+  type = _GD_ConstType(D, E->EN(scalar,const_type));
+  _GD_ConvertType(D, (char *)E->e->u.scalar.d + first * GD_SIZE(type), type,
+      data_out, return_type, len);
+
+  if (D->error) { /* bad input type */
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  dreturn("%" PRNsize_t, len);
+  return len;
+}
+
+/* _GD_DoField: Locate the field in the database and read it.
+*/
+size_t _GD_DoField(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
+    off64_t first_samp, size_t num_samp, gd_type_t return_type,
+    void *restrict data_out)
+{
+  size_t n_read = 0;
+  gd_type_t ntype;
+  void *true_data_out = data_out;
+  const gd_type_t true_return_type = return_type;
+  int out_of_place = 0;
+
+  dtrace("%p, %p(%s), %i, %lli, %" PRNsize_t ", 0x%X, %p", D, E, E->field, repr,
+      (long long)first_samp, num_samp, return_type, data_out);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    D->recurse_level--;
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (!E->e->calculated) {
+    _GD_CalculateEntry(D, E, 1);
+
+    if (D->error) {
+      D->recurse_level--;
+      dreturn("%i", 0);
+      return 0;
+    }
+  }
+
+  /* calculate the native type */
+  ntype = _GD_NativeType(D, E, GD_REPR_NONE);
+
+  if (D->error) {
+    D->recurse_level--;
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (first_samp == GD_HERE) {
+    first_samp = _GD_GetFilePos(D, E, -1);
+    if (D->error) {
+      D->recurse_level--;
+      dreturn("%i", 0);
+      return 0;
+    }
+  }
+
+  /* short circuit for purely real native types */
+  if (~ntype & GD_COMPLEX) {
+    if (repr == GD_REPR_IMAG) {
+      memset(data_out, 0, GD_SIZE(return_type) * num_samp);
+      dreturn("%" PRNsize_t, num_samp);
+      return num_samp;
+    } else if (repr == GD_REPR_REAL)
+      repr = GD_REPR_NONE;
+  }
+
+  /* if the native type is complex valued, but our return type is purely real,
+   * we compute the field out-of-place, and then cast it to the return type
+   * later, otherwise we just compute things in-place and don't worry too much
+   * about accuracy */
+  if (ntype & GD_COMPLEX && ~return_type & GD_COMPLEX) {
+    out_of_place = 1;
+    return_type = GD_COMPLEX128;
+    data_out = _GD_Alloc(D, GD_COMPLEX128, num_samp);
+    if (repr == GD_REPR_NONE)
+      repr = GD_REPR_AUTO;
+  }
+
+  switch (E->field_type) {
+    case GD_RAW_ENTRY:
+      n_read = _GD_DoRaw(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_LINTERP_ENTRY:
+      n_read = _GD_DoLinterp(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_LINCOM_ENTRY:
+      n_read = _GD_DoLincom(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_BIT_ENTRY:
+      n_read = _GD_DoBit(D, E, 0, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_RECIP_ENTRY:
+      n_read = _GD_DoRecip(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_DIVIDE_ENTRY:
+      n_read = _GD_DoDivide(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_MULTIPLY_ENTRY:
+      n_read = _GD_DoMultiply(D, E, first_samp, num_samp, return_type,
+          data_out);
+      break;
+    case GD_PHASE_ENTRY:
+      n_read = _GD_DoPhase(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_INDEX_ENTRY:
+      /* if Asking for "INDEX", just return it */
+      _GD_FillFileFrame(data_out, return_type, first_samp, n_read = num_samp);
+      break;
+    case GD_POLYNOM_ENTRY:
+      n_read = _GD_DoPolynom(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_SBIT_ENTRY:
+      n_read = _GD_DoBit(D, E, 1, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_WINDOW_ENTRY:
+      n_read = _GD_DoWindow(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_MPLEX_ENTRY:
+      n_read = _GD_DoMplex(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+      n_read = _GD_DoConst(D, E, first_samp, num_samp, return_type, data_out);
+      break;
+    case GD_STRING_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_NO_ENTRY:
+      /* Can't get here */
+      _GD_InternalError(D);
+      n_read = 0;
+  }
+
+  /* extract the requested representation */
+  if (!D->error && repr != GD_REPR_NONE)
+    _GD_ExtractRepr(D, data_out, return_type, true_data_out, true_return_type,
+        n_read, repr);
+
+  if (out_of_place)
+    free(data_out);
+
+  D->recurse_level--;
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* this function is little more than a public boilerplate for _GD_DoField */
+size_t gd_getdata64(DIRFILE* D, const char *field_code_in, off64_t first_frame,
+    off64_t first_samp, size_t num_frames, size_t num_samp,
+    gd_type_t return_type, void *data_out)
+{
+  size_t n_read = 0;
+  gd_entry_t* entry;
+  char* field_code;
+  int repr;
+  unsigned int spf;
+
+  dtrace("%p, \"%s\", %lli, %lli, %" PRNsize_t ", %" PRNsize_t ", 0x%X, %p", D,
+      field_code_in, (long long)first_frame, (long long)first_samp, num_frames,
+      num_samp, return_type, data_out);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (entry->field_type & GD_SCALAR_ENTRY_BIT)
+    _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (first_frame == GD_HERE || first_samp == GD_HERE) {
+    first_samp = GD_HERE;
+    first_frame = 0;
+  }
+
+  if (first_frame > 0 || num_frames > 0) {
+    /* get the samples per frame */
+    spf = _GD_GetSPF(D, entry);
+
+    if (D->error) {
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    first_samp += spf * first_frame;
+    num_samp += spf * num_frames;
+  }
+
+  if (first_samp < 0 && (first_samp != GD_HERE || first_frame != 0)) {
+    _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_read = _GD_DoField(D, entry, repr, first_samp, num_samp, return_type,
+      data_out);
+
+  dreturn("%" PRNsize_t, n_read);
+  return n_read;
+}
+
+/* 32(ish)-bit wrapper for the 64-bit version, when needed */
+size_t gd_getdata(DIRFILE* D, const char *field_code, off_t first_frame,
+    off_t first_samp, size_t num_frames, size_t num_samp,
+    gd_type_t return_type, void *data_out)
+{
+  return gd_getdata64(D, field_code, first_frame, first_samp, num_frames,
+      num_samp, return_type, data_out);
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/getdata.h.in b/src/getdata.h.in
new file mode 100644
index 0000000..07d2570
--- /dev/null
+++ b/src/getdata.h.in
@@ -0,0 +1,1216 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2003-2005 Theodore Kisner
+ * Copyright (C) 2005-2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/* GETDATA.H -- GetData Library public API definition
+ * --------------------------------------------------
+ *
+ * Several preprocessor symbols may be defined before including this file to
+ * modify it's use:
+ *
+ * - defining GD_NO_LEGACY_API will prevent the Legacy API declarations in
+ *   getdata_legacy.h from being declared.  If the Legacy API was omitted from
+ *   the library when it was built, this symbol does nothing.
+ *
+ * - defining GD_C89_API will prevent declarations herein from using the C99
+ *   keyword `_Complex'.  Affected declarations will instead use a two-element
+ *   array of doubles in place of the complex types.  This symbol permits
+ *   including these declarations using a non-C99 conforming compiler.
+ *
+ * - defining GD_64BIT_API will expose the declaration of versions of funtions
+ *   using an explicitly 64-bit off_t type, regardless of the actual size of
+ *   off_t itself.  These functions have "64" appended to their name (e.g.
+ *   gd_getdata64()).  It will also define th gd_off64_t type, which is used in
+ *   these exposed definitions as a replacement for off_t.  This symbol is
+ *   automatically defined if _LARGEFILE64_SOURCE has been defined before
+ *   including this file, and may also be defined on certain platforms where
+ *   off_t is 64-bits.
+ *
+ * - defining GD_FUNCTION_ALIASES will result in a number of function aliases
+ *   which map the version 0.7 function names to the names used in GetData-0.6.
+ *   This feature is provided only to ease transistion, and will be removed in
+ *   some unpecified future release.
+ */
+
+#ifndef GETDATA_H
+#define GETDATA_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The most recent standards version supported by this library */
+#define GD_DIRFILE_STANDARDS_VERSION 9
+
+#include <math.h>
+#include <sys/types.h>
+
+/* If this symbol is defined here, the C99-API is not present in the library */
+ at DEFINE_GD_NO_C99_API@
+
+#if defined(GD_NO_C99_API) && ! defined(GD_C89_API)
+# define GD_C89_API
+#endif
+
+/* MSVC build system defines GD_C89_API */
+#if defined(GD_C89_API)
+# define GD_NO_C99_API
+#endif
+
+/* define function attributes */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+#  define gd_gnu_enough ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
+#else
+#  define gd_gnu_enough 0
+#endif
+
+#ifdef __attribute_deprecated__
+# define gd_deprecated __attribute_deprecated__
+#elif gd_gnu_enough
+# define gd_deprecated __attribute__ ((__deprecated__))
+#else
+# define gd_deprecated /**/
+#endif
+
+#ifdef __THROW
+# define gd_nothrow __THROW
+#elif !defined __cplusplus && gd_gnu_enough
+# define gd_nothrow __attribute__ ((__nothrow__))
+#else
+# define gd_nothrow /**/
+#endif
+
+/* ICC complains that it ignores the __nonnull__ attribute */
+#ifdef __INTEL_COMPILER
+# define gd_nonnull(...) /**/
+#elif gd_gnu_enough
+# define gd_nonnull(...) __attribute__ ((__nonnull__ __VA_ARGS__))
+#else
+# define gd_nonnull(...) /**/
+#endif
+
+/* formerly, this was the maximum length of a format file line.  We keep it
+ * around for legacy reasons.  (The actual maximum length of a format file
+ * line is the maximum value of ssize_t, i.e. 2**(n-1)-1 on a n-bit system.)
+ */
+#define GD_MAX_LINE_LENGTH  4096
+
+/* maximum number of elements allowed in a CARRAY.  Really the maximum should be
+ * whatever fits on a format file line, but that's hard to calculate.  This is
+ * 2**(n-8)-1 on a n-bit system.
+ */
+#define GD_MAX_CARRAY_LENGTH ((int)(((unsigned int)-1) >> 8))
+
+
+/* error codes */
+#define GD_E_OK                0 /* this MUST be zero */
+#define GD_E_OPEN              1
+#define GD_E_FORMAT            2
+#define GD_E_TRUNC             3
+#define GD_E_CREAT             4
+#define GD_E_BAD_CODE          5
+#define GD_E_BAD_TYPE          6
+#define GD_E_RAW_IO            7
+#define GD_E_OPEN_FRAGMENT     8
+#define GD_E_INTERNAL_ERROR    9
+#define GD_E_ALLOC            10
+#define GD_E_RANGE            11
+#define GD_E_OPEN_LINFILE     12
+#define GD_E_RECURSE_LEVEL    13
+#define GD_E_BAD_DIRFILE      14
+#define GD_E_BAD_FIELD_TYPE   15
+#define GD_E_ACCMODE          16
+#define GD_E_UNSUPPORTED      17
+#define GD_E_UNKNOWN_ENCODING 18
+#define GD_E_BAD_ENTRY        19
+#define GD_E_DUPLICATE        20
+#define GD_E_DIMENSION        21
+#define GD_E_BAD_INDEX        22
+#define GD_E_BAD_SCALAR       23
+#define GD_E_BAD_REFERENCE    24
+#define GD_E_PROTECTED        25
+#define GD_E_DELETE           26
+#define GD_E_ARGUMENT         27
+#define GD_E_CALLBACK         28
+#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
+#define GD_E_BOUNDS           35
+#define GD_E_LINE_TOO_LONG    36
+
+#define GD_N_ERROR_CODES      37
+
+/* Deprecated error codes */
+#define GD_E_OPEN_INCLUDE     GD_E_OPEN_FRAGMENT
+#define GD_E_BAD_ENDIANNESS   GD_E_ARGUMENT
+#define GD_E_BAD_PROTECTION   GD_E_ARGUMENT
+#define GD_E_BAD_VERSION      GD_E_ARGUMENT
+
+#define GD_MAX_LINCOM 3
+
+/* the following MUST be at least one less than twice GD_MAX_LINCOM */
+#define GD_MAX_POLYORD (GD_MAX_LINCOM * 2 - 1)
+
+/* syntax suberrors */
+#define GD_E_FORMAT_BAD_SPF    1
+#define GD_E_FORMAT_N_FIELDS   2
+#define GD_E_FORMAT_N_TOK      3
+#define GD_E_FORMAT_NUMBITS    4
+#define GD_E_FORMAT_BITNUM     5
+#define GD_E_FORMAT_BITSIZE    6
+#define GD_E_FORMAT_CHARACTER  7
+#define GD_E_FORMAT_BAD_LINE   8
+#define GD_E_FORMAT_RES_NAME   9
+#define GD_E_FORMAT_ENDIAN    10
+#define GD_E_FORMAT_BAD_TYPE  11
+#define GD_E_FORMAT_BAD_NAME  12
+#define GD_E_FORMAT_UNTERM    13
+#define GD_E_FORMAT_METARAW   14
+#define GD_E_FORMAT_NO_FIELD  15
+#define GD_E_FORMAT_DUPLICATE 16
+#define GD_E_FORMAT_LOCATION  17
+#define GD_E_FORMAT_PROTECT   18
+#define GD_E_FORMAT_LITERAL   19
+#define GD_E_FORMAT_WINDOP    20
+#define GD_E_FORMAT_META_META 21
+#define GD_E_FORMAT_ALIAS     22
+#define GD_E_FORMAT_MPLEXVAL  23
+
+/* deprecated syntax suberrors */
+#define GD_E_FORMAT_NO_PARENT GD_E_FORMAT_NO_FIELD
+
+/* parser callback return values */
+#define GD_SYNTAX_ABORT    0
+#define GD_SYNTAX_RESCAN   1
+#define GD_SYNTAX_IGNORE   2
+#define GD_SYNTAX_CONTINUE 3
+
+/* Protection levels */
+#define GD_PROTECT_NONE   00
+#define GD_PROTECT_FORMAT 01
+#define GD_PROTECT_DATA   02
+#define GD_PROTECT_ALL    ( GD_PROTECT_DATA | GD_PROTECT_FORMAT )
+
+/* Standards specifiers */
+#define GD_VERSION_CURRENT  (-1)
+#define GD_VERSION_LATEST   (-2)
+#define GD_VERSION_EARLIEST (-3)
+
+/* this MUST be one less than the lowest allowed fragment index */
+#define GD_ALL_FRAGMENTS (-1)
+
+#define GD_SCALAR_ENTRY_BIT  0x10
+#define GD_SPECIAL_ENTRY_BIT 0x20
+/* field types */
+typedef enum {
+  GD_NO_ENTRY       = 0x00,
+  GD_RAW_ENTRY      = 0x01,
+  GD_LINCOM_ENTRY   = 0x02,
+  GD_LINTERP_ENTRY  = 0x03,
+  GD_BIT_ENTRY      = 0x04,
+  GD_MULTIPLY_ENTRY = 0x05,
+  GD_PHASE_ENTRY    = 0x06,
+  GD_INDEX_ENTRY    = 0x07,
+  GD_POLYNOM_ENTRY  = 0x08,
+  GD_SBIT_ENTRY     = 0x09,
+  GD_DIVIDE_ENTRY   = 0x0A,
+  GD_RECIP_ENTRY    = 0x0B,
+  GD_WINDOW_ENTRY   = 0x0C,
+  GD_MPLEX_ENTRY    = 0x0D,
+  GD_CONST_ENTRY    = GD_SCALAR_ENTRY_BIT | 0x00,
+  GD_STRING_ENTRY   = GD_SCALAR_ENTRY_BIT | 0x01,
+  GD_CARRAY_ENTRY   = GD_SCALAR_ENTRY_BIT | 0x02,
+
+  /* not a real entry type, but it's convenient to put this here */
+  GD_ALIAS_ENTRY    =   -1
+} gd_entype_t;
+
+/* GD_NO_ENTRY and GD_ALIAS_ENTRY are not part of this count */
+#define GD_N_ENTYPES 16
+
+/* Special types for gd_nentries(3) and gd_entry_list(3) */
+#define GD_ALL_ENTRIES    0
+#define GD_VECTOR_ENTRIES (GD_SPECIAL_ENTRY_BIT | 0x01)
+#define GD_SCALAR_ENTRIES (GD_SPECIAL_ENTRY_BIT | 0x02)
+#define GD_ALIAS_ENTRIES  GD_ALIAS_ENTRY
+
+/* gd_nentries(3) and gd_entry_list(3) flags */
+#define GD_ENTRIES_HIDDEN  0x1
+#define GD_ENTRIES_NOALIAS 0x2
+
+/* the current location of the I/O pointer */
+#define GD_HERE  (-1)
+
+/* MPLEX lookback defines */
+#define GD_DEFAULT_LOOKBACK 10
+#define GD_LOOKBACK_ALL (-1)
+
+/* C data types */
+#if ! defined GD_C89_API
+# include <inttypes.h>
+# define gd_int64_t int64_t
+# define gd_uint64_t uint64_t
+# define GD_DCOMPLEXM(v) double _Complex v
+# define GD_DCOMPLEXP(v) double _Complex *v
+typedef int64_t gd_shift_t;
+#else
+ at DEFINE_gd_int64_t@
+ at DEFINE_gd_uint64_t@
+# define GD_DCOMPLEXM(v) double v[2]
+# define GD_DCOMPLEXP(v) double *v
+typedef gd_int64_t gd_shift_t;
+#endif
+
+/* Deprecated types */
+typedef int gd_bit_t;
+typedef unsigned int gd_spf_t;
+
+/* Data types -- No valid type may set 0x40 */
+#define GD_SIZE8     0x001
+#define GD_SIZE16    0x002
+#define GD_SIZE32    0x004
+#define GD_SIZE64    0x008
+#define GD_SIZE128   0x010
+#define GD_SIZE(x)   ((x) & 0x01f)
+
+#define GD_SIGNED    0x020
+#define GD_IEEE754   0x080
+#define GD_COMPLEX   0x100
+
+typedef enum {
+  GD_NULL       = 0,
+  GD_UNKNOWN    = 0xfa0,  /* GD_SIZE(GD_UNKNOWN) MUST evaluate to zero */
+  GD_UINT8      = GD_SIZE8,
+  GD_INT8       = GD_SIZE8   | GD_SIGNED,
+  GD_UINT16     = GD_SIZE16,
+  GD_INT16      = GD_SIZE16  | GD_SIGNED,
+  GD_UINT32     = GD_SIZE32,
+  GD_INT32      = GD_SIZE32  | GD_SIGNED,
+  GD_UINT64     = GD_SIZE64,
+  GD_INT64      = GD_SIZE64  | GD_SIGNED,
+  GD_FLOAT32    = GD_SIZE32  | GD_IEEE754,
+  GD_FLOAT64    = GD_SIZE64  | GD_IEEE754,
+  GD_COMPLEX64  = GD_SIZE64  | GD_COMPLEX,
+  GD_COMPLEX128 = GD_SIZE128 | GD_COMPLEX
+} gd_type_t;
+/* deprecated type aliases */
+#define GD_FLOAT     GD_FLOAT32
+#define GD_DOUBLE    GD_FLOAT64
+
+/* Window operations */
+typedef enum {
+  GD_WINDOP_UNK,
+  GD_WINDOP_EQ,
+  GD_WINDOP_GE,
+  GD_WINDOP_GT,
+  GD_WINDOP_LE,
+  GD_WINDOP_LT,
+  GD_WINDOP_NE,
+  GD_WINDOP_SET,
+  GD_WINDOP_CLR
+} gd_windop_t;
+
+struct gd_private_entry_;
+
+typedef union {
+  gd_int64_t i;
+  gd_uint64_t u;
+  double r;
+} gd_triplet_t;
+
+/* ANSI C does not permit anonymous structs/unions */
+#ifdef GD_C89_API
+# define GD_ANON(x) x
+#else
+# define GD_ANON(x)
+#endif
+/* Unified entry struct */
+struct gd_unified_entry_ {
+  char *field;
+  gd_entype_t field_type;
+  char *in_fields[GD_MAX_LINCOM];
+  char *scalar[GD_MAX_POLYORD + 1];
+  int scalar_ind[GD_MAX_POLYORD + 1];
+  int fragment_index;
+  int comp_scal;
+  int hidden;
+  union {
+    struct { /* RAW */
+      unsigned int spf;
+      gd_type_t data_type;
+    } GD_ANON(raw);
+    struct { /* LINCOM */
+      int n_fields;
+      double m[GD_MAX_LINCOM];
+      GD_DCOMPLEXM(cm[GD_MAX_LINCOM]);
+      double b[GD_MAX_LINCOM];
+      GD_DCOMPLEXM(cb[GD_MAX_LINCOM]);
+    } GD_ANON(lincom);
+    struct { /* BIT and SBIT */
+      int bitnum;
+      int numbits;
+    } GD_ANON(bit);
+    struct { /* POLYNOM */
+      int poly_ord;
+      double a[GD_MAX_POLYORD + 1];
+      GD_DCOMPLEXM(ca[GD_MAX_POLYORD + 1]);
+    } GD_ANON(polynom);
+    struct { /* RECIP */
+      double dividend;
+      GD_DCOMPLEXM(cdividend);
+    } GD_ANON(recip);
+    struct { /* LINTERP */
+      char *table;
+    } GD_ANON(linterp);
+    struct { /* PHASE */
+      gd_shift_t shift;
+    } GD_ANON(phase);
+    struct { /* WINDOW */
+      gd_windop_t windop;
+      gd_triplet_t threshold;
+    } GD_ANON(window);
+    struct { /* MPLEX */
+      int count_val;
+      int period;
+    } GD_ANON(mplex);
+    struct { /* CONST */
+      gd_type_t const_type;
+      size_t array_len;
+    } GD_ANON(scalar);
+  } GD_ANON(u);
+
+  struct gd_private_entry_ *e;
+};
+
+typedef struct gd_unified_entry_ gd_entry_t;
+
+/* The dirifle object */
+typedef struct gd_dirfile_ DIRFILE;
+
+/* Parser callback objects */
+struct gd_callback_data_ {
+  const DIRFILE *dirfile;
+  int suberror;
+  int linenum;
+  const char *filename;
+  char *line;
+  size_t buflen;
+};
+
+/* the carray list object */
+struct gd_carray_data_ {
+  size_t n;
+  void *d;
+};
+
+typedef struct gd_carray_data_ gd_carray_t;
+
+typedef struct gd_callback_data_ gd_parser_data_t;
+
+typedef int (*gd_parser_callback_t)(gd_parser_data_t*, void*);
+
+
+/* dirfile_flags --- 0xF0000000 are reserved */
+#define GD_ACCMODE        0x00000001 /* mask */
+#define GD_RDONLY         0x00000000 /* open read only */
+#define GD_RDWR           0x00000001 /* open read/write */
+
+#define GD_FORCE_ENDIAN   0x00000002 /* override endianness */
+#define GD_BIG_ENDIAN     0x00000004 /* assume big-endian raw data */
+#define GD_LITTLE_ENDIAN  0x00000008 /* assume litte-endian raw data */
+#define GD_CREAT          0x00000010 /* create dirfile if it doesn't exist */
+#define GD_EXCL           0x00000020 /* force creation: fail on existence */
+#define GD_TRUNC          0x00000040 /* truncate dirfile (scary!) */
+#define GD_PEDANTIC       0x00000080 /* be pedantic */
+#define GD_FORCE_ENCODING 0x00000100 /* override encoding scheme */
+#define GD_VERBOSE        0x00000200 /* be verbose */
+#define GD_IGNORE_DUPS    0x00000400 /* ignore duplicate fields */
+#define GD_IGNORE_REFS    0x00000800 /* ignore REFERENCE directives --
+                                        dirfile_include only */
+#define GD_PRETTY_PRINT   0x00001000 /* make a nicer looking format file */
+
+#if (defined __arm__ && !(defined __VFP_FP__ || defined __MAVERICK__))
+# define GD_ARM_ENDIAN     0x00000000 /* ARM-endian doubles */
+# define GD_NOT_ARM_ENDIAN 0x00002000 /* "normal"-endian doubles */
+#else
+# define GD_ARM_ENDIAN     0x00002000 /* ARM-endian doubles */
+# define GD_NOT_ARM_ENDIAN 0x00000000 /* "normal"-endian doubles */
+#endif
+
+#define GD_PERMISSIVE     0x00004000 /* be permissive */
+#define GD_TRUNCSUB       0x00008000 /* truncate subdirectories */
+
+#define GD_ENCODING       0x0F000000 /* mask */
+#define GD_AUTO_ENCODED   0x00000000 /* Encoding scheme unknown */
+#define GD_UNENCODED      0x01000000 /* Data are not encoded */
+#define GD_TEXT_ENCODED   0x02000000 /* Data are text encoded */
+#define GD_SLIM_ENCODED   0x03000000 /* Data are slimlib encoded */
+#define GD_GZIP_ENCODED   0x04000000 /* Data are gzip encoded */
+#define GD_BZIP2_ENCODED  0x05000000 /* Data are bzip2 encoded */
+#define GD_LZMA_ENCODED   0x06000000 /* Data are xz encoded */
+#define GD_SIE_ENCODED    0x07000000 /* Data are sample index encoded */
+#define GD_ZZIP_ENCODED   0x08000000 /* Data are zzip encoded */
+#define GD_ZZSLIM_ENCODED 0x09000000 /* Data are zzslim encoded */
+#define GD_ENC_UNSUPPORTED GD_ENCODING /* Encoding unsupported */
+
+/* delete flags */
+#define GD_DEL_META  0x1
+#define GD_DEL_DATA  0x2
+#define GD_DEL_DEREF 0x4
+#define GD_DEL_FORCE 0x8
+
+/* move flags */
+#define GD_REN_DATA  0x1
+#define GD_REN_UPDB  0x2
+
+/* seek flags */
+#define GD_SEEK_SET   0x0
+#define GD_SEEK_CUR   0x1
+#define GD_SEEK_END   0x2
+#define GD_SEEK_WRITE 0x4
+
+/* desync flags */
+#define GD_DESYNC_PATHCHECK 0x1
+#define GD_DESYNC_REOPEN    0x2
+
+extern int gd_add_alias(DIRFILE *dirfile, const char *alias_name,
+    const char *target_code, int fragment_index) gd_nothrow
+gd_nonnull ((1,2,3));
+
+extern int gd_add_bit(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, int bitnum, int numbits, int fragment_index)
+gd_nothrow gd_nonnull ((1,2,3));
+
+extern int gd_add_clincom(DIRFILE *dirfile, const char *field_code,
+    int n_fields, const char **in_fields, const GD_DCOMPLEXP(cm),
+    const GD_DCOMPLEXP(cb), int fragment_index) gd_nothrow
+gd_nonnull ((1,2,4,5,6));
+
+extern int gd_add_carray(DIRFILE *dirfile, const char *field_code,
+    gd_type_t const_type, size_t array_len, gd_type_t data_type,
+    const void *values, int fragment_index) gd_nothrow gd_nonnull((1,2,6));
+
+extern int gd_add_const(DIRFILE *dirfile, const char *field_code,
+    gd_type_t const_type, gd_type_t data_type, const void *value,
+    int fragment_index) gd_nothrow gd_nonnull ((1,2,5));
+
+extern int gd_add_cpolynom(DIRFILE *dirfile, const char *field_code,
+    int poly_ord, const char *in_field, const GD_DCOMPLEXP(ca),
+    int fragment_index) gd_nothrow gd_nonnull ((1,2,4));
+
+/* The native gd_add_crecip cannot be used in C89 mode */
+#if ! defined GD_C89_API
+extern int gd_add_crecip(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, _Complex double cdividend, int fragment_index)
+  gd_nothrow gd_nonnull ((1,2,3));
+#else
+#define gd_add_crecip gd_add_crecip89
+#endif
+
+extern int gd_add_crecip89(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, const double cdividend[2], int fragment_index)
+  gd_nothrow gd_nonnull ((1,2,3));
+
+extern int gd_add_divide(DIRFILE *dirfile, const char *field_code,
+    const char *in_field1, const char *in_field2, int fragment_index)
+gd_nothrow gd_nonnull ((1,2,3,4));
+
+extern int gd_add_lincom(DIRFILE *dirfile, const char *field_code, int n_fields,
+    const char **in_fields, const double *m, const double *b,
+    int fragment_index) gd_nothrow gd_nonnull ((1,2,4,5,6));
+
+extern int gd_add_linterp(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, const char *table, int fragment_index) gd_nothrow
+gd_nonnull ((1,2,3,4));
+
+extern int gd_add_mplex(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, const char *count_field, int count_val, int period,
+    int fragment_index) gd_nothrow gd_nonnull ((1,2,3,4));
+
+extern int gd_add_multiply(DIRFILE *dirfile, const char *field_code,
+    const char *in_field1, const char *in_field2, int fragment_index)
+gd_nothrow gd_nonnull ((1,2,3,4));
+
+extern int gd_add_phase(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, gd_shift_t shift, int fragment_index) gd_nothrow
+gd_nonnull ((1,2,3));
+
+extern int gd_add_polynom(DIRFILE *dirfile, const char *field_code,
+    int poly_ord, const char *in_field, const double *a, int fragment_index)
+gd_nothrow gd_nonnull ((1,2,4));
+
+extern int gd_add_recip(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, double dividend, int fragment_index) gd_nothrow
+gd_nonnull ((1,2,3));
+
+extern int gd_add_sbit(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, int bitnum, int numbits,
+    int fragment_index) gd_nothrow gd_nonnull ((1,2,3));
+
+extern int gd_add_string(DIRFILE *dirfile, const char *field_code,
+    const char *value, int fragment_index) gd_nothrow gd_nonnull((1,2,3));
+
+extern int gd_add_window(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, const char *check_field, gd_windop_t windop,
+    gd_triplet_t threshold, int fragment_index) gd_nothrow
+gd_nonnull ((1,2,3,4));
+
+extern const char *gd_alias_target(DIRFILE *dirfile,
+    const char *field_code) gd_nothrow gd_nonnull ((1,2));
+
+extern const char **gd_aliases(DIRFILE *dirfile,
+    const char *field_code) gd_nothrow gd_nonnull ((1,2));
+
+extern int gd_alter_affixes(DIRFILE *dirfile, int index, const char *prefix,
+        const char *suffix) gd_nothrow gd_nonnull ((1));
+
+extern int gd_alter_bit(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, int bitnum, int numbits) gd_nothrow
+gd_nonnull((1,2));
+
+extern int gd_alter_carray(DIRFILE *dirfile, const char *field_code,
+    gd_type_t const_type, size_t array_len) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_clincom(DIRFILE *dirfile, const char *field_code,
+    int n_fields, const char **in_fields, const GD_DCOMPLEXP(m),
+    const GD_DCOMPLEXP(b)) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_const(DIRFILE *dirfile, const char *field_code,
+    gd_type_t const_type) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_cpolynom(DIRFILE *dirfile, const char *field_code,
+    int poly_ord, const char *in_field, const GD_DCOMPLEXP(a)) gd_nothrow
+gd_nonnull((1,2));
+
+#if ! defined GD_C89_API
+extern int gd_alter_crecip(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, _Complex double cdividend) gd_nothrow
+gd_nonnull((1,2));
+#else
+#define gd_alter_crecip gd_alter_crecip89
+#endif
+
+extern int gd_alter_crecip89(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, const double cdividend[2]) gd_nothrow
+gd_nonnull((1,2));
+
+extern int gd_alter_divide(DIRFILE *dirfile, const char *field_code,
+    const char *in_field1, const char *in_field2) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_lincom(DIRFILE *dirfile, const char *field_code,
+    int n_fields, const char **in_fields, const double *m, const double *b)
+gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_mplex(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, const char *count_field, int count_val,
+    int period) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_multiply(DIRFILE *dirfile, const char *field_code,
+    const char *in_field1, const char *in_field2) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_phase(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, gd_shift_t shift) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_polynom(DIRFILE *dirfile, const char *field_code,
+    int poly_ord, const char *in_field, const double *a) gd_nothrow
+gd_nonnull((1,2));
+
+extern int gd_alter_recip(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, double cdividend) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_alter_sbit(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, int bitnum, int numbits) gd_nothrow
+gd_nonnull((1,2));
+
+extern int gd_alter_window(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, const char *check_field, gd_windop_t windop,
+    gd_triplet_t threshold) gd_nothrow gd_nonnull((1,2));
+
+extern size_t gd_carray_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 int gd_get_carray(DIRFILE *dirfile, const char *field_code,
+    gd_type_t return_type, void *data_out) gd_nothrow gd_nonnull((1,2));
+
+extern int gd_get_carray_slice(DIRFILE *dirfile, const char *field_code,
+    unsigned int start, size_t n, gd_type_t return_type, void *data_out)
+gd_nothrow gd_nonnull((1,2));
+
+extern int gd_put_carray(DIRFILE *dirfile, const char *field_code,
+  gd_type_t data_type, const void *data_in) gd_nothrow gd_nonnull((1,2,4));
+
+extern int gd_put_carray_slice(DIRFILE *dirfile, const char *field_code,
+    unsigned int first, size_t n, gd_type_t data_type, const void *data_in)
+gd_nothrow gd_nonnull((1,2,6));
+
+extern int gd_get_constant(DIRFILE *dirfile, const char *field_code,
+    gd_type_t return_type, void *data) gd_nothrow gd_nonnull ((1, 2));
+
+extern int gd_put_constant(DIRFILE *dirfile, const char *field_code,
+    gd_type_t data_type, const void *data) gd_nothrow gd_nonnull ((1, 2, 4));
+
+extern const void *gd_constants(DIRFILE *dirfile,
+    gd_type_t return_type) gd_nothrow gd_nonnull ((1));
+
+extern const gd_carray_t *gd_carrays(DIRFILE *dirfile,
+    gd_type_t return_type) gd_nothrow gd_nonnull ((1));
+
+extern gd_entry_t *gd_free_entry_strings(gd_entry_t *entry) gd_nothrow;
+
+extern unsigned long int gd_encoding(DIRFILE *dirfile,
+    int fragment) gd_nothrow gd_nonnull ((1));
+
+extern unsigned long int gd_endianness(DIRFILE *dirfile,
+    int fragment) gd_nothrow gd_nonnull((1));
+
+extern int gd_entry(DIRFILE *dirfile, const char *field_code,
+    gd_entry_t *entry) gd_nothrow gd_nonnull ((1, 2));
+
+extern const char **gd_entry_list(DIRFILE* D, const char *parent, int type,
+    unsigned int flags) gd_nothrow gd_nonnull ((1));
+
+extern gd_entype_t gd_entry_type(DIRFILE *dirfile,
+    const char *field_code) gd_nothrow gd_nonnull ((1));
+
+extern int gd_error(const DIRFILE *dirfile) gd_nothrow gd_nonnull ((1));
+
+extern int gd_error_count(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1));
+
+extern char *gd_error_string(const DIRFILE *dirfile, char *buffer,
+    size_t buflen) gd_nothrow gd_nonnull ((1));
+
+extern const char **gd_field_list(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1));
+
+extern const char **gd_field_list_by_type(DIRFILE *dirfile,
+    gd_entype_t type) gd_nothrow gd_nonnull ((1));
+
+extern unsigned long gd_flags(DIRFILE *D, unsigned long set,
+    unsigned long resest) gd_nothrow gd_nonnull ((1));
+
+extern int gd_fragment_affixes(DIRFILE *dirfile, int index, char **prefix,
+    char **suffix) gd_nothrow gd_nonnull ((1,3,4));
+
+extern int gd_fragment_index(DIRFILE *dirfile,
+    const char *field_code) gd_nothrow gd_nonnull ((1));
+
+extern const char *gd_fragmentname(DIRFILE *dirfile,
+    int index) gd_nothrow gd_nonnull ((1));
+
+extern int gd_hidden(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1,2));
+
+extern int gd_hide(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1,2));
+
+extern DIRFILE *gd_invalid_dirfile(void) gd_nothrow;
+
+extern char *gd_linterp_tablename(DIRFILE *D, const char *field_code) gd_nothrow
+gd_nonnull ((1, 2));
+
+extern int gd_madd(DIRFILE *dirfile, const gd_entry_t *entry,
+    const char *parent) gd_nothrow gd_nonnull ((1,2,3));
+
+extern int gd_madd_alias(DIRFILE *dirfile, const char *parent,
+    const char *alias_name, const char *target_code) gd_nothrow
+gd_nonnull ((1,2,3,4));
+
+extern int gd_madd_bit(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, int bitnum,
+    int numbits) gd_nothrow gd_nonnull ((1,2,3,4));
+
+extern int gd_madd_carray(DIRFILE *dirfile, const char *parent,
+    const char *field_code, gd_type_t const_type, size_t array_len,
+    gd_type_t data_type, const void *values) gd_nothrow gd_nonnull((1,2,3,7));
+
+extern int gd_madd_clincom(DIRFILE *dirfile, const char *parent,
+    const char *field_code, int n_fields, const char **in_fields,
+    const GD_DCOMPLEXP(cm), const GD_DCOMPLEXP(cb)) gd_nothrow
+gd_nonnull((1,2,3,5,6,7));
+
+extern int gd_madd_const(DIRFILE *dirfile, const char *parent,
+    const char *field_code, gd_type_t const_type, gd_type_t data_type,
+    const void *value) gd_nothrow gd_nonnull ((1,2,3,6));
+
+extern int gd_madd_cpolynom(DIRFILE *dirfile, const char *parent,
+    const char *field_code, int poly_ord, const char *in_field,
+    const GD_DCOMPLEXP(ca)) gd_nothrow gd_nonnull ((1,2,3,5));
+
+#if ! defined GD_C89_API
+extern int gd_madd_crecip(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, _Complex double cdividend)
+gd_nothrow gd_nonnull ((1,2,3,4));
+#else
+#define gd_madd_crecip gd_madd_crecip89
+#endif
+
+extern int gd_madd_crecip89(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, const double cdividend[2])
+gd_nothrow gd_nonnull ((1,2,3,4));
+
+extern int gd_madd_divide(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field1, const char *in_field2)
+gd_nothrow gd_nonnull ((1,2,3,4,5));
+
+extern int gd_madd_lincom(DIRFILE *dirfile, const char *parent,
+    const char *field_code, int n_fields, const char **in_fields,
+    const double *m, const double *b) gd_nothrow gd_nonnull((1,2,3,5,6,7));
+
+extern int gd_madd_linterp(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, const char *table)
+gd_nothrow gd_nonnull ((1,2,3,4,5));
+
+extern int gd_madd_mplex(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, const char *count_field,
+    int count_val, int period) gd_nothrow
+gd_nonnull ((1,2,3,4,5));
+
+extern int gd_madd_multiply(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field1, const char *in_field2)
+gd_nothrow gd_nonnull ((1,2,3,4,5));
+
+extern int gd_madd_phase(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, gd_shift_t shift)
+gd_nothrow gd_nonnull ((1,2,3,4));
+
+extern int gd_madd_polynom(DIRFILE *dirfile, const char *parent,
+    const char *field_code, int poly_ord, const char *in_field, const double *a)
+gd_nothrow gd_nonnull ((1,2,3,5));
+
+extern int gd_madd_recip(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, double dividend) gd_nothrow
+gd_nonnull ((1,2,3,4));
+
+extern int gd_madd_sbit(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, int bitnum,
+    int numbits) gd_nothrow gd_nonnull ((1,2,3,4));
+
+extern int gd_madd_spec(DIRFILE *dirfile, const char *line,
+    const char *parent) gd_nothrow gd_nonnull ((1,2,3));
+
+extern int gd_madd_string(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *value) gd_nothrow
+gd_nonnull ((1,2,3,4));
+
+extern int gd_madd_window(DIRFILE *dirfile, const char *parent,
+    const char *field_code, const char *in_field, const char *check_field,
+    gd_windop_t windop, gd_triplet_t threshold) gd_nothrow
+gd_nonnull ((1,2,3,4,5));
+
+extern int gd_dirfile_standards(DIRFILE *dirfile, int vers) gd_nothrow
+gd_nonnull ((1));
+
+extern const void *gd_mconstants(DIRFILE *dirfile, const char *parent,
+    gd_type_t return_type) gd_nothrow gd_nonnull((1,2));
+
+extern const gd_carray_t *gd_mcarrays(DIRFILE *dirfile, const char *parent,
+    gd_type_t return_type) gd_nothrow;
+
+extern const char **gd_mfield_list(DIRFILE *dirfile,
+    const char *parent) gd_nothrow gd_nonnull((1,2));
+
+extern const char **gd_mfield_list_by_type(DIRFILE *dirfile,
+    const char *parent, gd_entype_t type) gd_nothrow gd_nonnull((1,2));
+
+extern 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));
+
+extern const char **gd_mstrings(DIRFILE *dirfile, const char *parent) gd_nothrow
+gd_nonnull((1,2));
+
+extern const char **gd_mvector_list(DIRFILE *dirfile,
+    const char *parent) gd_nothrow gd_nonnull((1,2));
+
+extern const char *gd_dirfilename(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1));
+
+extern int gd_naliases(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1,2));
+
+extern gd_type_t gd_native_type(DIRFILE *dirfile,
+    const char *field_code) gd_nothrow gd_nonnull ((1,2));
+
+extern unsigned int gd_nentries(DIRFILE *D, const char *parent, int type,
+    unsigned int flags) gd_nothrow gd_nonnull ((1));
+
+extern unsigned int gd_nfields(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1));
+
+extern unsigned int gd_nfields_by_type(DIRFILE *dirfile,
+    gd_entype_t type) gd_nothrow gd_nonnull ((1));
+
+extern int gd_nfragments(DIRFILE *dirfile) gd_nothrow gd_nonnull((1));
+
+extern unsigned int gd_nmfields(DIRFILE *dirfile, const char *parent) gd_nothrow
+gd_nonnull((1,2));
+
+extern unsigned int gd_nmfields_by_type(DIRFILE *dirfile, const char *parent,
+    gd_entype_t type) gd_nothrow gd_nonnull((1,2));
+
+extern unsigned int gd_nmvectors(DIRFILE *dirfile,
+    const char *parent) gd_nothrow gd_nonnull((1,2));
+
+extern unsigned int gd_nvectors(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1));
+
+extern int gd_parent_fragment(DIRFILE *dirfile, int fragment_index) gd_nothrow
+gd_nonnull ((1));
+
+extern void gd_parser_callback(DIRFILE *dirfile, gd_parser_callback_t sehandler,
+    void*) gd_nothrow gd_nonnull ((1));
+
+extern int gd_alter_protection(DIRFILE *dirfile, int protection_level,
+    int fragment_index) gd_nothrow gd_nonnull ((1));
+
+extern int gd_protection(DIRFILE *dirfile, int fragment_index) gd_nothrow
+gd_nonnull ((1));
+
+extern char *gd_raw_filename(DIRFILE *dirfile,
+    const char *field_code) gd_nothrow gd_nonnull ((1, 2));
+
+extern const char *gd_reference(DIRFILE *dirfile,
+    const char *field_code) gd_nothrow gd_nonnull ((1));
+
+extern unsigned int gd_spf(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1, 2));
+
+extern size_t gd_get_string(DIRFILE *dirfile, const char *field_code,
+    size_t len, char *data) gd_nothrow gd_nonnull ((1, 2));
+
+extern size_t gd_put_string(DIRFILE *dirfile, const char *field_code,
+    const char *data) gd_nothrow gd_nonnull ((1, 2, 3));
+
+extern const char **gd_strings(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1));
+
+extern char *gd_strtok(DIRFILE *D, const char *string) gd_nothrow
+gd_nonnull ((1));
+
+extern int gd_unhide(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1,2));
+
+extern int gd_validate(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull((1,2));
+
+extern int gd_verbose_prefix(DIRFILE *D, const char *prefix) gd_nothrow
+gd_nonnull ((1));
+
+extern const char **gd_vector_list(DIRFILE *dirfile) gd_nothrow gd_nonnull((1));
+
+/* The following functions contain calls to I/O functions, making them
+ * cancellation points.  As a result we cannot mark them with gd_nothrow.
+ */
+extern int gd_add(DIRFILE *dirfile, const gd_entry_t *entry) gd_nonnull((1,2));
+
+extern int gd_add_raw(DIRFILE *dirfile, const char *field_code,
+    gd_type_t data_type, unsigned int spf,
+    int fragment_index) gd_nonnull((1,2));
+
+extern int gd_add_spec(DIRFILE *dirfile, const char *line,
+    int fragment_index) gd_nonnull ((1,2));
+
+extern int gd_alter_encoding(DIRFILE *dirfile, unsigned long int encoding,
+    int fragment, int recode) gd_nonnull ((1));
+
+extern int gd_alter_endianness(DIRFILE *dirfile, unsigned long int byte_sex,
+    int fragment, int recode) gd_nonnull ((1));
+
+extern int gd_alter_entry(DIRFILE *dirfile, const char *field_code,
+    const gd_entry_t *entry, int recode) gd_nonnull ((1,2));
+
+extern int gd_alter_linterp(DIRFILE *dirfile, const char *field_code,
+    const char *in_field, const char *table, int recode) gd_nonnull ((1,2));
+
+extern int gd_alter_raw(DIRFILE *dirfile, const char *field_code,
+    gd_type_t data_type, unsigned int spf, int recode) gd_nonnull ((1,2));
+
+extern int gd_alter_spec(DIRFILE *dirfile, const char *line,
+    int recode) gd_nonnull ((1,2));
+
+extern DIRFILE *gd_cbopen(const char *dirfilename, unsigned long int flags,
+    gd_parser_callback_t sehandler, void *extra) gd_nonnull ((1));
+
+extern int gd_close(DIRFILE *dirfile);
+
+extern int gd_delete(DIRFILE *dirfile, const char *field_code,
+    unsigned int flags) gd_nonnull ((1,2));
+
+extern int gd_desync(DIRFILE *dirfile, unsigned int flags);
+
+extern int gd_discard(DIRFILE *dirfile);
+
+extern int gd_flush(DIRFILE *dirfile, const char *field_code) gd_nonnull ((1));
+
+extern int gd_include(DIRFILE *dirfile, const char *file, int fragment_index,
+    unsigned long int flags) gd_nonnull ((1,2));
+
+extern int gd_include_affix(DIRFILE *dirfile, const char *file,
+    int fragment_index, const char *prefix, const char *suffix,
+    unsigned long int flags) gd_nonnull ((1,2));
+
+extern double gd_framenum(DIRFILE *dirfile, const char *field_code,
+    double value) gd_nonnull ((1,2));
+
+extern int gd_malter_spec(DIRFILE *dirfile, const char *line,
+    const char *parent, int recode) gd_nonnull ((1,2,3));
+
+extern int gd_metaflush(DIRFILE *dirfile) gd_nonnull ((1));
+
+extern int gd_move(DIRFILE *dirfile, const char *field_code, int new_fragment,
+    int move_data) gd_nonnull ((1,2));
+
+extern DIRFILE *gd_open(const char *dirfilename,
+    unsigned long int flags) gd_nonnull ((1));
+
+extern int gd_raw_close(DIRFILE *dirfile,
+    const char *field_code) gd_nonnull ((1));
+
+extern int gd_rename(DIRFILE *dirfile, const char *old_code,
+    const char *new_name, unsigned flags) gd_nonnull ((1,2,3));
+
+extern int gd_rewrite_fragment(DIRFILE *dirfile, int fragment) gd_nonnull ((1));
+
+extern int gd_sync(DIRFILE *dirfile, const char *field_code) gd_nonnull ((1));
+
+extern int gd_uninclude(DIRFILE *dirfile, int fragment_index,
+    int del) gd_nonnull ((1));
+
+/* if 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
+#define GD_64BIT_API
+#endif
+#endif
+
+/* the following functions are _FILE_OFFSET_BITS sensitive */
+extern int gd_alter_frameoffset(DIRFILE *dirfile, off_t offset, int fragment,
+    int recode) gd_nonnull ((1));
+
+extern size_t gd_getdata(DIRFILE *dirfile, const char *field_code,
+    off_t first_frame, off_t first_sample, size_t num_frames,
+    size_t num_samples, gd_type_t return_type, void *data) gd_nonnull ((1, 2));
+
+extern size_t gd_putdata(DIRFILE *dirfile, const char *field_code,
+    off_t first_frame, off_t first_sample, size_t num_frames,
+    size_t num_samples, gd_type_t data_type, const void *data)
+gd_nonnull ((1, 2));
+
+extern double gd_framenum_subset(DIRFILE *dirfile, const char *field_code,
+    double value, off_t field_start, off_t field_end) gd_nonnull ((1,2));
+
+extern off_t gd_frameoffset(DIRFILE *dirfile, int fragment) gd_nothrow
+gd_nonnull ((1));
+
+extern off_t gd_nframes(DIRFILE *dirfile) gd_nonnull ((1));
+
+extern off_t gd_bof(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1,2));
+
+extern off_t gd_eof(DIRFILE *dirfile, const char *field_code)
+  gd_nonnull ((1,2));
+
+extern off_t gd_seek(DIRFILE *dirfile, const char *field_code, off_t frame_num,
+    off_t sample_num, int whence) gd_nonnull ((1,2));
+
+extern off_t gd_tell(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1,2));
+
+#ifdef GD_64BIT_API
+#ifdef __off64_t_defined
+typedef __off64_t gd_off64_t;
+#elif (defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64)
+typedef off_t gd_off64_t;
+#else
+typedef gd_int64_t gd_off64_t;
+#endif
+
+extern int gd_alter_frameoffset64(DIRFILE *dirfile, gd_off64_t offset,
+    int fragment, int recode) gd_nonnull ((1));
+
+extern size_t gd_getdata64(DIRFILE *dirfile, const char *field_code,
+    gd_off64_t first_frame, gd_off64_t first_samp, size_t num_frames,
+    size_t num_samp, gd_type_t return_type, void *data) gd_nonnull ((1, 2));
+
+extern size_t gd_putdata64(DIRFILE *dirfile, const char *field_code,
+    gd_off64_t first_frame, gd_off64_t first_sample, size_t num_frames,
+    size_t num_samples, gd_type_t data_type, const void *data)
+gd_nonnull ((1, 2));
+
+extern gd_off64_t gd_frameoffset64(DIRFILE *dirfile,
+    int fragment) gd_nonnull((1));
+
+extern double gd_framenum_subset64(DIRFILE *dirfile, const char *field_code,
+    double value, gd_off64_t field_start,
+    gd_off64_t field_end) gd_nonnull ((1,2));
+
+extern gd_off64_t gd_nframes64(DIRFILE *dirfile) gd_nonnull ((1));
+
+extern gd_off64_t gd_bof64(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1,2));
+
+extern gd_off64_t gd_eof64(DIRFILE *dirfile, const char *field_code)
+  gd_nonnull ((1,2));
+
+extern gd_off64_t gd_seek64(DIRFILE *dirfile, const char *field_code,
+    gd_off64_t frame_num, gd_off64_t sample_num, int whence) gd_nonnull ((1,2));
+
+extern gd_off64_t gd_tell64(DIRFILE *dirfile, const char *field_code) gd_nothrow
+gd_nonnull ((1,2));
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* If this symbol is defined here, the legacy API is present in the library */
+ at DEFINE_GD_LEGACY_API@
+
+/* The caller can disable the legacy API by defining GD_NO_LEGACY_API
+ * before including getdata.h
+ */
+#ifndef GD_NO_LEGACY_API
+/* include the legacy api, if present */
+#  ifdef GD_LEGACY_API
+#    include <getdata_legacy.h>
+#  endif
+#endif
+
+/* function aliases */
+#ifdef GD_FUNCTION_ALIASES
+#  warning "Using deprecated function aliases."
+#  define dirfile_add gd_add
+#  define dirfile_add_bit gd_add_bit
+#  define dirfile_add_clincom gd_add_clincom
+#  define dirfile_add_const gd_add_const
+#  define dirfile_add_cpolynom gd_add_cpolynom
+#  define dirfile_add_lincom gd_add_lincom
+#  define dirfile_add_linterp gd_add_linterp
+#  define dirfile_add_multiply gd_add_multiply
+#  define dirfile_add_phase gd_add_phase
+#  define dirfile_add_polynom gd_add_polynom
+#  define dirfile_add_raw gd_add_raw
+#  define dirfile_add_sbit gd_add_sbit
+#  define dirfile_add_spec gd_add_spec
+#  define dirfile_add_string gd_add_string
+#  define dirfile_alter_bit gd_alter_bit
+#  define dirfile_alter_clincom gd_alter_clincom
+#  define dirfile_alter_const gd_alter_const
+#  define dirfile_alter_cpolynom gd_alter_cpolynom
+#  define dirfile_alter_encoding gd_alter_encoding
+#  define dirfile_alter_endianness gd_alter_endianness
+#  define dirfile_alter_entry gd_alter_entry
+#  define dirfile_alter_frameoffset gd_alter_frameoffset
+#  define dirfile_alter_frameoffset64 gd_alter_frameoffset64
+#  define dirfile_alter_lincom gd_alter_lincom
+#  define dirfile_alter_linterp gd_alter_linterp
+#  define dirfile_alter_multiply gd_alter_multiply
+#  define dirfile_alter_phase gd_alter_phase
+#  define dirfile_alter_polynom gd_alter_polynom
+#  define dirfile_alter_raw gd_alter_raw
+#  define dirfile_alter_sbit gd_alter_sbit
+#  define dirfile_alter_spec gd_alter_spec
+#  define dirfile_cbopen gd_cbopen
+#  define dirfile_close gd_close
+#  define get_constant gd_get_constant
+#  define put_constant gd_put_constant
+#  define get_constants gd_constants
+#  define getdata gd_getdata
+#  define putdata gd_putdata
+#  define getdata64 gd_getdata64
+#  define putdata64 gd_putdata64
+#  define dirfile_delete gd_delete
+#  define dirfile_discard gd_discard
+#  define get_encoding gd_encoding
+#  define get_endianness gd_endianness
+#  define get_entry gd_entry
+#  define get_entry_type gd_entry_type
+#  define get_error gd_error
+#  define get_error_string gd_error_string
+#  define get_field_list gd_field_list
+#  define get_field_list_by_type gd_field_list_by_type
+#  define dirfile_flush gd_flush
+#  define get_fragment_index gd_fragment_index
+#  define get_fragmentname gd_fragmentname
+#  define get_framenum_subset gd_framenum_subset
+#  define get_framenum_subset64 gd_framenum_subset64
+#  define get_frameoffset gd_frameoffset
+#  define get_frameoffset64 gd_frameoffset64
+#  define dirfile_free_entry_strings gd_free_entry_strings
+#  define dirfile_include gd_include
+#  define dirfile_madd gd_madd
+#  define dirfile_madd_bit gd_madd_bit
+#  define dirfile_madd_clincom gd_madd_clincom
+#  define dirfile_madd_const gd_madd_const
+#  define dirfile_madd_cpolynom gd_madd_cpolynom
+#  define dirfile_madd_lincom gd_madd_lincom
+#  define dirfile_madd_linterp gd_madd_linterp
+#  define dirfile_madd_multiply gd_madd_multiply
+#  define dirfile_madd_phase gd_madd_phase
+#  define dirfile_madd_polynom gd_madd_polynom
+#  define dirfile_madd_sbit gd_madd_sbit
+#  define dirfile_madd_spec gd_madd_spec
+#  define dirfile_madd_string gd_madd_string
+#  define dirfile_malter_spec gd_malter_spec
+#  define get_mconstants gd_mconstants
+#  define dirfile_metaflush gd_metaflush
+#  define get_mfield_list gd_mfield_list
+#  define get_mfield_list_by_type gd_mfield_list_by_type
+#  define dirfile_move gd_move
+#  define get_mstrings gd_mstrings
+#  define get_mvector_list gd_mvector_list
+#  define dirfilename gd_dirfilename
+#  define get_native_type gd_native_type
+#  define get_nfields gd_nfields
+#  define get_nfields_by_type gd_nfields_by_type
+#  define get_nfragments gd_nfragments
+#  define get_nframes gd_nframes
+#  define get_nframes64 gd_nframes64
+#  define get_nmfields gd_nmfields
+#  define get_nmfields_by_type gd_nmfields_by_type
+#  define get_nmvectors gd_nmvectors
+#  define get_nvectors gd_nvectors
+#  define dirfile_open gd_open
+#  define get_parent_fragment gd_parent_fragment
+#  define dirfile_parser_callback gd_parser_callback
+#  define dirfile_protect gd_alter_protection
+#  define get_protection gd_protection
+#  define get_raw_filename gd_raw_filename
+#  define dirfile_reference gd_reference
+#  define get_reference(D) gd_reference(D,NULL)
+#  define dirfile_rename gd_rename
+#  define get_spf gd_spf
+#  define dirfile_standards gd_dirfile_standards
+#  define get_string gd_get_string
+#  define put_string gd_put_string
+#  define get_strings gd_strings
+#  define dirfile_uninclude gd_uninclude
+#  define dirfile_validate gd_validate
+#  define get_vector_list gd_vector_list
+#endif
+
+#endif
diff --git a/src/getdata.pc.in b/src/getdata.pc.in
new file mode 100644
index 0000000..3f600dd
--- /dev/null
+++ b/src/getdata.pc.in
@@ -0,0 +1,13 @@
+# GetData pkg-config metadata
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: GetData
+Description: Dirfile Interface Library
+Version: @PACKAGE_VERSION@
+URL: http://getdata.sourceforge.net/
+Libs: -L${libdir} -lgetdata
+Libs.private: @PRIVATE_LIBS@
+Cflags: -I${includedir}
diff --git a/src/getdata_legacy.h b/src/getdata_legacy.h
new file mode 100644
index 0000000..0fd63e0
--- /dev/null
+++ b/src/getdata_legacy.h
@@ -0,0 +1,130 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2003-2005 Theodore Kisner
+ * Copyright (C) 2005-2010 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifndef GETDATA_LEGACY_H
+#define GETDATA_LEGACY_H
+
+/* Sanity check */
+#ifndef GETDATA_H
+#error "Never use <getdata_legacy.h> directly; include <getdata.h> instead."
+#endif
+
+extern const char *GD_ERROR_CODES[GD_N_ERROR_CODES] gd_deprecated;
+
+struct RawEntryType {
+  const char* field;
+  char type;
+  int size;
+  int samples_per_frame;
+};
+
+struct LincomEntryType {
+  const char *field;
+  int n_fields;
+  const char *in_fields[GD_MAX_LINCOM];
+  double m[GD_MAX_LINCOM], b[GD_MAX_LINCOM];
+};
+
+struct LinterpEntryType {
+  const char *field, *raw_field, *linterp_file;
+  int n_interp;
+  double *x, *y;
+};
+
+struct MultiplyEntryType {
+  const char *field;
+  const char *in_fields[2];
+};
+
+struct MPlexEntryType {
+  const char *field, *cnt_field, *data_field;
+  int i;
+  int max_i;
+};
+
+struct BitEntryType {
+  const char *field, *raw_field;
+  int bitnum, numbits;
+};
+
+struct PhaseEntryType {
+  const char *field, *raw_field;
+  int shift;
+};
+
+/* The old Format type */
+struct FormatType {
+  const char* FileDirName;
+  int frame_offset;
+  struct RawEntryType first_field;
+  struct RawEntryType *rawEntries;
+  int n_raw;
+  struct LincomEntryType *lincomEntries;
+  int n_lincom;
+  struct LinterpEntryType *linterpEntries;
+  int n_linterp;
+  struct MultiplyEntryType *multiplyEntries;
+  int n_multiply;
+  struct MPlexEntryType *mplexEntries;
+  int n_mplex;
+  struct BitEntryType *bitEntries;
+  int n_bit;
+  struct PhaseEntryType *phaseEntries;
+  int n_phase;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct FormatType *GetFormat(const char *filedir, int *error_code)
+  gd_nothrow gd_nonnull ((1,2)) gd_deprecated;
+
+/* legacy API for get_error_string() */
+extern char* GetDataErrorString(char* buffer, size_t buflen) gd_nothrow
+  gd_nonnull ((1)) gd_deprecated;
+
+/* legacy API for getdata() */
+extern int GetData(const char *dirfilename, const char *field_code,
+    int first_frame, int first_samp, int num_frames, int num_samp,
+    char return_type, void *data_out, int *error_code) gd_nonnull ((1,2,9))
+  gd_deprecated;
+
+/* legacy API for get_nframes() */
+extern int GetNFrames(const char *dirfilename, int *error_code,
+    const void *unused) gd_nonnull ((1,2)) gd_deprecated;
+
+/* legacy API for get_spf() */
+extern int GetSamplesPerFrame(const char *dirfilename, const char *field_code,
+    int *error_code) gd_nothrow gd_nonnull ((1,2,3)) gd_deprecated;
+
+/* legacy API for putdata() */
+extern int PutData(const char *filename_in, const char *field_code,
+    int first_frame, int first_samp, int num_frames, int num_samp,
+    char data_type, const void *data_in, int *error_code)
+gd_nonnull ((1,2,9)) gd_deprecated;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/globals.c b/src/globals.c
new file mode 100644
index 0000000..6349fb9
--- /dev/null
+++ b/src/globals.c
@@ -0,0 +1,173 @@
+/* Copyright (C) 2008-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* This is a canonicalised version of the path specified in the open call.
+ * In the presence of third parties modifying symlinks after dirfile open, the
+ * caller is unable to determine the actual path to the dirfile that was
+ * opened if we don't help out. */
+const char *gd_dirfilename(DIRFILE* D) gd_nothrow
+{
+  dtrace("%p", D);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  dreturn("\"%s\"", D->dir[0].path);
+  return D->dir[0].path;
+}
+
+const char *gd_reference(DIRFILE* D, const char* field_code) gd_nothrow
+{
+  gd_entry_t *E;
+  char *ptr;
+
+  dtrace("%p, \"%s\"", D, field_code);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+  
+  /* if no field specified, return only the field name */
+  if (field_code == NULL) {
+    if (D->reference_field == NULL) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    dreturn("\"%s\"", D->reference_field->field);
+    return D->reference_field->field;
+  }
+
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* Check field */
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
+
+  if (E == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (E->field_type != GD_RAW_ENTRY) {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* Check protection */
+  if (D->fragment[0].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[0].cname);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  
+  ptr = _GD_Strdup(D, E->field);
+
+  if (ptr == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* set the new reference field */
+  D->reference_field = E;
+  free(D->fragment[0].ref_name);
+  D->fragment[0].ref_name = ptr;
+  D->fragment[0].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+
+  dreturn("\"%s\"", D->reference_field->field);
+  return D->reference_field->field;
+}
+
+/* the mask of allowed flags */
+#define GD_FLAG_MASK ( GD_VERBOSE | GD_PRETTY_PRINT)
+unsigned long gd_flags(DIRFILE *D, unsigned long set, unsigned long reset)
+  gd_nothrow
+{
+  dtrace("%p, 0x%lX, 0x%lX", D, set, reset);
+
+  _GD_ClearError(D);
+
+  set &= GD_FLAG_MASK;
+  reset &= GD_FLAG_MASK;
+
+  D->flags = (D->flags | set) & ~(D->flags & reset);
+  D->open_flags = (D->open_flags | set) & ~(D->open_flags & reset);
+
+  dreturn("0x%lX", D->flags & GD_FLAG_MASK);
+  return D->flags & GD_FLAG_MASK;
+}
+
+int gd_verbose_prefix(DIRFILE *D, const char *prefix) gd_nothrow
+{
+  char *ptr = NULL;
+  dtrace("%p, \"%s\"", D, prefix);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  if (prefix) {
+    ptr = _GD_Strdup(D, prefix);
+    if (D->error) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+
+  free(D->error_prefix);
+  D->error_prefix = ptr;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+void gd_mplex_lookback(DIRFILE *D, int lookback) gd_nothrow
+{
+  dtrace("%p, %i", D, lookback);
+
+  _GD_ClearError(D);
+
+  D->lookback = lookback;
+
+  dreturnvoid();
+}
diff --git a/src/gzip.c b/src/gzip.c
new file mode 100644
index 0000000..ee70f16
--- /dev/null
+++ b/src/gzip.c
@@ -0,0 +1,220 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#ifdef HAVE_ZLIB_H
+#include <zlib.h>
+#endif
+
+#ifdef USE_MODULES
+#define _GD_GzipOpen libgetdatagzip_LTX_GD_GzipOpen
+#define _GD_GzipSeek libgetdatagzip_LTX_GD_GzipSeek
+#define _GD_GzipRead libgetdatagzip_LTX_GD_GzipRead
+#define _GD_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
+#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)
+{
+  const char *gzmode = "w";
+  dtrace("%i, %p, <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;
+
+  file->edata = gzdopen(file->idata, gzmode);
+
+  if (file->edata == NULL) {
+    close(file->idata);
+    file->idata = -1;
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  file->mode = mode;
+  file->pos = 0;
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_GzipSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int mode)
+{
+  off64_t n = 0;
+
+  dtrace("%p, %lli, 0x%X, 0x%X", file, (long long)count, data_type, mode);
+
+  if (file->pos == count) {
+    dreturn("%lli", (long long)count);
+    return count;
+  }
+
+  count *= GD_SIZE(data_type);
+
+  if (count >= 0) {
+    n = (off64_t)gzseek((gzFile)file[(mode == GD_FILE_WRITE) ? 1 : 0].edata,
+        (off_t)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);
+      else {
+        dreturn("%i", -1);
+        return -1;
+      }
+    }
+
+    n /= GD_SIZE(data_type);
+    file->pos = n;
+  }
+
+  dreturn("%lli", (long long)n);
+  return n;
+}
+
+ssize_t _GD_GzipRead(struct gd_raw_file_ *file, void *ptr, gd_type_t data_type,
+    size_t nmemb)
+{
+  ssize_t n;
+  int errnum;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb);
+
+  n = gzread((gzFile)file->edata, ptr, GD_SIZE(data_type) * nmemb);
+
+  if (n >= 0) {
+    n /= GD_SIZE(data_type);
+    file->pos += n;
+  } else {
+    gzerror((gzFile)file->edata, &errnum);
+    if (errnum < 0)
+      n = -1;
+  }
+
+  dreturn("%" PRNsize_t, n);
+  return n;
+}
+
+ssize_t _GD_GzipWrite(struct gd_raw_file_ *file, const void *ptr,
+    gd_type_t data_type, size_t nmemb)
+{
+  ssize_t n;
+  int errnum;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb);
+
+  n = gzwrite((gzFile)file->edata, ptr, GD_SIZE(data_type) * nmemb);
+
+  if (n >= 0) {
+    n /= GD_SIZE(data_type);
+    file->pos += n;
+  } else {
+    gzerror((gzFile)file[1].edata, &errnum);
+    if (errnum < 0)
+      n = -1;
+  }
+
+  dreturn("%" PRNssize_t, n);
+  return n;
+}
+
+/* Because calling gzflush can result in degredation of compression, we avoid
+ * doing anything here */
+int _GD_GzipSync(struct gd_raw_file_ *file gd_unused_)
+{
+  dtrace("<unused>");
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int _GD_GzipClose(struct gd_raw_file_ *file)
+{
+  int ret;
+
+  dtrace("%p", file);
+
+  ret = gzclose((gzFile)file->edata);
+  if (ret) {
+    dreturn("%i", ret);
+    return ret;
+  }
+
+  file->idata = -1;
+  file->edata = NULL;
+  file->mode = 0;
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_GzipSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
+    int swap gd_unused_)
+{
+  int fd;
+  uint32_t size = 0;
+
+  dtrace("%i, %p, 0x%X, <unused>", dirfd, file, data_type);
+
+  fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666);
+  if (fd < 0) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* seek to the end */
+  if (lseek64(fd, -4, SEEK_END) == -1) {
+    dreturn("%i", -1);
+    return -1;
+  }
+  if (read(fd, &size, 4) < 4) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* the checksum size is stored little endian */
+#ifdef WORDS_BIGENDIAN
+  size = (size << 24) | ((size << 8) & 0x00ff0000)
+    | (size >> 24) | ((size >> 8) & 0x0000ff00);
+#endif
+
+  close(fd);
+
+  size /= GD_SIZE(data_type);
+
+  dreturn("%lli", (long long)size);
+  return size;
+}
diff --git a/src/include.c b/src/include.c
new file mode 100644
index 0000000..7f7fecf
--- /dev/null
+++ b/src/include.c
@@ -0,0 +1,565 @@
+/* Copyright (C) 2008-2011, 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "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)
+{
+  dtrace("%p, %i, \"%s\", \"%s\", %i, %i, \"%s\", %i, %p, %p", D, me, prefix_in,
+      suffix_in, standards, pedantic, format_file, line, prefix, suffix);
+
+  /* suffix first, for some reason */
+  if (suffix_in && suffix_in[0] != '\0') {
+    if (_GD_ValidateField(suffix_in, standards, pedantic, 1, NULL))
+    {
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+          suffix_in);
+      dreturn("%i", 1);
+      return 1;
+    }
+
+    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);
+      if (*suffix)
+        strcat(strcpy(*suffix, suffix_in), D->fragment[me].suffix);
+    }
+  } else if (D->fragment[me].suffix)
+    *suffix = _GD_Strdup(D, D->fragment[me].suffix);
+
+  if (D->error) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  /* now the prefix */
+  if (prefix_in && prefix_in[0] != '\0') {
+    if (_GD_ValidateField(prefix_in, standards, pedantic, 1, NULL))
+    {
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, format_file, line,
+          prefix_in);
+      dreturn("%i", 1);
+      return 1;
+    }
+
+    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);
+      if (*prefix)
+        strcat(strcpy(*prefix, D->fragment[me].prefix), prefix_in);
+    }
+  } else if (D->fragment[me].prefix)
+    *prefix = _GD_Strdup(D, D->fragment[me].prefix);
+
+  dreturn("%i", D->error);
+  return D->error;
+}
+
+/* Include a format file fragment -- returns the mew 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 i;
+  int me = D->n_fragment;
+  int old_standards = *standards;
+  int old_pedantic = *flags & GD_PEDANTIC;
+  int dirfd = -1;
+  char *temp_buf1 = NULL, *temp_buf2, *sname = NULL;
+  char *base = NULL, *prefix = NULL, *suffix = NULL;
+  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);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_INCLUDE, format_file,
+        linenum, ename);
+    goto include_error;
+  }
+
+  if (_GD_SetFieldAffixes(D, parent, prefix_in, suffix_in, old_standards,
+        old_pedantic, format_file, linenum, &prefix, &suffix))
+  {
+    goto include_error;
+  }
+
+  /* isolate filename */
+  temp_buf2 = _GD_Strdup(D, ename);
+  if (temp_buf2 == NULL)
+    goto include_error;
+  base = _GD_Strdup(D, basename(temp_buf2));
+  free(temp_buf2);
+  if (base == NULL)
+    goto include_error;
+
+  /* isolate relative path */
+  temp_buf2 = _GD_Strdup(D, ename);
+  if (temp_buf2 == NULL)
+    goto include_error;
+  sname = _GD_Strdup(D, dirname(temp_buf2));
+  free(temp_buf2);
+  if (sname == NULL)
+    goto include_error;
+
+  /* Open the containing directory */
+  dirfd = _GD_GrabDir(D, D->fragment[parent].dirfd, ename);
+  if (dirfd == -1 && D->error == GD_E_OK)
+    _GD_SetError(D, GD_E_OPEN_FRAGMENT, errno, format_file, linenum, 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);
+      _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_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_ReleaseDir(D, dirfd);
+      goto include_error;
+    }
+  }
+
+  /* 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);
+
+  if (i < 0) {
+    _GD_SetError(D, GD_E_OPEN_FRAGMENT, errno, format_file, linenum,
+        temp_buf1);
+    _GD_ReleaseDir(D, dirfd);
+    goto include_error;
+  }
+
+  new_fp = fdopen(i, (*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_ReleaseDir(D, dirfd);
+    goto include_error;
+  }
+
+  /* fstat the file and record the mtime */
+  if (fstat(i, &statbuf) == 0)
+    mtime = statbuf.st_mtime;
+
+  /* If we got here, we managed to open the included file; parse it */
+  ptr = _GD_Realloc(D, D->fragment,
+      (++D->n_fragment) * sizeof(struct gd_fragment_t));
+  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[me].bname = base;
+  D->fragment[me].cname = temp_buf1;
+  D->fragment[me].ename = _GD_Strdup(D, ename);
+  D->fragment[me].enc_data = NULL;
+  D->fragment[me].modified = 0;
+  D->fragment[me].parent = parent;
+  D->fragment[me].dirfd = dirfd;
+  D->fragment[me].encoding = *flags & GD_ENCODING;
+  D->fragment[me].byte_sex =
+#ifdef WORDS_BIGENDIAN
+    (*flags & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN
+#else
+    (*flags & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN
+#endif
+    ;
+  D->fragment[me].ref_name = NULL;
+  D->fragment[me].frame_offset = D->fragment[parent].frame_offset;
+  D->fragment[me].protection = GD_PROTECT_NONE;
+  D->fragment[me].prefix = prefix;
+  D->fragment[me].suffix = suffix;
+  D->fragment[me].mtime = mtime;
+  D->fragment[me].vers = (*flags & GD_PEDANTIC) ? 1ULL << *standards : 0;
+
+  /* compute the (relative) subdirectory name */
+  if (sname[0] == '.' && sname[1] == '\0') {
+    /* dirname is the same as the parent fragment's */
+    D->fragment[me].sname = (D->fragment[parent].sname) ?
+      _GD_Strdup(D, D->fragment[parent].sname) : NULL;
+    free(sname);
+  } else if (D->fragment[parent].sname && _GD_AbsPath(sname)) {
+    /* have both a relative dirname and the parent's sname; squish them
+     * together */
+    D->fragment[me].sname = (char*)_GD_Malloc(D, strlen(sname) +
+        strlen(D->fragment[parent].sname) + 2);
+    if (D->fragment[me].sname)
+      sprintf(D->fragment[me].sname, "%s%c%s", D->fragment[parent].sname,
+          GD_DIRSEP, sname);
+    free(sname);
+  } else
+    /* just save the sname */
+    D->fragment[me].sname = sname;
+
+  /* catch alloc errors */
+  if (D->error) {
+    D->n_fragment--;
+    temp_buf1 = prefix = suffix = base = NULL;
+    fclose(new_fp);
+    _GD_ReleaseDir(D, dirfd);
+    goto include_error;
+  }
+
+  *ref_name = _GD_ParseFragment(new_fp, D, me, standards, flags, resolve);
+
+  fclose(new_fp);
+
+  /* prevent /VERSION leak in DSV >= 9 */
+  if ((old_standards >= 9 && old_pedantic) || *standards >= 9) {
+    if (*standards != old_standards) {
+      *standards = old_standards;
+      D->flags |= GD_MULTISTANDARD;
+    }
+    if (!old_pedantic)
+      *flags &= ~GD_PEDANTIC;
+  }
+
+  D->recurse_level--;
+  dreturn("%i", me);
+  return me;
+
+include_error:
+  free(prefix);
+  free(suffix);
+  free(base);
+  free(sname);
+  free(temp_buf1);
+  D->recurse_level--;
+  dreturn("%i", -1);
+  return -1;
+}
+
+int gd_include_affix(DIRFILE* D, const char* file, int fragment_index,
+    const char *prefix, const char *suffix, unsigned long flags)
+{
+  int standards = GD_DIRFILE_STANDARDS_VERSION;
+  char* ref_name = NULL;
+  int i, new_fragment;
+
+  dtrace("%p, \"%s\", %i, \"%s\", \"%s\", 0x%lX", D, file, fragment_index,
+      prefix, suffix, flags);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check for include index out of range */
+  if (fragment_index < 0 || fragment_index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check protection */
+  if (D->fragment[fragment_index].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[fragment_index].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (~D->flags & GD_HAVE_VERSION)
+    _GD_FindVersion(D);
+
+  /* only set if the dirfile conforms to some standard */
+  if (D->av)
+    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;
+
+  new_fragment = _GD_Include(D, file, "dirfile_include()", 0, &ref_name,
+      fragment_index, prefix, suffix, &standards, &flags, 1);
+
+  if (!D->error) {
+    D->fragment[fragment_index].modified = 1;
+    D->flags &= ~GD_HAVE_VERSION;
+  }
+
+  /* If ref_name is non-NULL, the included fragment contained a REFERENCE
+   * directive.  If ref_name is NULL but D->fragment[new_fragment].ref_name is
+   * non-NULL, no REFERENCE directive was present, but the parser found a RAW
+   * field to serve as a reference field.
+   */
+  if (new_fragment >= 0 && D->fragment[new_fragment].ref_name != NULL)
+    /* If the parser chose a reference field, propagate it upward if requried */
+    for (i = fragment_index; i != -1; i = D->fragment[i].parent) {
+      if (D->fragment[i].ref_name == NULL) {
+        D->fragment[i].ref_name = strdup(D->fragment[new_fragment].ref_name);
+        D->fragment[i].modified = 1;
+      } else
+        break;
+    }
+
+  /* Honour the reference directive, if not prohibited by the caller */
+  if (ref_name != NULL && ~flags & GD_IGNORE_REFS) {
+    gd_entry_t *E = _GD_FindField(D, ref_name, D->entry, D->n_entries, 1, NULL);
+
+    /* FIXME: These errors are problematic, since they'll cause the call to
+     * fail, even though the new fragment has been integrated into the DIRFILE.
+     */
+
+    if (E == NULL)
+      _GD_SetError(D, GD_E_BAD_REFERENCE, GD_E_REFERENCE_CODE, NULL, 0,
+          ref_name);
+    else if (E->field_type != GD_RAW_ENTRY)
+      _GD_SetError(D, GD_E_BAD_REFERENCE, GD_E_REFERENCE_TYPE, NULL, 0,
+          ref_name);
+    else
+      D->reference_field = E;
+  }
+  free(ref_name);
+
+  dreturn("%i", new_fragment);
+  return new_fragment;
+}
+
+int gd_include(DIRFILE* D, const char* file, int fragment_index,
+    unsigned long flags)
+{
+  int new_fragment;
+
+  dtrace("%p, \"%s\", %i, 0x%lX", D, file, fragment_index, flags);
+
+  new_fragment = gd_include_affix(D, file, fragment_index, NULL, NULL, flags);
+
+  dreturn("%i", new_fragment);
+  return new_fragment;
+}
+
+static int _GD_CollectFragments(DIRFILE* D, int** f, int fragment, int nf)
+{
+  int i;
+  int *new_f;
+
+  dtrace("%p, %p, %i, %i", D, f, fragment, nf);
+
+  new_f = (int *)_GD_Realloc(D, *f, sizeof(int) * ++nf);
+  if (new_f == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+  new_f[nf - 1] = fragment;
+
+  for (i = 0; i < D->n_fragment; ++i)
+    if (D->fragment[i].parent == fragment) {
+      nf = _GD_CollectFragments(D, &new_f, i, nf);
+      if (nf == -1)
+        break;
+    }
+
+  *f = new_f;
+
+  dreturn("%i", nf);
+  return nf;
+}
+
+static int _GD_ContainsFragment(int* f, int nf, int fragment)
+{
+  int i;
+
+  dtrace("%p, %i, %i", f, nf, fragment);
+
+  for (i = 0; i < nf; ++i)
+    if (f[i] == fragment) {
+      dreturn("%i", 1);
+      return 1;
+    }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_uninclude(DIRFILE* D, int fragment_index, int del)
+{
+  int parent, j, nf;
+  unsigned int i, o, old_count;
+  int *f = NULL;
+
+  dtrace("%p, %i, %i", D, fragment_index, del);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment_index <= 0 || fragment_index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  parent = D->fragment[fragment_index].parent;
+
+  if (D->fragment[parent].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[parent].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* find all affected fragments */
+  nf = _GD_CollectFragments(D, &f, fragment_index, 0);
+
+  if (D->error) {
+    free(f);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* close affected raw fields */
+  for (i = 0; i < D->n_entries; ++i)
+    if (D->entry[i]->field_type == GD_RAW_ENTRY &&
+        _GD_ContainsFragment(f, nf, D->entry[i]->fragment_index))
+    {
+      _GD_Flush(D, D->entry[i], 0, 1);
+    }
+
+  /* flush the fragment's metadata, if requested */
+  if (!del)
+    for (j = 0; j < nf; ++j)
+      _GD_FlushMeta(D, f[j], 0);
+
+  if (D->error) {
+    free(f);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Nothing from now on may fail */
+
+  /* delete the fragments, if requested */
+  if (del)
+    for (j = 0; j < nf; ++j)
+      gd_UnlinkAt(D, D->fragment[f[j]].dirfd, D->fragment[f[j]].bname, 0);
+
+  /* delete fields from the fragment -- memory use is not sufficient to warrant
+   * resizing D->entry */
+  old_count = D->n_entries;
+  for (i = o = 0; i < old_count; ++i)
+    if (_GD_ContainsFragment(f, nf, D->entry[i]->fragment_index)) {
+      if (D->entry[i]->e->n_meta >= 0)
+        D->n_entries--;
+
+      _GD_FreeE(D, D->entry[i], 1);
+    } else
+      D->entry[o++] = D->entry[i];
+
+  /* Flag the parent as modified */
+  D->fragment[parent].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+
+  /* delete the fragments -- again, don't bother resizing D->fragment */
+  for (j = 0; j < nf; ++j) {
+    _GD_ReleaseDir(D, D->fragment[f[j]].dirfd);
+    free(D->fragment[f[j]].cname);
+    free(D->fragment[f[j]].ename);
+    free(D->fragment[f[j]].bname);
+    free(D->fragment[f[j]].ref_name);
+
+    memcpy(D->fragment + f[j], D->fragment + D->n_fragment - 1,
+        sizeof(struct gd_fragment_t));
+    D->n_fragment--;
+
+    /* Relocate all fields of the fragment we just moved */
+    for (i = 0; i < D->n_entries; ++i)
+      if (D->entry[i]->fragment_index == D->n_fragment)
+        D->entry[i]->fragment_index = f[j];
+  }
+
+  /* Clear the cache of all fields */
+  /* FIXME: Should probably just clear affected fields */
+  for (i = 0; i < D->n_entries; ++i) {
+    D->entry[i]->e->calculated = 0;
+    for (j = 0; j < GD_MAX_LINCOM; ++j)
+      D->entry[i]->e->entry[j] = NULL;
+    D->entry[i]->e->value_list_validity = 0;
+    D->entry[i]->e->entry_list_validity = 0;
+  }
+
+  /* Invalidate the field lists */
+  D->value_list_validity = 0;
+  D->entry_list_validity = 0;
+
+  free(f);
+
+  dreturn("%i", 0);
+  return 0;
+}
diff --git a/src/index.c b/src/index.c
new file mode 100644
index 0000000..cf9c435
--- /dev/null
+++ b/src/index.c
@@ -0,0 +1,297 @@
+/* Copyright (C) 2009-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#include "nan.h"
+
+static double _GD_Extrapolate(DIRFILE *D, gd_entry_t *E, int repr, double value,
+    off64_t limit, int eof)
+{
+  off64_t n;
+  double sample = NAN;
+  double data[2];
+
+  dtrace("%p, %p, %i, %g, %lli, %i", D, E, repr, value, (long long)limit, eof);
+
+  /* load data */
+  n = _GD_DoField(D, E, repr, limit - eof, 2, GD_FLOAT64, data);
+
+  if (D->error) {
+    dreturn("%g", sample);
+    return sample;
+  } else if (n < 2) {
+    _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
+    dreturn("%g", sample);
+    return sample;
+  }
+
+  sample = limit + (value - data[eof]) / (data[1] - data[0]);
+  dreturn("%g", sample);
+  return sample;
+}
+
+/* find the (fractional) frame number based on a monotonic look-up */
+static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value,
+    off64_t field_start, off64_t field_end)
+{
+  double sample = NAN;
+  int dir = -1; /* -1 = unknown; 0 = ascending; 1 = descending */
+  off64_t low = field_start;
+  off64_t high = field_end;
+  off64_t c;
+  double low_v, high_v, field_start_v, c_v;
+  size_t n;
+
+  dtrace("%p, %p, %i, %g, %lli, %lli", D, E, repr, value,
+      (long long)field_start, (long long)field_end);
+
+  /* find the end-points */
+  n = _GD_DoField(D, E, repr, field_start, 1, GD_FLOAT64, &low_v);
+  field_start_v = low_v;
+
+  if (D->error) {
+    dreturn("%g", sample);
+    return sample;
+  }
+
+  if (n == 0) {
+    _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
+    dreturn("%g", sample);
+    return sample;
+  }
+
+  n = _GD_DoField(D, E, repr, field_end - 1, 1, GD_FLOAT64, &high_v);
+
+  if (D->error) {
+    dreturn("%g", sample);
+    return sample;
+  }
+
+  if (n > 0) {
+    if (high_v == low_v) {
+      _GD_SetError(D, GD_E_RANGE, GD_E_SINGULAR_RANGE, NULL, 0, NULL);
+      dreturn("%g", sample);
+      return sample;
+    }
+
+    dir = (high_v < low_v) ? 1 : 0;
+
+    /* extrapolate, if necessary */
+    if ((!dir && low_v > value) || (dir && low_v < value)) {
+      sample = _GD_Extrapolate(D, E, repr, value, low, 0);
+      dreturn("%g", sample);
+      return sample;
+    } else if ((!dir && high_v < value) || (dir && high_v > value)) {
+      sample = _GD_Extrapolate(D, E, repr, value, high - 1, 1);
+      dreturn("%g", sample);
+      return sample;
+    }
+  } else {
+    /* binary search until either we find the end or we find a subdomain in
+     * which our value lies */
+    for (;;) {
+      c = (high + low) / 2;
+      n = _GD_DoField(D, E, repr, c, 1, GD_FLOAT64, &c_v);
+
+      if (D->error) {
+        dreturn("%g", sample);
+        return sample;
+      }
+
+      if (n == 0) {
+        if (c - low == 1) {
+          if (low == field_start) {
+            _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
+            dreturn("%g", sample);
+            return sample;
+          }
+
+          /* low is the EOF -- so, extrapolate */
+          sample = _GD_Extrapolate(D, E, repr, value, low, 1);
+          dreturn("%g", sample);
+          return sample;
+        } else {
+          /* haven't found the EOF yet */
+          high = c;
+        }
+      } else {
+        if (dir == -1) {
+          if (c_v == low_v) {
+            /* in this case, the range may not be singular, so use our guess
+             * as the new lower limit and keep looking */
+            low = c;
+            continue;
+          }
+
+          dir = (c_v < field_start_v) ? 1 : 0;
+
+          if ((!dir && field_start_v > value) ||
+              (dir && field_start_v < value))
+          {
+            /* extrapolate BOF */
+            sample = _GD_Extrapolate(D, E, repr, value, low, 0);
+            dreturn("%g", sample);
+            return sample;
+          }
+        }
+        if ((!dir && c_v > value) || (dir && c_v < value)) {
+          /* below our guess -- finding the end is no longer relevant */
+          high = c;
+          high_v = c_v;
+          break;
+        } else if ((!dir && c_v < value) || (dir && c_v > value)) {
+          /* above our guess -- still need to look for the end */
+          low = c;
+          low_v = c_v;
+        }
+      }
+    }
+  }
+
+  /* Step 2: binary search until we find the value */
+  for (;high - low > 1;) {
+    /* load data */
+    c = (high + low) / 2;
+    n = _GD_DoField(D, E, repr, c, 1, GD_FLOAT64, &c_v);
+
+    if (D->error) {
+      dreturn("%g", sample);
+      return sample;
+    }
+
+    if (n == 0) {
+      /* someone's been stealing our data.  How Rude! */
+      _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
+      dreturn("%g", sample);
+      return sample;
+    }
+
+    if ((!dir && c_v > value) || (dir && c_v < value)) {
+      /* before our guess */
+      high_v = c_v;
+      high = c;
+    } else if ((!dir && c_v < value) || (dir && c_v > value)) {
+      /* after our guess */
+      low_v = c_v;
+      low = c;
+    } else {
+      /* our guess was unexpectedly correct */
+      sample = (double)c;
+      dreturn("%g", sample);
+      return sample;
+    }
+  }
+
+  sample = low + (value - low_v) / (high_v - low_v);
+  dreturn("%g", sample);
+  return sample;
+}
+
+double gd_framenum_subset64(DIRFILE* D, const char* field_code_in,
+    double value, off64_t field_start, off64_t field_end)
+{
+  double frame = NAN;
+  gd_entry_t* entry;
+  char* field_code;
+  int repr = GD_REPR_NONE;
+  unsigned int spf;
+
+  dtrace("%p, \"%s\", %g, %lli, %lli", D, field_code_in, value,
+      (long long)field_start, (long long)field_end);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%g", frame);
+    return frame;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%g", frame);
+    return frame;
+  }
+
+  if (_GD_NativeType(D, entry, repr) & GD_COMPLEX)
+    _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_COMPLEX, NULL, 0, NULL);
+  else if (entry->field_type & GD_SCALAR_ENTRY_BIT)
+    _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error) {
+    dreturn("%g", frame);
+    return frame;
+  }
+
+  spf = _GD_GetSPF(D, entry);
+  if (field_start == 0)
+    field_start = D->fragment[entry->fragment_index].frame_offset * spf;
+  else
+    field_start *= spf;
+
+  if (field_end == 0)
+    field_end = (gd_nframes64(D) + 1) * spf - 1;
+  else
+    field_end = (field_end + 1) * spf - 1;
+
+  if (field_end - field_start < 2)
+    _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL);
+
+  if (!D->error)
+    frame = _GD_GetIndex(D, entry, repr, value, field_start, field_end) / spf;
+
+  dreturn("%g", frame);
+  return frame;
+}
+
+double gd_framenum_subset(DIRFILE* D, const char* field_code, double value,
+    off_t field_start, off_t field_end)
+{
+  double frame;
+
+  dtrace("%p, \"%s\", %g, %lli, %lli", D, field_code, value,
+      (long long int)field_start, (long long int)field_end);
+
+  frame = gd_framenum_subset64(D, field_code,  value, (off64_t)field_start,
+      (off64_t)field_end);
+
+  dreturn("%g", frame);
+  return frame;
+}
+
+double gd_framenum(DIRFILE* D, const char* field_code, double value)
+{
+  double frame;
+
+  dtrace("%p, \"%s\", %g", D, field_code, value);
+
+  frame = gd_framenum_subset64(D, field_code,  value, 0, 0);
+
+  dreturn("%g", frame);
+  return frame;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/internal.h b/src/internal.h
new file mode 100644
index 0000000..1641144
--- /dev/null
+++ b/src/internal.h
@@ -0,0 +1,1332 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifndef GETDATA_INTERNAL_H
+#define GETDATA_INTERNAL_H
+
+#ifdef HAVE_CONFIG_H
+#include "gd_config.h"
+#endif
+
+#define GD_64BIT_API
+#include "getdata.h"
+
+/* OS X 10.6 deprecates lstat64 */
+#ifdef HAVE_AVAILABILITY_H
+#include <Availability.h>
+#endif
+
+#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
+  (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060)
+# undef HAVE_LSTAT64
+# undef HAVE_STRUCT_STAT64
+# ifndef _DARWIN_FEATURE_64_BIT_INODE
+#  define _DARWIN_FEATURE_64_BIT_INODE
+# endif
+#endif
+
+/* library headers */
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
+#include <math.h>
+#include <time.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+#include <inttypes.h>
+#endif
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#endif
+
+/* MSVC types */
+#ifdef _MSC_VER
+#ifdef _WIN64
+typedef __int64 ssize_t;
+#define PRNssize_t "li"
+#define PRNsize_t  "lu"
+#else
+typedef int ssize_t;
+#define PRNssize_t "i"
+#define PRNsize_t  "u"
+#endif
+typedef int mode_t;
+#else
+#define PRNssize_t "zi"
+#define PRNsize_t  "zu"
+#endif
+
+#ifndef HAVE_OFF64_T
+typedef gd_off64_t off64_t;
+#endif
+
+#ifdef _MSC_VER
+/* missing in sys/stat.h */
+#define S_ISREG(m)  (((m) & _S_IFMT) == _S_IFREG)
+#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
+#endif
+
+/* the open() in the MSVCRT doesn't permit open()ing directories */
+#ifdef __MSVCRT__
+#define GD_NO_DIR_OPEN
+/* rename open() flags */
+#define O_RDWR _O_RDWR
+#define O_RDONLY _O_RDONLY
+#define O_CREAT _O_CREAT
+#define O_EXCL _O_EXCL
+#define O_TRUNC _O_TRUNC
+#endif
+
+#ifdef GD_NO_C99_API
+/* generic dcomplex pointer for passing around malloc'd vectors */
+#  define GD_DCOMPLEXP_t double *
+/* a dcomplex scalar */
+#  define GD_DCOMPLEXA(v) double v[2]
+/* used when passing the complex arrays from the entry struct */
+#  define GD_DCOMPLEXV(v) double v[][2]
+/* norm */
+#  define cabs(z)  sqrt((z)[0] * (z)[0] + (z)[1] * (z)[1])
+/* phase */
+#  define carg(z)  atan2((z)[1], (z)[0])
+/* real part of z */
+#  define creal(z) ((z)[0])
+/* imaginary part of z */
+#  define cimag(z) ((z)[1])
+/* real part of (*z) */
+#  define crealp(z) creal(z)
+/* imaginary part of (*z) */
+#  define cimagp(z) cimag(z)
+/* a pointer to element i of GD_DCOMPLEXP_t array a */
+#  define gd_cap_(a,i) (((GD_DCOMPLEXP_t)(a)) + 2 * i)
+/* a pointer to a complex scalar */
+#  define gd_csp_(a) ((GD_DCOMPLEXP_t)a)
+/* assign real two-element array b to scalar a */
+#  define gd_ra2cs_(a,b) gd_cs2cs_(a,b)
+/* assign scalar b to scalar a */
+#  define gd_cs2cs_(a,b) do { (a)[0] = (b)[0]; (a)[1] = (b)[1]; } while(0)
+/* assign scalar b to scalar (*a) */
+#  define gd_cs2cp_(a,b) gd_cs2cs_(a,b)
+/* assign b[i] to scalar a */
+#  define gd_ca2cs_(a,b,i) gd_cs2cs_((a),(b) + 2 * i)
+/* assign scalar (*b) to a[i] */
+#  define gd_cp2ca_(a,i,b) do { \
+  (a)[2 * i] = (b)[0]; (a)[2 * i + 1] = (b)[1]; \
+} while(0)
+/* assign literal (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) */
+#  define gd_li2cp_(a,x,y) gd_li2cs_(a,x,y)
+/* assign polar (r,p) to scalar a */
+#  define gd_po2cs_(a,r,p) do { \
+  (a)[0] = (r) * cos(p); (a)[1] = (r) * sin(p); \
+} while (0)
+/* assign polar (r,p) to scalar (*a) */
+#  define gd_po2cp_(a,r,p) gd_po2cs_(a,r,p)
+/* assign real scalar b to scalar a */
+#  define gd_rs2cs_(a,b) gd_li2cs_(a,b,0)
+/* assign real scalar b to scalar (*a) */
+#  define gd_rs2cp_(a,b) gd_rs2cs_(a,b)
+/* assign complex scalar b to a[i], both of type t */
+#  define gd_cs2ca_(a,i,b,t) do { \
+  ((t*)a)[2 * i] = (t)(b)[0]; ((t*)a)[2 * i + 1] = (t)(b)[1]; \
+} while(0)
+/* assign real scalar b to a[i], both of type t */
+#  define gd_rs2ca_(a,i,b,t) do { \
+  ((t*)a)[2 * i] = (t)(b); ((t*)a)[2 * i + 1] = 0; \
+} while(0)
+/* compare a to literal (x;y) */
+#  define gd_ccmpl_(a,x,y) ((a)[0] == x && (a)[1] == y)
+/* compare a to b */
+#  define gd_ccmpc_(a,b) ((a)[0] == (b)[0] && (a)[1] == (b)[1])
+#else
+#  define GD_DCOMPLEXP_t double _Complex *
+#  define GD_DCOMPLEXA(v) double _Complex v
+#  define GD_DCOMPLEXV(v) double _Complex *restrict v
+#  define crealp(z) creal(*(z))
+#  define cimagp(z) cimag(*(z))
+#  define gd_cap_(a,i) (a + i)
+#  define gd_csp_(a) (&(a))
+#  define gd_ra2cs_(a,b) a = *((double complex*)(b))
+#  define gd_cs2cs_(a,b) a = b
+#  define gd_cs2cp_(a,b) *a = b
+#  define gd_ca2cs_(a,b,i) a = b[i]
+#  define gd_cp2ca_(a,i,b) (a)[i] = *(b)
+#  define gd_li2cs_(a,x,y) a = (x + _Complex_I * y)
+#  define gd_li2cp_(a,x,y) *a = (x + _Complex_I * y)
+#  define gd_po2cs_(a,r,p) a = (r) * cexp(p)
+#  define gd_po2cp_(a,r,p) *a = (r) * cexp(p)
+#  define gd_rs2cs_(a,b) a = b
+#  define gd_rs2cp_(a,b) *a = b
+#  define gd_cs2ca_(a,i,b,t) ((complex t*)a)[i] = (complex t)(b)
+#  define gd_rs2ca_(a,i,b,t) gd_cs2ca_(a,i,b,t)
+#  define gd_ccmpl_(a,x,y) (a == (x + _Complex_I * y))
+#  define gd_ccmpc_(a,b) (a == b)
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#elif defined HAVE_CABS && defined __GNUC__ && (__GNUC__ > 3)
+/* This is a cygwin hack: the Cygwin C library isn't C99 compliant, but gcc 3+
+ * contains built-in versions of these functions */
+#define complex _Complex
+#define _Complex_I (__extension__ 1.0iF)
+double cabs(double complex z);
+double carg(double complex z);
+#define cexp(z) (exp(__real__ (z)) * (cos(__imag__ (z)) + _Complex_I \
+      * sin(__imag__ (z))))
+double creal(double complex z);
+double cimag(double complex z);
+#endif
+#endif
+
+#ifdef GD_RESTRICT_ARRAY_OK
+#define gd_restrict_arr restrict
+#else
+#define gd_restrict_arr
+#endif
+
+#ifndef PATH_MAX
+# ifdef _POSIX_PATH_MAX
+#  define PATH_MAX _POSIX_PATH_MAX
+# elif defined MAXPATHLEN
+#  define PATH_MAX MAXPATHLEN
+# else
+/* POSIX says we're supposed to check _pathconf in this case, but it goes on to
+ * say that the PATH_MAX value reported by _pathconf isn't guaranteed to be
+ * suitable for mallocing, so its not clear what they're trying to do there.
+ * The following will have to do.
+ */
+#  define PATH_MAX 4096
+# endif
+#endif
+
+/* gd_type_t type for native integers */
+#ifndef SIZEOF_INT
+#define SIZEOF_INT (sizeof(int))
+#endif
+
+#ifndef SIZEOF_UNSIGNED_INT
+#define SIZEOF_UNSIGNED_INT (sizeof(unsigned int))
+#endif
+
+#ifndef SIZEOF_SIZE_T
+#define SIZEOF_SIZE_T (sizeof(size_t))
+#endif
+
+#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
+#endif
+
+/* the default mplex cycle length */
+#define GD_MPLEX_CYCLE 10
+
+#ifdef _MSC_VER
+# define gd_static_inline_ static
+#else
+# define gd_static_inline_ static inline
+#endif
+
+/* unaligned access */
+#ifdef UNALIGNED_ACCESS_OK
+#define gd_get_unaligned64(p) (*(p))
+#define gd_put_unaligned64(v,p) *(p) = (v)
+#else
+#ifdef HAVE_ASM_UNALIGNED_H
+#include <asm/unaligned.h>
+#endif
+#if defined HAVE_DECL_GET_UNALIGNED && HAVE_DECL_GET_UNALIGNED == 1
+#define gd_get_unaligned64 get_unaligned
+#else
+gd_static_inline_ int64_t gd_get_unaligned64(const void *p)
+{
+  int64_t v;
+  memcpy(&v, p, 8);
+  return v;
+}
+#endif
+#if defined HAVE_DECL_PUT_UNALIGNED && HAVE_DECL_PUT_UNALIGNED == 1
+#define gd_put_unaligned64 put_unaligned
+#else
+gd_static_inline_ int64_t gd_put_unaligned64(int64_t v, void *p)
+{
+  memcpy(p, &v, 8);
+  return v;
+}
+#endif
+#endif
+
+/* 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:
+ *
+ *  - samples per frame is always unsigned int
+ *  - variables holding offsets or file sizes should be of type gd_off64_t
+ *    (which may be simply off_t, if it's the right size)
+ *  - variables holding object sizes or counts of items read or written should
+ *    be of type size_t
+ *  - public functions taking or returning types of off64_t should have both
+ *    a off_t prototype and a gd_off64_t type prototype.
+ */
+
+#ifndef __attribute_malloc__
+# define __attribute_malloc__
+#endif
+
+#ifndef __wur
+# define __wur
+#endif
+
+#ifdef _MSC_VER
+# define gd_unused_
+#else
+# define gd_unused_ __attribute__ (( unused ))
+#endif
+
+/* disable the "unspecified order" remark in ICC */
+#ifdef __INTEL_COMPILER
+#  pragma warning (disable : 981)
+#endif
+
+#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__)
+#define dtrace(fmt, ...) printf("%s %s(" fmt ")\n", gd_coladd(), \
+    __FUNCTION__, ##__VA_ARGS__)
+#define dprintf(fmt, ...) printf("%s %s:%i " fmt "\n", gd_colnil(), \
+    __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define dreturnvoid() printf("%s %s = (nil)\n", gd_colsub(), __FUNCTION__)
+#define dreturn(fmt, ...) printf("%s %s = " fmt "\n", gd_colsub(), \
+    __FUNCTION__, ##__VA_ARGS__)
+#define dwatch(fmt, v) printf("%s %s = " fmt "\n", gd_colnil(), #v, v)
+#else
+#define dtracevoid()
+#define dtrace(...)
+#define dprintf(...)
+#define dreturnvoid()
+#define dreturn(...)
+#define dwatch(...)
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+#ifndef O_TEXT
+#define O_TEXT 0
+#endif
+
+/* The Microsoft CRT appears to treat %hh as %h */
+#ifdef __MSVCRT__
+#define NO_8BIT_INT_PREFIX
+#endif
+
+/* function aliases */
+#ifndef HAVE_FSEEKO64
+#  ifndef HAVE_FSEEKO
+#    define fseeko64(a,b,c) fseek(a,(long)(b),c)
+#  else
+#    define fseeko64(a,b,c) fseeko(a,(off_t)(b),c)
+#  endif
+#endif
+
+#ifdef HAVE__GETCWD
+# define gd_getcwd _getcwd
+#elif defined HAVE_GETCWD
+# define gd_getcwd getcwd
+#else
+# define gd_getcwd(...) (NULL)
+#endif
+
+#ifndef HAVE_SNPRINTF
+# ifdef HAVE__SNPRINTF
+#  define snprintf _snprintf
+# endif
+#endif
+
+#ifndef HAVE_BASENAME
+char *basename(char *path);
+#endif
+
+#ifndef HAVE_FTELLO64
+#  ifndef HAVE_FTELLO
+#    define ftello64 (off64_t)ftell
+#  else
+#    define ftello64 (off64_t)ftello
+#  endif
+#endif
+
+#ifndef HAVE_LSTAT64
+# ifdef HAVE_LSTAT
+#  define lstat64 lstat
+#  define HAVE_LSTAT64
+# endif
+#endif
+
+#ifndef offsetof
+#define offsetof(t,m) ((size_t)(((char*)&((t*)0)->m) - (char*)0))
+#endif
+
+#ifdef HAVE_READDIR_R
+# define _GD_ReadDir readdir_r
+#else
+int _GD_ReadDir(DIR *dirp, struct dirent *entry, struct dirent **result);
+#endif
+
+#ifdef HAVE__STRTOI64
+#  define gd_strtoll _strtoi64
+#elif defined(HAVE_STRTOLL)
+#  define gd_strtoll strtoll
+#elif defined(HAVE_STRTOQ)
+#  define gd_strtoll strtoq
+#else
+#  define gd_strtoll strtol
+#endif
+
+#ifdef HAVE__STRTOUI64
+#  define gd_strtoull _strtoi64
+#elif defined(HAVE_STRTOULL)
+#  define gd_strtoull strtoull
+#elif defined(HAVE_STRTOUQ)
+#  define gd_strtoll strtouq
+#else
+#  define gd_strtoull strtoul
+#endif
+
+/* the MSVCRT's strtod is not POSIX compliant */
+#ifdef __MSVCRT__
+double gd_strtod(const char *nptr, char **endptr);
+#else
+#define gd_strtod strtod
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__FDOPEN
+#define fdopen _fdopen
+#endif
+
+#if !HAVE_FSYNC && HAVE__COMMIT
+#  define fsync _commit
+#endif
+
+#ifndef __MINGW64_VERSION_MAJOR /* mingw-w64 has pthread.h*/
+#ifndef HAVE_PTHREAD_H
+#ifndef HAVE_GMTIME_R
+struct tm *gmtime_r(const time_t *timep, struct tm *result);
+#endif
+#endif
+#endif
+
+#ifndef HAVE_LSEEK64
+# ifdef HAVE__LSEEKI64
+#  define lseek64 (off64_t)_lseeki64
+# else
+#  define lseek64 (off64_t)lseek
+# endif
+#endif
+
+#ifdef MKDIR_NO_MODE
+#ifdef HAVE__MKDIR
+#define mkdir(f,m) _mkdir(f)
+#else
+#define mkdir(f,m) mkdir(f)
+#endif
+#endif
+
+#ifndef EOVERFLOW
+#define EOVERFLOW EINVAL
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__OPEN
+#define open _open
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__READ
+#define read _read
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__RMDIR
+#define rmdir _rmdir
+#endif
+
+#if HAVE_STRUCT_STAT64
+typedef struct stat64 gd_stat64_t;
+#elif HAVE_STRUCT__STAT64
+typedef struct _stat64 gd_stat64_t;
+#elif HAVE_STRUCT___STAT64
+typedef struct __stat64 gd_stat64_t;
+#else
+typedef struct stat gd_stat64_t;
+#define GD_NO_64BIT_STAT
+#endif
+
+#ifdef GD_NO_64BIT_STAT
+# define gd_stat64 stat
+# define gd_fstat64 fstat
+#else
+# if HAVE_STAT64
+#  define gd_stat64 stat64
+# elif HAVE__STAT64
+#  define gd_stat64 _stat64
+# else
+#  define gd_stat64 stat
+# endif
+
+# if HAVE_FSTAT64
+#  define gd_fstat64 fstat64
+# elif HAVE__FSTAT64
+#  define gd_fstat64 _fstat64
+# elif HAVE__FSTAT
+#  define gd_fstat64 _fstat
+# else
+#  define gd_fstat64 fstat
+# endif
+#endif
+
+#ifdef HAVE_OPENAT
+# ifdef GETDATA_DEBUG
+#  define gd_unused_d /**/
+# else
+#  define gd_unused_d gd_unused_
+# endif
+# define gd_OpenAt(d,...) openat(__VA_ARGS__)
+#else
+# define gd_unused_d /**/
+int gd_OpenAt(const DIRFILE*, int, const char*, int, mode_t);
+#endif
+
+#ifdef HAVE_FSTATAT
+# define gd_StatAt(d,...) fstatat(__VA_ARGS__)
+#else
+#ifndef HAVE_SYS_STAT_H
+struct stat;
+#endif
+int gd_StatAt(const DIRFILE*, int, const char*, struct stat*, int);
+#endif
+
+#ifdef HAVE_RENAMEAT
+#define gd_RenameAt(d,...) renameat(__VA_ARGS__)
+#else
+int gd_RenameAt(const DIRFILE *D, int, const char*, int, const char*);
+#endif
+
+#ifdef HAVE_UNLINKAT
+# define gd_UnlinkAt(d,...) unlinkat(__VA_ARGS__)
+#else
+int gd_UnlinkAt(const DIRFILE*, int, const char*, int);
+#endif
+
+#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
+char* strerror_r(int, char*, size_t);
+#else
+int strerror_r(int, char*, size_t);
+#endif
+#endif
+
+#if defined HAVE_FTRUNCATE64
+#define gd_truncate ftruncate64
+#elif defined HAVE_FTRUNCATE
+#define gd_truncate(d,l) ftruncate(d, (off_t)l)
+#elif defined HAVE__CHSIZE_S
+#define gd_truncate(d,l) _chsize_s(d, (int64_t)l)
+#elif defined HAVE__CHSIZE
+#define gd_truncate(d,l) _chsize(d, (long)l)
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__UNLINK
+#define unlink _unlink
+#endif
+
+#if defined __MSVCRT__ && defined HAVE__WRITE
+#define write _write
+#endif
+
+#ifndef HAVE_GETDELIM
+ssize_t getdelim(char**, size_t*, int, FILE*);
+#endif
+
+/* byte swapping */
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+#ifdef HAVE_LIBKERN_OSBYTEORDER_H
+#include <libkern/OSByteOrder.h>
+#endif
+#if defined HAVE_DECL_BSWAP_16 && HAVE_DECL_BSWAP_16 == 1
+# define gd_swap16 bswap_16
+# define gd_swap32 bswap_32
+# define gd_swap64 bswap_64
+#elif defined HAVE_DECL_OSSWAPINT16 && HAVE_DECL_OSSWAPINT16 == 1
+# define gd_swap16 OSSwapInt16
+# define gd_swap32 OSSwapInt32
+# define gd_swap64 OSSwapInt64
+#elif defined HAVE_DECL_BSWAP16 && HAVE_DECL_BSWAP16 == 1
+# define gd_swap16 bswap16
+# define gd_swap32 bswap32
+# define gd_swap64 bswap64
+#else
+# define gd_swap16(x) (((uint16_t)(x) << 8) | ((uint16_t)(x) >> 8))
+# define gd_swap32(x) ( \
+    (((uint32_t)(x) << 24) & 0xff000000UL) | \
+    (((uint32_t)(x) << 8)  & 0xff0000UL) | \
+    (((uint32_t)(x) >> 8)  & 0xff00UL) | \
+    ((uint32_t)(x) >> 24))
+#define gd_swap64(x) ( \
+     (((uint64_t)(x) << 56) | \
+     (((uint64_t)(x) << 40) & 0xff000000000000ULL) | \
+     (((uint64_t)(x) << 24) & 0xff0000000000ULL) | \
+     (((uint64_t)(x) << 8)  & 0xff00000000ULL) | \
+     (((uint64_t)(x) >> 8)  & 0xff000000ULL) | \
+     (((uint64_t)(x) >> 24) & 0xff0000ULL) | \
+     (((uint64_t)(x) >> 40) & 0xff00ULL) | \
+     ((uint64_t)(x)  >> 56)))
+#endif
+
+/* path malarkey */
+#define _GD_IsDirSep(c) (((c) == GD_DIRSEP) || ((c) == '/'))
+#if defined _WIN32 || defined _WIN64
+# define _GD_AbsPath(s)  (s && ((s)[0] == '/' || (s)[0] == GD_DIRSEP || \
+                                  ((s)[0] != '\0' && (s)[1] == ':')))
+# define _GD_Root(s,d,l) \
+  do { \
+    if ((d)[0] == '/' || (d)[0] == GD_DIRSEP) { \
+      (s)[0] = (d)[0]; \
+      l = 1; \
+      if ((d)[1] == '/' || (d)[1] == GD_DIRSEP) { \
+        (s)[1] = (d)[1]; \
+        l = 2; \
+      } \
+    } else { \
+      (s)[0] = (d)[0]; \
+      (s)[1] = ':'; \
+      (s)[2] = '\\'; \
+      (s)[3] = '\0'; \
+      l = 3; \
+    } \
+  } while (0)
+# define _GD_RootLen(d) ( \
+    ((d)[0] == '/' || (d)[0] == GD_DIRSEP) ? \
+    ((d)[1] == '/' || (d)[1] == GD_DIRSEP) ? 2 : 1 : 3 \
+    )
+#else
+# define _GD_AbsPath(s)  (s && (s)[0] == '/')
+# define _GD_Root(s,d,l) \
+  do { \
+    (s)[0] = '/'; \
+    (s)[1] = '\0'; \
+    l = 1; \
+  } while (0)
+# define _GD_RootLen(d) 1
+#endif
+
+/* maximum number of recursions */
+#define GD_MAX_RECURSE_LEVEL  32
+
+#define MAX_IN_COLS (3 * GD_MAX_LINCOM + 5) /* for META lincom */
+
+/* Suberror codes */
+/* GD_E_FORMAT suberrors are in getdata.h */
+
+#define GD_E_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_RECURSE_CODE       1
+#define GD_E_RECURSE_INCLUDE    2
+
+#define GD_E_FIELD_PUT         1
+#define GD_E_FIELD_BAD         2
+#define GD_E_FIELD_MATCH       3
+
+#define GD_E_ENTRY_TYPE      1
+#define GD_E_ENTRY_METARAW   2
+#define GD_E_ENTRY_SPF       3
+#define GD_E_ENTRY_NFIELDS   4
+#define GD_E_ENTRY_NUMBITS   5
+#define GD_E_ENTRY_BITNUM    6
+#define GD_E_ENTRY_BITSIZE   7
+#define GD_E_ENTRY_POLYORD   8
+#define GD_E_ENTRY_WINDOP    9
+#define GD_E_ENTRY_CNTVAL   10
+#define GD_E_ENTRY_PERIOD   11
+
+#define GD_E_SCALAR_CODE        1
+#define GD_E_SCALAR_TYPE        2
+
+#define GD_E_REFERENCE_CODE     1
+#define GD_E_REFERENCE_TYPE     2
+
+#define GD_E_PROTECTED_FORMAT   1
+#define GD_E_PROTECTED_DATA     2
+
+#define GD_E_DEL_META           1
+#define GD_E_DEL_CONST          2
+#define GD_E_DEL_DERIVED        3
+#define GD_E_DEL_ALIAS          4
+
+#define GD_E_REPR_UNKNOWN       1
+#define GD_E_REPR_PUT           2
+
+#define GD_E_DOMAIN_COMPLEX     1
+#define GD_E_DOMAIN_EMPTY       2
+#define GD_E_DOMAIN_ANTITONIC   3
+#define GD_E_DOMAIN_MULTIPOS    4
+
+#define GD_E_OUT_OF_RANGE       1
+#define GD_E_SINGULAR_RANGE     2
+
+#define GD_E_DIM_FORMAT         1
+#define GD_E_DIM_CALLER         2
+
+#define GD_E_FLUSH_MKTMP        1
+#define GD_E_FLUSH_OPEN         2
+#define GD_E_FLUSH_RENAME       3
+
+#define GD_E_UNENC_UNDET        1
+#define GD_E_UNENC_TARGET       2
+
+#define GD_E_ARG_WHENCE         1
+#define GD_E_ARG_ENDIANNESS     2
+#define GD_E_ARG_PROTECTION     3
+#define GD_E_ARG_NODATA         4
+#define GD_E_ARG_NO_VERS        5
+#define GD_E_ARG_BAD_VERS       6
+
+
+/* I/O flags */
+#define GD_FILE_READ  0x1
+#define GD_FILE_WRITE 0x2
+#define GD_FILE_RDWR  ( GD_FILE_READ | GD_FILE_WRITE )
+#define GD_FILE_TEMP  0x4
+#define GD_FILE_TOUCH 0x8
+
+/* lists -- all the entry types plus alias, scalar, vector, all */
+#define GD_N_ENTRY_LISTS (GD_N_ENTYPES + 4)
+
+#define GD_LIST_VALID_STRING_VALUE 0x01
+
+struct gd_raw_file_ {
+  char* name;
+  int idata;
+  void* edata;
+  int subenc;
+  const DIRFILE *D;
+  unsigned int mode;
+  off64_t pos;
+};
+
+struct gd_lut_ {
+  double x;
+  union {
+    double r;
+    GD_DCOMPLEXM(c);
+  } y;
+};
+
+/* Unified entry struct */
+struct gd_private_entry_ {
+  gd_entry_t* entry[GD_MAX_LINCOM];
+  int repr[GD_MAX_LINCOM];
+
+  int calculated;
+
+  int n_meta;
+  union {
+    gd_entry_t** meta_entry;
+    const gd_entry_t* parent;
+  } p;
+
+  /* field lists */
+  const char **alias_list;
+  const char **entry_list[GD_N_ENTRY_LISTS];
+  unsigned int entry_list_flags[GD_N_ENTRY_LISTS];
+  const char** string_value_list;
+  void *const_value_list;
+  gd_carray_t *carray_value_list;
+  uint32_t value_list_validity;
+  uint32_t entry_list_validity;
+
+  union {
+    struct { /* RAW */
+      char* filebase;
+      size_t size;
+      struct gd_raw_file_ file[2]; /* encoding framework data */
+    } raw;
+    struct { /* LINTERP */
+      char *table_file;
+      int table_dirfd;
+      int table_len;
+      int complex_table;
+      int table_monotonic;
+      struct gd_lut_ *lut;
+    } linterp;
+    struct { /* CONST */
+      void *d;
+      int n_client;
+      gd_entry_t** client;
+    } scalar;
+    struct { /* MPLEX */
+      gd_type_t type;
+      off64_t sample;
+      char d[16];
+    } mplex;
+    char *string; /* STRING */
+    off64_t index_pos; /* INDEX */
+  } u;
+};
+
+#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
+
+#define GD_N_SUBENCODINGS (GD_ENC_UNKNOWN + 1)
+
+#define GD_EF_NAME    0x0001
+#define GD_EF_OPEN    0x0002
+#define GD_EF_CLOSE   0x0004
+#define GD_EF_SEEK    0x0008
+#define GD_EF_READ    0x0010
+#define GD_EF_SIZE    0x0020
+#define GD_EF_WRITE   0x0040
+#define GD_EF_SYNC    0x0080
+#define GD_EF_MOVE    0x0100
+#define GD_EF_UNLINK  0x0200
+
+#define GD_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
+
+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 off64_t (*gd_ef_seek_t)(struct gd_raw_file_*, off64_t, gd_type_t,
+    unsigned int);
+typedef off64_t (*gd_ef_size_t)(int, struct gd_raw_file_*, gd_type_t, int);
+typedef ssize_t (*gd_ef_read_t)(struct gd_raw_file_*, void*, gd_type_t, size_t);
+typedef ssize_t (*gd_ef_write_t)(struct gd_raw_file_*, const void*, gd_type_t,
+    size_t);
+typedef int (*gd_ef_close_t)(struct gd_raw_file_*);
+typedef int (*gd_ef_sync_t)(struct gd_raw_file_*);
+typedef int (*gd_ef_unlink_t)(int, struct gd_raw_file_*);
+typedef int (*gd_ef_move_t)(int, struct gd_raw_file_*, int, char*);
+
+/* 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_OOP  0x4 /* writes occur out-of-place */
+#define GD_EF_EDAT 0x8 /* The /ENCODING datum is used */
+/* 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;
+  gd_ef_name_t name;
+  gd_ef_open_t open;
+  gd_ef_close_t close;
+  gd_ef_seek_t seek;
+  gd_ef_read_t read;
+  gd_ef_size_t size;
+  gd_ef_write_t write;
+  gd_ef_sync_t sync;
+  gd_ef_move_t move;
+  gd_ef_unlink_t unlink;
+} gd_ef_[GD_N_SUBENCODINGS];
+
+/* 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;
+  void *enc_data;
+  int modified;
+  int parent;
+  int dirfd;
+  time_t mtime;
+  unsigned long int encoding;
+  unsigned long int byte_sex;
+  int protection;
+  char* ref_name;
+  off64_t frame_offset;
+  uint32_t vers;
+
+  char *prefix;
+  char *suffix;
+};
+
+/* directory metadata */
+struct gd_dir_t {
+  char *path;
+  int fd;
+  int rc;
+};
+
+/* internal 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 */
+
+/* representation suffixes */
+#define GD_REPR_NONE 0
+#define GD_REPR_REAL 'r'
+#define GD_REPR_IMAG 'i'
+#define GD_REPR_MOD  'm'
+#define GD_REPR_ARG  'a'
+
+#define GD_REPR_AUTO GD_REPR_REAL
+
+/* The DIRFILE struct.  */
+struct gd_dirfile_ {
+  /* library error data */
+  int error;
+  int suberror;
+  char* error_string;
+  char* error_file;
+  int error_line;
+
+  /* global data */
+  unsigned long int flags;
+
+  char *error_prefix;
+  unsigned long int open_flags; /* the original flags (used in gd_desynced) */
+  uint64_t av;
+  int standards;
+  int n_error;
+  int lookback;
+
+  /* for the public tokeniser */
+  char *tok_base;
+  const char *tok_pos;
+
+  /* field counts */
+  unsigned int n_entries;
+  unsigned int n_dot;
+
+  /* field array */
+  gd_entry_t** entry;
+  gd_entry_t** dot_list;
+
+  /* the reference field */
+  gd_entry_t* reference_field;
+
+  /* directory name (this is just whatever was passed to gd_open() */
+  char* name;
+
+  /* directory list */
+  unsigned int ndir;
+  struct gd_dir_t *dir;
+
+  /* recursion counter */
+  int recurse_level;
+
+  /* fragment list */
+  struct gd_fragment_t* fragment;
+  int n_fragment;
+
+  /* field lists */
+  const char **entry_list[GD_N_ENTRY_LISTS];
+  unsigned int entry_list_flags[GD_N_ENTRY_LISTS];
+  const char **string_value_list;
+  void *const_value_list;
+  gd_carray_t *carray_value_list;
+  uint32_t value_list_validity;
+  uint32_t entry_list_validity;
+
+  /* syntax error callback */
+  gd_parser_callback_t sehandler;
+  void* sehandler_extra;
+};
+
+/* forward declarations */
+void *_GD_Alloc(DIRFILE*, gd_type_t, size_t) __attribute_malloc__;
+void _GD_ArmEndianise(uint64_t*, int, size_t);
+int _GD_BadInput(DIRFILE *, const gd_entry_t *, int, int);
+
+#define _GD_BadWindop(op) \
+  ( \
+   (op != GD_WINDOP_EQ) && (op != GD_WINDOP_GE) && (op != GD_WINDOP_GT) && \
+   (op != GD_WINDOP_LE) && (op != GD_WINDOP_LT) && (op != GD_WINDOP_NE) && \
+   (op != GD_WINDOP_SET) && (op != GD_WINDOP_CLR) \
+  )
+
+int _GD_CalculateEntry(DIRFILE *restrict, gd_entry_t *restrict, int);
+char *_GD_CanonicalPath(const char *restrict, const char *restrict);
+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,
+    GD_DCOMPLEXA(dividend), size_t);
+
+/* _GD_ClearError: Everything's A-OK; clear the last error. */
+#define _GD_ClearError(D) (D)->error = 0
+
+void _GD_CLincomData(DIRFILE *restrict, int, void *restrict, gd_type_t,
+    const GD_DCOMPLEXP_t restrict, const GD_DCOMPLEXP_t restrict,
+    GD_DCOMPLEXV(m), GD_DCOMPLEXV(b), const unsigned int *restrict, size_t);
+void _GD_ConvertType(DIRFILE *restrict, const void *restrict, gd_type_t,
+    void *restrict, gd_type_t, size_t) gd_nothrow;
+gd_type_t _GD_ConstType(DIRFILE *D, gd_type_t type);
+const char *_GD_DirName(const DIRFILE *D, int dirfd);
+size_t _GD_DoField(DIRFILE *restrict, gd_entry_t *restrict, int, off64_t,
+    size_t, gd_type_t, void *restrict);
+size_t _GD_DoFieldOut(DIRFILE *restrict, gd_entry_t *restrict, 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);
+int _GD_EntryCmp(const void*, const void*);
+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
+int _GD_FiniRawIO(DIRFILE*, const gd_entry_t*, int, int);
+void _GD_Flush(DIRFILE *restrict, gd_entry_t *restrict, int, int);
+void _GD_FlushMeta(DIRFILE* D, int fragment, int force);
+void _GD_FreeE(DIRFILE *restrict, gd_entry_t *restrict, int);
+off64_t _GD_GetEOF(DIRFILE *restrict, const gd_entry_t *restrict,
+    const char *restrict, int *restrict);
+off64_t _GD_GetFilePos(DIRFILE *restrict, gd_entry_t *restrict, off64_t);
+char *_GD_GetLine(FILE *restrict, size_t *restrict, int *restrict);
+int _GD_GetRepr(DIRFILE *restrict, const char *restrict,
+    char **restrict, int);
+unsigned int _GD_GetSPF(DIRFILE*, gd_entry_t*);
+int _GD_GrabDir(DIRFILE*, int, const char *restrict);
+int _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);
+void _GD_InitialiseFramework(void);
+int _GD_InitRawIO(DIRFILE*, const gd_entry_t*, const char*, int,
+    const struct encoding_t*, unsigned int, unsigned int, int);
+void _GD_InvertData(DIRFILE *restrict, void *restrict, gd_type_t return_type,
+    double dividend, size_t n_read);
+void _GD_InsertSort(DIRFILE *restrict, gd_entry_t *restrict, int u) gd_nothrow;
+
+#define _GD_InternalError(D) \
+  _GD_SetError(D, GD_E_INTERNAL_ERROR, 0, __FILE__, __LINE__, NULL)
+
+int _GD_InvalidEntype(gd_entype_t t);
+gd_type_t _GD_LegacyType(char c);
+void _GD_LincomData(DIRFILE *restrict, int n, void *restrict,
+    gd_type_t return_type, const double *restrict, const double *restrict,
+    const double *restrict, const double *restrict,
+    const unsigned int *restrict, size_t);
+void _GD_LinterpData(DIRFILE *restrict, void *restrict, gd_type_t, int,
+    const double *restrict, size_t, const struct gd_lut_ *restrict, size_t);
+int _GD_ListEntry(const gd_entry_t *E, int meta, int hidden, int noalias,
+    int special, gd_entype_t type);
+char *_GD_MakeFullPath(DIRFILE *restrict, int, const char *restrict, int);
+#ifdef USE_MODULES
+#define _GD_MakeFullPathOnly gd_MakeFullPathOnly
+#else
+#define gd_MakeFullPathOnly _GD_MakeFullPathOnly
+#endif
+char *_GD_MakeFullPathOnly(const DIRFILE *D, int dirfd, const char *name);
+int _GD_MakeTempFile(const DIRFILE*, int, char*);
+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,
+    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);
+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);
+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_SetError(DIRFILE*, int, int, const char*, int, const char*);
+int _GD_SetTablePath(DIRFILE *restrict, const gd_entry_t *restrict,
+    struct gd_private_entry_ *restrict);
+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);
+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);
+ssize_t _GD_WriteOut(const gd_entry_t*, const struct encoding_t*, const void*,
+    gd_type_t, size_t, int);
+
+/* generic I/O methods */
+int _GD_GenericMove(int, struct gd_raw_file_ *restrict, int, char *restrict);
+int _GD_GenericName(DIRFILE *restrict, const char *restrict,
+    struct gd_raw_file_ *restrict, const char *restrict, int, int);
+int _GD_GenericUnlink(int, struct gd_raw_file_* file);
+
+/* unencoded I/O methods */
+int _GD_RawOpen(int, struct gd_raw_file_* file, int swap, unsigned int);
+off64_t _GD_RawSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int);
+ssize_t _GD_RawRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
+    size_t);
+ssize_t _GD_RawWrite(struct gd_raw_file_ *restrict, const void *restrict,
+    gd_type_t, size_t);
+int _GD_RawSync(struct gd_raw_file_* file);
+int _GD_RawClose(struct gd_raw_file_* file);
+off64_t _GD_RawSize(int, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap);
+
+/* text I/O methods */
+int _GD_AsciiOpen(int, struct gd_raw_file_* file, int swap, unsigned int);
+off64_t _GD_AsciiSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int);
+ssize_t _GD_AsciiRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
+    size_t);
+ssize_t _GD_AsciiWrite(struct gd_raw_file_ *restrict, const void *restrict,
+    gd_type_t, size_t);
+int _GD_AsciiSync(struct gd_raw_file_* file);
+int _GD_AsciiClose(struct gd_raw_file_* file);
+off64_t _GD_AsciiSize(int, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap);
+
+/* bzip I/O methods */
+int _GD_Bzip2Open(int, struct gd_raw_file_* file, int swap, 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,
+    int swap);
+
+/* gzip I/O methods */
+int _GD_GzipOpen(int, struct gd_raw_file_* file, int swap, 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_GzipClose(struct gd_raw_file_* file);
+off64_t _GD_GzipSize(int, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap);
+
+/* lzma I/O methods */
+int _GD_LzmaOpen(int, struct gd_raw_file_* file, int swap, 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);
+int _GD_LzmaClose(struct gd_raw_file_* file);
+off64_t _GD_LzmaSize(int, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap);
+
+/* slim I/O methods */
+int _GD_SlimOpen(int, struct gd_raw_file_* file, int, unsigned int);
+off64_t _GD_SlimSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int);
+ssize_t _GD_SlimRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
+    size_t);
+int _GD_SlimClose(struct gd_raw_file_* file);
+off64_t _GD_SlimSize(int, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap);
+
+/* 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);
+
+/* 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);
+off64_t _GD_ZzipSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int);
+ssize_t _GD_ZzipRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
+    size_t);
+int _GD_ZzipClose(struct gd_raw_file_* file);
+off64_t _GD_ZzipSize(int, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap);
+
+/* 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);
+off64_t _GD_ZzslimSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int);
+ssize_t _GD_ZzslimRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t,
+    size_t);
+int _GD_ZzslimClose(struct gd_raw_file_* file);
+off64_t _GD_ZzslimSize(int, struct gd_raw_file_* file, gd_type_t data_type,
+    int swap);
+
+#ifndef __cplusplus
+# undef gd_nothrow
+# define gd_nothrow
+#endif
+
+#ifdef GD_C89_API
+# define EN(t,v) u.t.v
+#else
+# define EN(t,v) v
+#endif
+
+#endif
diff --git a/src/legacy.c b/src/legacy.c
new file mode 100644
index 0000000..efbcd5d
--- /dev/null
+++ b/src/legacy.c
@@ -0,0 +1,651 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2003-2005 Theodore Kisner
+ * Copyright (C) 2005-2012, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+static struct {
+  unsigned int n;
+  DIRFILE** D;
+} _GD_Dirfiles = {0, NULL};
+
+/* Error-reporting kludge for deprecated API */
+static DIRFILE _GD_GlobalErrors = {
+#ifndef GD_NO_C99_API
+  .error = 0,
+  .suberror = 0,
+  .error_string = NULL,
+  .error_file = NULL,
+  .error_line = 0,
+  .flags = GD_INVALID,
+#else
+  0, 0, NULL, NULL, 0, GD_INVALID
+#endif
+};
+
+/* old error strings */
+const char *GD_ERROR_CODES[GD_N_ERROR_CODES] = {
+  "Success", /* GD_E_OK */
+  "Error opening dirfile", /* GD_E_OPEN */
+  "Error in Format file", /* GD_E_FORMAT */
+  NULL, /* GD_E_TRUNC */
+  NULL, /* GD_E_CREAT */
+  "Bad field code", /* GD_E_BAD_CODE */
+  "Unrecognized data type", /* GD_E_BAD_TYPE */
+  "I/O error accessing field file", /* GD_E_RAW_IO */
+  "Could not open fragment", /* GD_E_OPEN_FRAGMENT */
+  "Internal error", /* GD_E_INTERNAL_ERROR */
+  "Memory allocation failed", /* GD_E_ALLOC */
+  "Request out-of-range", /* GD_E_RANGE */
+  "Could not open interpolation table", /* GD_E_OPEN_LINFILE */
+  "Too many levels of recursion", /* GD_E_RECURSE_LEVEL */
+  "Bad dirfile", /* GD_E_BAD_DIRFILE */
+  "Bad field type", /* GD_E_BAD_FIELD_TYPE */
+  "Read-only dirfile", /* GD_E_ACC_MODE */
+  "Operation not supported by current encoding scheme", /* GD_E_UNSUPPORTED */
+  "Unknown encoding scheme", /* GD_E_UNKNOWN_ENCODING */
+  NULL, /* GD_E_BAD_ENTRY */
+  NULL, /* GD_E_DUPLICATE */
+  "Scalar field found where vector field expected", /* GD_E_DIMENSION */
+  NULL, /* GD_E_BAD_INDEX */
+  "Scalar field code not found", /* GD_E_BAD_SCALAR */
+  "Bad REFERENCE field", /* GD_E_BAD_REFERENCE */
+  "Operation prohibited by protection level", /* GD_E_PROTECTED */
+  NULL, /* GD_E_DELETE */
+  "Bad argument", /* GD_E_ARGUMENT */
+  NULL, /* GD_E_CALLBACK */
+  NULL, /* GD_E_EXISTS */
+  NULL, /* GD_E_UNCLEAN_DB */
+  "Improper domain", /* GD_E_DOMAIN */
+  "Bad representation", /* GD_E_BAD_REPR */
+  NULL, /* unused */
+  NULL, /* GD_E_FLUSH */
+  NULL, /* GD_E_BOUNDS */
+  "Line too long", /* GD_E_LINE_TOO_LONG */
+};
+
+static struct FormatType Format;
+
+/* _GD_CopyGlobalError: Copy the last error message to the global error buffer.
+*/
+static int _GD_CopyGlobalError(DIRFILE* D)
+{
+  dtrace("%p", D);
+
+  _GD_GlobalErrors.suberror = D->suberror;
+  _GD_GlobalErrors.error_line = D->error_line;
+  free(_GD_GlobalErrors.error_file);
+  _GD_GlobalErrors.error_file = (D->error_file) ? strdup(D->error_file) : NULL;
+  free(_GD_GlobalErrors.error_string);
+  _GD_GlobalErrors.error_string = (D->error_string) ? strdup(D->error_string) :
+    NULL;
+
+  dreturn("%i", D->error);
+  return _GD_GlobalErrors.error = D->error;
+}
+
+/* legacy wrapper for gd_error_string()
+*/
+char *GetDataErrorString(char* buffer, size_t buflen) gd_nothrow
+{
+  return gd_error_string(&_GD_GlobalErrors, buffer, buflen);
+}
+
+/* _GD_GetDirfile: Locate the legacy DIRFILE given the filespec.  This started
+ * life as GetFormat...
+ */
+static DIRFILE *_GD_GetDirfile(const char *filename_in, int mode,
+    int *error_code)
+{
+  unsigned int i_dirfile;
+  void *ptr;
+  char *filedir;
+
+  dtrace("\"%s\", %x", filename_in, mode);
+
+  filedir = strdup(filename_in);
+
+  if (!filedir) {
+    *error_code = GD_E_ALLOC;
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if (filedir[strlen(filedir) - 1] == '/')
+    filedir[strlen(filedir) - 1] = '\0';
+
+  /* first check to see if we have already read it */
+  for (i_dirfile = 0; i_dirfile < _GD_Dirfiles.n; i_dirfile++) {
+    if (strcmp(filedir, _GD_Dirfiles.D[i_dirfile]->name) == 0) {
+      /* if the dirfile was previously opened read-only, close it so we can
+       * re-open it read-write */
+      if ((mode & GD_RDWR) && (_GD_Dirfiles.D[i_dirfile]->flags & GD_ACCMODE) ==
+          GD_RDONLY) {
+        /* close it */
+        gd_discard(_GD_Dirfiles.D[i_dirfile]);
+
+        /* copy the last dirfile in the list over top of this one and decrement
+         * the counter -- next realloc will do nothing */
+        _GD_Dirfiles.D[i_dirfile] = _GD_Dirfiles.D[--_GD_Dirfiles.n];
+      } else {
+        free(filedir);
+        _GD_ClearError(_GD_Dirfiles.D[i_dirfile]);
+        dreturn("%p", _GD_Dirfiles.D[i_dirfile]);
+        return _GD_Dirfiles.D[i_dirfile];
+      }
+    }
+  }
+
+  /* if we get here, the file has not yet been read */
+  /* Allocate the memory, then fill.  If we have an error, */
+  /*  we will have to free the memory... */
+  ptr = realloc(_GD_Dirfiles.D, (_GD_Dirfiles.n + 1) * sizeof(DIRFILE*));
+  if (ptr == NULL) {
+    *error_code = _GD_GlobalErrors.error = GD_E_ALLOC;
+    free(filedir);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_Dirfiles.D = (DIRFILE **)ptr;
+
+  /* Open a dirfile */
+  _GD_Dirfiles.D[_GD_Dirfiles.n] = gd_open(filedir, mode);
+  free(filedir);
+
+  /* Error encountered -- clean up */
+  if (_GD_Dirfiles.D[_GD_Dirfiles.n]->error != GD_E_OK) {
+    *error_code = _GD_CopyGlobalError(_GD_Dirfiles.D[_GD_Dirfiles.n]);
+    gd_discard(_GD_Dirfiles.D[_GD_Dirfiles.n]);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  dreturn("%p", _GD_Dirfiles.D[_GD_Dirfiles.n]);
+  return _GD_Dirfiles.D[_GD_Dirfiles.n++];
+}
+
+static void CopyRawEntry(struct RawEntryType* R, gd_entry_t* E)
+{
+  dtrace("%p, %p", R, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  R->field = E->field;
+
+  switch(E->EN(raw,data_type)) {
+    case GD_UINT8:
+      R->type = 'c';
+      break;
+    case GD_UINT16:
+      R->type = 'u';
+      break;
+    case GD_INT16:
+      R->type = 's';
+      break;
+    case GD_UINT32:
+      R->type = 'U';
+      break;
+    case GD_INT32:
+      R->type = 'S';
+      break;
+    case GD_FLOAT32:
+      R->type = 'f';
+      break;
+    case GD_FLOAT64:
+      R->type = 'd';
+      break;
+    default: /* Well, this isn't right, but it's the best we can do. */
+      R->type = 'n';
+      break;
+  }
+
+  R->size = (int)E->e->u.raw.size;
+  R->samples_per_frame = (int)E->EN(raw,spf);
+
+  dreturnvoid();
+}
+
+/* We operate under the myth that POLYNOMs are actually LINCOMs.  We report them
+ * to have one input field, and discard non-linear terms */
+static void CopyPolynomEntry(struct LincomEntryType* L, gd_entry_t* E)
+{
+  dtrace("%p, %p", L, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  L->field = E->field;
+  L->n_fields = 1;
+  L->in_fields[0] = E->in_fields[0];
+  L->m[0] = E->EN(polynom,a)[1];
+  L->b[0] = E->EN(polynom,a)[0];
+
+  dreturnvoid();
+}
+
+static void CopyLincomEntry(struct LincomEntryType* L, gd_entry_t* E)
+{
+  int i;
+
+  dtrace("%p, %p", L, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  L->field = E->field;
+  L->n_fields = E->EN(lincom,n_fields);
+  for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+    L->in_fields[i] = E->in_fields[i];
+    L->m[i] = E->EN(lincom,m)[i];
+    L->b[i] = E->EN(lincom,b)[i];
+  }
+
+  dreturnvoid();
+}
+
+static void CopyLinterpEntry(struct LinterpEntryType* L, gd_entry_t* E)
+{
+  dtrace("%p, %p", L, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  L->field = E->field;
+  L->raw_field = E->in_fields[0];
+  L->linterp_file = E->EN(linterp,table);
+
+  dreturnvoid();
+}
+
+static void CopyBitEntry(struct BitEntryType* B, gd_entry_t* E)
+{
+  dtrace("%p, %p", B, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  B->field = E->field;
+  B->raw_field = E->in_fields[0];
+  B->bitnum = E->EN(bit,bitnum);
+  B->numbits = E->EN(bit,numbits);
+
+  dreturnvoid();
+}
+
+static void CopyMultDivEntry(struct MultiplyEntryType* M, gd_entry_t* E)
+{
+  dtrace("%p, %p", M, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  M->field = E->field;
+  M->in_fields[0] = E->in_fields[0];
+  M->in_fields[1] = E->in_fields[1];
+
+  dreturnvoid();
+}
+
+static void CopyReciprocalEntry(struct LincomEntryType* L, gd_entry_t* E)
+{
+  dtrace("%p, %p", L, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  L->field = E->field;
+  L->n_fields = 1;
+  L->in_fields[0] = E->in_fields[0];
+  L->m[0] = E->EN(recip,dividend);
+  L->b[0] = 0;
+
+  dreturnvoid();
+}
+
+static void CopyPhaseEntry(struct PhaseEntryType* P, gd_entry_t* E)
+{
+  dtrace("%p, %p", P, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  P->field = E->field;
+  P->raw_field = E->in_fields[0];
+  P->shift = E->EN(phase,shift);
+
+  dreturnvoid();
+}
+
+static void CopyWindowEntry(struct MPlexEntryType* M, gd_entry_t* E)
+{
+  dtrace("%p, %p", M, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  M->field = E->field;
+  M->data_field = E->in_fields[0];
+  M->cnt_field = E->in_fields[1];
+  M->i = (int)E->EN(window,windop);
+  M->max_i = (int)E->EN(window,threshold.i);
+
+  dreturnvoid();
+}
+
+static void CopyMplexEntry(struct MPlexEntryType* M, gd_entry_t* E)
+{
+  dtrace("%p, %p", M, E);
+
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+
+  M->field = E->field;
+  M->data_field = E->in_fields[0];
+  M->cnt_field = E->in_fields[1];
+  M->i = (int)E->EN(mplex,count_val);
+  M->max_i = (int)E->EN(mplex,period);
+
+  dreturnvoid();
+}
+
+/* Okay, reconstruct the old FormatType.  This is painful. */
+struct FormatType *GetFormat(const char *filedir, int *error_code) gd_nothrow
+{
+  unsigned int i;
+
+  int nraw = 0;
+  int nlincom = 0;
+  int nlinterp = 0;
+  int nmultiply = 0;
+  int nbit = 0;
+  int nphase = 0;
+  int nmplex = 0;
+  DIRFILE *D;
+
+  dtrace("\"%s\", %p", filedir, error_code);
+
+  D = _GD_GetDirfile(filedir, GD_RDONLY, error_code);
+
+  if (!D) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  memset(&Format, 0, sizeof(Format));
+
+  /* fill the structure -- like everything about the legacy API, this is
+   * not thread-safe */
+  Format.FileDirName = filedir; 
+  Format.frame_offset = (int)D->fragment[0].frame_offset;
+  CopyRawEntry(&Format.first_field, D->reference_field);
+
+  /* Pass one: run through the entry list and count the number of different
+   * types */
+  for (i = 0; i < D->n_entries; ++i) 
+    switch(D->entry[i]->field_type) {
+      case GD_RAW_ENTRY:
+        Format.n_raw++;
+        break;
+      case GD_LINCOM_ENTRY:
+      case GD_POLYNOM_ENTRY:
+      case GD_RECIP_ENTRY:
+        Format.n_lincom++;
+        break;
+      case GD_LINTERP_ENTRY:
+        Format.n_linterp++;
+        break;
+      case GD_BIT_ENTRY:
+      case GD_SBIT_ENTRY:
+        Format.n_bit++;
+        break;
+      case GD_MULTIPLY_ENTRY:
+      case GD_DIVIDE_ENTRY:
+        Format.n_multiply++;
+        break;
+      case GD_PHASE_ENTRY:
+        Format.n_phase++;
+        break;
+      case GD_WINDOW_ENTRY:
+      case GD_MPLEX_ENTRY:
+        Format.n_mplex++;
+        break;
+      case GD_NO_ENTRY:
+      case GD_ALIAS_ENTRY:
+      case GD_CONST_ENTRY:
+      case GD_CARRAY_ENTRY:
+      case GD_INDEX_ENTRY:
+      case GD_STRING_ENTRY:
+        break;
+    }
+
+  /* Now reallocate the Entry arrays */
+  free(Format.rawEntries);
+  free(Format.lincomEntries);
+  free(Format.linterpEntries);
+  free(Format.mplexEntries);
+  free(Format.multiplyEntries);
+  free(Format.bitEntries);
+  free(Format.phaseEntries);
+
+  Format.rawEntries = (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));
+
+  if (Format.rawEntries == NULL || Format.lincomEntries == NULL ||
+      Format.linterpEntries == NULL || Format.mplexEntries == NULL ||
+      Format.multiplyEntries == NULL || Format.bitEntries == NULL ||
+      Format.phaseEntries == NULL)
+  {
+    D->error = GD_E_ALLOC;
+    *error_code = _GD_CopyGlobalError(D);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* Pass 2: Fill the Entry structs */
+  for (i = 0; i < D->n_entries; ++i)
+    switch(D->entry[i]->field_type) {
+      case GD_RAW_ENTRY:
+        CopyRawEntry(&Format.rawEntries[nraw++], D->entry[i]);
+        break;
+      case GD_POLYNOM_ENTRY:
+        CopyPolynomEntry(&Format.lincomEntries[nlincom++], D->entry[i]);
+        break;
+      case GD_LINCOM_ENTRY:
+        CopyLincomEntry(&Format.lincomEntries[nlincom++], D->entry[i]);
+        break;
+      case GD_LINTERP_ENTRY:
+        CopyLinterpEntry(&Format.linterpEntries[nlinterp++], D->entry[i]);
+        break;
+      case GD_BIT_ENTRY:
+      case GD_SBIT_ENTRY:
+        CopyBitEntry(&Format.bitEntries[nbit++], D->entry[i]);
+        break;
+      case GD_RECIP_ENTRY:
+        CopyReciprocalEntry(&Format.lincomEntries[nlincom++], D->entry[i]);
+        break;
+      case GD_MULTIPLY_ENTRY:
+      case GD_DIVIDE_ENTRY:
+        CopyMultDivEntry(&Format.multiplyEntries[nmultiply++], D->entry[i]);
+        break;
+      case GD_PHASE_ENTRY:
+        CopyPhaseEntry(&Format.phaseEntries[nphase++], D->entry[i]);
+        break;
+      case GD_WINDOW_ENTRY:
+        CopyWindowEntry(&Format.mplexEntries[nmplex++], D->entry[i]);
+        break;
+      case GD_MPLEX_ENTRY:
+        CopyMplexEntry(&Format.mplexEntries[nmplex++], D->entry[i]);
+        break;
+      case GD_STRING_ENTRY:
+      case GD_CONST_ENTRY:
+      case GD_CARRAY_ENTRY:
+      case GD_INDEX_ENTRY:
+      case GD_ALIAS_ENTRY:
+      case GD_NO_ENTRY:
+        break;
+    }
+
+  dreturn("%p", &Format);
+  return &Format;
+}
+
+/* legacy interface to getdata() */
+int GetData(const char *filename, const char *field_code,
+    int first_frame, int first_samp, int num_frames, int num_samp,
+    char return_type, void *data_out, int *error_code)
+{
+  DIRFILE* D;
+  int nread;
+
+  dtrace("\"%s\", \"%s\", %i, %i, %i, %i, '%c', %p, %p", filename, field_code,
+      first_frame, first_samp, num_frames, num_samp, return_type, data_out,
+      error_code);
+
+  D = _GD_GetDirfile(filename, GD_RDONLY, error_code);
+
+  if (!D) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  nread = (int)gd_getdata64(D, field_code, (off64_t)first_frame,
+      (off64_t)first_samp, (size_t)num_frames, (size_t)num_samp,
+      _GD_LegacyType(return_type), data_out);
+  *error_code = _GD_CopyGlobalError(D);
+
+  dreturn("%i", nread);
+  return nread;
+}
+
+/* legacy interface to get_nframes() --- the third argument to this function
+ * has been ignored since at least 2005 (and why does it come after
+ * error_code?)
+ */
+int GetNFrames(const char *filename, int *error_code,
+    const void *unused gd_unused_)
+{
+  DIRFILE* D;
+  int nf;
+
+  dtrace("\"%s\", %p, <unused>", filename, error_code);
+
+  D = _GD_GetDirfile(filename, GD_RDONLY, error_code);
+
+  if (!D) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  nf = (int)gd_nframes(D);
+  *error_code = _GD_CopyGlobalError(D);
+
+  dreturn("%i", nf);
+  return nf;
+}
+
+/* legacy interface to get_spf()
+*/
+int GetSamplesPerFrame(const char *filename, const char *field_code,
+    int *error_code) gd_nothrow
+{
+  DIRFILE* D;
+  int spf;
+
+  dtrace("\"%s\", \"%s\", %p", filename, field_code, error_code);
+
+  D = _GD_GetDirfile(filename, GD_RDONLY, error_code);
+
+  if (!D) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  spf = (int)gd_spf(D, field_code);
+  *error_code = _GD_CopyGlobalError(D);
+
+  dreturn("%i", spf);
+  return spf;
+}
+
+/* legacy interface to putdata()
+*/
+int PutData(const char *filename, const char *field_code,
+    int first_frame, int first_samp, int num_frames, int num_samp,
+    char data_type, const void *data_in, int *error_code)
+{
+  DIRFILE* D;
+  int n_write = 0;
+
+  dtrace("\"%s\", \"%s\", %i, %i, %i, %i, '%c', %p, %p", filename, field_code,
+      first_frame, first_samp, num_frames, num_samp, data_type, data_in,
+      error_code);
+
+  D = _GD_GetDirfile(filename, GD_RDWR | GD_UNENCODED, error_code);
+
+  if (!D) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_write = (int)gd_putdata64(D, field_code, (off64_t)first_frame,
+      (off64_t)first_samp, (size_t)num_frames, (size_t)num_samp,
+      _GD_LegacyType(data_type), data_in);
+  *error_code = _GD_CopyGlobalError(D);
+
+  dreturn("%i", n_write);
+  return n_write;
+}
+/* vim: ts=2 sw=2 et
+*/
diff --git a/src/lzma.c b/src/lzma.c
new file mode 100644
index 0000000..f3f1db3
--- /dev/null
+++ b/src/lzma.c
@@ -0,0 +1,336 @@
+/* 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 "internal.h"
+
+#ifdef HAVE_LZMA_H
+#include <lzma.h>
+#endif
+
+#ifdef USE_MODULES
+#define _GD_LzmaOpen libgetdatalzma_LTX_GD_LzmaOpen
+#define _GD_LzmaSeek libgetdatalzma_LTX_GD_LzmaSeek
+#define _GD_LzmaRead libgetdatalzma_LTX_GD_LzmaRead
+#define _GD_LzmaClose libgetdatalzma_LTX_GD_LzmaClose
+#define _GD_LzmaSize libgetdatalzma_LTX_GD_LzmaSize
+#endif
+
+#if SIZEOF_INT < 4
+#define GD_LZMA_BUFFER_SIZE 32767
+#else
+#define GD_LZMA_BUFFER_SIZE 1000000
+#endif
+
+struct gd_lzmadata {
+  lzma_stream xzfile;
+  FILE* stream;
+  int xzerror;
+  int stream_end; /* uncompressed file ran out of data */
+  int input_eof; /* compressed file ran out of data */
+  int read_in; /* location of the end of valid data in data_in */
+  int out_pos; /* library's current position relative to the start of
+                  data_out */
+  int end; /* location of the end of valid data in data_out */
+  off64_t base; /* position of the start of data_out in the uncompressed
+                   stream */
+  uint8_t data_in[GD_LZMA_BUFFER_SIZE];
+  uint8_t data_out[GD_LZMA_BUFFER_SIZE];
+};
+
+/* The bzip encoding scheme uses edata as a gd_lzmadata pointer.  If a file is
+ * open, idata = 0 otherwise idata = -1. */
+
+static struct gd_lzmadata *_GD_LzmaDoOpen(int dirfd, struct gd_raw_file_* file)
+{
+  struct gd_lzmadata *ptr;
+  int fd;
+
+  dtrace("%i, %p", dirfd, file);
+
+  if ((ptr = (struct gd_lzmadata *)malloc(sizeof(struct gd_lzmadata))) == NULL)
+  {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if ((fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666))
+      == -1)
+  {
+    free(ptr);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  if ((ptr->stream = fdopen(fd, "rb")) == 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);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  ptr->read_in = ptr->out_pos = ptr->end = 0;
+  ptr->base = ptr->stream_end = ptr->input_eof = 0;
+
+  dreturn("%p", ptr);
+  return ptr;
+}
+
+int _GD_LzmaOpen(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
+    unsigned int mode gd_unused_)
+{
+  dtrace("%i, %p, <unused>, <unused>", dirfd, file);
+
+  file->edata = _GD_LzmaDoOpen(dirfd, file);
+
+  if (file->edata == NULL) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  file->mode = GD_FILE_READ;
+  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)
+{
+  int n = 0;
+
+  dtrace("%p", ptr);
+
+  if (!ptr->input_eof) {
+    n = fread(ptr->data_in + ptr->read_in, 1, GD_LZMA_BUFFER_SIZE -
+        ptr->read_in, ptr->stream);
+
+    if (n < GD_LZMA_BUFFER_SIZE - ptr->read_in) {
+      if (feof(ptr->stream))
+        ptr->input_eof = 1;
+      else {
+        dreturn("%i", -1);
+        return -1;
+      }
+    }
+  }
+
+  ptr->xzfile.avail_in = ptr->read_in + n;
+
+  /* no more data to convert -- end of stream reached */
+  if (ptr->xzfile.avail_in == 0) {
+    ptr->stream_end = 1;
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* amount of data = amount already in buffer + amount just now read */
+  ptr->xzerror = lzma_code(&ptr->xzfile, LZMA_RUN);
+
+  if (ptr->xzerror == LZMA_OK || ptr->xzerror == LZMA_STREAM_END) {
+    ptr->base += ptr->end;
+    ptr->end = ptr->xzfile.total_out;
+    /* shift unused input to start of buffer */
+    memmove(ptr->data_in, ptr->data_in + ptr->xzfile.total_in,
+        ptr->xzfile.avail_in);
+    ptr->read_in = ptr->xzfile.avail_in;
+  } else {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_LzmaSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int mode gd_unused_)
+{
+  struct gd_lzmadata *ptr = (struct gd_lzmadata *)file->edata;
+
+  dtrace("%p, %lli, 0x%X, <unused>", file, (long long)count, data_type);
+
+  count *= GD_SIZE(data_type);
+
+  /* the easy case */
+  if (file->pos == count) {
+    dreturn("%lli", (long long)count);
+    return count;
+  }
+
+  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;
+    }
+    rewind(ptr->stream);
+    ptr->read_in = ptr->out_pos = ptr->end = 0;
+    ptr->base = ptr->input_eof = ptr->stream_end = 0;
+  }
+
+  /* seek forward the slow way */
+  while (ptr->base + ptr->end < count) {
+    if (_GD_LzmaDecode(ptr)) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    /* eof */
+    if (ptr->stream_end)
+      break;
+  }
+
+  ptr->out_pos = (ptr->stream_end && count >= ptr->base + ptr->end) ?  ptr->end
+    : count - ptr->base;
+
+  file->pos = (ptr->base + ptr->out_pos) / GD_SIZE(data_type);
+
+  dreturn("%lli", (long long)(file->pos));
+  return file->pos;
+}
+
+ssize_t _GD_LzmaRead(struct gd_raw_file_ *file, void *data, gd_type_t data_type,
+    size_t nmemb)
+{
+  char* output = (char *)data;
+  struct gd_lzmadata *ptr = (struct gd_lzmadata *)file->edata;
+  uint64_t nbytes = nmemb * GD_SIZE(data_type);
+
+  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 (_GD_LzmaDecode(ptr)) {
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    /* eof */
+    if (ptr->stream_end)
+      break;
+  }
+
+  /* If we still have more data than we need (no EOF), copy it all, otherwise
+   * (reached EOF) copy as much as we have */
+  if (nbytes > (uint64_t)(ptr->end - ptr->out_pos)) {
+    memcpy(output, ptr->data_out + ptr->out_pos, ptr->end - ptr->out_pos);
+    ptr->out_pos = ptr->end;
+    nbytes -= ptr->end;
+  } else {
+    memcpy(output, ptr->data_out + ptr->out_pos, nbytes);
+    ptr->out_pos += nbytes;
+    nbytes = 0;
+  }
+
+  file->pos += nmemb - nbytes / GD_SIZE(data_type);
+
+  dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type)));
+  return nmemb - nbytes / GD_SIZE(data_type);
+}
+
+int _GD_LzmaClose(struct gd_raw_file_ *file)
+{
+  struct gd_lzmadata *ptr = (struct gd_lzmadata *)file->edata;
+
+  dtrace("%p", file);
+
+  ptr->xzerror = 0;
+  lzma_end(&ptr->xzfile);
+  if (fclose(ptr->stream)) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  file->idata = -1;
+  file->mode = 0;
+  free(file->edata);
+  dreturn("%i", 0);
+  return 0;
+}
+
+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;
+
+  dtrace("%i, %p, 0x%X, <unused>", dirfd, file, data_type);
+
+  ptr = _GD_LzmaDoOpen(dirfd, file);
+
+  if (ptr == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* seek forward the slow way  to the end */
+  while (!ptr->stream_end) {
+    if (_GD_LzmaDecode(ptr)) {
+      lzma_end(&ptr->xzfile);
+      fclose(ptr->stream);
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+  lzma_end(&ptr->xzfile);
+  fclose(ptr->stream);
+
+  n = (ptr->base + ptr->end) / GD_SIZE(data_type);
+  free(ptr);
+
+  dreturn("%lli", (long long)n);
+  return n;
+}
diff --git a/src/mod.c b/src/mod.c
new file mode 100644
index 0000000..a458d07
--- /dev/null
+++ b/src/mod.c
@@ -0,0 +1,1826 @@
+/* Copyright (C) 2008-2012, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+static unsigned int gd_max_(unsigned int A, unsigned int B)
+{
+  return (A > B) ? A : B;
+}
+
+#define GD_AS_FREE_SCALAR 1
+#define GD_AS_NEED_RECALC 2
+#define GD_AS_ERROR       4
+#define GD_AS_MODIFIED    8
+/*  sold snew alit
+ * 0a N    N0   0     -> do nothing         ()
+ * 1  N    N0   1     -> set lout           ()
+ * 2  Na   a    01    -> set sout           (free scalar; need recalc)
+ * 3  a    N    0     -> recalc, set sout   (free scalar)
+ * 4  a    N    1     -> set sout, set lout (free scalar)
+ * 0b a    0    01    -> do nothing         ()
+ */
+static int _GD_AlterScalar(DIRFILE* D, int alter_literal, gd_type_t type,
+    void *lout, const void *lin, char **sout, int *iout, const char *sin,
+    int iin, int calculated, int fragment_index)
+{
+  int r = 0;
+  int set_lout = 0;
+
+  dtrace("%p, %i, 0x%X, %p, %p, %p, %p, %p, %i, %i, %i", D, alter_literal, type,
+      lout, lin, sout, iout, sin, iin, calculated, fragment_index);
+
+  if (sin == NULL) {
+    if (*sout != NULL) {
+      if (alter_literal) {
+        /* 4: replace a CONST field with a literal scalar */
+        r = GD_AS_FREE_SCALAR | GD_AS_MODIFIED;
+        *sout = NULL;
+        set_lout = 1;
+      } else {
+        /* 3: derefencing a CONST field to turn it into a literal scalar
+         *    lout is not set from lin, but kept as-is, after calculation;
+         *    this may throw GD_E_BAD_CODE or GD_E_BAD_FIELD_TYPE, via
+         *    get_constant. */
+        r = GD_AS_FREE_SCALAR | GD_AS_MODIFIED;
+        if (!calculated)
+          gd_get_constant(D, *sout, GD_INT64, lout);
+        *sout = NULL;
+      }
+    } else if (alter_literal) {
+      /* 1: set lout from lin */
+      set_lout = 1;
+    }
+    /* otherwise 0a: do nothing */
+  } else if (sin[0] == '\0') {
+    if (*sout == NULL && alter_literal) {
+      /* 1: set lout from lin */
+      set_lout = 1;
+    }
+    /* otherwise 0b: do nothing */
+  } else {
+    /* 2: set a new CONST field from sout; if this is a RAW field, and we've
+     *    been asked to move the raw file, _GD_Change is going to need to
+     *    recalculate the entry; no need to change lout: it's ignored. */
+    if (!_GD_CheckCodeAffixes(D, NULL, sin, fragment_index)) {
+      r = GD_AS_FREE_SCALAR | GD_AS_NEED_RECALC | GD_AS_MODIFIED;
+      *sout = _GD_Strdup(D, sin);
+      *iout = iin;
+    }
+  }
+
+  if (!D->error && set_lout) {
+    r |= GD_AS_MODIFIED;
+    if (type == GD_INT64)
+      *(int64_t *)lout = *(int64_t *)lin;
+    else if (type == GD_COMPLEX128)
+      memcpy(lout, lin, 2 * sizeof(double));
+    else if (type == GD_FLOAT64)
+      *(double *)lout = *(double *)lin;
+    else if (type == GD_INT16)
+      *(int16_t *)lout = *(int16_t *)lin;
+    else if (type == GD_UINT16)
+      *(uint16_t *)lout = *(uint16_t *)lin;
+    else if (type == GD_INT32)
+      *(int32_t *)lout = *(int32_t *)lin;
+    else if (type == GD_UINT32)
+      *(uint32_t *)lout = *(uint32_t *)lin;
+    else if (type == GD_UINT64)
+      *(uint64_t *)lout = *(uint64_t *)lin;
+    else
+      _GD_InternalError(D);
+  }
+
+  if (D->error)
+    r |= GD_AS_ERROR;
+
+  dreturn("%i", r);
+  return r;
+}
+
+/* _GD_SPFConvert: this is the no-longer used AddData, cut down for use by
+ * _GD_Change.  NB: Don't precompute (spfB / spfA) here: the order of operations
+ * is important to get proper integer trucation.
+ */
+static void _GD_SPFConvert(DIRFILE* D, void *A, unsigned int spfA, void *B,
+    unsigned int spfB, gd_type_t type, size_t n)
+{
+  size_t i;
+
+  dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n);
+
+  switch (type) {
+    case GD_NULL: /* null read */
+      break;
+    case GD_INT8:
+      for (i = 0; i < n; i++)
+        ((int8_t *)A)[i] = ((int8_t *)B)[i * spfB / spfA];
+      break;
+    case GD_UINT8:
+      for (i = 0; i < n; i++)
+        ((uint8_t *)A)[i] = ((uint8_t *)B)[i * spfB / spfA];
+      break;
+    case GD_INT16:
+      for (i = 0; i < n; i++)
+        ((int16_t *)A)[i] = ((int16_t *)B)[i * spfB / spfA];
+      break;
+    case GD_UINT16:
+      for (i = 0; i < n; i++)
+        ((uint16_t *)A)[i] = ((uint16_t *)B)[i * spfB / spfA];
+      break;
+    case GD_INT32:
+      for (i = 0; i < n; i++)
+        ((int32_t *)A)[i] = ((int32_t *)B)[i * spfB / spfA];
+      break;
+    case GD_UINT32:
+      for (i = 0; i < n; i++)
+        ((uint32_t *)A)[i] = ((uint32_t *)B)[i * spfB / spfA];
+      break;
+    case GD_INT64:
+      for (i = 0; i < n; i++)
+        ((int64_t *)A)[i] = ((int64_t *)B)[i * spfB / spfA];
+      break;
+    case GD_UINT64:
+      for (i = 0; i < n; i++)
+        ((uint64_t *)A)[i] = ((uint64_t *)B)[i * spfB / spfA];
+      break;
+    case GD_FLOAT32:
+      for (i = 0; i < n; i++)
+        ((float *)A)[i] = ((float *)B)[i * spfB / spfA];
+      break;
+    case GD_FLOAT64:
+      for (i = 0; i < n; i++)
+        ((double *)A)[i] = ((double *)B)[i * spfB / spfA];
+      break;
+    case GD_COMPLEX64:
+      for (i = 0; i < n; i++)
+        memcpy((float *)A + 2 * i, (float *)B + 2 * (i * spfB / spfA),
+            2 * sizeof(float));
+      break;
+    case GD_COMPLEX128:
+      for (i = 0; i < n; i++)
+        memcpy((double *)A + 2 * i, (double *)B + 2 * (i * spfB / spfA),
+            2 * sizeof(double));
+      break;
+    default:
+      _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+      break;
+  }
+
+  dreturnvoid();
+}
+
+/* returns -1 on error, 1 if modified, 0 if no change */
+static int _GD_AlterInField(DIRFILE *D, int i, char **Q, char *const *N,
+    char *const *E, int fragment_index, int force)
+{
+  dtrace("%p, %i, %p, %p, %p, %i, %i", D, i, Q, N, E, fragment_index, force);
+
+  if (force || (N[i] != NULL && strcmp(E[i], N[i]))) {
+    if (_GD_CheckCodeAffixes(D, NULL, N[i], fragment_index)) {
+      dreturn("%i", -1);
+      return -1;
+    } else if ((Q[i] = _GD_Strdup(D, N[i])) == NULL) {
+      dreturn("%i", -1); 
+      return -1;
+    }
+
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* N is the new entry, supplied by the user
+ * E is the old entry, stored in the database
+ * Q is our workspace; in the end, Q is a sanitised N which replaces E */
+static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N,
+    int flags)
+{
+  int i, j;
+  int field_free = 0;
+  int scalar_free = 0;
+  int modified = 0;
+  size_t n;
+  gd_type_t type;
+  void *ptr;
+  gd_entry_t *E = NULL;
+  gd_entry_t Q;
+  struct gd_private_entry_ Qe;
+
+  dtrace("%p, \"%s\", %p, %i", D, field_code, N, flags);
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR)
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+  else if ((E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL))
+      == NULL)
+  {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+  } else if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT)
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+  else if (E->field_type != N->field_type)
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_MATCH, NULL, 0, field_code);
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memcpy(&Qe, E->e, sizeof(struct gd_private_entry_));
+  memcpy(&Q, E, sizeof(gd_entry_t));
+
+  /* hiddenness isn't changeable with this interface */
+  Q.hidden = E->hidden;
+
+  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);
+
+      if (j & GD_AS_ERROR)
+        break;
+      if (j & GD_AS_FREE_SCALAR)
+        scalar_free |= 1;
+      if (j & GD_AS_NEED_RECALC)
+        Qe.calculated = 0;
+
+      Q.EN(raw,data_type) = (N->EN(raw,data_type) == GD_NULL) ?
+        E->EN(raw,data_type) : N->EN(raw,data_type);
+
+      /* nothing to do */
+      if (Q.EN(raw,spf) == E->EN(raw,spf) && Q.EN(raw,data_type) ==
+          E->EN(raw,data_type) && Q.scalar[0] == E->scalar[0])
+        break;
+
+      modified = 1;
+
+      if (Q.EN(raw,data_type) & 0x40 ||
+          (Qe.u.raw.size = GD_SIZE(Q.EN(raw,data_type))) == 0)
+      {
+        _GD_SetError(D, GD_E_BAD_TYPE, Q.EN(raw,data_type), NULL, 0, NULL);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      if (flags) {
+        ssize_t nread, nwrote;
+        off64_t ns_out, nf;
+        void *buffer1;
+        void *buffer2;
+        struct encoding_t *enc;
+
+        if (j & GD_AS_NEED_RECALC)
+          if (gd_get_constant(D, Q.scalar[0], GD_UINT_TYPE, &Q.EN(raw,spf)))
+            break;
+
+        nf = BUFFER_SIZE / gd_max_(E->e->u.raw.size,
+            GD_SIZE(Q.EN(raw,data_type))) / gd_max_(E->EN(raw,spf),
+            Q.EN(raw,spf));
+
+        if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA)
+          _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0,
+              D->fragment[E->fragment_index].cname);
+        else
+          _GD_Supports(D, E, GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK |
+              GD_EF_READ | GD_EF_WRITE | GD_EF_SYNC | GD_EF_UNLINK);
+
+        if (D->error)
+          break;
+
+        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))
+          break;
+        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);
+        }
+
+        if (D->error)
+          break;
+
+        /* Create a temporary file and open it */
+        if (_GD_InitRawIO(D, E, NULL, -1, enc, 0, GD_FILE_WRITE | GD_FILE_TEMP,
+              _GD_FileSwapBytes(D, E->fragment_index)))
+          break;
+        else if (_GD_WriteSeek(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);
+
+        if (D->error) {
+          free(buffer1);
+          break;
+        }
+
+        /* Now copy the old file to the new file */
+        for (;;) {
+          nread = (*enc->read)(E->e->u.raw.file, buffer1, E->EN(raw,data_type),
+              nf * E->EN(raw,spf));
+
+          if (nread < 0) {
+            _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+                NULL);
+            break;
+          }
+
+          if (nread == 0)
+            break;
+
+          ns_out = nread * Q.EN(raw,spf) / E->EN(raw,spf);
+
+          /* spf convert */
+          if (Q.EN(raw,spf) != E->EN(raw,spf))
+            _GD_SPFConvert(D, buffer2, Q.EN(raw,spf), buffer1, E->EN(raw,spf),
+                E->EN(raw,data_type), ns_out);
+          else {
+            ptr = buffer1;
+            buffer1 = buffer2;
+            buffer2 = ptr;
+          }
+
+          /* type convert */
+          if (Q.EN(raw,data_type) != E->EN(raw,data_type))
+            _GD_ConvertType(D, buffer2, E->EN(raw,data_type), buffer1,
+                Q.EN(raw,data_type), ns_out);
+          else {
+            ptr = buffer1;
+            buffer1 = buffer2;
+            buffer2 = ptr;
+          }
+
+          nwrote = _GD_WriteOut(E, enc, buffer1, Q.EN(raw,data_type), ns_out,
+              1);
+
+          if (nwrote < ns_out) {
+            _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[1].name, errno,
+                NULL);
+            break;
+          }
+        }
+
+        free(buffer1);
+        free(buffer2);
+
+        if (D->error)
+          /* An error occurred, delete the temporary file (the old
+           * file can stay open) */
+          _GD_FiniRawIO(D, E, E->fragment_index,
+              GD_FINIRAW_CLOTEMP | GD_FINIRAW_DISCARD);
+        else {
+          /* discard the old file and move the temporary file into place */
+          if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD) == 0)
+            _GD_FiniRawIO(D, E, E->fragment_index,
+                GD_FINIRAW_KEEP | GD_FINIRAW_CLOTEMP);
+        }
+      }
+      memcpy(Qe.u.raw.file, E->e->u.raw.file, sizeof(struct gd_raw_file_));
+
+      break;
+    case GD_LINCOM_ENTRY:
+      Q.EN(lincom,n_fields) = (N->EN(lincom,n_fields) == 0) ?
+        E->EN(lincom,n_fields) : N->EN(lincom,n_fields);
+      if (Q.EN(lincom,n_fields) < 1 || Q.EN(lincom,n_fields) > GD_MAX_LINCOM) {
+        _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL,
+            E->EN(lincom,n_fields), NULL);
+        break;
+      }
+
+      if (Q.EN(lincom,n_fields) != E->EN(lincom,n_fields)) {
+        modified = 1;
+        if (Q.EN(lincom,n_fields) < E->EN(lincom,n_fields))
+          for (i = Q.EN(lincom,n_fields); i < E->EN(lincom,n_fields); ++i) {
+            field_free |= 1 << i;
+            scalar_free |= 1 << i;
+            scalar_free |= 1 << (i + GD_MAX_LINCOM);
+          }
+      }
+
+      Q.comp_scal = 0;
+
+      for (i = 0; i < Q.EN(lincom,n_fields); ++i) {
+        if (flags & 0x1) {
+          j = _GD_AlterInField(D, i, Q.in_fields, N->in_fields, E->in_fields,
+              E->fragment_index, E->EN(lincom,n_fields) <= i);
+          if (j < 0)
+            break;
+          else if (j) {
+            modified = 1;
+            field_free |= 1 << i;
+          }
+        }
+
+        if (flags & 0x2) {
+          if (N->comp_scal) {
+            j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(lincom,cm)[i],
+                  N->EN(lincom,cm)[i]), GD_COMPLEX128, Q.EN(lincom,cm) + i,
+                N->EN(lincom,cm) + i, Q.scalar + i, Q.scalar_ind + i,
+                N->scalar[i], N->scalar_ind[i], E->e->calculated,
+                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);
+            gd_rs2cs_(Q.EN(lincom,cm)[i], Q.EN(lincom,m)[i]);
+          }
+
+          if (j & GD_AS_FREE_SCALAR)
+            scalar_free |= 1 << i;
+          if (j & GD_AS_MODIFIED)
+            modified = 1;
+          if (j & GD_AS_NEED_RECALC)
+            Qe.calculated = 0;
+          if (j & GD_AS_MODIFIED)
+            modified = 1;
+        }
+
+        if (flags & 0x4) {
+          if (N->comp_scal) {
+            j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(lincom,cb)[i],
+                  N->EN(lincom,cb)[i]), GD_COMPLEX128, Q.EN(lincom,cb) + i,
+                N->EN(lincom,cb) + i, Q.scalar + i + GD_MAX_LINCOM,
+                Q.scalar_ind + i + GD_MAX_LINCOM, N->scalar[i +  GD_MAX_LINCOM],
+                N->scalar_ind[i + GD_MAX_LINCOM], E->e->calculated,
+                E->fragment_index);
+            Q.EN(lincom,b)[i] = creal(Q.EN(lincom,cb)[i]);
+          } else {
+            j = _GD_AlterScalar(D, E->EN(lincom,b)[i] != N->EN(lincom,b)[i],
+                GD_FLOAT64, Q.EN(lincom,b) + i, N->EN(lincom,b) + i,
+                Q.scalar + i + GD_MAX_LINCOM, Q.scalar_ind + i + GD_MAX_LINCOM,
+                N->scalar[i + GD_MAX_LINCOM], N->scalar_ind[i + GD_MAX_LINCOM],
+                E->e->calculated, E->fragment_index);
+            gd_rs2cs_(Q.EN(lincom,cb)[i], Q.EN(lincom,b)[i]);
+          }
+
+          if (j & GD_AS_FREE_SCALAR)
+            scalar_free |= 1 << (i + GD_MAX_LINCOM);
+          if (j & GD_AS_MODIFIED)
+            modified = 1;
+          if (j & GD_AS_NEED_RECALC)
+            Qe.calculated = 0;
+          if (j & GD_AS_MODIFIED)
+            modified = 1;
+        }
+
+        if (cimag(Q.EN(lincom,cm)[i]) || cimag(Q.EN(lincom,cb)[i]))
+          Q.comp_scal = 1;
+      }
+
+      if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
+        modified = 1;
+      break;
+    case GD_LINTERP_ENTRY:
+      j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free = 1;
+      }
+
+      if (N->EN(linterp,table) != NULL && strcmp(E->EN(linterp,table),
+            N->EN(linterp,table)))
+      {
+        Q.EN(linterp,table) = _GD_Strdup(D, N->EN(linterp,table));
+        Qe.u.linterp.table_file = NULL;
+
+        if (Q.EN(linterp,table) == NULL)
+          break;
+
+        if (flags) {
+          if (E->e->u.linterp.table_file == NULL)
+            if (_GD_SetTablePath(D, E, E->e))
+              break;
+
+          if (Qe.u.linterp.table_file == NULL)
+            if (_GD_SetTablePath(D, &Q, &Qe))
+              break;
+
+          if (gd_RenameAt(D, E->e->u.linterp.table_dirfd,
+                E->e->u.linterp.table_file, Qe.u.linterp.table_dirfd,
+                Qe.u.linterp.table_file))
+          {
+            _GD_ReleaseDir(D, Qe.u.linterp.table_dirfd);
+            _GD_SetError(D, GD_E_RAW_IO, 0, E->EN(linterp,table), errno, 0);
+            break;
+          }
+        }
+
+        modified = 1;
+        free(E->EN(linterp,table));
+        free(E->e->u.linterp.table_file);
+      }
+
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      j = _GD_AlterScalar(D, N->EN(bit,numbits) >= 1 && E->EN(bit,numbits) !=
+          N->EN(bit,numbits), GD_INT_TYPE, &Q.EN(bit,numbits),
+          &N->EN(bit,numbits), Q.scalar + 1, Q.scalar_ind + 1, N->scalar[1],
+          N->scalar_ind[1], E->e->calculated, 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;
+      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);
+
+      if (j & GD_AS_ERROR)
+        break;
+      if (j & GD_AS_FREE_SCALAR)
+        scalar_free |= 1;
+      if (j & GD_AS_NEED_RECALC)
+        Qe.calculated = 0;
+      if (j & GD_AS_MODIFIED)
+        modified = 1;
+
+      j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free = 1;
+      }
+
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free = 1;
+      }
+
+      j = _GD_AlterInField(D, 1, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free |= 2;
+      }
+
+      break;
+    case GD_RECIP_ENTRY:
+      j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free = 1;
+      }
+
+      Q.comp_scal = 0;
+      if (N->comp_scal) {
+        j = _GD_AlterScalar(D, cabs(N->EN(recip,cdividend)) != 0 &&
+            !gd_ccmpc_(E->EN(recip,cdividend), N->EN(recip,cdividend)),
+            GD_COMPLEX128, &Q.EN(recip,cdividend), &(N->EN(recip,cdividend)),
+            Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0],
+            E->e->calculated, E->fragment_index);
+        Q.EN(recip,dividend) = creal(Q.EN(recip,cdividend));
+        if (cimag(Q.EN(recip,cdividend)) != 0)
+          Q.comp_scal = 1;
+      } else {
+        j = _GD_AlterScalar(D, N->EN(recip,dividend) != 0 &&
+            E->EN(recip,dividend) != N->EN(recip,dividend), GD_FLOAT64,
+            &Q.EN(recip,dividend), &(N->EN(recip,dividend)), Q.scalar,
+            Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->e->calculated,
+            E->fragment_index);
+        gd_rs2cs_(Q.EN(recip,cdividend), Q.EN(recip,dividend));
+      }
+
+      if (j & GD_AS_ERROR)
+        break;
+      if (j & GD_AS_FREE_SCALAR)
+        scalar_free = 1;
+      if (j & GD_AS_NEED_RECALC)
+        Qe.calculated = 0;
+      if (j & GD_AS_MODIFIED)
+        modified = 1;
+
+      if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
+        modified = 1;
+
+      break;
+    case GD_PHASE_ENTRY:
+      j = _GD_AlterScalar(D, E->EN(phase,shift) != N->EN(phase,shift), GD_INT64,
+          &Q.EN(phase,shift), &N->EN(phase,shift), Q.scalar, Q.scalar_ind,
+          N->scalar[0], N->scalar_ind[0], E->e->calculated, 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;
+      if (j & GD_AS_MODIFIED)
+        modified = 1;
+
+      j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free = 1;
+      }
+
+      break;
+    case GD_POLYNOM_ENTRY:
+      j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free = 1;
+      }
+
+      Q.EN(polynom,poly_ord) = (N->EN(polynom,poly_ord) == 0) ?
+        E->EN(polynom,poly_ord) : N->EN(polynom,poly_ord);
+      if (Q.EN(polynom,poly_ord) != E->EN(polynom,poly_ord))
+        modified = 1;
+
+      Q.comp_scal = 0;
+
+      if (flags & 0x1)
+        for (i = 0; i <= Q.EN(polynom,poly_ord); ++i) {
+          if (N->comp_scal) {
+            j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(polynom,ca)[i],
+                  N->EN(polynom,ca)[i]), GD_COMPLEX128, Q.EN(polynom,ca) + i,
+                N->EN(polynom,ca) + i, Q.scalar + i, Q.scalar_ind + i,
+                N->scalar[i], N->scalar_ind[i], E->e->calculated,
+                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);
+            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;
+          if (j & GD_AS_MODIFIED)
+            modified = 1;
+
+          if (cimag(Q.EN(polynom,ca)[i]))
+            Q.comp_scal = 1;
+        }
+
+      if ((Q.comp_scal && !E->comp_scal) || (!Q.comp_scal && E->comp_scal))
+        modified = 1;
+
+      break;
+    case GD_WINDOW_ENTRY:
+      if (N->EN(window,windop) == GD_WINDOP_UNK)
+        Q.EN(window,windop) = E->EN(window,windop);
+      else {
+        Q.EN(window,windop) = N->EN(window,windop);
+        modified = 1;
+      }
+
+      switch (Q.EN(window,windop)) {
+        case GD_WINDOP_EQ:
+        case GD_WINDOP_NE:
+          j = _GD_AlterScalar(D, E->EN(window,threshold.i) !=
+              N->EN(window,threshold.i), GD_INT64, &Q.EN(window,threshold.i),
+              &N->EN(window,threshold.i), Q.scalar, Q.scalar_ind, N->scalar[0],
+              N->scalar_ind[0], E->e->calculated, 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);
+          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);
+          break;
+      }
+
+      if (j & GD_AS_ERROR)
+        break;
+      if (j & GD_AS_FREE_SCALAR)
+        scalar_free |= 1;
+      if (j & GD_AS_NEED_RECALC)
+        Qe.calculated = 0;
+      if (j & GD_AS_MODIFIED)
+        modified = 1;
+
+      j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free |= 1;
+      }
+
+      j = _GD_AlterInField(D, 1, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free |= 2;
+      }
+
+      break;
+    case GD_MPLEX_ENTRY:
+      j = _GD_AlterScalar(D, N->EN(mplex,period) != -1 &&
+          E->EN(mplex,period) != N->EN(mplex,period), GD_INT_TYPE,
+          &Q.EN(mplex,period), &N->EN(mplex,period), Q.scalar + 1,
+          Q.scalar_ind + 1, N->scalar[1], N->scalar_ind[1], E->e->calculated,
+          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;
+      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);
+
+      if (j & GD_AS_ERROR)
+        break;
+      if (j & GD_AS_FREE_SCALAR)
+        scalar_free |= 1;
+      if (j & GD_AS_NEED_RECALC)
+        Qe.calculated = 0;
+      if (j & GD_AS_MODIFIED)
+        modified = 1;
+
+      j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free |= 1;
+      }
+
+      j = _GD_AlterInField(D, 1, Q.in_fields, N->in_fields, E->in_fields,
+          E->fragment_index, 0);
+      if (j < 0)
+        break;
+      else if (j) {
+        modified = 1;
+        field_free |= 2;
+      }
+
+      break;
+    case GD_CONST_ENTRY:
+      Q.EN(scalar,const_type) = (N->EN(scalar,const_type) == GD_NULL) ?
+        E->EN(scalar,const_type) : N->EN(scalar,const_type);
+
+      if (Q.EN(scalar,const_type) & 0x40 || GD_SIZE(Q.EN(scalar,const_type))
+          == 0)
+      {
+        _GD_SetError(D, GD_E_BAD_TYPE, Q.EN(scalar,const_type), NULL, 0, NULL);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      type = _GD_ConstType(D, Q.EN(scalar,const_type));
+      if (Q.EN(scalar,const_type) != E->EN(scalar,const_type))
+        modified = 1;
+
+      if (type == _GD_ConstType(D, E->EN(scalar,const_type)))
+        Qe.u.scalar.d = E->e->u.scalar.d;
+      else {
+        /* type convert */
+        Qe.u.scalar.d = _GD_Malloc(D, GD_SIZE(type));
+        if (Qe.u.scalar.d == NULL) {
+          dreturn("%i", -1);
+          return -1;
+        }
+        if (type == GD_COMPLEX128) {
+          *(double*)Qe.u.scalar.d = (E->EN(scalar,const_type) & GD_IEEE754) ?
+            *(double*)E->e->u.scalar.d : (E->EN(scalar,const_type) & GD_SIGNED)
+            ? (double)*(int64_t*)E->e->u.scalar.d
+            : (double)*(uint64_t*)E->e->u.scalar.d;
+          ((double*)Qe.u.scalar.d)[1] = 0;
+        } else if (type == GD_FLOAT64)
+          *(double*)Qe.u.scalar.d = (E->EN(scalar,const_type) & GD_COMPLEX) ?
+            *(double*)E->e->u.scalar.d : (E->EN(scalar,const_type) & GD_SIGNED)
+            ? (double)*(int64_t*)E->e->u.scalar.d
+            : (double)*(uint64_t*)E->e->u.scalar.d;
+        else if (type == GD_INT64)
+          *(int64_t*)Qe.u.scalar.d = (E->EN(scalar,const_type) & (GD_COMPLEX |
+                GD_IEEE754)) ? (int64_t)*(double*)E->e->u.scalar.d :
+            (int64_t)*(uint64_t*)E->e->u.scalar.d;
+        else
+          *(uint64_t*)Qe.u.scalar.d = (E->EN(scalar,const_type) & (GD_COMPLEX |
+                GD_IEEE754)) ? (uint64_t)*(double*)E->e->u.scalar.d :
+            (uint64_t)*(int64_t*)E->e->u.scalar.d;
+        free(E->e->u.scalar.d);
+      }
+
+      break;
+    case GD_CARRAY_ENTRY:
+      Q.EN(scalar,array_len) = (N->EN(scalar,array_len) == 0) ?
+        E->EN(scalar,array_len) : N->EN(scalar,array_len);
+
+      Q.EN(scalar,const_type) = (N->EN(scalar,const_type) == GD_NULL) ?
+        E->EN(scalar,const_type) : N->EN(scalar,const_type);
+
+      if (Q.EN(scalar,const_type) & 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));
+
+      /* copy via type conversion, if array_len has increased, trailing elements
+       * are uninitialised. */
+      n = E->EN(scalar,array_len);
+      if (n > Q.EN(scalar,array_len))
+        n = Q.EN(scalar,array_len);
+
+      _GD_ConvertType(D, E->e->u.scalar.d, _GD_ConstType(D,
+            E->EN(scalar,const_type)), Qe.u.scalar.d, type, n);
+
+      if (D->error) {
+        free(Qe.u.scalar.d);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      free(E->e->u.scalar.d);
+      break;
+    case GD_INDEX_ENTRY:
+      /* INDEX may not be modified */
+      _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_STRING_ENTRY:
+      break;
+  }
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (modified) {
+    for (i = 0; i < GD_MAX_LINCOM; ++i) {
+      if (field_free & (1 << i)) {
+        Qe.entry[i] = NULL;
+        free(E->in_fields[i]);
+      }
+    }
+
+    for (i = 0; i <= GD_MAX_POLYORD; ++i) {
+      if (scalar_free & (1 << i))
+        free(E->scalar[i]);
+    }
+
+    if (E->field_type == GD_LINTERP_ENTRY && flags)
+      _GD_ReleaseDir(D, Qe.u.linterp.table_dirfd);
+
+    memcpy(E->e, &Qe, sizeof(struct gd_private_entry_));
+    Q.e = E->e;
+    memcpy(E, &Q, sizeof(gd_entry_t));
+    D->fragment[E->fragment_index].modified = 1;
+    D->flags &= ~GD_HAVE_VERSION;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_alter_entry(DIRFILE* D, const char* field_code,
+    const gd_entry_t *entry, int move)
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", %p, %i", D, field_code, entry, move);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  /* To ensure .e is NULLed */
+  memcpy(&N, entry, sizeof(gd_entry_t));
+  N.e = NULL;
+
+  /* for these field types, move is a set of bitflags; we set them all */
+  if (N.field_type == GD_LINCOM_ENTRY || N.field_type == GD_POLYNOM_ENTRY)
+    move = 7;
+
+  ret = _GD_Change(D, field_code, &N, move);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_raw(DIRFILE *D, const char *field_code,
+    gd_type_t data_type, unsigned int spf, int move)
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", %u, 0x%X, %i", D, field_code, spf, data_type, move);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_RAW_ENTRY;
+  N.EN(raw,spf) = spf;
+  N.EN(raw,data_type) = data_type;
+  N.e = NULL;
+  N.scalar[0] = (spf == 0) ? (char *)"" : NULL;
+
+  ret = _GD_Change(D, field_code, &N, move);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_lincom(DIRFILE* D, const char* field_code, int n_fields,
+    const char** in_fields, const double* m, const double* b) gd_nothrow
+{
+  gd_entry_t N;
+  int i, ret;
+  int flags = 0;
+
+  dtrace("%p, \"%s\", %i, %p, %p, %p", D, field_code, n_fields, in_fields, m,
+      b);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  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);
+    return -1;
+  } else if (n_fields != 0)
+    N.EN(lincom,n_fields) = n_fields;
+  else {
+    gd_entry_t *E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1,
+        NULL);
+
+    if (E == NULL) {
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    N.EN(lincom,n_fields) = E->EN(lincom,n_fields);
+  }
+  N.e = NULL;
+
+  for (i = 0; i < N.EN(lincom,n_fields); ++i) {
+    if (in_fields != NULL) {
+      flags |= 1;
+      N.in_fields[i] = (char *)in_fields[i];
+    }
+
+    if (m != NULL) {
+      flags |= 2;
+      N.EN(lincom,m)[i] = m[i];
+      N.scalar[i] = NULL;
+    } else
+      N.scalar[i] = "";
+
+    if (b != NULL) {
+      flags |= 4;
+      N.EN(lincom,b)[i] = b[i];
+      N.scalar[i + GD_MAX_LINCOM] = NULL;
+    } else
+      N.scalar[i + GD_MAX_LINCOM] = "";
+  }
+
+  ret = _GD_Change(D, field_code, &N, flags);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_clincom(DIRFILE* D, const char* field_code, int n_fields,
+    const char** in_fields, const GD_DCOMPLEXP(cm), const GD_DCOMPLEXP(cb))
+  gd_nothrow
+{
+  gd_entry_t N;
+  int i, ret;
+  int flags = 0;
+
+  dtrace("%p, \"%s\", %i, %p, %p, %p", D, field_code, n_fields, in_fields, cm,
+      cb);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_LINCOM_ENTRY;
+  N.comp_scal = 1;
+  if (n_fields > GD_MAX_LINCOM || n_fields < 0) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL);
+    dreturn("%i", -1);
+    return -1;
+  } else if (n_fields != 0)
+    N.EN(lincom,n_fields) = n_fields;
+  else {
+    gd_entry_t *E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1,
+        NULL);
+
+    if (E == NULL) {
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    N.EN(lincom,n_fields) = E->EN(lincom,n_fields);
+  }
+  N.e = NULL;
+
+  for (i = 0; i < N.EN(lincom,n_fields); ++i) {
+    if (in_fields != NULL) {
+      flags |= 1;
+      N.in_fields[i] = (char *)in_fields[i];
+    }
+
+    if (cm != NULL) {
+      flags |= 2;
+      gd_ca2cs_(N.EN(lincom,cm)[i], cm, i);
+      N.scalar[i] = NULL;
+    } else
+      N.scalar[i] = "";
+
+    if (cb != NULL) {
+      flags |= 4;
+      gd_ca2cs_(N.EN(lincom,cb)[i], cb, i);
+      N.scalar[i + GD_MAX_LINCOM] = NULL;
+    } else
+      N.scalar[i + GD_MAX_LINCOM] = "";
+  }
+
+  ret = _GD_Change(D, field_code, &N, flags);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_linterp(DIRFILE* D, const char* field_code, const char* in_field,
+    const char* table, int move)
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, field_code, in_field, table,
+      move);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_LINTERP_ENTRY;
+  N.in_fields[0] = (char *)in_field;
+  N.EN(linterp,table) = (char *)table;
+  N.e = NULL;
+
+  ret = _GD_Change(D, field_code, &N, move);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_bit(DIRFILE* D, const char* field_code, const char* in_field,
+    int bitnum, int numbits) gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", %i, %i", D, field_code, in_field, bitnum,
+      numbits);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_BIT_ENTRY;
+  N.in_fields[0] = (char *)in_field;
+  N.EN(bit,bitnum) = bitnum;
+  N.EN(bit,numbits) = numbits;
+  N.e = NULL;
+  N.scalar[0] = (bitnum == -1) ? (char *)"" : NULL;
+  N.scalar[1] = (numbits == 0) ? (char *)"" : NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_sbit(DIRFILE* D, const char* field_code, const char* in_field,
+    int bitnum, int numbits) gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", %i, %i", D, field_code, in_field, bitnum,
+      numbits);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_SBIT_ENTRY;
+  N.in_fields[0] = (char *)in_field;
+  N.EN(bit,bitnum) = bitnum;
+  N.EN(bit,numbits) = numbits;
+  N.e = NULL;
+  N.scalar[0] = (bitnum == -1) ? (char *)"" : NULL;
+  N.scalar[1] = (numbits == 0) ? (char *)"" : NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_recip(DIRFILE* D, const char* field_code, const char* in_field,
+    double dividend) gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", %g", D, field_code, in_field, dividend);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_RECIP_ENTRY;
+  N.in_fields[0] = (char *)in_field;
+  N.scalar[0] = (dividend == 0) ? (char *)"" : NULL;
+  N.EN(recip,dividend) = dividend;
+  N.comp_scal = 0;
+  N.e = NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+#ifndef GD_NO_C99_API
+int gd_alter_crecip(DIRFILE* D, const char* field_code, const char* in_field,
+    double complex cdividend)
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", %g;%g", D, field_code, in_field, creal(cdividend),
+      cimag(cdividend));
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  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);
+
+  dreturn("%i", ret);
+  return ret;
+}
+#endif
+
+int gd_alter_crecip89(DIRFILE* D, const char* field_code, const char* in_field,
+    const double cdividend[2]) gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", [%g, %g]", D, field_code, in_field,
+      (cdividend == NULL) ? 0 : cdividend[0],
+      (cdividend == NULL) ? 0 : cdividend[1]);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_RECIP_ENTRY;
+  N.in_fields[0] = (char *)in_field;
+  if (cdividend == NULL) {
+    N.scalar[0] = "";
+    gd_li2cs_(N.EN(recip,cdividend), 0, 0);
+  } else {
+    N.scalar[0] = (cdividend[0] == 0 && cdividend[1] == 0) ? (char *)"" : NULL;
+    gd_ra2cs_(N.EN(recip,cdividend), cdividend);
+  }
+  N.scalar_ind[0] = 0;
+  N.comp_scal = 1;
+  N.e = NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_divide(DIRFILE* D, const char* field_code, const char* in_field1,
+    const char* in_field2) gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\"", D, field_code, in_field1, in_field2);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_DIVIDE_ENTRY;
+  N.in_fields[0] = (char *)in_field1;
+  N.in_fields[1] = (char *)in_field2;
+  N.e = NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_multiply(DIRFILE* D, const char* field_code, const char* in_field1,
+    const char* in_field2) gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\"", D, field_code, in_field1, in_field2);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  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);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_phase(DIRFILE* D, const char* field_code, const char* in_field,
+    gd_shift_t shift) gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", %lli", D, field_code, in_field, (long long)shift);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_PHASE_ENTRY;
+  N.in_fields[0] = (char *)in_field;
+  N.EN(phase,shift) = shift;
+  N.e = NULL;
+  N.scalar[0] = NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_const(DIRFILE* D, const char* field_code, gd_type_t const_type)
+  gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", 0x%X", D, field_code, const_type);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  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);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_carray(DIRFILE* D, const char* field_code, gd_type_t const_type,
+    size_t array_len) gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", 0x%X, %" PRNsize_t, D, field_code, const_type, array_len);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_CARRAY_ENTRY;
+  N.EN(scalar,const_type) = const_type;
+  N.EN(scalar,array_len) = array_len;
+  N.e = NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_polynom(DIRFILE* D, const char* field_code, int poly_ord,
+    const char* in_field, const double* a) gd_nothrow
+{
+  gd_entry_t N;
+  int i, ret;
+  int flags = 0;
+
+  dtrace("%p, \"%s\", %i, \"%s\", %p", D, field_code, poly_ord, in_field, a);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  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);
+    return -1;
+  } else if (poly_ord != 0)
+    N.EN(polynom,poly_ord) = poly_ord;
+  else {
+    gd_entry_t *E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1,
+        NULL);
+
+    if (E == NULL) {
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    N.EN(polynom,poly_ord) = E->EN(polynom,poly_ord);
+  }
+  N.in_fields[0] = (char *)in_field;
+  N.e = NULL;
+
+  if (a != NULL) {
+    flags |= 1;
+    for (i = 0; i <= N.EN(polynom,poly_ord); ++i) {
+      N.EN(polynom,a)[i] = a[i];
+      N.scalar[i] = NULL;
+    }
+  } else
+    for (i = 0; i <= N.EN(polynom,poly_ord); ++i)
+      N.scalar[i] = "";
+
+  ret = _GD_Change(D, field_code, &N, flags);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_cpolynom(DIRFILE* D, const char* field_code, int poly_ord,
+    const char* in_field, const GD_DCOMPLEXP(ca)) gd_nothrow
+{
+  gd_entry_t N;
+  int i, ret;
+  int flags = 0;
+
+  dtrace("%p, \"%s\", %i, \"%s\", %p", D, field_code, poly_ord, in_field, ca);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_POLYNOM_ENTRY;
+  N.comp_scal = 1;
+  if (poly_ord > GD_MAX_POLYORD || poly_ord < 0) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL);
+    dreturn("%i", -1);
+    return -1;
+  } else if (poly_ord != 0)
+    N.EN(polynom,poly_ord) = poly_ord;
+  else {
+    gd_entry_t *E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1,
+        NULL);
+
+    if (E == NULL) {
+      _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    N.EN(polynom,poly_ord) = E->EN(polynom,poly_ord);
+  }
+  N.in_fields[0] = (char *)in_field;
+  N.e = NULL;
+
+  if (ca != NULL)  {
+    flags |= 1;
+    for (i = 0; i <= N.EN(polynom,poly_ord); ++i) {
+      gd_ca2cs_(N.EN(polynom,ca)[i], ca, i);
+      N.scalar[i] = NULL;
+    }
+  } else
+    for (i = 0; i <= N.EN(polynom,poly_ord); ++i)
+      N.scalar[i] = "";
+
+  ret = _GD_Change(D, field_code, &N, flags);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_window(DIRFILE* D, const char *field_code, const char *in_field,
+    const char *check_field, gd_windop_t windop, gd_triplet_t threshold)
+  gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}", D, field_code,
+      in_field, check_field, windop, threshold.r,
+      (unsigned long long)threshold.u, (long long)threshold.i);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_WINDOW_ENTRY;
+  N.in_fields[0] = (char *)in_field;
+  N.in_fields[1] = (char *)check_field;
+  N.EN(window,windop) = windop;
+  N.EN(window,threshold) = threshold;
+  N.scalar[0] = NULL;
+  N.e = NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_mplex(DIRFILE* D, const char *field_code, const char *in_field,
+    const char *count_field, int count_val, int period)
+  gd_nothrow
+{
+  int ret;
+  gd_entry_t N;
+
+  dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %i", D, field_code, in_field,
+      count_field, count_val, period);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(&N, 0, sizeof(gd_entry_t));
+  N.field_type = GD_MPLEX_ENTRY;
+  N.in_fields[0] = (char *)in_field;
+  N.in_fields[1] = (char *)count_field;
+  N.EN(mplex,count_val) = count_val;
+  N.EN(mplex,period) = period;
+  N.scalar[0] = NULL;
+  N.e = NULL;
+
+  ret = _GD_Change(D, field_code, &N, 0);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_alter_spec(DIRFILE* D, const char* line, int move)
+{
+  const char *tok_pos = NULL;
+  char *outstring = NULL, *new_code;
+  char *in_cols[MAX_IN_COLS];
+  int n_cols, ret;
+  int standards = GD_DIRFILE_STANDARDS_VERSION;
+  gd_entry_t *N = NULL;
+
+  dtrace("%p, \"%s\", %i", D, line, move);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  if (~D->flags & GD_HAVE_VERSION)
+    _GD_FindVersion(D);
+
+  if (D->av)
+    standards = D->standards;
+
+  /* start parsing */
+  n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols,
+      "dirfile_alter_spec()", 0, standards, D->flags & GD_PERMISSIVE);
+
+  if (D->error) {
+    free(outstring);
+    dreturn("%i", -1); /* tokeniser threw an error */
+    return -1;
+  }
+
+  /* Sanity check */
+  if (n_cols == 0) {
+    free(outstring);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, "dirfile_alter_spec()", 0,
+        NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  N = _GD_FindField(D, in_cols[0], D->entry, D->n_entries, 1, NULL);
+
+  if (N == NULL) {
+    free(outstring);
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, in_cols[0]);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* the parser will modifiy in_cols[0] if it contains a metafield code */
+  if ((new_code = _GD_Strdup(D, in_cols[0])) == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Let the parser compose the entry */
+  N = _GD_ParseFieldSpec(D, n_cols, in_cols, NULL, "dirfile_alter_spec()", 0,
+      N->fragment_index, standards, 0, GD_PEDANTIC, 0, &outstring, tok_pos);
+
+  free(outstring);
+
+  if (D->error) {
+    free(new_code);
+    dreturn("%i", -1); /* field spec parser threw an error */
+    return -1;
+  }
+
+  /* The parser will have re-applied the prefix and suffix, undo that */
+  free(N->field);
+  N->field = new_code;
+
+  if (N->field_type == GD_LINCOM_ENTRY || N->field_type == GD_POLYNOM_ENTRY)
+    move = 7;
+
+  /* Change the entry */
+  ret = _GD_Change(D, N->field, N, move);
+
+  _GD_FreeE(D, N, 1);
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int gd_malter_spec(DIRFILE* D, const char* line, const char* parent, int move)
+{
+  char *outstring = NULL;
+  const char *tok_pos;
+  char *in_cols[MAX_IN_COLS];
+  int n_cols, ret;
+  int standards = GD_DIRFILE_STANDARDS_VERSION;
+  gd_entry_t *N = NULL;
+
+  dtrace("%p, \"%s\", \"%s\", %i", D, line, parent, move);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  N = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+  if (N == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, parent);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (~D->flags & GD_HAVE_VERSION)
+    _GD_FindVersion(D);
+
+  if (D->av)
+    standards = D->standards;
+
+  /* start parsing */
+  n_cols = _GD_Tokenise(D, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols,
+      "dirfile_malter_spec()", 0, standards, D->flags & GD_PERMISSIVE);
+
+  if (!D->error) {
+    /* Let the parser compose the entry */
+    N = _GD_ParseFieldSpec(D, n_cols, in_cols, N, "dirfile_malter_spec()", 0,
+        N->fragment_index, standards, 0, GD_PEDANTIC, 0, &outstring, tok_pos);
+
+    /* 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)))
+    {
+      sprintf(N->field, "%s/%s", parent, in_cols[0]);
+    }
+  }
+
+  free(outstring);
+
+  if (D->error) {
+    dreturn("%i", -1); /* field spec parser threw an error */
+    return -1;
+  }
+
+  if (N->field_type == GD_LINCOM_ENTRY || N->field_type == GD_POLYNOM_ENTRY)
+    move = 7;
+
+  /* Change the entry */
+  ret = _GD_Change(D, N->field, N, move);
+
+  _GD_FreeE(D, N, 1);
+
+  dreturn("%i", ret);
+  return ret;
+}
diff --git a/src/move.c b/src/move.c
new file mode 100644
index 0000000..aedeca6
--- /dev/null
+++ b/src/move.c
@@ -0,0 +1,542 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding,
+    unsigned long byte_sex, off64_t offset, int finalise, int new_fragment,
+    char* new_filebase)
+{
+  const struct encoding_t* enc_in;
+  const struct encoding_t* enc_out;
+  const size_t ns = BUFFER_SIZE / E->e->u.raw.size;
+  ssize_t nread, nwrote;
+  int subencoding = GD_ENC_UNKNOWN;
+  int i, ef_swap;
+  int arm_endianise;
+  void *buffer;
+
+  dtrace("%p, %p, %lu, %lu, %lli, %i, %i, %p", D, E, encoding, byte_sex,
+      (long long)offset, finalise, new_fragment, new_filebase);
+
+  if (new_fragment == -1)
+    new_fragment = E->fragment_index;
+
+  if (new_filebase == NULL) {
+    new_filebase = _GD_Strdup(D, E->e->u.raw.filebase);
+    if (new_filebase == NULL) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+
+  offset -= D->fragment[E->fragment_index].frame_offset;
+
+  /* Figure out the new subencoding scheme */
+  if (encoding == D->fragment[E->fragment_index].encoding &&
+      E->e->u.raw.file[0].subenc != GD_ENC_UNKNOWN)
+  {
+    subencoding = E->e->u.raw.file[0].subenc;
+  } else
+    for (i = 0; gd_ef_[i].scheme != GD_ENC_UNSUPPORTED; i++) {
+      if (gd_ef_[i].scheme == encoding) {
+        subencoding = i;
+        break;
+      }
+    }
+
+  if (subencoding == GD_ENC_UNKNOWN) {
+    _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_TARGET, NULL, 0, NULL);
+    free(new_filebase);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  enc_out = gd_ef_ + subencoding;
+
+  /* Check output encoding */
+  if (_GD_MissingFramework(subencoding, GD_EF_CLOSE | GD_EF_SEEK | GD_EF_WRITE |
+        GD_EF_SYNC))
+  {
+    _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL);
+    free(new_filebase);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* input encoding check */
+  if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK |
+        GD_EF_READ | GD_EF_UNLINK))
+  {
+    free(new_filebase);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  enc_in = gd_ef_ + E->e->u.raw.file[0].subenc;
+
+  /* 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. */
+
+  /* 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 ==
+      D->fragment[E->fragment_index].dirfd)
+  {
+    free(new_filebase);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* check data protection */
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA ||
+      D->fragment[new_fragment].protection & GD_PROTECT_DATA)
+  {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+    free(new_filebase);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Open the input file, if necessary */
+  if (_GD_InitRawIO(D, E, NULL, 0, NULL, 0, GD_FILE_READ, 0)) {
+    free(new_filebase);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Create the output file and open it. If we're changing encodings, we
+   * could write to the new file directly.  However, we use a temporary file
+   * anyway just to keep things clean. */
+  E->e->u.raw.file[1].subenc = subencoding;
+
+  if (_GD_InitRawIO(D, E, new_filebase, new_fragment, enc_out, 0,
+        GD_FILE_WRITE | GD_FILE_TEMP, ef_swap))
+  {
+    free(new_filebase);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Adjust for the change in offset */
+  if (offset < 0) { /* new offset is less, pad new file */
+    if ((*enc_in->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type),
+          GD_FILE_WRITE) == -1)
+    {
+      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+    } else
+      _GD_WriteSeek(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);
+    } else
+      _GD_WriteSeek(D, E, enc_out, 0, GD_FILE_WRITE | GD_FILE_TEMP);
+  }
+
+  if (D->error) {
+    free(new_filebase);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((buffer = _GD_Malloc(D, BUFFER_SIZE)) == NULL) {
+    free(new_filebase);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Now copy the old file to the new file */
+  for (;;) {
+    nread = (*enc_in->read)(E->e->u.raw.file, buffer, E->EN(raw,data_type),
+        ns);
+
+    if (nread < 0) {
+      _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+      break;
+    }
+
+    if (nread == 0)
+      break;
+
+    /* fix army-ness, if required */
+    if (arm_endianise)
+      _GD_ArmEndianise((uint64_t *)buffer, E->EN(raw,data_type) & GD_COMPLEX,
+          nread);
+
+    /* swap endianness, if required */
+    if (byte_sex) {
+      if (E->EN(raw,data_type) & GD_COMPLEX)
+        _GD_FixEndianness((char *)buffer, E->e->u.raw.size / 2, nread * 2);
+      else
+        _GD_FixEndianness((char *)buffer, E->e->u.raw.size, nread);
+    }
+
+    nwrote = _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);
+      break;
+    }
+  }
+
+  free(buffer);
+
+
+  if (finalise) {
+    /* Finalise the conversion: on error delete the temporary file, otherwise
+     * copy it over top of the new one. */
+    if (D->error) {
+      /* An error occurred, delete the temporary file (the old
+       * file can stay open) */
+      _GD_FiniRawIO(D, E, new_fragment, GD_FINIRAW_CLOTEMP
+          | GD_FINIRAW_DISCARD);
+    } else {
+      struct gd_raw_file_ temp;
+      memcpy(&temp, E->e->u.raw.file, sizeof(temp));
+
+      /* discard the old file */
+      _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD);
+
+      E->e->u.raw.file[0].name = NULL;
+      E->e->u.raw.file[0].subenc = subencoding;
+
+      if ((*gd_ef_[E->e->u.raw.file[0].subenc].name)(D,
+            (const char*)D->fragment[E->fragment_index].enc_data,
+            E->e->u.raw.file, new_filebase, 0, 0))
+      {
+        E->e->u.raw.file[0].name = temp.name;
+        E->e->u.raw.file[0].subenc = temp.subenc;
+      } else if (_GD_FiniRawIO(D, E, new_fragment, GD_FINIRAW_KEEP |
+            GD_FINIRAW_CLOTEMP))
+      {
+        E->e->u.raw.file[0].name = temp.name;
+        E->e->u.raw.file[0].subenc = temp.subenc;
+      } else if ((subencoding != temp.subenc || strcmp(E->e->u.raw.filebase,
+              new_filebase) || D->fragment[new_fragment].dirfd !=
+            D->fragment[E->fragment_index].dirfd) && (*enc_in->unlink)(
+              D->fragment[E->fragment_index].dirfd, &temp))
+      {
+        _GD_SetError(D, GD_E_RAW_IO, 0, temp.name, errno, NULL);
+        E->e->u.raw.file[0].name = temp.name;
+        E->e->u.raw.file[0].subenc = temp.subenc;
+      } else {
+        free(temp.name);
+        free(E->e->u.raw.filebase);
+        E->e->u.raw.filebase = new_filebase;
+      }
+    }
+  } else {
+    free(new_filebase);
+
+    /* Close both files */
+    _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DEFER);
+    _GD_FiniRawIO(D, E, new_fragment, GD_FINIRAW_DEFER | GD_FINIRAW_CLOTEMP);
+  }
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int _GD_StrCmpNull(const char *s1, const char *s2)
+{
+  int r;
+
+  dtrace("%p, %p", s1, s2);
+
+  if (s1 == NULL && s2 == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (s1 == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (s2 == NULL) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  r = strcmp(s1, s2);
+
+  dreturn("%i", r);
+  return r;
+}
+
+int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, int move_data)
+{
+  char *new_filebase, *new_code;
+  char **new_meta = NULL;
+  int i, dummy;
+
+  dtrace("%p, %p, %i, %i", D, E, new_fragment, move_data);
+
+  /* check access mode */
+  if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* check metadata protection */
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT ||
+      D->fragment[new_fragment].protection & GD_PROTECT_FORMAT)
+  {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Compose the field's new name */
+  new_filebase = _GD_MungeCode(D, NULL, D->fragment[E->fragment_index].prefix,
+      D->fragment[E->fragment_index].suffix, NULL, NULL, E->field, &dummy, 0);
+  
+  if (!new_filebase) {
+    _GD_InternalError(D); /* the prefix/suffix wasn't found */
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  new_code = _GD_MungeFromFrag(D, NULL, new_fragment, new_filebase, &dummy);
+
+  if (strcmp(new_code, E->field)) {
+    /* duplicate check */
+    if (_GD_FindField(D, new_code, D->entry, D->n_entries, 1, NULL)) {
+      _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, new_code);
+      free(new_filebase);
+      free(new_code);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    /* 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;
+      }
+    }
+  } else {
+    free(new_code);
+    new_code = NULL;
+  }
+
+  if (move_data && E->field_type == GD_RAW_ENTRY &&
+      (D->fragment[E->fragment_index].encoding !=
+       D->fragment[new_fragment].encoding ||
+       D->fragment[E->fragment_index].byte_sex !=
+       D->fragment[new_fragment].byte_sex ||
+       D->fragment[E->fragment_index].frame_offset !=
+       D->fragment[new_fragment].frame_offset ||
+       _GD_StrCmpNull(D->fragment[E->fragment_index].sname,
+         D->fragment[new_fragment].sname)))
+  {
+    if (_GD_MogrifyFile(D, E, D->fragment[new_fragment].encoding,
+          D->fragment[new_fragment].byte_sex,
+          D->fragment[new_fragment].frame_offset, 1, new_fragment,
+          new_filebase))
+    {
+      if (new_meta) {
+        for (i = 0; i < E->e->n_meta; ++i)
+          free(new_meta[i]);
+        free(new_meta);
+      }
+      free(new_code);
+      dreturn("%i", -1);
+      return -1;
+    }
+  } else
+    free(new_filebase);
+
+  /* nothing from now on may fail */
+  D->fragment[E->fragment_index].modified = 1;
+  D->fragment[new_fragment].modified = 1;
+  D->flags &= ~GD_HAVE_VERSION;
+  E->fragment_index = new_fragment;
+
+  /* update meta fields */
+  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;
+
+    /* resort */
+    qsort(D->entry, D->n_entries, sizeof(gd_entry_t*), _GD_EntryCmp);
+    qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp);
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_move(DIRFILE *D, const char *field_code, int new_fragment, int move_data)
+{
+  gd_entry_t *E;
+  int ret;
+
+  dtrace("%p, \"%s\", %i, %i", D, field_code, new_fragment, move_data);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
+
+  if (E == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (E->field_type == GD_INDEX_ENTRY) {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, "INDEX");
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (new_fragment < 0 || new_fragment >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, new_fragment, NULL);
+    dreturn("%i", -1);
+    return -1;
+  } else if (E->fragment_index == new_fragment) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  ret = _GD_Move(D, E, new_fragment, 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);
+
+  dreturn("%i", ret);
+  return ret;
+}
diff --git a/src/name.c b/src/name.c
new file mode 100644
index 0000000..b51ffa4
--- /dev/null
+++ b/src/name.c
@@ -0,0 +1,738 @@
+/* Copyright (C) 2008-2012, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#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)
+{
+  size_t len, oplen = 0, oslen = 0, nplen = 0, nslen = 0, plen = 0, mlen = 0;
+  const char *ptr, *slash;
+  char *new_code;
+
+  dtrace("%p, %p, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", %p, %i", D, P,
+      old_prefix, old_suffix, new_prefix, new_suffix, code, offset, err_ok);
+
+  if (code == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  len = strlen(code);
+
+  /* Verify the old prefix is present */
+  if (old_prefix) {
+    oplen = strlen(old_prefix);
+    if (strncmp(old_prefix, code, oplen)) {
+      /* prefix missing */
+      if (err_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;
+
+  /* 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;
+  }
+
+  /* Verify the suffix is present */
+  if (old_suffix) {
+    oslen = strlen(old_suffix);
+    if (strncmp(old_suffix, ptr + len - oslen, oslen)) {
+      /* suffix missing */
+      if (err_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;
+  }
+
+  if (new_prefix)
+    nplen = strlen(new_prefix);
+
+  if (new_suffix)
+    nslen = strlen(new_suffix);
+
+  if (P)
+    plen = strlen(P->field) + 1;
+
+  if ((new_code = (char*)_GD_Malloc(D, plen + nplen + len + nslen + mlen + 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);
+
+    strncpy(new_code + nplen, ptr, len);
+
+    if (nslen > 0)
+      strcpy(new_code + nplen + len, new_suffix);
+
+    if (slash) {
+      new_code[nplen + len + nslen] = '/';
+      strcpy(new_code + nplen + len + nslen + 1, slash);
+    }
+
+    new_code[nplen + len + nslen + mlen] = '\0';
+  }
+
+  *offset = plen;
+
+  dreturn("\"%s\" (%i)", new_code, *offset);
+  return new_code;
+}
+
+/* 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);
+
+  new_code = _GD_MungeCode(D, P, NULL, NULL, D->fragment[me].prefix,
+      D->fragment[me].suffix, code, offset, 1);
+
+  dreturn("\"%s\"", new_code);
+  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)
+{
+  int dummy;
+
+  dtrace("%p, %p, \"%s\", %i", D, P, field_code, fragment);
+
+  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));
+
+  dreturn("%i", D->error);
+  return D->error;
+}
+
+/* Check for a valid field name -- returns 1 on error */
+int _GD_ValidateField(const char* field_code, int standards, int strict,
+    int affix, int* is_dot)
+{
+  const size_t len = strlen(field_code);
+  size_t i, local_dot = 0;
+
+  dtrace("\"%s\", %i, %i, %i, %p", field_code, standards, strict, affix,
+      is_dot);
+
+  if (is_dot)
+    *is_dot = 0;
+
+  if (!affix && (field_code[0] == '\0' || (strict &&
+          ((len > 50 && standards < 5) || (len > 16 && standards < 3)))))
+  {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  for (i = 0; i < len; ++i)
+    if (field_code[i] == '/' || field_code[i] < 0x20) {
+      /* these characters are always forbidden */
+      dreturn("%i", 1);
+      return 1;
+    } else if (strict && ((standards >= 5 && (field_code[i] == '<' ||
+              field_code[i] == '>' || field_code[i] == ';' ||
+              field_code[i] == '|' || field_code[i] == '&')) ||
+          (standards == 5 && (field_code[i] == '\\' || field_code[i] == '#'))))
+    {
+      /* these characters are sometimes forbidden */
+      dreturn("%i", 1);
+      return 1;
+    } else if (field_code[i] == '.') {
+      if (affix || is_dot == NULL || (standards >= 6 && strict)) {
+        dreturn("%i", 1);
+        return 1;
+      } else
+        local_dot = 1;
+    }
+
+  if (!affix) {
+    if (strict && standards < 8)
+      if ((strcmp("FRAMEOFFSET", field_code) == 0 && standards >= 1)
+          || (strcmp("ENCODING", field_code) == 0 && standards >= 6)
+          || (strcmp("ENDIAN", field_code) == 0 && standards >= 5)
+          || (strcmp("INCLUDE", field_code) == 0 && standards >= 3)
+          || (strcmp("META", field_code) == 0 && standards >= 6)
+          || (strcmp("VERSION", field_code) == 0 && standards >= 5)
+          || (strcmp("PROTECT", field_code) == 0 && standards >= 6)
+          || (strcmp("REFERENCE", field_code) == 0 && standards >= 6))
+      {
+        dreturn("%i", 1);
+        return 1;
+      }
+
+    if (is_dot)
+      *is_dot = local_dot;
+  }
+
+  dreturn("%i", 0);
+  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
+ */
+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)
+{
+  char **ptr;
+  size_t old_len;
+
+  dtrace("%p, %p, %p, \"%s\", %p, %" PRNsize_t ", %i, %i, %i", D, T, E,
+      old_name, list, len, n, pass, *nl);
+
+  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("%p (-)", list);
+    return list;
+  }
+
+  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;
+    }
+    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;
+}
+
+/* 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)
+{
+  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;
+    }
+  } else if (T->e->entry[m] != E) {
+    dreturn("%p (-)", list);
+    return list;
+  }
+
+  if (pass == 0)
+    T->e->entry[m] = NULL;
+  else if (pass == 3) {
+    if ((ptr = (char**)_GD_Realloc(D, list, sizeof(char *) * (*nl + 1)))
+        == NULL)
+    {
+      *nl = -1;
+      dreturn("%p", list);
+      return list;
+    }
+    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;
+}
+
+static char **_GD_InvalidateConst(DIRFILE *D, const gd_entry_t *E,
+    const char *old_name, char **list, size_t len, int pass, int *nl)
+{
+  int i;
+  unsigned u;
+
+  dtrace("%p, %p, \"%s\", %p, %" PRNsize_t ", %i, %p", D, E, old_name, list,
+      len, pass, nl);
+
+  /* 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:
+          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);
+          }
+          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);
+          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);
+          /* 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);
+          break;
+        case GD_NO_ENTRY:
+        case GD_LINTERP_ENTRY:
+        case GD_MULTIPLY_ENTRY:
+        case GD_DIVIDE_ENTRY:
+        case GD_INDEX_ENTRY:
+        case GD_STRING_ENTRY:
+        case GD_CONST_ENTRY:
+        case GD_CARRAY_ENTRY:
+          break;
+      }
+    }
+
+  dreturn("%p", list);
+  return list;
+}
+
+static char **_GD_InvalidateVect(DIRFILE *D, const gd_entry_t *E,
+    const char *old_name, char **list, size_t len, int pass, int *nl)
+{
+  unsigned u;
+
+  dtrace("%p, %p, %p, %" PRNsize_t ", %i, %p", D, E, list, len, pass, nl);
+
+  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;
+  }
+
+  dreturn("%p", list);
+  return list;
+}
+
+static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name,
+    int old_dot, unsigned dot_ind, unsigned flags)
+{
+  gd_entry_t *Q;
+  char *name;
+  int dummy, new_dot;
+
+  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)) {
+    _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);
+    if (name == NULL) {
+      dreturn("%i", -1);
+      return -1;
+    }      
+    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);
+      dreturn("%i", -1);
+      return -1;
+    }
+    free(name);
+    name = _GD_Strdup(D, new_name);
+  }
+
+  if (D->error) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* Duplicate check */
+  Q = _GD_FindField(D, name, D->entry, D->n_entries, 1, NULL);
+
+  if (Q == E) {
+    free(name);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (Q != NULL) {
+    _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, name);
+    free(name);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (E->field_type == GD_RAW_ENTRY) {
+    /* Compose the new filename */
+    char *filebase = _GD_Strdup(D, new_name);
+
+    if (filebase == NULL) {
+      free(name);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    /* Close the old file */
+    if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) {
+      free(name);
+      free(filebase);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    /* 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;
+
+      /* check data protection */
+      if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA) {
+        _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0,
+            D->fragment[E->fragment_index].cname);
+        free(name);
+        free(filebase);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_MOVE)) {
+        free(name);
+        free(filebase);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      memcpy(&temp, E->e->u.raw.file, sizeof(struct gd_raw_file_));
+      temp.name = NULL;
+      if ((*gd_ef_[temp.subenc].name)(D,
+            (const char*)D->fragment[E->fragment_index].enc_data, &temp,
+            filebase, 0, 0))
+      {
+        free(name);
+        free(filebase);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      if ((*gd_ef_[temp.subenc].name)(D,
+            (const char*)D->fragment[E->fragment_index].enc_data,
+            E->e->u.raw.file, E->e->u.raw.filebase, 0, 0))
+      {
+        free(name);
+        free(filebase);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      if ((*gd_ef_[E->e->u.raw.file[0].subenc].move)(
+            D->fragment[E->fragment_index].dirfd, E->e->u.raw.file,
+            D->fragment[E->fragment_index].dirfd, temp.name))
+      {
+        _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
+        free(filebase);
+        dreturn("%i", -1);
+        return -1;
+      }
+
+      /* Nothing may fail from now on */
+
+    } else {
+      free(E->e->u.raw.file[0].name);
+      E->e->u.raw.file[0].name = NULL;
+    }
+
+    free(E->e->u.raw.filebase);
+    E->e->u.raw.filebase = filebase;
+  }
+
+  free(E->field);
+  E->field = name;
+
+  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);
+
+  /* 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;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+int gd_rename(DIRFILE *D, const char *old_code, const char *new_name,
+    unsigned flags)
+{
+  gd_entry_t *E = NULL;
+  int ret, i, nl = 0, old_dot = 0;
+  size_t len;
+  gd_entype_t type;
+  unsigned dot_ind = 0;
+  char **code_list = NULL;
+
+  dtrace("%p, \"%s\", \"%s\", 0x%X", D, old_code, new_name, flags);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  _GD_ClearError(D);
+
+  len = strlen(new_name);
+
+  /* check for a dotted field name */
+  if (D->n_dot > 0)
+    E = _GD_FindField(D, old_code, D->dot_list, D->n_dot, 0, &dot_ind);
+
+  if (E)
+    old_dot = 1;
+  else
+    E = _GD_FindField(D, old_code, D->entry, D->n_entries, 0, NULL);
+
+  if (E == NULL) {
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, old_code);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  type = E->field_type;
+
+  if (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);
+    }
+    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
new file mode 100644
index 0000000..d9da387
--- /dev/null
+++ b/src/nan.h
@@ -0,0 +1,34 @@
+/* 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
new file mode 100644
index 0000000..5116030
--- /dev/null
+++ b/src/native.c
@@ -0,0 +1,182 @@
+/* Copyright (C) 2009-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+gd_type_t _GD_NativeType(DIRFILE *restrict D, gd_entry_t *restrict E, int repr)
+{
+  gd_type_t type = GD_UNKNOWN;
+  int i;
+
+  dtrace("%p, %p, %i", D, E, repr);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    D->recurse_level--;
+    dreturn("%u", type);
+    return type;
+  }
+
+  switch(E->field_type) {
+    case GD_RAW_ENTRY:
+      type = E->EN(raw,data_type);
+      break;
+    case GD_LINCOM_ENTRY:
+      if (!E->e->calculated)
+        _GD_CalculateEntry(D, E, 1);
+
+      if (E->comp_scal) {
+        type = GD_COMPLEX128;
+        break;
+      }
+
+      type = GD_FLOAT64;
+      for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+        if (_GD_BadInput(D, E, i, 1))
+          break;
+
+        if (_GD_NativeType(D, E->e->entry[i], E->e->repr[i]) & GD_COMPLEX) {
+          type = GD_COMPLEX128;
+          break;
+        }
+      }
+      break;
+    case GD_LINTERP_ENTRY:
+      /* initialise the table, if necessary */
+      if (E->e->u.linterp.table_len < 0) {
+        _GD_ReadLinterpFile(D, E);
+        if (D->error != GD_E_OK)
+          break;
+      }
+
+      type = E->e->u.linterp.complex_table ? GD_COMPLEX128 : GD_FLOAT64;
+      break;
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1) || _GD_BadInput(D, E, 1, 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))
+        break;
+
+      type = ((_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX)
+          || E->comp_scal) ?  GD_COMPLEX128 : GD_FLOAT64;
+      break;
+    case GD_BIT_ENTRY:
+    case GD_INDEX_ENTRY:
+      type = GD_UINT64;
+      break;
+    case GD_PHASE_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1))
+        break;
+
+      type = _GD_NativeType(D, E->e->entry[0], E->e->repr[0]);
+      break;
+    case GD_POLYNOM_ENTRY:
+      if (!E->e->calculated)
+        _GD_CalculateEntry(D, E, 1);
+
+      if (E->comp_scal) {
+        type = GD_COMPLEX128;
+        break;
+      }
+
+      if (_GD_BadInput(D, E, 0, 1))
+        break;
+
+      type = (_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX) ?
+        GD_COMPLEX128 : GD_FLOAT64;
+
+      break;
+    case GD_SBIT_ENTRY:
+      type = GD_INT64;
+      break;
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+      type = E->EN(scalar,const_type);
+      break;
+    case GD_STRING_ENTRY:
+      type = GD_NULL;
+      break;
+    case GD_NO_ENTRY:
+    case GD_ALIAS_ENTRY:
+      _GD_InternalError(D);
+  }
+
+  /* representation */
+  if (repr != GD_REPR_NONE) {
+    if (type == GD_COMPLEX128)
+      type = GD_FLOAT64;
+    else if (type == GD_COMPLEX64)
+      type = GD_FLOAT32;
+  }
+
+  /* catch errors */
+  if (D->error)
+    type = GD_UNKNOWN;
+
+  D->recurse_level--;
+
+  dreturn("0x%02x", type);
+  return type;
+}
+
+gd_type_t gd_native_type(DIRFILE* D, const char* field_code_in) gd_nothrow
+{
+  gd_type_t type = GD_UNKNOWN;
+  gd_entry_t* entry;
+  int repr;
+  char* field_code;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("0x%x", GD_UNKNOWN);
+    return GD_UNKNOWN;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("0x%x", GD_UNKNOWN);
+    return GD_UNKNOWN;
+  }
+
+  type = _GD_NativeType(D, entry, repr);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  dreturn("0x%x", type);
+  return type;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/nfields.c b/src/nfields.c
new file mode 100644
index 0000000..0b35eae
--- /dev/null
+++ b/src/nfields.c
@@ -0,0 +1,149 @@
+/* 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 "internal.h"
+
+unsigned int _GD_NEntries(DIRFILE *D, struct gd_private_entry_ *p, int type,
+    unsigned int flags)
+{
+  int i;
+  unsigned int u, n = 0;
+  const int special = (type & GD_SPECIAL_ENTRY_BIT) ? type : 0;
+  const gd_entype_t ctype = (type & GD_SPECIAL_ENTRY_BIT) ? GD_NO_ENTRY :
+    (gd_entype_t)type;
+  const int hidden = (flags & GD_ENTRIES_HIDDEN);
+  const int noalias = (flags & GD_ENTRIES_NOALIAS);
+  dtrace("%p, %p, 0x%X, 0x%X", D, p, type, flags);
+
+  /* check for invalid type */
+  if (ctype && _GD_InvalidEntype(ctype)) {
+    _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_TYPE, NULL, type, NULL);
+    dreturn("%u", 0);
+    return 0;
+  }
+
+  if (p) {
+    for (i = 0; i < p->n_meta; ++i)
+      if (_GD_ListEntry(p->p.meta_entry[i], 1, hidden, noalias, special,
+            ctype))
+        n++;
+  } else {
+    for (u = 0; u < D->n_entries; ++u)
+      if (_GD_ListEntry(D->entry[u], 0, hidden, noalias, special, ctype))
+        n++;
+  }
+
+  dreturn("%u", n);
+  return n;
+}
+
+unsigned int gd_nentries(DIRFILE *D, const char *parent, int type,
+    unsigned int flags) gd_nothrow
+{
+  unsigned int n;
+  struct gd_private_entry_ *p = NULL;
+
+  dtrace("%p, \"%s\", 0x%X, 0x%X", D, parent, type, flags);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%u", 0);
+    return 0;
+  }
+
+  if (parent) {
+    gd_entry_t *P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL);
+
+    if (P == NULL || P->e->n_meta == -1) {
+      _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING,
+          NULL, 0, parent);
+      dreturn("%u", 0);
+      return 0;
+    }
+    p = P->e;
+  }
+
+  _GD_ClearError(D);
+
+  n = _GD_NEntries(D, p, type, flags);
+  dreturn("%u", n);
+  return n;
+}
+
+unsigned int gd_nfields(DIRFILE* D) gd_nothrow
+{
+  unsigned int n;
+  dtrace("%p", D);
+
+  n = gd_nentries(D, NULL, 0, 0);
+  dreturn("%u", n);
+  return n;
+}
+
+unsigned int gd_nvectors(DIRFILE* D) gd_nothrow
+{
+  unsigned int n;
+  dtrace("%p", D);
+
+  n = gd_nentries(D, NULL, GD_VECTOR_ENTRIES, 0);
+  dreturn("%u", n);
+  return n;
+}
+
+unsigned int gd_nfields_by_type(DIRFILE* D, gd_entype_t type) gd_nothrow
+{
+  unsigned int n;
+  dtrace("%p, 0x%X", D, type);
+
+  n = gd_nentries(D, NULL, type, 0);
+  dreturn("%u", n);
+  return n;
+}
+
+unsigned int gd_nmfields(DIRFILE* D, const char* parent) gd_nothrow
+{
+  unsigned int n;
+  dtrace("%p, \"%s\"", D, parent);
+
+  n = gd_nentries(D, parent, 0, 0);
+  dreturn("%u", n);
+  return n;
+}
+
+unsigned int gd_nmvectors(DIRFILE* D, const char* parent) gd_nothrow
+{
+  unsigned int n;
+  dtrace("%p, \"%s\"", D, parent);
+
+  n = gd_nentries(D, parent, GD_VECTOR_ENTRIES, 0);
+  dreturn("%u", n);
+  return n;
+}
+
+unsigned int gd_nmfields_by_type(DIRFILE* D, const char* parent,
+    gd_entype_t type) gd_nothrow
+{
+  unsigned int n;
+  dtrace("%p, \"%s\", %i", D, parent, type);
+
+  n = gd_nentries(D, parent, type, 0);
+  dreturn("%u", n);
+  return n;
+}
diff --git a/src/nframes.c b/src/nframes.c
new file mode 100644
index 0000000..d88d564
--- /dev/null
+++ b/src/nframes.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+#undef gd_nframes64
+
+off64_t gd_nframes64(DIRFILE* D)
+{
+  off64_t nf;
+
+  dtrace("%p", D);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (D->reference_field == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (!_GD_Supports(D, D->reference_field, GD_EF_NAME | GD_EF_SIZE)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if ((*gd_ef_[D->reference_field->e->u.raw.file[0].subenc].name)(D,
+        (const char*)D->fragment[D->reference_field->fragment_index].enc_data,
+        D->reference_field->e->u.raw.file,
+        D->reference_field->e->u.raw.filebase, 0, 0))
+  {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  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));
+
+  if (nf < 0) {
+    _GD_SetError(D, GD_E_RAW_IO, 0, D->reference_field->e->u.raw.file[0].name,
+        errno, NULL);
+    dreturn("%lli", 0LL);
+    return 0;
+  }
+
+  nf /= D->reference_field->EN(raw,spf);
+  nf += D->fragment[D->reference_field->fragment_index].frame_offset;
+
+  dreturn("%lli", (unsigned long long)nf);
+  return nf;
+}
+
+/* 32(ish)-bit wrapper for the 64-bit version, when needed */
+off_t gd_nframes(DIRFILE* D)
+{
+  return (off_t)gd_nframes64(D);
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/open.c b/src/open.c
new file mode 100644
index 0000000..fa03f3b
--- /dev/null
+++ b/src/open.c
@@ -0,0 +1,671 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2012, 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* crawl the directory, and delete everything */
+static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root)
+{
+  int ret, format_trunc = 0;
+  DIR* dir;
+  struct dirent *lamb, *result;
+  struct stat statbuf;
+  size_t dirent_len = offsetof(struct dirent, d_name);
+  size_t dirfile_len = strlen(dirfile);
+
+  dtrace("%p, %i, \"%s\", %i", D, dirfd, dirfile, root);
+
+#if defined(HAVE_FDOPENDIR) && !defined(GD_NO_DIR_OPEN)
+  {
+    int fd = dirfd;
+    /* only need to duplicate the fd of the root directory; otherwise this
+     * function will close the fd */
+    if (root && (fd = dup(dirfd)) == -1) {
+      _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_DIR, dirfile, errno, NULL);
+      dreturn("%i", -1);
+      return -1;
+    }
+    dir = fdopendir(fd);
+
+#ifdef HAVE_FPATHCONF
+    dirent_len += fpathconf(fd, _PC_NAME_MAX) + 1;
+#elif defined HAVE_PATHCONF
+    dirent_len += pathconf(dirfile, _PC_NAME_MAX) + 1;
+#else
+    dirent_len += FILENAME_MAX;
+#endif
+  }
+
+#else
+  dir = opendir(dirfile);
+
+#ifdef HAVE_PATHCONF
+  dirent_len += pathconf(dirfile, _PC_NAME_MAX) + 1;
+#else
+  dirent_len += FILENAME_MAX;
+#endif
+
+#endif
+
+  if (dir == NULL) {
+    _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_DIR, dirfile, errno, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((lamb = (struct dirent*)_GD_Malloc(D, dirent_len)) == NULL) {
+    closedir(dir);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  ret = _GD_ReadDir(dir, lamb, &result);
+  for (; result; ret = _GD_ReadDir(dir, lamb, &result)) {
+    char *name;
+    if (lamb->d_name[0] == '.' && lamb->d_name[1] == '\0')
+      continue; /* skip current dir */
+    else if (lamb->d_name[0] == '.' && lamb->d_name[1] == '.' &&
+        lamb->d_name[2] == '\0')
+    {
+      continue; /* skip parent dir */
+    }
+
+    name = (char *)_GD_Malloc(D, dirfile_len + strlen(lamb->d_name) + 2);
+    if (name == NULL) {
+      free(lamb);
+      closedir(dir);
+      dreturn("%i", -1);
+      return -1;
+    }
+    sprintf(name, "%s%c%s", dirfile, GD_DIRSEP, lamb->d_name);
+    if (
+#if defined(HAVE_FSTATAT) && !defined(GD_NO_DIR_OPEN)
+        fstatat(dirfd, lamb->d_name, &statbuf, AT_SYMLINK_NOFOLLOW)
+#elif HAVE_LSTAT
+        lstat(name, &statbuf)
+#else
+        stat(name, &statbuf)
+#endif
+       )
+    {
+      _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_STAT, name, errno, NULL);
+      free(name);
+      closedir(dir);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    /* check file type */
+    switch (statbuf.st_mode & S_IFMT) {
+      case S_IFREG:
+#ifdef S_IFBLK
+      case S_IFBLK:
+#endif
+#ifdef S_IFIFO
+      case S_IFIFO:
+#endif
+#ifdef S_IFCHR
+      case S_IFCHR:
+#endif
+#ifdef S_IFLNK
+      case S_IFLNK:
+#endif
+        if (root && strcmp(lamb->d_name, "format") == 0) {
+          /* don't delete the format file; we'll truncate it later */
+          format_trunc = 1;
+        } else if (
+#ifdef HAVE_UNLINKAT
+            unlinkat(dirfd, lamb->d_name, 0)
+#else
+            unlink(name)
+#endif
+            )
+        {
+          _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_UNLINK, name, errno, NULL);
+          free(lamb);
+          free(name);
+          closedir(dir);
+          dreturn("%i", -1);
+          return -1;
+        }
+        break;
+      case S_IFDIR:
+        /* descend into subdir if requested */
+        if (D->flags & GD_TRUNCSUB) {
+          int subdirfd;
+#ifdef GD_NO_DIR_OPEN
+          subdirfd = 0; /* unused */
+#else
+          if ((
+#ifdef HAVE_OPENAT
+                subdirfd = openat(dirfd, lamb->d_name, O_RDONLY)
+#else
+                subdirfd = open(name, O_RDONLY)
+#endif
+              ) < 0)
+          {
+            _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_STAT, name, errno, NULL);
+            free(lamb);
+            closedir(dir);
+            free(name);
+            dreturn("%i", -1);
+            return -1;
+          }
+#endif
+          /* descend -- this will close subdirfd */
+          _GD_TruncDir(D, subdirfd, name, 0);
+
+          /* delete */
+          if (
+#ifdef HAVE_UNLINKAT
+              unlinkat(dirfd, lamb->d_name, AT_REMOVEDIR)
+#else
+              rmdir(name)
+#endif
+             ) {
+            _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_UNLINK, name, errno, NULL);
+            free(lamb);
+            free(name);
+            closedir(dir);
+            dreturn("%i", -1);
+            return -1;
+          }
+        }
+    }
+    free(name);
+  }
+  free(lamb);
+
+  closedir(dir);
+
+  if (ret) {
+    _GD_SetError(D, GD_E_TRUNC, GD_E_TRUNC_DIR, dirfile, errno, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", format_trunc);
+  return format_trunc;
+}
+
+/* attempt to open or create a new dirfile - set error appropriately */
+static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
+    char *restrict dirfile, time_t *mtime)
+{
+  struct stat statbuf;
+  int fd = -1;
+  int format_error = 0, format_trunc = 0;
+  FILE* fp = NULL;
+
+  dtrace("%p, %i, %i, \"%s\", %p", D, dirfd, dir_error, dirfile, mtime);
+
+  /* naively try to open the format file */
+  if (dirfd < 0)
+    format_error = ENOENT;
+  else if ((fd = gd_OpenAt(D, dirfd, "format", O_RDONLY | O_BINARY, 0666)) < 0)
+  {
+    format_error = errno;
+
+    /* in the non-POSIX case, this has already been done. */
+#ifndef GD_NO_DIR_OPEN
+    /* open failed, try to stat the directory itself */
+    if (fstat(dirfd, &statbuf))
+      dir_error = errno;
+    else if (!S_ISDIR(statbuf.st_mode))
+      dir_error = ENOTDIR;
+#endif
+  } else
+    dir_error = 0;
+
+  /* First, cast out our four 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);
+    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);
+    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)) {
+    _GD_SetError(D, GD_E_EXISTS, 0, NULL, 0, NULL);
+    free(dirfile);
+    close(fd);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* If we made it here we either:
+   * 1) have no such directory, but plan to create it, or
+   * 2) have a "dirfile", i.e. the directory supplied contains a readable
+   *   file called format */
+
+  /* Truncate, if needed -- dangerous!  Truncating a dirfile deletes every
+   * regular file in the specified directory.  It does not touch subdirectories.
+   * Note that the rather lame definition of a dirfile at this point
+   * (specifically, we haven't bothered to see if the format file is parsable)
+   * could be problematic if users use GD_TRUNC cavalierly. */
+  if (D->flags & GD_TRUNC && !format_error) {
+    close(fd);
+
+    /* can't truncate a read-only dirfile */
+    if ((D->flags & GD_ACCMODE) == GD_RDONLY) {
+      _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+      free(dirfile);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    format_trunc = _GD_TruncDir(D, dirfd, dirfile, 1);
+    if (format_trunc < 0) {
+      free(dirfile);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  }
+
+  /* Create, if needed */
+  if ((D->flags & GD_CREAT && 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;
+    }
+
+    /* attempt to create the dirfile directory, if not present */
+    if (dir_error) {
+      if (mkdir(dirfile, 0777) < 0) {
+        _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_DIR, dirfile, errno, NULL);
+        free(dirfile);
+        dreturn("%p", NULL);
+        return NULL;
+      }
+
+#ifdef GD_NO_DIR_OPEN
+      /* in the non-POSIX situation, dirfd just holds the index in the
+       * directory entry */
+      dirfd = 0;
+#else
+      if ((dirfd = open(dirfile, O_RDONLY)) < 0) {
+        _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_OPEN, dirfile, errno, NULL);
+        free(dirfile);
+        dreturn("%p", NULL);
+        return NULL;
+      }
+#endif
+    }
+
+    /* create a new, empty format file, or else truncate it */
+    if ((fd = gd_OpenAt(D, dirfd, "format", O_RDWR | O_CREAT | O_BINARY |
+            (format_trunc ? O_TRUNC : O_EXCL), 0666)) < 0)
+    {
+      char *format_file = (char *)malloc(strlen(dirfile) + 8);
+      strcat(strcpy(format_file, dirfile), "/format");
+      _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, errno, NULL);
+      free(dirfile);
+      free(format_file);
+#ifndef GD_NO_DIR_OPEN
+      if (dirfd >= 0)
+        close(dirfd);
+#endif
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    /* set GD_UNENCODED if GD_AUTO_ENCODED was specified */
+    if ((D->flags & GD_ENCODING) == GD_AUTO_ENCODED)
+      D->flags = (D->flags & ~GD_ENCODING) | GD_UNENCODED;
+  }
+
+  /* associate a stream with the format file */
+  if ((fp = fdopen(fd, "rb")) == NULL) {
+    char *format_file = (char *)malloc(strlen(dirfile) + 8);
+    strcat(strcpy(format_file, dirfile), "/format");
+    _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, errno, NULL);
+    free(dirfile);
+    free(format_file);
+    close(fd);
+#ifndef GD_NO_DIR_OPEN
+      if (dirfd >= 0)
+        close(dirfd);
+#endif
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* open succeeds */
+  D->dir = (struct gd_dir_t *)malloc(sizeof(struct gd_dir_t));
+  D->dir[0].fd = dirfd;
+  D->dir[0].rc = 1;
+  D->dir[0].path = dirfile;
+  D->ndir = 1;
+
+  /* get the mtime */
+  if (fstat(fd, &statbuf) == 0)
+    *mtime = statbuf.st_mtime;
+
+  dreturn("%p", fp);
+  return fp;
+}
+
+void gd_parser_callback(DIRFILE* D, gd_parser_callback_t sehandler, void* extra)
+  gd_nothrow
+{
+  dtrace("%p, %p, %p", D, sehandler, extra);
+
+  D->sehandler = sehandler;
+  D->sehandler_extra = extra;
+
+  dreturnvoid();
+}
+
+DIRFILE* gd_invalid_dirfile(void) gd_nothrow
+{
+  DIRFILE *D;
+
+  dtracevoid();
+
+  D = (DIRFILE *)malloc(sizeof(DIRFILE));
+  if (D) {
+    memset(D, 0, sizeof(DIRFILE));
+    D->flags = GD_INVALID;
+  }
+
+  dreturn("%p", D);
+  return D;
+}
+
+/* _GD_Open: open (or, perhaps, create) and parse the specified dirfile
+*/
+DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir,
+    unsigned long flags, gd_parser_callback_t sehandler, void *extra)
+{
+  FILE *fp;
+  char *ref_name;
+  char *dirfile;
+  gd_entry_t* E;
+  int dirfd_error = 0;
+  time_t mtime = 0;
+
+#ifdef GD_NO_DIR_OPEN
+  gd_stat64_t statbuf;
+#endif
+
+  dtrace("%p, %i, \"%s\", 0x%lX, %p, %p", D, dirfd, filedir,
+      (unsigned long)flags, sehandler, extra);
+
+  errno = 0;
+
+  /* canonicalise the path to protect us against the caller chdir'ing away */
+  dirfile = _GD_CanonicalPath(NULL, filedir);
+
+#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;
+#endif
+  _GD_InitialiseFramework();
+
+  if (D == NULL)
+    D = (DIRFILE *)malloc(sizeof(DIRFILE));
+  if (D == NULL) {
+    free(dirfile);
+#ifndef GD_NO_DIR_OPEN
+    if (dirfd >= 0)
+      close(dirfd);
+#endif
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(D, 0, sizeof(DIRFILE));
+
+  /* user specified flags (used if we're forced to re-open) */
+  D->open_flags = flags;
+  /* clear GD_PERMISSIVE if it was specified along with GD_PEDANTIC */
+  if (flags & GD_PERMISSIVE && flags & GD_PEDANTIC)
+    flags &= ~GD_PERMISSIVE;
+
+  D->name = dirfile; /* temporarily store canonicalised path here */
+  D->flags = (flags | GD_INVALID) & ~GD_IGNORE_REFS;
+  D->sehandler = sehandler;
+  D->sehandler_extra = extra;
+  D->standards = GD_DIRFILE_STANDARDS_VERSION;
+  D->lookback = GD_DEFAULT_LOOKBACK;
+
+  if (dirfile == NULL) {
+    _GD_SetError(D, GD_E_RAW_IO, 0, filedir, errno, NULL);
+#ifndef GD_NO_DIR_OPEN
+    if (dirfd >= 0)
+      close(dirfd);
+#endif
+    dreturn("%p", D);
+    return D;
+  }
+
+  /* Add the INDEX entry */
+  D->n_entries = 1;
+
+  D->entry = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*));
+  if (D->entry)
+    D->entry[0] = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+
+  if (D->error) {
+    free(dirfile);
+#ifndef GD_NO_DIR_OPEN
+    if (dirfd >= 0)
+      close(dirfd);
+#endif
+    dreturn("%p", D);
+    return D;
+  }
+
+  memset(D->entry[0], 0, sizeof(gd_entry_t));
+  D->entry[0]->field_type = GD_INDEX_ENTRY;
+  D->entry[0]->e =
+    (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_));
+  D->entry[0]->field = _GD_Strdup(D, "INDEX");
+  if (D->error) {
+    free(dirfile);
+#ifndef GD_NO_DIR_OPEN
+    close(dirfd);
+#endif
+    dreturn("%p", D);
+    return D;
+  }
+  memset(D->entry[0]->e, 0, sizeof(struct gd_private_entry_));
+  D->entry[0]->e->calculated = 1;
+
+  /* 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);
+#endif
+    D->name = NULL; /* so a subsequent gd_discard() doesn't go awry. */
+    dreturn("%p", D);
+    return D; /* errors have already been set */
+  }
+
+  /* remember back when we temporarily stored the canonicalised path here?
+   * We're over that.  Remember the dirfile's name.  */
+  D->name = strdup(filedir);
+
+  if (D->name == NULL) {
+    fclose(fp);
+    _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+    dreturn("%p", D);
+    return D;
+  }
+
+  /* Parse the file.  This will take care of any necessary inclusions */
+  D->n_fragment = 1;
+
+  D->fragment = (struct gd_fragment_t *)_GD_Malloc(D,
+      sizeof(struct gd_fragment_t));
+  if (D->error) {
+    dreturn("%p", D);
+    return D;
+  }
+
+  D->fragment[0].cname = _GD_CanonicalPath(dirfile, "format");
+  if (D->fragment[0].cname == NULL) {
+    if (errno == ENOMEM)
+      _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+    else
+      _GD_SetError(D, GD_E_OPEN, GD_E_OPEN_PATH, dirfile, 0, NULL);
+  }
+
+  D->fragment[0].bname = _GD_Strdup(D, "format");
+
+  if (D->error) {
+    dreturn("%p", D);
+    return D;
+  }
+  D->fragment[0].sname = NULL;
+  /* The root format file needs no external name */
+  D->fragment[0].ename = NULL;
+  D->fragment[0].enc_data = NULL;
+  D->fragment[0].modified = 0;
+  D->fragment[0].parent = -1;
+  D->fragment[0].dirfd = D->dir[0].fd;
+  D->fragment[0].encoding = D->flags & GD_ENCODING;
+  D->fragment[0].byte_sex = (
+#ifdef WORDS_BIGENDIAN
+      (D->flags & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN
+#else
+      (D->flags & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN
+#endif
+      ) | (D->flags & GD_ARM_FLAG);
+  D->fragment[0].ref_name = NULL;
+  D->fragment[0].frame_offset = 0;
+  D->fragment[0].mtime = mtime;
+  D->fragment[0].protection = GD_PROTECT_NONE;
+  D->fragment[0].vers = (flags & GD_PEDANTIC) ? GD_DIRFILE_STANDARDS_VERSION :
+    0;
+  D->fragment[0].suffix = D->fragment[0].prefix = NULL;
+
+  ref_name = _GD_ParseFragment(fp, D, 0, &D->standards, &D->flags, 1);
+  fclose(fp);
+
+  if (D->error != GD_E_OK) {
+    dreturn("%p", D);
+    return D;
+  }
+
+  /* Find the reference field */
+  if (ref_name != NULL) {
+    E = _GD_FindField(D, ref_name, D->entry, D->n_entries, 1, NULL);
+    if (E == NULL)
+      _GD_SetError(D, GD_E_BAD_REFERENCE, GD_E_REFERENCE_CODE, NULL, 0,
+          ref_name);
+    else if (E->field_type != GD_RAW_ENTRY)
+      _GD_SetError(D, GD_E_BAD_REFERENCE, GD_E_REFERENCE_TYPE, NULL, 0,
+          ref_name);
+    else
+      D->reference_field = E;
+    free(ref_name);
+  }
+
+  /* Success! Clear invalid bit */
+  if (D->error == GD_E_OK)
+    D->flags &= ~GD_INVALID;
+
+  /* if GD_PEDANTIC is not set or GD_MULTISTANDARD is set, we don't know which
+   * version this conforms to; try to figure it out. */
+  if (!D->error && (!(D->flags & GD_PEDANTIC) || D->flags & GD_MULTISTANDARD)) {
+    if (_GD_FindVersion(D)) {
+      /* conforms to some standard, use the latest */
+      gd_dirfile_standards(D, GD_VERSION_LATEST); /* can't fail */
+      D->flags &= ~GD_PERMISSIVE;
+    } else
+      /* non-conformant dirfile, flag it */
+      D->flags |= GD_PERMISSIVE;
+  } else
+    D->flags &= ~GD_PERMISSIVE;
+
+  dreturn("%p", D);
+  return D;
+}
+
+DIRFILE *gd_cbopen(const char* filedir, unsigned long flags,
+    gd_parser_callback_t sehandler, void* extra)
+{
+  DIRFILE *D;
+
+  dtrace("\"%s\", 0x%lX, %p, %p", filedir, (unsigned long)flags, sehandler,
+      extra);
+
+  D = _GD_Open(NULL, -1, filedir, flags, sehandler, extra);
+
+  dreturn("%p", D);
+  return D;
+}
+
+DIRFILE* gd_open(const char* filedir, unsigned long flags)
+{
+  DIRFILE *D;
+
+  dtrace("\"%s\", 0x%lX", filedir, (unsigned long)flags);
+
+  D = _GD_Open(NULL, -1, filedir, flags, NULL, NULL);
+
+  dreturn("%p", D);
+  return D;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/parse.c b/src/parse.c
new file mode 100644
index 0000000..92fa322
--- /dev/null
+++ b/src/parse.c
@@ -0,0 +1,2444 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+static gd_type_t _GD_RawType(const char* type, int standards, int pedantic)
+{
+  gd_type_t t = GD_UNKNOWN;;
+  dtrace("\"%s\", %i, %i", type, standards, pedantic);
+
+  /* for backwards compatibility */
+  if (strlen(type) == 1 && (!pedantic || standards < 8))
+    t = _GD_LegacyType(type[0]);
+  else if (pedantic && standards < 5)
+    t = GD_UNKNOWN;
+
+  else if (strcmp(type, "NULL") == 0)
+    t = GD_NULL;
+  else if (strcmp(type, "INT8") == 0)
+    t = GD_INT8;
+  else if (strcmp(type, "UINT8") == 0)
+    t = GD_UINT8;
+  else if (strcmp(type, "INT16") == 0)
+    t = GD_INT16;
+  else if (strcmp(type, "INT32") == 0)
+    t = GD_INT32;
+  else if (strcmp(type, "UINT32") == 0)
+    t = GD_UINT32;
+  else if (strcmp(type, "UINT64") == 0)
+    t = GD_UINT64;
+  else if (strcmp(type, "INT64") == 0)
+    t = GD_INT64;
+  else if (strcmp(type, "UINT16") == 0)
+    t = GD_UINT16;
+  else if (strcmp(type, "FLOAT32") == 0)
+    t = GD_FLOAT32;
+  else if (strcmp(type, "FLOAT") == 0)
+    t = GD_FLOAT32;
+  else if (strcmp(type, "FLOAT64") == 0)
+    t = GD_FLOAT64;
+  else if (strcmp(type, "DOUBLE") == 0)
+    t = GD_FLOAT64;
+  else if (pedantic && standards < 7)
+    t = GD_UNKNOWN;
+
+  else if (strcmp(type, "COMPLEX64") == 0)
+    t = GD_COMPLEX64;
+  else if (strcmp(type, "COMPLEX128") == 0)
+    t = GD_COMPLEX128;
+
+  dreturn("0x%X", t);
+  return t;
+}
+
+static gd_windop_t _GD_WindOp(const char *op)
+{
+  gd_windop_t o = GD_WINDOP_UNK;
+  dtrace("\"%s\"", op);
+
+  switch (op[0]) {
+    case 'E':
+      if (op[1] == 'Q')
+        o = GD_WINDOP_EQ;
+      break;
+    case 'L':
+      if (op[1] == 'T')
+        o = GD_WINDOP_LT;
+      else if (op[1] == 'E')
+        o = GD_WINDOP_LE;
+      break;
+    case 'G':
+      if (op[1] == 'T')
+        o = GD_WINDOP_GT;
+      else if (op[1] == 'E')
+        o = GD_WINDOP_GE;
+      break;
+    case 'N':
+      if (op[1] == 'E')
+        o = GD_WINDOP_NE;
+      break;
+    case 'S':
+      if (op[1] == 'E' && op[2] == 'T')
+        o = GD_WINDOP_SET;
+      break;
+    case 'C':
+      if (op[1] == 'L' && op[2] == 'R')
+        o = GD_WINDOP_CLR;
+      break;
+  }
+
+  dreturn("%i", o);
+  return o;
+}
+
+/* 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)
+{
+  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;
+
+    /* there were trailing characters in the double or real part of complex */
+    if (ptr != semicolon) {
+      ptr = _GD_Strdup(D, token);
+      if (ptr == NULL) {
+        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;
+      }
+
+      i = gd_strtod(semicolon + 1, &ptr);
+
+      /* there were trailing characters in the imaginary part of complex -- this
+       * can't be a valid field name, since ; is prohibited */
+      if (*ptr != '\0') {
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+            token);
+        dreturn("%p", NULL);
+        return NULL;
+      }
+
+      *comp_scal = 1;
+    }
+
+    if (type == GD_COMPLEX128) {
+      *(double *)data = d;
+      *((double *)data + 1) = i;
+    } else if (type == GD_COMPLEX64) {
+      *(float *)data = (float)d;
+      *((float *)data + 1) = (float)i;
+    } else if (type == GD_FLOAT64)
+      *(double *)data = d;
+    else if (type == GD_FLOAT32)
+      *(float *)data = (float)d;
+    else
+      _GD_InternalError(D);
+  } else if (type & GD_SIGNED) {
+    /* try to convert to long long int */
+    long long int lli = gd_strtoll(token, &ptr,
+        (!pedantic || standards >= 9) ? 0 : 10);
+
+    /* there were trailing characters in the long long int */
+    if (*ptr != '\0') {
+      ptr = _GD_MungeFromFrag(D, NULL, me, token, &dummy);
+      if (D->error) {
+        dreturn("%p", NULL);
+        return NULL;
+      }
+      goto carray_check;
+    }
+
+    if (type == GD_INT64)
+      *(int64_t *)data = (int64_t)lli;
+    else if (type == GD_INT32)
+      *(int32_t *)data = (int32_t)lli;
+    else if (type == GD_INT16)
+      *(int16_t *)data = (int16_t)lli;
+    else if (type == GD_INT8)
+      *(int8_t *)data = (int8_t)lli;
+    else
+      _GD_InternalError(D);
+  } else {
+    /* try to convert to unsigned long long int */
+    unsigned long long int ulli = gd_strtoull(token, &ptr,
+        (!pedantic || standards >= 9) ? 0 : 10);
+
+    /* there were trailing characters in the unsigned long long int */
+    if (*ptr != '\0') {
+      ptr = _GD_MungeFromFrag(D, NULL, me, token, &dummy);
+      if (D->error) {
+        dreturn("%p", NULL);
+        return NULL;
+      }
+      goto carray_check;
+    }
+
+    if (type == GD_UINT64)
+      *(uint64_t *)data = (uint64_t)ulli;
+    else if (type == GD_UINT32)
+      *(uint32_t *)data = (uint32_t)ulli;
+    else if (type == GD_UINT16)
+      *(uint16_t *)data = (uint16_t)ulli;
+    else if (type == GD_UINT8)
+      *(uint8_t *)data = (uint8_t)ulli;
+    else
+      _GD_InternalError(D);
+  }
+
+  dreturn("%p", NULL);
+  return NULL;
+
+carray_check:
+  /* look for a < delimeter */
+  *index = -1;
+  for (lt = ptr; *lt; ++lt)
+    if (*lt == '<') {
+      *lt = '\0';
+      *index = atoi(lt + 1);
+      break;
+    }
+
+  dreturn("\"%s\" (%i)", ptr, *index);
+  return ptr;
+}
+
+/* _GD_ParseRaw: parse a RAW entry in the format file
+*/
+static gd_entry_t *_GD_ParseRaw(DIRFILE *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;
+  }
+
+  /* META RAW fields are prohibited */
+  if (parent != NULL) {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_METARAW, format_file, line, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E, 0, sizeof(gd_entry_t));
+
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL) {
+    free(E);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+
+  E->field_type = GD_RAW_ENTRY;
+  E->e->u.raw.file[0].idata = E->e->u.raw.file[1].idata = -1;
+  E->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN; /* don't know the encoding
+                                                    subscheme yet */
+
+  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);
+    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->e->u.raw.size = GD_SIZE(E->EN(raw,data_type));
+
+  if (E->e->u.raw.size == 0 || E->EN(raw,data_type) & 0x40)
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, format_file, line,
+        in_cols[2]);
+  else if ((E->scalar[0] = _GD_SetScalar(D, in_cols[3], &E->EN(raw,spf),
+          GD_UINT_TYPE, me, format_file, line, E->scalar_ind, NULL, standards,
+          pedantic)) == NULL)
+  {
+    E->e->calculated = 1;
+    if (E->EN(raw,spf) <= 0)
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_SPF, format_file, line,
+          in_cols[3]);
+  }
+
+  if (D->error != GD_E_OK) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParseLincom: parse a LINCOM entry in the format file.
+*/
+static gd_entry_t *_GD_ParseLincom(DIRFILE *restrict D,
+    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)
+{
+  int i, offset;
+  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);
+
+  if (n_cols < 3) {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E, 0, sizeof(gd_entry_t));
+
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL) {
+    free(E);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+
+  E->field_type = GD_LINCOM_ENTRY;
+
+  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->e->calculated = 1;
+  E->EN(lincom,n_fields) = (int)(strtol(in_cols[2], &ptr, 10));
+  if (*ptr != '\0') {
+    E->EN(lincom,n_fields) = (n_cols - 2) / 3;
+    /* assume <n> has been omitted */
+    if (n_cols % 3 != 2 || E->EN(lincom,n_fields) < 1 || E->EN(lincom,n_fields)
+        > GD_MAX_LINCOM)
+    {
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+      _GD_FreeE(D, E, 1);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+    /* the following two statements are somewhat hacky.... */
+    n_cols++;
+    in_cols--;
+  }
+
+  if ((E->EN(lincom,n_fields) < 1) || (E->EN(lincom,n_fields) >
+        GD_MAX_LINCOM))
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_FIELDS, format_file, line,
+        in_cols[2]);
+  else if (n_cols < E->EN(lincom,n_fields) * 3 + 3)
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+  else
+    for (i = 0; i < E->EN(lincom,n_fields); i++) {
+      E->in_fields[i] = _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->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->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
+
+      if (E->scalar[i] != NULL || E->scalar[i + GD_MAX_LINCOM] != NULL)
+        E->e->calculated = 0;
+    }
+
+  if (D->error != GD_E_OK) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParseLinterp: parse a LINTERP entry in the format file.
+*/
+static gd_entry_t *_GD_ParseLinterp(DIRFILE *restrict D,
+    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_LINTERP_ENTRY;
+  E->in_fields[0] = NULL;
+  E->e->entry[0] = NULL;
+  E->e->calculated = 1;
+  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);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
+  E->e->u.linterp.table_len = -1; /* linterp file not read yet */
+
+  E->EN(linterp,table) = _GD_Strdup(D, in_cols[3]);
+
+  if (D->error) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParseMultiply: parse MULTIPLY entry in format file.
+*/
+static gd_entry_t *_GD_ParseMultiply(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_MULTIPLY_ENTRY;
+  E->in_fields[0] = E->in_fields[1] = NULL;
+  E->e->entry[0] = E->e->entry[1] = NULL;
+  E->e->calculated = 1;
+
+  E->field = _GD_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);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParseRecip: parse RECIP entry in format file.
+*/
+static gd_entry_t *_GD_ParseRecip(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_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);
+    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(recip,cdividend),
+      GD_COMPLEX128, me, format_file, line, E->scalar_ind, &E->comp_scal,
+      standards, pedantic);
+  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);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParseWindow: parse WINDOW entry in format file.
+*/
+static gd_entry_t *_GD_ParseWindow(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 < 6) {
+    _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_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);
+    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->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,
+        in_cols[4]);
+    _GD_FreeE(D, E, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  switch (E->EN(window,windop)) {
+    case GD_WINDOP_EQ:
+    case GD_WINDOP_NE:
+      E->scalar[0] = _GD_SetScalar(D, in_cols[5], &E->EN(window,threshold.i),
+          GD_INT64, me, format_file, line, E->scalar_ind, NULL, standards,
+          pedantic);
+      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);
+      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);
+      break;
+  }
+
+  if (D->error != GD_E_OK) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParseMplex: parse MPLEX entry in format file.
+*/
+static gd_entry_t *_GD_ParseMplex(DIRFILE *restrict D,
+    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 < 5) {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E, 0, sizeof(gd_entry_t));
+
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL) {
+    free(E);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+
+  E->field_type = GD_MPLEX_ENTRY;
+
+  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);
+
+  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);
+
+  /* the count max, 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);
+    if (E->scalar[1] == NULL && E->EN(mplex,period) < 0)
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_MPLEXVAL, format_file, line,
+        in_cols[5]);
+  }
+
+  if (D->error != GD_E_OK) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  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,
+    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, %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);
+
+  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 = (is_signed) ? GD_SBIT_ENTRY : GD_BIT_ENTRY;
+  E->in_fields[0] = NULL;
+  E->e->entry[0] = NULL;
+  E->e->calculated = 1;
+
+  E->field = _GD_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->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);
+
+  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);
+  else
+    E->EN(bit,numbits) = 1;
+
+  if (E->scalar[0] != NULL || E->scalar[1] != NULL)
+    E->e->calculated = 0;
+
+  if (E->scalar[1] == NULL && E->EN(bit,numbits) < 1)
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NUMBITS, format_file, line, NULL);
+  else if (E->scalar[0] == NULL && E->EN(bit,bitnum) < 0)
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITNUM, format_file, line, NULL);
+  else if (E->e->calculated && E->EN(bit,bitnum) + E->EN(bit,numbits) - 1 > 63)
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITSIZE, format_file, line, NULL);
+
+  if (D->error != GD_E_OK) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParsePhase: parse PHASE entry in formats file.
+*/
+static gd_entry_t *_GD_ParsePhase(DIRFILE *restrict D,
+    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_PHASE_ENTRY;
+  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);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
+
+  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)
+  {
+    E->e->calculated = 1;
+  }
+
+  if (D->error != GD_E_OK) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParsePolynom: parse a POLYNOM in the format file.
+*/
+static gd_entry_t *_GD_ParsePolynom(DIRFILE *restrict D,
+    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)
+{
+  int i, offset;
+  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);
+
+  if (n_cols < 5) {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E, 0, sizeof(gd_entry_t));
+
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL) {
+    free(E);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+
+  E->field_type = GD_POLYNOM_ENTRY;
+  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->EN(polynom,poly_ord) = n_cols - 4;
+
+  /* the legacy ignore-trailing-tokens "feature" */
+  if (E->EN(polynom,poly_ord) > GD_MAX_POLYORD)
+    E->EN(polynom,poly_ord) = GD_MAX_POLYORD;
+
+  E->e->calculated = 1;
+
+  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, in_cols[2], &offset);
+
+  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->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]);
+
+    if (E->scalar[i] != NULL)
+      E->e->calculated = 0;
+  }
+
+  if (D->error != GD_E_OK) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+gd_type_t _GD_ConstType(DIRFILE *D, gd_type_t type)
+{
+  dtrace("%p, 0x%X", D, type);
+
+  switch (type) {
+    case GD_UINT8:
+    case GD_UINT16:
+    case GD_UINT32:
+    case GD_UINT64:
+      dreturn("0x%X", GD_UINT64);
+      return GD_UINT64;
+    case GD_INT8:
+    case GD_INT16:
+    case GD_INT32:
+    case GD_INT64:
+      dreturn("0x%X", GD_INT64);
+      return GD_INT64;
+    case GD_FLOAT32:
+    case GD_FLOAT64:
+      dreturn("0x%X", GD_FLOAT64);
+      return GD_FLOAT64;
+    case GD_COMPLEX64:
+    case GD_COMPLEX128:
+      dreturn("0x%X", GD_COMPLEX128);
+      return GD_COMPLEX128;
+    case GD_NULL:
+    case GD_UNKNOWN:
+      _GD_InternalError(D);
+  }
+
+  dreturn("0x%X", GD_NULL);
+  return GD_NULL;
+}
+
+/* _GD_ParseConst: parse CONST entry in formats file.
+*/
+static gd_entry_t *_GD_ParseConst(DIRFILE *restrict D,
+    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)
+{
+  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);
+
+  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_CONST_ENTRY;
+  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]);
+    _GD_FreeE(D, E, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E->EN(scalar,const_type) = _GD_RawType(in_cols[2], standards, pedantic);
+  E->EN(scalar,array_len) = -1;
+
+  if (GD_SIZE(E->EN(scalar,const_type)) == 0 || E->EN(scalar,const_type) & 0x40)
+  {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, format_file, line,
+        in_cols[2]);
+    _GD_FreeE(D, E, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  type = _GD_ConstType(D, E->EN(scalar,const_type));
+  E->e->u.scalar.d = _GD_Malloc(D, GD_SIZE(type));
+
+  if (D->error) {
+    _GD_FreeE(D, E, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  ptr = _GD_SetScalar(D, in_cols[3], E->e->u.scalar.d, type, me, format_file,
+      line, &offset, &offset, standards, pedantic);
+  if (ptr) {
+    free(ptr);
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+        in_cols[3]);
+  }
+
+  if (D->error) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParseCarray: parse CARRAY 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)
+{
+  int offset;
+  int c, first, new_z, s, z;
+  size_t n;
+  gd_type_t t;
+  char* ptr;
+  void *data;
+  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,
+      outstring, tok_pos);
+
+  if (n_cols < 4) {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E, 0, sizeof(gd_entry_t));
+
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL) {
+    free(E);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+
+  E->field_type = GD_CARRAY_ENTRY;
+  E->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]);
+    _GD_FreeE(D, E, 1);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E->EN(scalar,const_type) = _GD_RawType(in_cols[2], standards, pedantic);
+
+  if (GD_SIZE(E->EN(scalar,const_type)) == 0 || E->EN(raw,data_type) & 0x40) {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, format_file, line,
+        in_cols[2]);
+  }
+
+  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);
+
+  for (;;) {
+    if (z < new_z) {
+      void *new_data = (char *)_GD_Realloc(D, data, new_z * s);
+      if (new_data == NULL) {
+        free(data);
+        _GD_FreeE(D, E, 1);
+        dreturn("%p", NULL);
+        return NULL;
+      }
+      data = new_data;
+      z = new_z;
+    }
+
+    for (c = first; c < n_cols; ++c) {
+      ptr = _GD_SetScalar(D, in_cols[c], (char *)data + s * n++, t, me,
+          format_file, line, &offset, &offset, standards, pedantic);
+
+      if (ptr) {
+        free(ptr);
+        free(data);
+        _GD_FreeE(D, E, 1);
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, format_file, line,
+            in_cols[c]);
+        dreturn("%p", NULL);
+        return NULL;
+      }
+
+      if (n == GD_MAX_CARRAY_LENGTH)
+        break;
+    }
+
+    if (n_cols < MAX_IN_COLS)
+      break;
+
+    /* 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);
+    if (n_cols == 0 || D->error)
+      break;
+    first = 0;
+    new_z = z + n_cols;
+  }
+  /* save the list */
+  E->e->u.scalar.d = data;
+  E->EN(scalar,array_len) = n;
+
+  if (D->error) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+/* _GD_ParseString: parse STRING entry in formats file.
+*/
+static gd_entry_t *_GD_ParseString(DIRFILE *restrict D,
+    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 < 3) {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, line, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL) {
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E, 0, sizeof(gd_entry_t));
+
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL) {
+    free(E);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+
+  E->field_type = GD_STRING_ENTRY;
+  E->e->u.string = _GD_Strdup(D, in_cols[2]);
+  E->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]);
+  }
+
+  if (D->error) {
+    _GD_FreeE(D, E, 1);
+    E = NULL;
+  }
+
+  dreturn("%p", E);
+  return E;
+}
+
+static int _GD_UTF8Encode(DIRFILE *restrict D, const char *restrict format_file,
+    int linenum, char **restrict op, uint32_t value)
+{
+  dtrace("%p, %p, %llx", D, op, (long long)value);
+
+  if (value > 0x10FFFF || value == 0) {
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, format_file, linenum,
+        NULL);
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  if (value <= 0x7F)
+    *((*op)++) = (char)value;
+  else if (value <= 0x7FF) {
+    *((*op)++) = (char)(0xC0 + (value >> 6));
+    *((*op)++) = (char)(0x80 + (value & 0x3F));
+  } else if (value <= 0xFFFF) {
+    *((*op)++) = (char)(0xE0 + (value >> 12));
+    *((*op)++) = (char)(0x80 + ((value >> 6) & 0x3F));
+    *((*op)++) = (char)(0x80 + (value & 0x3F));
+  } else {
+    *((*op)++) = (char)(0xF0 + (value >> 18));
+    *((*op)++) = (char)(0x80 + ((value >> 12) & 0x3F));
+    *((*op)++) = (char)(0x80 + ((value >> 6) & 0x3F));
+    *((*op)++) = (char)(0x80 + (value & 0x3F));
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* _GD_CheckParent: look for a slashed field name and, if found, see if the
+ * parent exists in the current fragment.  Returns parent entry on success,
+ * and points *name to the metaname part.  me == -1 implies we're not in the
+ * parser, but called from _GD_Add.
+ */
+gd_entry_t *_GD_CheckParent(DIRFILE *restrict D, char **restrict name, int me,
+    int linenum)
+{
+  int dummy;
+  char *cptr, *munged_code;
+  gd_entry_t *P = NULL;
+
+  dtrace("%p, \"%s\", %i, %i", D, *name, me, linenum);
+
+  for (cptr = *name + 1; *cptr != '\0'; ++cptr)
+    if (*cptr == '/') {
+      *cptr = '\0';
+      if (me == -1)
+        munged_code = strdup(*name);
+      else
+        munged_code = _GD_MungeFromFrag(D, NULL, me, *name, &dummy);
+      if (munged_code) {
+        P = _GD_FindField(D, munged_code, D->entry, D->n_entries, 0, NULL);
+        free(munged_code);
+      }
+      if (P == NULL) {
+        if (me == -1) {
+          *cptr = '/'; /* undo field munging; _GD_Add will conclude this is
+                          a field with an illegal '/' */
+          dreturn("%p", NULL);
+          return NULL;
+        }
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD,
+            D->fragment[me].cname, linenum, *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);
+      } else if (P->fragment_index != me && me != -1)
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION,
+            D->fragment[me].cname, linenum, *name);
+
+      if (D->error) {
+        dreturn("%p", NULL);
+        return NULL;
+      }
+
+      /* point name to the metafield name */
+      *name = cptr + 1;
+      break;
+    }
+
+  dreturn("%p", P);
+  return P;
+}
+
+/* _GD_ParseFieldSpec: Parse a format file line fragment containing a field
+ * specification */
+gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict D, 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,
+    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);
+
+  /* Check for barth-style metafield definition */
+  if (P == NULL && (!pedantic || standards >= 7)) {
+    P = _GD_CheckParent(D, in_cols + 0, me, linenum);
+    if (P) {
+      if (n_cols < 2)
+        _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
+            linenum, NULL);
+      else
+        E = _GD_ParseFieldSpec(D, n_cols, in_cols, P, D->fragment[me].cname,
+            linenum, me, standards, creat, flags, insert, outstring, tok_pos);
+      dreturn("%p", (!insert) ? E : NULL);
+      return (!insert) ? E : NULL;
+    }
+  }
+
+  ptr = _GD_Realloc(D, D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*));
+  if (ptr == NULL) {
+    dreturn ("%p", NULL);
+    return NULL;
+  }
+  D->entry = (gd_entry_t **)ptr;
+
+  if (n_cols < 2)
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, format_file, linenum,
+        NULL);
+  else if (P == NULL && (strcmp(in_cols[0], "INDEX") == 0 || (pedantic &&
+          standards < 6 && strcmp(in_cols[0], "FILEFRAM") == 0)))
+    /* reserved field name */
+    _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_RES_NAME, format_file, linenum,
+        NULL);
+  else if (strcmp(in_cols[1], "RAW") == 0) {
+    E = _GD_ParseRaw(D, in_cols, n_cols, P, 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);
+    }
+
+    /* 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);
+
+  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);
+      _GD_FreeE(D, E, 1);
+      dreturn("%p", NULL);
+      return NULL;
+    }
+
+    if (is_dot) {
+      ptr = _GD_Realloc(D, D->dot_list, (D->n_dot + 1) * sizeof(gd_entry_t*));
+      if (ptr == NULL) {
+        _GD_FreeE(D, E, 1);
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+      D->dot_list = (gd_entry_t **)ptr;
+    }
+
+    /* Initialse the meta counts */
+    if (P != NULL) {
+      E->e->n_meta = -1;
+      E->e->p.parent = P;
+      /* there is no need to sort this list */
+      ptr = _GD_Realloc(D, P->e->p.meta_entry, (P->e->n_meta + 1) *
+          sizeof(gd_entry_t*));
+      if (ptr == NULL) {
+        _GD_FreeE(D, E, 1);
+        dreturn ("%p", NULL);
+        return NULL;
+      }
+      P->e->p.meta_entry = (gd_entry_t **)ptr;
+      P->e->p.meta_entry[P->e->n_meta++] = E;
+    }
+
+    /* update the dot list if necessary */
+    if (is_dot) {
+      D->dot_list[D->n_dot++] = E;
+      qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp);
+    }
+
+    /* sort */
+    _GD_InsertSort(D, E, u);
+    D->n_entries++;
+  }
+
+  /* return the entry object if we either:
+   * - didn't insert the object into the list of fields (ie. we were called
+   *   by [m]alter_spec)
+   * - found a RAW field (which might be the reference field)
+   */
+  dreturn("%p", (!insert || (E && E->field_type == GD_RAW_ENTRY)) ? E : NULL);
+  return (!insert || (E && E->field_type == GD_RAW_ENTRY)) ? E : NULL;
+}
+
+/* _GD_Tokenise: Tokenise a line.  Returns n_cols.  This is a simple state
+ * machine. */
+#define ACC_MODE_NONE  0
+#define ACC_MODE_OCTAL 1
+#define ACC_MODE_HEX   2
+#define ACC_MODE_UTF8  3
+int _GD_Tokenise(DIRFILE *restrict D, const 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)
+{
+  const char* ip;
+  char* op;
+  int n_cols = 0;
+  int escaped_char = 0;
+  int quotated = 0;
+  int ws = 1;
+  uint32_t accumulator = 0;
+  int n_acc = 0;
+  int acc_mode = ACC_MODE_NONE;
+
+  dtrace("%p, \"%s\", %p, %p, %i, %p, \"%s\", %i, %i, %i", D, instring,
+      outstring, pos, tok_want, in_cols, format_file, linenum, standards,
+      pedantic);
+
+  op = *outstring = _GD_Strdup(D, instring);
+  if (op == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+  *op = '\0';
+
+  /* tokenise the line */
+  for (ip = instring; *ip != '\0'; ++ip) {
+    if (escaped_char) {
+      if (ws) {
+        if (n_cols >= tok_want)
+          break; /* Ignore trailing data on the line */
+        in_cols[n_cols++] = op;
+        ws = 0;
+      }
+
+      if (acc_mode == ACC_MODE_OCTAL) {
+        if (*ip >= '0' && *ip <= '7') {
+          accumulator = accumulator * 8 + *ip - '0';
+          n_acc++;
+        }
+
+        if (n_acc == 3 || accumulator > 037 || *ip < '0' || *ip > '7') {
+          if (accumulator == 0) {
+            _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, format_file,
+                linenum, NULL);
+            break;
+          }
+
+          *(op++) = (char)accumulator;
+
+          if (*ip < '0' || *ip > '7')
+            ip--; /* rewind */
+          escaped_char = 0;
+          acc_mode = ACC_MODE_NONE;
+        }
+      } else if (acc_mode != ACC_MODE_NONE) {
+        if (isxdigit(*ip)) {
+          n_acc++;
+          if (*ip >= '0' && *ip <= '9')
+            accumulator = accumulator * 16 + *ip - '0';
+          else if (*ip >= 'A' && *ip <= 'F')
+            accumulator = accumulator * 16 + *ip - 'A' + 10;
+          else
+            accumulator = accumulator * 16 + *ip - 'a' + 10;
+        }
+
+        if (acc_mode == ACC_MODE_HEX && (n_acc == 2 || !isxdigit(*ip))) {
+          if (accumulator == 0) {
+            _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, format_file,
+                linenum, NULL);
+            break;
+          }
+
+          *(op++) = (char)accumulator;
+
+          if (!isxdigit(*ip))
+            ip--; /* rewind */
+          escaped_char = 0;
+          acc_mode = ACC_MODE_NONE;
+        } else if (acc_mode == ACC_MODE_UTF8 && (n_acc == 7 ||
+              accumulator > 0x10FFFF || !isxdigit(*ip)))
+        {
+          if (_GD_UTF8Encode(D, format_file, linenum, &op, accumulator))
+            break; /* syntax error */
+
+          if (!isxdigit(*ip))
+            ip--; /* rewind */
+          escaped_char = 0;
+          acc_mode = ACC_MODE_NONE;
+        }
+      } else {
+        switch(*ip) {
+          case '\n': /* this is a backslach at the end of a line -- we don't
+                        support line splicing in this manner */
+            break;
+          case 'a':
+            *(op++) = '\a';
+            escaped_char = 0;
+            break;
+          case 'b':
+            *(op++) = '\b';
+            escaped_char = 0;
+            break;
+          case 'e':
+            *(op++) = '\x1B';
+            escaped_char = 0;
+            break;
+          case 'f':
+            *(op++) = '\f';
+            escaped_char = 0;
+            break;
+          case 'n':
+            *(op++) = '\n';
+            escaped_char = 0;
+            break;
+          case 'r':
+            *(op++) = '\r';
+            escaped_char = 0;
+            break;
+          case 't':
+            *(op++) = '\t';
+            escaped_char = 0;
+            break;
+          case 'v':
+            *(op++) = '\v';
+            escaped_char = 0;
+            break;
+          case '0':
+          case '1':
+          case '2':
+          case '3':
+          case '4':
+          case '5':
+          case '6':
+          case '7':
+            n_acc = 1;
+            accumulator = *ip - '0';
+            acc_mode = ACC_MODE_OCTAL;
+            break;
+          case 'u':
+            n_acc = 0;
+            accumulator = 0;
+            acc_mode = ACC_MODE_UTF8;
+            break;
+          case 'x':
+            n_acc = 0;
+            accumulator = 0;
+            acc_mode = ACC_MODE_HEX;
+            break;
+          default:
+            *(op++) = *ip;
+            escaped_char = 0;
+        }
+      }
+    } else {
+      if (*ip == '\\' && (!pedantic || standards >= 6))
+        escaped_char = 1;
+      else if (*ip == '"' && (!pedantic || standards >= 6)) {
+        if ((quotated = !quotated)) {
+          if (ws) {
+            if (n_cols >= tok_want)
+              break; /* Ignore trailing data on the line */
+            in_cols[n_cols++] = op;
+            ws = 0;
+          }
+        }
+      } else if (!quotated && *ip <= ' ' && (*ip == ' ' || *ip == '\n' ||
+            *ip == '\t' || *ip == '\r' || *ip == '\f' || *ip == '\v'))
+      {
+        if (!ws) {
+          *(op++) = '\0';
+          ws = 1;
+        }
+      } else if (!quotated && *ip == '#') {
+        *op = '\0';
+        break;
+      } else {
+        if (ws) {
+          if (n_cols >= tok_want)
+            break; /* Ignore trailing data on the line */
+          in_cols[n_cols++] = op;
+          ws = 0;
+        }
+        *(op++) = *ip;
+      }
+    }
+  }
+  *op = '\0';
+
+  if (quotated || escaped_char) {
+    if (*ip == 0 || *ip == '\n') {
+      /* Unterminated token */
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_UNTERM, format_file, linenum,
+          NULL);
+    } else {
+      /* a partial tokenisation where we've landed on top of " or \ when
+       * finishing up; back up a space */
+      ip--;
+    }
+  }
+
+  if (pos)
+    *pos = ip;
+
+  dreturn("%i", n_cols);
+  return n_cols;
+}
+
+/* _GD_ParseAlias: set up an alias
+ */
+static void _GD_ParseAlias(DIRFILE *restrict D, char **restrict name,
+    const char *restrict target, int me, int line, int standards, int pedantic,
+    int ignore_dups)
+{
+  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);
+
+  P = _GD_CheckParent(D, name, me, line);
+  if (D->error) {
+    dreturnvoid();
+    return;
+  }
+
+  ptr = _GD_Realloc(D, D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*));
+  if (ptr == NULL) {
+    dreturnvoid();
+    return;
+  }
+  D->entry = (gd_entry_t **)ptr;
+
+  E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t));
+  if (E == NULL) {
+    dreturnvoid();
+    return;
+  }
+  memset(E, 0, sizeof(gd_entry_t));
+
+  E->e = (struct gd_private_entry_ *)_GD_Malloc(D,
+      sizeof(struct gd_private_entry_));
+  if (E->e == NULL) {
+    free(E);
+    dreturnvoid();
+    return;
+  }
+  memset(E->e, 0, sizeof(struct gd_private_entry_));
+
+  E->field_type = GD_ALIAS_ENTRY;
+  E->fragment_index = me;
+  E->in_fields[0] = _GD_MungeFromFrag(D, NULL, me, target, &offset);
+
+  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_E_OK) {
+    _GD_FreeE(D, E, 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);
+    _GD_FreeE(D, E, 1);
+    dreturnvoid();
+    return;
+  }
+
+  /* Allocate where necessary */
+  if (P) {
+    new_meta_list = (gd_entry_t **)_GD_Realloc(D, P->e->p.meta_entry,
+        (P->e->n_meta + 1) * sizeof(gd_entry_t*));
+    if (new_meta_list == NULL) {
+      _GD_FreeE(D, E, 1);
+      dreturnvoid();
+      return;
+    }
+  }
+
+  /* Nothing from here on may fail */
+
+  /* Initialse the meta counts */
+  if (P) {
+    E->e->n_meta = -1;
+    E->e->p.parent = P;
+    /* there is no need to sort this list */
+    P->e->p.meta_entry = new_meta_list;
+    P->e->p.meta_entry[P->e->n_meta++] = E;
+  }
+
+  /* sort */
+  _GD_InsertSort(D, E, u);
+  D->n_entries++;
+
+  dreturnvoid();
+}
+
+/* _GD_ParseDirective: Actually parse a single format file line.
+ *       Returns 1 if a match was made.
+ */
+static int _GD_ParseDirective(DIRFILE *D, 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)
+{
+  const char* ptr;
+  char *munged_code;
+  int i, dummy, matched = 0;
+  int pedantic = *flags & GD_PEDANTIC;
+  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);
+
+  /* Starting with Standards Version 8, the forward slash is required. */
+  if (*standards >= 8 && pedantic && in_cols[0][0] != '/') {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* set up for possibly slashed reserved words */
+  ptr = in_cols[0];
+  if (*standards >= 5 || !pedantic)
+    if (in_cols[0][0] == '/')
+      ptr++;
+
+  if (!pedantic && in_cols[0][0] != '/' && n_cols > 2)
+    /* check for a field spec masquerading as a directive */
+    if ((strcmp(in_cols[1], "RAW") == 0) ||
+        (strcmp(in_cols[1], "LINCOM") == 0) ||
+        (strcmp(in_cols[1], "BIT") == 0) ||
+        (strcmp(in_cols[1], "LINTERP") == 0) ||
+        (strcmp(in_cols[1], "PHASE") == 0) ||
+        (strcmp(in_cols[1], "MULTIPLY") == 0) ||
+        (strcmp(in_cols[1], "SBIT") == 0) ||
+        (strcmp(in_cols[1], "POLYNOM") == 0) ||
+        (strcmp(in_cols[1], "STRING") == 0) ||
+        (strcmp(in_cols[1], "CONST") == 0))
+    {
+      dreturn("%i", 0);
+      return 0;
+    }
+
+  switch(ptr[0]) {
+    case 'A':
+      if (strcmp(ptr, "ALIAS") == 0 && (!pedantic || *standards >= 9)) {
+        matched = 1;
+        if (n_cols < 3) {
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
+              linenum, NULL);
+          break;
+        }
+
+        _GD_ParseAlias(D, in_cols + 1, in_cols[2], me, linenum, *standards,
+            pedantic, *flags & GD_IGNORE_DUPS);
+      }
+      break;
+    case 'E':
+      if (strcmp(ptr, "ENCODING") == 0 && (!pedantic || *standards >= 6)) {
+        matched = 1;
+        if (!(*flags & GD_FORCE_ENCODING)) {
+          D->fragment[me].encoding = GD_ENC_UNSUPPORTED;
+          for (i = 0; i < GD_N_SUBENCODINGS - 1; ++i)
+            if (strcmp(in_cols[1], gd_ef_[i].ffname) == 0) {
+              D->fragment[me].encoding = gd_ef_[i].scheme;
+              free(D->fragment[me].enc_data);
+              if (n_cols > 2 && gd_ef_[i].flags & GD_EF_EDAT)
+                D->fragment[me].enc_data = _GD_Strdup(D, in_cols[2]);
+              else
+                D->fragment[me].enc_data = NULL;
+              break;
+            }
+        }
+      } else if (strcmp(ptr, "ENDIAN") == 0 && (!pedantic || *standards >= 5)) {
+        matched = 1;
+        if (!(*flags & GD_FORCE_ENDIAN)) {
+          if (strcmp(in_cols[1], "big") == 0)
+            D->fragment[me].byte_sex = GD_BIG_ENDIAN;
+          else if (strcmp(in_cols[1], "little") == 0)
+            D->fragment[me].byte_sex = GD_LITTLE_ENDIAN;
+          else
+            _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN,
+            D->fragment[me].cname, linenum, NULL);
+          if (n_cols > 2 && (!pedantic || *standards >= 8)) {
+            if (strcmp(in_cols[2], "arm") == 0) {
+#if ! defined(ARM_ENDIAN_DOUBLES)
+              D->fragment[me].byte_sex |= GD_ARM_FLAG;
+#endif
+            } else
+              _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN,
+                  D->fragment[me].cname, linenum, NULL);
+          }
+#ifdef ARM_ENDIAN_DOUBLES
+          else
+            D->fragment[me].byte_sex |= GD_ARM_FLAG;
+#endif
+        }
+      }
+      break;
+    case 'F':
+      if (strcmp(ptr, "FRAMEOFFSET") == 0 && (!pedantic || *standards >= 1)) {
+        matched = 1;
+        D->fragment[me].frame_offset = gd_strtoll(in_cols[1], NULL,
+            (!pedantic || *standards >= 9) ? 0 : 10);
+      }
+      break;
+    case 'H':
+      if (strcmp(ptr, "HIDDEN") == 0 && (!pedantic || *standards >= 9)) {
+        matched = 1;
+        munged_code = _GD_MungeFromFrag(D, NULL, me, in_cols[1], &dummy);
+        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]);
+        else if (E->fragment_index != me)
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION,
+              D->fragment[me].cname, linenum, in_cols[1]);
+        else
+          E->hidden = 1;
+      }
+      break;
+    case 'I':
+      if (strcmp(ptr, "INCLUDE") == 0 && (!pedantic || *standards >= 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));
+        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);
+
+        if (new_ref) {
+          free(*ref_name);
+          *ref_name = new_ref;
+        }
+
+        if ((pedantic = subflags & GD_PEDANTIC))
+          *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)) {
+        matched = 1;
+        munged_code = _GD_MungeFromFrag(D, NULL, me, in_cols[1], &dummy);
+        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]);
+        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]);
+        else if (E->fragment_index != me)
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION,
+              D->fragment[me].cname, linenum, 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]);
+        else if (n_cols < 4)
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
+              linenum, NULL);
+        else
+          _GD_ParseFieldSpec(D, n_cols - 2, in_cols + 2, E,
+              D->fragment[me].cname, linenum, me, *standards, 0, *flags, 1,
+              outstring, tok_pos);
+      }
+      break;
+    case 'P':
+      if (strcmp(ptr, "PROTECT") == 0 && (!pedantic || *standards >= 6)) {
+        matched = 1;
+        if (strcmp(in_cols[1], "none") == 0)
+          D->fragment[me].protection = GD_PROTECT_NONE;
+        else if (strcmp(in_cols[1], "format") == 0)
+          D->fragment[me].protection = GD_PROTECT_FORMAT;
+        else if (strcmp(in_cols[1], "data") == 0)
+          D->fragment[me].protection = GD_PROTECT_DATA;
+        else if (strcmp(in_cols[1], "all") == 0)
+          D->fragment[me].protection = GD_PROTECT_ALL;
+        else
+          _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_PROTECT,
+              D->fragment[me].cname, linenum, in_cols[1]);
+      }
+      break;
+    case 'R':
+      if (strcmp(ptr, "REFERENCE") == 0 && (!pedantic || *standards >= 6)) {
+        matched = 1;
+        free(*ref_name);
+        *ref_name = _GD_MungeFromFrag(D, NULL, me, in_cols[1], &dummy);
+      }
+      break;
+    case 'V':
+      if (strcmp(ptr, "VERSION") == 0 && (!pedantic || *standards >= 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;
+      }
+      break;
+  }
+
+  dreturn("%i", matched);
+  return matched;
+}
+
+/* Resolve and record an alias, taking care of loops */
+static gd_entry_t *_GD_ResolveAlias(DIRFILE *restrict D, gd_entry_t *restrict E)
+{
+  gd_entry_t *T = NULL;
+
+  dtrace("%p, %p", D, E);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    D->recurse_level--;
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* Find the target */
+  T = _GD_FindField(D, E->in_fields[0], D->entry, D->n_entries, 0, NULL);
+
+  /* Aliases store the ulitmate target in entry[0] and the direct link
+   * in entry[1].
+   */
+  E->e->entry[0] = E->e->entry[1] = T;
+  if (T) {
+    if (T->field_type == GD_ALIAS_ENTRY) {
+      if (T->e->entry[0])
+        T = T->e->entry[0];
+      else
+        T = _GD_ResolveAlias(D, T);
+    }
+
+    E->e->entry[0] = T;
+  }
+
+  D->recurse_level--;
+  dreturn("%p", D->error ? NULL : E->e->entry[0]);
+  return D->error ? NULL : E->e->entry[0];
+}
+
+void _GD_UpdateAliases(DIRFILE *D, int reset)
+{
+  unsigned u;
+
+  dtrace("%p, %i", D, reset);
+
+  if (reset)
+    for (u = 0; u < D->n_entries; ++u)
+      if (D->entry[u]->field_type == GD_ALIAS_ENTRY)
+        D->entry[u]->e->entry[0] = D->entry[u]->e->entry[1] = NULL;
+
+  for (u = 0; u < D->n_entries; ++u)
+    if (D->entry[u]->field_type == GD_ALIAS_ENTRY &&
+        D->entry[u]->e->entry[1] == NULL)
+    {
+      _GD_ResolveAlias(D, D->entry[u]);
+    }
+
+  dreturnvoid();
+}
+
+/* _GD_ParseFragment: Parse each line of the fragment.
+ *
+ *       Returns NULL unless this fragment contains a REFERENCE directive.
+ */
+char *_GD_ParseFragment(FILE *restrict fp, DIRFILE *D, int me,
+    int *restrict standards, unsigned long *flags, int resolve)
+{
+  char *instring = NULL;
+  char *outstring = NULL;
+  const char *tok_pos = NULL;
+  char *in_cols[MAX_IN_COLS];
+  int linenum = 0;
+  char* ref_name = NULL;
+  int n_cols;
+  size_t n;
+  int match = 0;
+  int rescan = 0;
+  int se_action = GD_SYNTAX_ABORT;
+  gd_entry_t* first_raw = NULL;
+  gd_parser_data_t pdata;
+
+  int saved_error = 0;
+  int saved_suberror = 0;
+  int saved_line = 0;
+  char* saved_token = NULL;
+
+  dtrace("%p, %p, %i, %p, %p, %i", fp, D, me, standards, flags, resolve);
+
+  /* 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);
+
+    if (n_cols == 0) {/* a blank line */
+      free(outstring);
+      continue;
+    }
+    else if (n_cols < 2) /* any valid, non-blank line has at least two tokens */
+      _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, D->fragment[me].cname,
+          linenum, NULL);
+
+    if (D->error == GD_E_OK)
+      match = _GD_ParseDirective(D, in_cols, n_cols, me, standards, linenum,
+          &ref_name, flags, &outstring, tok_pos);
+
+    if (D->error == GD_E_OK && !match)
+      first_raw = _GD_ParseFieldSpec(D, n_cols, in_cols, NULL,
+          D->fragment[me].cname, linenum, me, *standards, 0, *flags, 1,
+          &outstring, tok_pos);
+
+    if (D->error == GD_E_FORMAT) {
+      /* call the callback for this error */
+      if (D->sehandler != NULL) {
+        /* we guarantee a buffer size of at least GD_MAX_LINE_LENGTH */
+        if (n < GD_MAX_LINE_LENGTH) {
+          char *ptr = (char *)_GD_Realloc(D, instring, GD_MAX_LINE_LENGTH);
+          if (ptr == NULL)
+            break;
+          instring = ptr;
+        }
+        pdata.dirfile = D;
+        pdata.suberror = D->suberror;
+        pdata.linenum = linenum;
+        pdata.filename = D->fragment[me].cname;
+        pdata.line = instring;
+        pdata.buflen = n;
+        se_action = (*D->sehandler)(&pdata, D->sehandler_extra);
+      }
+
+      switch(se_action) {
+        case GD_SYNTAX_ABORT:
+          break; /* abort parsing */
+        case GD_SYNTAX_CONTINUE:
+          if (!saved_error) { /* remember this error ... */
+            saved_suberror = D->suberror;
+            saved_line = D->error_line;
+            if (D->error_string != NULL)
+              saved_token = _GD_Strdup(D, D->error_string);
+            saved_error = 1;
+          }
+          /* ... and continue parsing (fallthrough) */
+        case GD_SYNTAX_IGNORE:
+          _GD_ClearError(D); /* ignore this line, continue parsing */
+          break;
+        case GD_SYNTAX_RESCAN:
+          _GD_ClearError(D);
+          rescan = 1; /* rescan the modified instring */
+          if (pdata.line != instring) {
+            /* a new line was malloc'd by the caller, delete our old one. */
+            free(instring);
+            instring = pdata.line;
+            n = pdata.buflen;
+          }
+          break;
+        default:
+          /* improper callback response */
+          _GD_SetError(D, GD_E_CALLBACK, 0, NULL, se_action, NULL);
+          break;
+      }
+    }
+
+    /* clean up */
+    free(outstring);
+    if (!rescan)
+      free(instring);
+
+    if (D->error)
+      break; /* abort in the event of a non-syntax error */
+  }
+  if (instring == NULL && errno == EOVERFLOW)
+    _GD_SetError(D, GD_E_LINE_TOO_LONG, 0, D->fragment[me].cname, linenum,
+        NULL);
+
+  /* restore a saved error, if we have one */
+  if (!D->error && saved_error) {
+    _GD_SetError(D, GD_E_FORMAT, saved_suberror, D->fragment[me].cname,
+        saved_line, saved_token);
+    free(saved_token);
+  }
+
+  /* Set reference */
+  if (!D->error) {
+    if (ref_name != NULL)
+      D->fragment[me].ref_name = _GD_Strdup(D, ref_name);
+    else if (first_raw != NULL)
+      D->fragment[me].ref_name = _GD_Strdup(D, first_raw->field);
+  }
+
+  /* resolve aliases, if requested */
+  if (resolve && !D->error)
+    _GD_UpdateAliases(D, 0);
+
+  dreturn("%p", ref_name);
+  return ref_name;
+}
+
+/* public access to the GetData tokeniser */
+char *gd_strtok(DIRFILE *D, const char *string) gd_nothrow
+{
+  char *outstring, *in_col;
+  int n_cols;
+
+  dtrace("%p, \"%s\"", D, string);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  _GD_ClearError(D);
+
+  if (string) {
+    free(D->tok_base);
+    D->tok_pos = D->tok_base = _GD_Strdup(D, string);
+    if (D->error) {
+      dreturn("%p", NULL);
+      return NULL;
+    }
+  } else if (D->tok_pos == NULL) {
+    _GD_SetError(D, GD_E_ARGUMENT, GD_E_ARG_NODATA, NULL, 0, NULL);
+    dreturn("%p", NULL);
+    return NULL;
+  }
+
+  /* tokenise! */
+  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);
+
+  if (D->error || n_cols < 1) {
+    free(D->tok_base);
+    D->tok_pos = D->tok_base = NULL;
+    free(outstring);
+    outstring = NULL;
+  }
+
+  /* in_col invariably points to outstring, so just let the caller worry about
+   * cleaning up.  Ha! */
+  dreturn("\"%s\"", outstring);
+  return outstring;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/protect.c b/src/protect.c
new file mode 100644
index 0000000..56c5576
--- /dev/null
+++ b/src/protect.c
@@ -0,0 +1,90 @@
+/* Copyright (C) 2008, 2010 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+int gd_protection(DIRFILE* D, int fragment_index) gd_nothrow
+{
+  dtrace("%p, %i", D, fragment_index);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment_index < 0 || fragment_index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%i", D->fragment[fragment_index].protection);
+  return D->fragment[fragment_index].protection;
+}
+
+int gd_alter_protection(DIRFILE *D, int protection_level, int fragment_index)
+  gd_nothrow
+{
+  int i;
+
+  dtrace("%p, %i, %i", D, protection_level, fragment_index);
+
+  _GD_ClearError(D);
+
+  if (D->flags & GD_INVALID) {
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment_index < GD_ALL_FRAGMENTS || fragment_index >= D->n_fragment) {
+    _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (protection_level != GD_PROTECT_NONE &&
+      protection_level != GD_PROTECT_FORMAT &&
+      protection_level != GD_PROTECT_DATA &&
+      protection_level != GD_PROTECT_ALL)
+  {
+    _GD_SetError(D, GD_E_ARGUMENT, GD_E_ARG_PROTECTION, NULL, 0, NULL);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (fragment_index == GD_ALL_FRAGMENTS)
+    for (i = 0; i < D->n_fragment; ++i)
+      D->fragment[i].protection = protection_level;
+  else
+    D->fragment[fragment_index].protection = protection_level;
+
+  dreturn("%i", 0);
+  return 0;
+}
diff --git a/src/putdata.c b/src/putdata.c
new file mode 100644
index 0000000..d982ca7
--- /dev/null
+++ b/src/putdata.c
@@ -0,0 +1,846 @@
+/* Copyright (C) 2003-2005 C. Barth Netterfield
+ * Copyright (C) 2003-2005 Theodore Kisner
+ * Copyright (C) 2005-2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+static size_t _GD_DoRawOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t s0, size_t ns, gd_type_t data_type, const void *restrict data_in)
+{
+  ssize_t n_wrote;
+  void *databuffer;
+
+  /* check protection */
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)s0, ns,
+      data_type, data_in);
+
+  if (s0 < D->fragment[E->fragment_index].frame_offset * E->EN(raw,spf)) {
+    _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  s0 -= D->fragment[E->fragment_index].frame_offset * E->EN(raw,spf);
+
+  if (!_GD_Supports(D, E, GD_EF_OPEN | GD_EF_SEEK | GD_EF_WRITE)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  databuffer = _GD_Alloc(D, E->EN(raw,data_type), ns);
+
+  if (databuffer == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ConvertType(D, data_in, data_type, databuffer, E->EN(raw,data_type), ns);
+
+  if (D->error) { /* bad input type */
+    free(databuffer);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  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);
+    }
+
+    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)) {
+    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)
+  {
+    _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,
+      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);
+    n_wrote = 0;
+  }
+
+  free(databuffer);
+
+  dreturn("%" PRNssize_t, n_wrote);
+  return (size_t)n_wrote;
+}
+
+static size_t _GD_DoLinterpOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t data_type,
+    const void *restrict data_in)
+{
+  size_t n_wrote;
+  int dir = -1, i;
+  double *tmpbuf;
+  struct gd_lut_ *tmp_lut;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, data_type, data_in);
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* if the table is complex valued, we can't invert it */
+  if (E->e->u.linterp.complex_table) {
+    _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_COMPLEX, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (E->e->u.linterp.table_len < 0) {
+    _GD_ReadLinterpFile(D, E);
+    if (D->error != GD_E_OK) {
+      dreturn("%i", 0);
+      return 0;
+    }
+  }
+
+  /* Check whether the LUT is monotonic */
+  if (E->e->u.linterp.table_monotonic == -1) {
+    E->e->u.linterp.table_monotonic = 1;
+    for (i = 1; i < E->e->u.linterp.table_len; ++i)
+      if (E->e->u.linterp.lut[i].y.r != E->e->u.linterp.lut[i - 1].y.r) {
+        if (dir == -1)
+          dir = (E->e->u.linterp.lut[i].y.r > E->e->u.linterp.lut[i - 1].y.r);
+        else if (dir != (E->e->u.linterp.lut[i].y.r >
+              E->e->u.linterp.lut[i - 1].y.r))
+        {
+          E->e->u.linterp.table_monotonic = 0;
+          break;
+        }
+      }
+  }
+
+  /* Can't invert a non-monotonic function */
+  if (E->e->u.linterp.table_monotonic == 0) {
+    _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_ANTITONIC, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  tmpbuf = (double *)_GD_Alloc(D, GD_FLOAT64, num_samp);
+  if (tmpbuf == NULL) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ConvertType(D, data_in, data_type, tmpbuf, GD_FLOAT64, num_samp);
+
+  if (D->error) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* Make the reverse lut */
+  tmp_lut = (struct gd_lut_ *)_GD_Malloc(D, E->e->u.linterp.table_len *
+      sizeof(struct gd_lut_));
+  if (tmp_lut == NULL) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  for (i = 0; i < E->e->u.linterp.table_len; ++i) {
+    tmp_lut[i].x = E->e->u.linterp.lut[i].y.r;
+    tmp_lut[i].y.r = E->e->u.linterp.lut[i].x;
+  }
+
+  _GD_LinterpData(D, tmpbuf, GD_FLOAT64, 0, tmpbuf, num_samp, tmp_lut,
+      E->e->u.linterp.table_len);
+
+  free(tmp_lut);
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
+      num_samp, GD_FLOAT64, tmpbuf);
+
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_wrote);
+  return n_wrote;
+}
+
+static size_t _GD_DoLincomOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t data_type,
+    const void *restrict data_in)
+{
+  size_t n_wrote;
+  void* tmpbuf;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, data_type, data_in);
+
+  /* we cannot write to LINCOM fields that are a linear combination */
+  /* of more than one raw field (no way to know how to split data). */
+
+  if (E->EN(lincom,n_fields) > 1) {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, NULL, 0, E->field);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* writeable copy */
+  tmpbuf = _GD_Alloc(D, data_type, num_samp);
+
+  if (tmpbuf == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type));
+
+  if (E->comp_scal) {
+#ifdef GD_NO_C99_API
+    double cm[1][2];
+    double cb[1][2];
+    const double d = E->EN(lincom,cm)[0][0] * E->EN(lincom,cm)[0][0]
+      + E->EN(lincom,cm)[0][1] * E->EN(lincom,cm)[0][1];
+
+    cm[0][0] = E->EN(lincom,cm)[0][0] / d;
+    cm[0][1] = -E->EN(lincom,cm)[0][1] / d;
+
+    cb[0][0] = -(E->EN(lincom,cb)[0][0] * E->EN(lincom,cm)[0][0] +
+        E->EN(lincom,cb)[0][1] * E->EN(lincom,cm)[0][1]) / d;
+    cb[0][1] = -(E->EN(lincom,cb)[0][1] * E->EN(lincom,cm)[0][0] -
+        E->EN(lincom,cb)[0][0] * E->EN(lincom,cm)[0][1]) / d;
+    _GD_CLincomData(D, 1, tmpbuf, data_type, NULL, NULL, cm, cb, NULL,
+        num_samp);
+#else
+    double complex cm = 1 / E->EN(lincom,cm)[0];
+    double complex cb = -E->EN(lincom,cb)[0] / E->EN(lincom,cm)[0];
+    _GD_CLincomData(D, 1, tmpbuf, data_type, NULL, NULL, &cm, &cb, NULL,
+        num_samp);
+#endif
+  } else {
+    double m = 1 / E->EN(lincom,m)[0];
+    double b = -E->EN(lincom,b)[0] / E->EN(lincom,m)[0];
+    _GD_LincomData(D, 1, tmpbuf, data_type, NULL, NULL, &m, &b, NULL, num_samp);
+  }
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
+      num_samp, data_type, tmpbuf);
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_wrote);
+  return n_wrote;
+}
+
+static size_t _GD_DoBitOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t data_type,
+    const void *restrict data_in)
+{
+  uint64_t *tmpbuf;
+  uint64_t *readbuf;
+  size_t i, n_wrote;
+  const uint64_t mask = (E->EN(bit,numbits) == 64) ? 0xffffffffffffffffULL :
+    ((uint64_t)1 << E->EN(bit,numbits)) - 1;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, data_type, data_in);
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  tmpbuf = (uint64_t *)_GD_Alloc(D, GD_UINT64, num_samp);
+  readbuf = (uint64_t *)_GD_Alloc(D, GD_UINT64, num_samp);
+
+  if (tmpbuf == NULL || readbuf == NULL) {
+    free(tmpbuf);
+    free(readbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  memset(tmpbuf, 0, sizeof(uint64_t) * num_samp);
+  memset(readbuf, 0, sizeof(uint64_t) * num_samp);
+
+  _GD_ConvertType(D, data_in, data_type, (void*)tmpbuf, GD_UINT64, num_samp);
+
+  /* first, READ the field in so that we can change the bits    */
+  _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, GD_UINT64,
+      readbuf);
+
+  /* error encountered, abort */
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* now go through and set the correct bits in each field value */
+  for (i = 0; i < num_samp; i++)
+    readbuf[i] = (readbuf[i] & ~(mask << E->EN(bit,bitnum))) |
+      (tmpbuf[i] & mask) << E->EN(bit,bitnum);
+
+  /* write the modified data out */
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
+      num_samp, GD_UINT64, (void*)readbuf);
+
+  free(readbuf);
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_wrote);
+  return n_wrote;
+}
+
+static size_t _GD_DoPhaseOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t data_type,
+    const void *restrict data_in)
+{
+  size_t n_wrote;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, data_type, data_in);
+
+  if (_GD_BadInput(D, E, 0, 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);
+
+  dreturn("%" PRNsize_t, n_wrote);
+
+  return n_wrote;
+}
+
+static size_t _GD_DoRecipOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t data_type,
+    const void *restrict data_in)
+{
+  size_t n_wrote;
+  void* tmpbuf;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, data_type, data_in);
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* writeable copy */
+  tmpbuf = _GD_Alloc(D, data_type, num_samp);
+
+  if (tmpbuf == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type));
+
+  /* calculate x = a/y instead of y = a/x */
+  if (E->comp_scal)
+    _GD_CInvertData(D, tmpbuf, data_type, E->EN(recip,cdividend), num_samp);
+  else
+    _GD_InvertData(D, tmpbuf, data_type, E->EN(recip,dividend), num_samp);
+
+  if (D->error) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
+      num_samp, data_type, tmpbuf);
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_wrote);
+
+  return n_wrote;
+}
+
+static size_t _GD_DoPolynomOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t data_type,
+    const void *restrict data_in)
+{
+  size_t n_wrote;
+  void* tmpbuf;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, data_type, data_in);
+
+  /* we cannot write to POLYNOM fields that are quadradic or higher order */
+
+  if (E->EN(polynom,poly_ord) > 1) {
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, NULL, 0, E->field);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* do the inverse scaling */
+  if (D->error != GD_E_OK) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* writeable copy */
+  tmpbuf = _GD_Alloc(D, data_type, num_samp);
+
+  if (tmpbuf == NULL) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type));
+
+  if (E->comp_scal) {
+#ifdef GD_NO_C99_API
+    double cm[1][2];
+    double cb[1][2];
+    const double d = E->EN(polynom,ca)[1][0] * E->EN(polynom,ca)[1][0]
+      + E->EN(polynom,ca)[1][1] * E->EN(polynom,ca)[1][1];
+
+    cm[0][0] = E->EN(polynom,ca)[1][0] / d;
+    cm[0][1] = -E->EN(polynom,ca)[1][1] / d;
+
+    cb[0][0] = -(E->EN(polynom,ca)[0][0] * E->EN(polynom,ca)[1][0] +
+        E->EN(polynom,ca)[0][1] * E->EN(polynom,ca)[1][1]) / d;
+    cb[0][1] = -(E->EN(polynom,ca)[0][1] * E->EN(polynom,ca)[1][0] -
+        E->EN(polynom,ca)[0][0] * E->EN(polynom,ca)[1][1]) / d;
+    _GD_CLincomData(D, 1, tmpbuf, data_type, NULL, NULL, cm, cb, NULL,
+        num_samp);
+#else
+    double complex cm = 1 / E->EN(polynom,ca)[1];
+    double complex cb = -E->EN(polynom,ca)[0] / E->EN(polynom,ca)[1];
+    _GD_CLincomData(D, 1, tmpbuf, data_type, NULL, NULL, &cm, &cb, NULL,
+        num_samp);
+#endif
+  } else {
+    double m = 1 / E->EN(polynom,a)[1];
+    double b = -E->EN(polynom,a)[0] / E->EN(polynom,a)[1];
+    _GD_LincomData(D, 1, tmpbuf, data_type, NULL, NULL, &m, &b, NULL, num_samp);
+  }
+
+  if (D->error != GD_E_OK) {
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
+      num_samp, data_type, tmpbuf);
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_wrote);
+  return n_wrote;
+}
+
+#define MPLEX(t) \
+  for (i = 0; i < n; i++) \
+    if (B[i] == val) \
+      ((t*)A)[i] = ((t*)C)[i * spfB / spfA];
+
+#define MPLEXC(t) \
+  do { \
+    for (i = 0; i < n; i++) \
+      if (B[i] == val) { \
+        ((t*)A)[i * 2] = ((t*)C)[i * 2 * spfB / spfA]; \
+        ((t*)A)[i * 2 + 1] = ((t*)C)[i * 2 * spfB / spfA + 1]; \
+      } \
+  } while (0)
+
+static void _GD_MplexOutData(DIRFILE *restrict D, void *restrict A,
+    unsigned int spfA, const int *restrict B, unsigned int spfB,
+    const void *restrict C, gd_type_t type, int val, size_t n)
+{
+  size_t i;
+
+  dtrace("%p, %p, %u, %p, %u, %p, 0x%X %i, %" PRNsize_t, D, A, spfA, B, spfB, C,
+      type, val, n);
+
+  switch (type) {
+    case GD_NULL:                        break;
+    case GD_UINT8:      MPLEX( uint8_t); break;
+    case GD_INT8:       MPLEX(  int8_t); break;
+    case GD_UINT16:     MPLEX(uint16_t); break;
+    case GD_INT16:      MPLEX( int16_t); break;
+    case GD_UINT32:     MPLEX(uint32_t); break;
+    case GD_INT32:      MPLEX( int32_t); break;
+    case GD_UINT64:     MPLEX(uint64_t); break;
+    case GD_INT64:      MPLEX( int64_t); break;
+    case GD_FLOAT32:    MPLEX(   float); break;
+    case GD_FLOAT64:    MPLEX(  double); break;
+    case GD_COMPLEX64:  MPLEXC(  float); break;
+    case GD_COMPLEX128: MPLEXC( double); break;
+    default:            _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL);
+                        break;
+  }
+
+  dreturnvoid();
+}
+
+static size_t _GD_DoMplexOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first_samp, size_t num_samp, gd_type_t data_type,
+    const void *restrict data_in)
+{
+  size_t n_wrote = 0, num_samp2;
+  void *tmpbuf;
+  int *cntbuf;
+  off64_t first_samp2;
+  unsigned int spf1, spf2;
+
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp,
+      num_samp, data_type, data_in);
+
+  if (_GD_BadInput(D, E, 0, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (_GD_BadInput(D, E, 1, 1)) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* read the data to be modified */
+  spf1 = _GD_GetSPF(D, E->e->entry[0]);
+  spf2 = _GD_GetSPF(D, E->e->entry[1]);
+
+  if (D->error) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  num_samp2 = (int)ceil((double)num_samp * spf2 / spf1);
+  first_samp2 = first_samp * spf2 / spf1;
+
+  tmpbuf = _GD_Alloc(D, data_type, num_samp);
+  cntbuf = (int*)_GD_Alloc(D, GD_INT_TYPE, num_samp2);
+
+  if (tmpbuf == NULL || cntbuf == NULL) {
+    free(cntbuf);
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  memset(tmpbuf, 0, num_samp * GD_SIZE(data_type));
+  memset(cntbuf, 0, num_samp2 * GD_SIZE(GD_INT_TYPE));
+
+  _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, data_type,
+      tmpbuf);
+
+  _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2, num_samp2,
+      GD_INT_TYPE, cntbuf);
+
+  if (D->error != GD_E_OK) {
+    free(cntbuf);
+    free(tmpbuf);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* enmultiplex the data */
+  _GD_MplexOutData(D, tmpbuf, spf1, cntbuf, spf2, data_in, data_type,
+      E->EN(mplex,count_val), num_samp);
+  free(cntbuf);
+
+  /* and write it. */
+  if (!D->error)
+    n_wrote = _GD_DoFieldOut(D, E->e->entry[0], E->e->repr[0], first_samp,
+        num_samp, data_type, tmpbuf);
+  free(tmpbuf);
+
+  dreturn("%" PRNsize_t, n_wrote);
+  return n_wrote;
+}
+
+static size_t _GD_DoConstOut(DIRFILE *restrict D, gd_entry_t *restrict E,
+    off64_t first, size_t len, gd_type_t data_type,
+    const void *restrict data_in)
+{
+  dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first, len,
+      data_type, data_in);
+
+  /* check protection */
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT)
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+  else {
+    gd_type_t type = _GD_ConstType(D, E->EN(scalar,const_type));
+    _GD_ConvertType(D, data_in, data_type, (char*)E->e->u.scalar.d + first *
+        GD_SIZE(type), type, len);
+  }
+
+  if (D->error) { /* bad input type */
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  D->fragment[E->fragment_index].modified = 1;
+
+  dreturn("%i", 1);
+  return 1;
+}
+
+size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E, int repr,
+    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);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    D->recurse_level--;
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (!E->e->calculated) {
+    _GD_CalculateEntry(D, E, 1);
+
+    if (D->error) {
+      D->recurse_level--;
+      dreturn("%i", 0);
+      return 0;
+    }
+  }
+
+  /* writing to representations is prohibited */
+  if (repr != GD_REPR_NONE) {
+    const char r[2] = {(char)repr, 0};
+    _GD_SetError(D, GD_E_BAD_REPR, GD_E_REPR_PUT, NULL, 0, r);
+    D->recurse_level--;
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* this call will throw GD_E_DOMAIN if a problem arises; however, that only
+   * happens in cases where the field has multiple inputs, which putdata will
+   * reject anyways; so we ignore this error for a more relevant one later
+   */
+  if (first_samp == GD_HERE)
+    first_samp = _GD_GetFilePos(D, E, -1);
+
+  switch (E->field_type) {
+    case GD_RAW_ENTRY:
+      n_wrote = _GD_DoRawOut(D, E, first_samp, num_samp, data_type, data_in);
+      break;
+    case GD_LINTERP_ENTRY:
+      n_wrote = _GD_DoLinterpOut(D, E, first_samp, num_samp, data_type,
+          data_in);
+      break;
+    case GD_LINCOM_ENTRY:
+      n_wrote = _GD_DoLincomOut(D, E, first_samp, num_samp, data_type, data_in);
+      break;
+    case GD_BIT_ENTRY:
+    case GD_SBIT_ENTRY:
+      n_wrote = _GD_DoBitOut(D, E, first_samp, num_samp, data_type, data_in);
+      break;
+    case GD_MPLEX_ENTRY:
+      n_wrote = _GD_DoMplexOut(D, E, first_samp, num_samp, data_type, data_in);
+      break;
+    case GD_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;
+    case GD_PHASE_ENTRY:
+      n_wrote = _GD_DoPhaseOut(D, E, first_samp, num_samp, data_type, data_in);
+      break;
+    case GD_POLYNOM_ENTRY:
+      n_wrote = _GD_DoPolynomOut(D, E, first_samp, num_samp, data_type,
+          data_in);
+      break;
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+      n_wrote = _GD_DoConstOut(D, E, first_samp, num_samp, data_type, data_in);
+      break;
+    case GD_STRING_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_NO_ENTRY:
+      _GD_InternalError(D);
+      break;
+  }
+
+  D->recurse_level--;
+  dreturn("%" PRNsize_t, n_wrote);
+  return n_wrote;
+}
+
+/* this function is little more than a public boilerplate for _GD_DoFieldOut */
+size_t gd_putdata64(DIRFILE* D, const char *field_code_in, off64_t first_frame,
+    off64_t first_samp, size_t num_frames, size_t num_samp, gd_type_t data_type,
+    const void *data_in)
+{
+  size_t n_wrote = 0;
+  gd_entry_t *entry;
+  char* field_code;
+  int repr;
+  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,
+      num_samp, data_type, data_in);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (entry->field_type & GD_SCALAR_ENTRY_BIT)
+    _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  if (D->error) {
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if (first_frame == GD_HERE || first_samp == GD_HERE) {
+    first_samp = GD_HERE;
+    first_frame = 0;
+  }
+
+  if (num_frames > 0 || first_frame > 0) {
+    /* get the samples per frame */
+    spf = _GD_GetSPF(D, entry);
+
+    if (D->error) {
+      dreturn("%i", 0);
+      return 0;
+    }
+
+    first_samp += spf * first_frame;
+    num_samp += spf * num_frames;
+  }
+
+  if (first_samp < 0 && (first_samp != GD_HERE || first_frame != 0)) {
+    _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  /* the easy case */
+  if (num_samp == 0) {
+    dreturn("%u", 0);
+    return 0;
+  }
+ 
+  n_wrote = _GD_DoFieldOut(D, entry, repr, first_samp, num_samp, data_type,
+      data_in);
+
+  dreturn("%" PRNsize_t, n_wrote);
+  return n_wrote;
+}
+
+/* 32(ish)-bit wrapper for the 64-bit version, when needed */
+size_t gd_putdata(DIRFILE* D, const char *field_code, off_t first_frame,
+    off_t first_samp, size_t num_frames, size_t num_samp, gd_type_t data_type,
+    const void *data_in)
+{
+  return gd_putdata64(D, field_code, first_frame, first_samp, num_frames,
+      num_samp, data_type, data_in);
+}
+/* vim: ts=2 sw=2 et
+*/
diff --git a/src/raw.c b/src/raw.c
new file mode 100644
index 0000000..c48baae
--- /dev/null
+++ b/src/raw.c
@@ -0,0 +1,150 @@
+/* Copyright (C) 2008, 2010, 2011, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+int _GD_RawOpen(int fd, struct gd_raw_file_* file, int swap gd_unused_,
+    unsigned int mode)
+{
+  dtrace("%i, %p, <unused>, 0x%X", fd, file, mode);
+
+  if (!(mode & GD_FILE_TEMP)) {
+    if (file->mode & mode) {
+      dreturn("%i", 0);
+      return 0;
+    } else if (file->idata >= 0)
+      close(file->idata);
+
+    file->idata = gd_OpenAt(file->D, fd, file->name, ((mode & GD_FILE_WRITE) ?
+          (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666);
+  } else
+    file->idata = fd;
+
+  file->pos = 0;
+  file->mode = mode | GD_FILE_READ;
+
+  dreturn("%i", file->idata < 0);
+  return (file->idata < 0);
+}
+
+off64_t _GD_RawSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int mode gd_unused_)
+{
+  off64_t pos;
+
+  dtrace("%p, %lli, 0x%X, <unused>", file, (long long)count, data_type);
+
+  /* short circuit */
+  if (file->pos == count) {
+    dreturn("%lli", (long long)count);
+    return count;
+  }
+
+  pos = lseek64(file->idata, count * GD_SIZE(data_type), SEEK_SET);
+
+  /* If we've landed in the middle of a sample, we have to back up */
+  if (pos > 0 && (pos % GD_SIZE(data_type)))
+    pos = lseek64(file->idata, -(pos % GD_SIZE(data_type)), SEEK_CUR);
+
+  if (pos == -1) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  pos /= GD_SIZE(data_type);
+
+  file->pos = pos;
+
+  dreturn("%lli", (long long)pos);
+  return pos;
+}
+
+ssize_t _GD_RawRead(struct gd_raw_file_ *restrict file, void *restrict ptr,
+    gd_type_t data_type, size_t nmemb)
+{
+  ssize_t nread;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb);
+
+  nread = read(file->idata, ptr, nmemb * GD_SIZE(data_type));
+
+  if (nread >= 0) {
+    nread /= GD_SIZE(data_type);
+    file->pos += nread;
+  }
+
+  dreturn("%" PRNssize_t, nread);
+  return nread;
+}
+
+ssize_t _GD_RawWrite(struct gd_raw_file_ *restrict file,
+    const void *restrict ptr, gd_type_t data_type, size_t nmemb)
+{
+  ssize_t nwrote;
+
+  dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb);
+
+  nwrote = write(file->idata, ptr, nmemb * GD_SIZE(data_type));
+
+  if (nwrote >= 0) {
+    nwrote /= GD_SIZE(data_type);
+    file->pos += nwrote;
+  }
+
+  dreturn("%" PRNsize_t, nwrote);
+  return nwrote;
+}
+
+int _GD_RawSync(struct gd_raw_file_ *file)
+{
+  return fsync(file->idata);
+}
+
+int _GD_RawClose(struct gd_raw_file_ *file)
+{
+  int ret;
+
+  dtrace("%p", file);
+
+  ret = close(file->idata);
+  if (!ret) {
+    file->idata = -1;
+    file->mode = 0;
+  }
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+off64_t _GD_RawSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type,
+    int swap gd_unused_)
+{
+  gd_stat64_t statbuf;
+
+  dtrace("%i, %p, 0x%X, <unused>", dirfd, file, data_type);
+
+  if (gd_StatAt64(file->D, dirfd, file->name, &statbuf, 0) < 0)  {
+    dreturn("%lli", -1LL);
+    return -1;
+  }
+
+  dreturn("%lli", (long long)statbuf.st_size);
+  return statbuf.st_size / GD_SIZE(data_type);
+}
diff --git a/src/sie.c b/src/sie.c
new file mode 100644
index 0000000..3338c49
--- /dev/null
+++ b/src/sie.c
@@ -0,0 +1,683 @@
+/* Copyright (C) 2011, 2012, 2013, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* define to debug this unit */
+#undef DEBUG_SIE
+
+#ifdef DEBUG_SIE
+#define dprintf_sie dprintf
+#else
+#define dprintf_sie(...)
+#endif
+
+#define DPRINTF dprintf_sie("F  r:%zi p:0x%llX s:%i,0x%llX " \
+    "d:0x%llX,0x%llX l:%i/0x%llX,0x%llX @%li", f->r, f->p, f->bof, f->s, \
+    f->d[0], f->d[1], f->have_l, f->l[0], f->l[1], ftell(f->fp));
+
+struct gd_siedata {
+  int swap; /* byte swapping required */
+  FILE *fp; /* stream */
+
+  ssize_t r; /* current record number */
+  int64_t p; /* I/O pointer in samples */
+  int64_t s; /* record ending sample */
+  int64_t d[3]; /* the raw record:
+                   d[0] is the sample number in storage order 
+                   d[1] and d[2] are space for the data */
+  int64_t l[3]; /* the previous record */
+  int have_l; /* a flag to indicate that l is initialised */
+  int bof;    /* this is the first record */
+};
+
+/* correct for byte sex */
+#define FIXSEX(swap,v) ((swap) ? (int64_t)gd_swap64(v) : (v))
+
+static int _GD_SampIndDoOpen(int fdin, struct gd_raw_file_ *file,
+    struct gd_siedata *f, int swap, unsigned int mode)
+{
+  int fd;
+  FILE *stream;
+
+  dtrace("%i, %p, %i, 0x%X", fdin, file, swap, mode);
+
+  if (!(mode & GD_FILE_TEMP)) {
+    fd = gd_OpenAt(file->D, fdin, file->name, ((mode & GD_FILE_WRITE) ?
+          (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666);
+
+    if (fd < 0) {
+      dreturn("%i", -1);
+      return -1;
+    }
+  } else
+    fd = fdin;
+
+  stream = fdopen(fd, (mode & GD_FILE_WRITE) ? "rb+" : "rb");
+
+  if (stream == NULL) {
+    close(fd);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  memset(f, 0, sizeof(struct gd_siedata));
+  f->r = f->s = f->p = f->d[0] = -1;
+  f->fp = stream;
+  f->swap = swap;
+  dreturn("%i", fd);
+  return fd;
+}
+
+int _GD_SampIndOpen(int fd, struct gd_raw_file_ *file, int swap,
+    unsigned int mode)
+{
+  dtrace("%i, %p, %i, 0x%X", fd, file, swap, mode);
+
+  if (file->mode & mode) {
+    dreturn("%i", 0);
+    return 0;
+  } else if (file->edata)
+    fclose(((struct gd_siedata *)(file->edata))->fp);
+  else
+    file->edata = malloc(sizeof(struct gd_siedata));
+
+  if (file->edata == NULL) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  file->idata = _GD_SampIndDoOpen(fd, file, (struct gd_siedata*)file->edata,
+      swap, mode);
+
+  if (file->idata < 0) {
+    free(file->edata);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  file->mode = mode;
+  file->pos = 0;
+  dreturn("%i", 0);
+  return 0;
+}
+
+/* advance one record, with byte swapping and error checking; returns -1 on EOF,
+ * -2 on error */
+static int _GD_Advance(struct gd_siedata *f, size_t size)
+{
+  size_t n;
+  int64_t p = f->s + 1;
+  int64_t l[3];
+  dtrace("%p, %" PRNsize_t, f, size);
+
+  /* save the current record */
+  if (p > 0)
+    memcpy(l, f->d, size);
+
+  /* read the next record */
+  n = fread(f->d, size, 1, f->fp);
+
+  if (n != 1) {
+    if (ferror(f->fp)) {
+      dreturn("%i", -2);
+      return -2;
+    } else {
+      /* we're past the end of the last record */
+      f->p = f->s + 1;
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+
+  /* handle newly read record */
+  f->s = FIXSEX(f->swap, f->d[0]);
+  f->p = p;
+  f->r++;
+
+  if (p > 0) {
+    memcpy(f->l, l, size);
+    f->have_l = 1;
+    f->bof = 0;
+  } else {
+    f->have_l = 0;
+    f->bof = 1;
+  }
+
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_SampIndSeek(struct gd_raw_file_ *file, off64_t sample,
+    gd_type_t data_type, unsigned int mode)
+{
+  int r;
+  const size_t size = sizeof(int64_t) + GD_SIZE(data_type);
+  struct gd_siedata *f = (struct gd_siedata*)(file->edata);
+
+  dtrace("%p, 0x%llx, 0x%X, 0x%X", file, (long long)sample, data_type, mode);
+
+  if (file->pos == sample && f->p >= 0) {
+    dreturn("0x%llX", (long long)sample);
+    return sample;
+  }
+
+  if (sample < f->p) {
+    /* seek backwards -- reading a file backwards doesn't necessarily work
+     * that well.  So, let's just rewind to the beginning and try again. */
+    rewind(f->fp);
+    file->idata = 0;
+    f->r = f->s = f->p = f->d[0] = -1;
+    f->bof = 1;
+    f->have_l = 0;
+  }
+
+  while (sample > f->s) {
+    DPRINTF;
+
+    /* seek ahead ... */
+    r = _GD_Advance(f, size);
+    if (r == -2) {
+      dreturn("%i", -1);
+      return -1;
+    } else if (r == -1)
+      break;
+  }
+  DPRINTF;
+
+  if ((mode & GD_FILE_WRITE) && sample > f->s && sample > 0) {
+    char zero[16];
+    memset(zero, 0, 16);
+
+    /* does the last record have a value of zero? */
+    if (memcmp(f->d + 1, &zero, GD_SIZE(data_type)) == 0
+        && ftell(f->fp) > 0)
+    {
+      /* in this case, just increase the current record's end */
+      f->s = sample;
+      f->d[0] = FIXSEX(f->swap, sample);
+
+      /* back up and update the file */
+      if (fseek(f->fp, -size, SEEK_CUR) || fwrite(f->d, size, 1, f->fp) < 1)
+      {
+        dreturn("%i", -1);
+        return -1;
+      }
+      /* The MSVCRT's stdio seems to screw up without the following: */
+      fflush(f->fp);
+
+      DPRINTF;
+    } else {
+      /* add a new record */
+      f->r++;
+      f->bof = 0;
+      f->s = sample;
+      memcpy(f->l, f->d, size);
+      f->have_l = 1;
+      f->d[0] = FIXSEX(f->swap, sample);
+      f->d[1] = f->d[2] = 0;
+      if (fwrite(f->d, size, 1, f->fp) < 1) {
+        dreturn("%i", -1);
+        return -1;
+      }
+      fflush(f->fp);
+
+      DPRINTF;
+    }
+  }
+  file->pos = f->p = sample;
+
+  DPRINTF;
+
+  dreturn("0x%llX", (unsigned long long)sample);
+  return (off64_t)(sample);
+}
+
+/* store n copies of s, which is of length l, in d */
+static void *_GD_Duplicate(void *restrict d, const void *restrict s, size_t l,
+    int64_t n)
+{
+  int64_t i;
+  dtrace("%p, %p, %" PRNsize_t ", 0x%llx", d, s, l, (long long)n);
+
+  if (n > 0) {
+    if (l == 1) {
+      memset(d, *(char*)s, (size_t)n);
+      d = (char*)d + n;
+    } else if (l == 2) {
+      uint16_t v = *(uint16_t*)s;
+      uint16_t *p = (uint16_t*)d;
+      for (i = 0; i < n; ++i)
+        *(p++) = v;
+      d = p;
+    } else if (l == 4) {
+      uint32_t v = *(uint32_t*)s;
+      uint32_t *p = (uint32_t*)d;
+      for (i = 0; i < n; ++i)
+        *(p++) = v;
+      d = p;
+    } else if (l == 8) {
+      uint64_t v = *(uint64_t*)s;
+      uint64_t *p = (uint64_t*)d;
+      for (i = 0; i < n; ++i)
+        *(p++) = v;
+      d = p;
+    } else if (l == 16) {
+#ifndef GD_NO_C99_API
+      double complex v = *(double complex*)s;
+      double complex *p = (double complex*)d;
+      for (i = 0; i < n; ++i)
+        *(p++) = v;
+#else
+      double v[2];
+      double *p = (double *)d;
+      v[0] = ((double*)s)[0];
+      v[1] = ((double*)s)[1];
+      for (i = 0; i < n; ++i) {
+        *(p++) = v[0];
+        *(p++) = v[1];
+      }
+#endif
+      d = p;
+    }
+  }
+
+  dreturn("%p", d);
+  return d;
+}
+
+ssize_t _GD_SampIndRead(struct gd_raw_file_ *restrict file, void *restrict ptr,
+    gd_type_t data_type, size_t nelem)
+{
+  int r;
+  ssize_t count = 0;
+  struct gd_siedata *f = (struct gd_siedata*)(file->edata);
+  void *cur = ptr;
+
+  dtrace("%p, %p, 0x%03x, %" PRNsize_t, file, ptr, data_type, nelem);
+
+  /* not enough data in the current run */
+  while (f->s - f->p < (int64_t)(nelem - count)) {
+    /* copy what we've got */
+    cur = _GD_Duplicate(cur, f->d + 1, GD_SIZE(data_type), f->s - f->p + 1);
+    count += f->s - f->p + 1;
+
+    DPRINTF;
+
+    /* advance */
+    r = _GD_Advance(f, sizeof(int64_t) + GD_SIZE(data_type));
+    if (r == -2) {
+      dreturn("%i", -1);
+      return -1;
+    } else if (r == -1)
+      break;
+  }
+  DPRINTF;
+
+  /* copy the remnant */
+  if (f->s - f->p >= (int64_t)(nelem - count)) {
+    _GD_Duplicate(cur, f->d + 1, GD_SIZE(data_type), nelem - count);
+    f->p += nelem - count;
+    count = nelem;
+  } else {
+    _GD_Duplicate(cur, f->d + 1, GD_SIZE(data_type), f->s - f->p + 1);
+    count += f->s - f->p + 1;
+    f->p = f->s + 1;
+  }
+
+  DPRINTF;
+
+  file->pos = f->p;
+
+  dreturn("%lli", (long long)count);
+  return count;
+}
+
+/* return the number of records in the file */
+static ssize_t _GD_GetNRec(struct gd_siedata *f, size_t size)
+{
+  gd_stat64_t statbuf;
+  dtrace("%p, %" PRNsize_t, f, size);
+
+  if (gd_fstat64(fileno(f->fp), &statbuf)) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  dreturn("%" PRNssize_t, (ssize_t)(statbuf.st_size / size));
+  return (ssize_t)(statbuf.st_size / size);
+}
+
+ssize_t _GD_SampIndWrite(struct gd_raw_file_ *restrict file,
+    const void *restrict ptr, gd_type_t data_type, size_t nelem)
+{
+  ssize_t nrec;
+  void *p;
+  size_t i;
+  ssize_t rin = 0, rout = 0, plen = 10;
+  int64_t fr;
+  int r;
+  int64_t *cur_end;
+  int64_t end;
+  void *cur_datum, *buffer;
+  struct gd_siedata *f = (struct gd_siedata*)(file->edata);
+  const size_t dlen = GD_SIZE(data_type);
+  const size_t size = sizeof(int64_t) + dlen;
+  dtrace("%p, %p, 0x%03x, %" PRNsize_t, file, ptr, data_type, nelem);
+
+  if ((nrec = _GD_GetNRec(f, size)) < 0) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* compress the data in core first, including the current record. */
+  p = malloc(plen * size);
+  memcpy(p, f->d, size);
+  cur_end = (int64_t*)p;
+  cur_datum = ((int64_t*)p) + 1;
+  DPRINTF;
+
+  if ((f->r == -1 || f->bof) && f->p == 0) {
+    /* we're overwriting everything from the start */
+    memcpy(cur_datum, ptr, dlen);
+  } else if (!f->bof) {
+    int64_t ls;
+    int need_advance = 0;
+
+    /* need to check the previous record to see if we're overwriting this whole
+     * record and we need to combine with the previous one */
+    if (!f->have_l) {
+      /* forced to back up to read the previous record */
+      if (fseek(f->fp, -2 * size, SEEK_CUR) ||
+          (fread(f->l, size, 1, f->fp) < 1))
+      {
+        free(p);
+        dreturn("%i", -1);
+        return -1;
+      }
+      need_advance = 1;
+
+      DPRINTF;
+    }
+
+    /* the ending sample of the previous record */
+    ls = FIXSEX(f->swap, f->l[0]);
+
+    /* if we're not at the start of the current record, we don't need to
+     * do anything fancy */
+    if (f->p == ls + 1) {
+      /* we're completely overwriting the current record, so update the value */
+      memcpy(cur_datum, ptr, dlen);
+      
+      /* then check whether that's the same as the value of the old record; if
+       * it is, combine them
+       */
+      if (memcmp(f->l + 1, ptr, dlen) == 0) {
+        dprintf_sie("combine: 0x%llX", f->l[1]);
+        /* the new value is the same as the value of the previous record, so
+         * back up a record and combine */
+
+        /* rewind if we haven't already done so */
+        if (f->have_l) {
+          if (fseek(f->fp, -size, SEEK_CUR)) {
+            free(p);
+            dreturn("%i", -1);
+            return -1;
+          }
+        }
+        need_advance = 0;
+
+        f->r--;
+        memcpy(f->d, f->l, size);
+        memcpy(p, f->d, size);
+        f->s = FIXSEX(f->swap, f->l[0]);
+        f->have_l = 0;
+      }
+    }
+
+    /* reset the file pointer if we didn't have to rewind but were forced to */
+    if (need_advance) {
+      if (fseek(f->fp, size, SEEK_CUR)) {
+        free(p);
+        dreturn("%i", -1);
+        return -1;
+      }
+      f->have_l = 1;
+    }
+
+    DPRINTF;
+  }
+
+  for (i = 0; i < nelem; ++i) {
+    if (memcmp(((const char*)ptr) + i * dlen, cur_datum, dlen)) {
+      dprintf_sie("mismatch on sample %zu:", i);
+      if (++rin == plen) {
+        void *p2;
+        plen *= 2;
+        p2 = realloc(p, plen * size);
+        if (p2 == NULL) {
+          free(p);
+          dreturn("%i", -1);
+          return -1;
+        }
+        p = p2;
+        cur_end = (int64_t*)((char*)p + size * (rin - 1));
+      }
+      end = f->p + i - 1;
+      dprintf_sie("*cur_end:   %llX -> %llX", FIXSEX(f->swap, *cur_end), end);
+      gd_put_unaligned64(FIXSEX(f->swap, end), cur_end);
+      dprintf_sie(" cur_end:   %p -> %p", cur_end, (char*)p + size * rin);
+      cur_end = (int64_t*)((char*)p + size * rin);
+      dprintf_sie(" cur_datum: %p -> %p", cur_datum, cur_end + 1);
+      cur_datum = cur_end + 1;
+      dprintf_sie("*cur_datum: %X -> %X", *((char*)cur_datum),
+          *(((const char*)ptr) + i * dlen));
+      memcpy(cur_datum, ((const char*)ptr) + i * dlen, dlen);
+    }
+  }
+  end = f->p + nelem - 1;
+  dprintf_sie("*cur_end:   %llX -> %llX", FIXSEX(f->swap, *cur_end), end);
+  gd_put_unaligned64(FIXSEX(f->swap, end), cur_end);
+  rin++;
+
+  for (i = 0; i < (size_t)rin; ++i) {
+    dprintf_sie("%zu: 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X",
+        i, ((char*)p)[size * i + 0], ((char*)p)[size * i + 1],
+        ((char*)p)[size * i + 2], ((char*)p)[size * i + 3],
+        ((char*)p)[size * i + 4], ((char*)p)[size * i + 5],
+        ((char*)p)[size * i + 6], ((char*)p)[size * i + 7],
+        ((char*)p)[size * i + 8]);
+  }
+
+  /* determine how many records we have to replace */
+  fr = f->r;
+  if (fr < 0) {
+    fr = 0;
+    rout--;
+  }
+
+  while (f->s <= end) {
+    ++rout;
+
+    DPRINTF;
+
+    r = _GD_Advance(f, sizeof(int64_t) + GD_SIZE(data_type));
+    if (r == -2) {
+      free(p);
+      dreturn("%i", -1);
+      return -1;
+    } else if (r == -1)
+      break;
+  }
+  DPRINTF;
+
+  dprintf_sie("nrec:%zi rin:%zi rout:%zi fr:%lli", nrec, rin, rout, fr);
+
+  /* now, do some moving: first, move the trailing records, forward by
+   * (rin - rout) records */
+  if (nrec - (fr + rout) > 0) {
+    buffer = malloc((nrec - (fr + rout)) * size);
+    if (buffer == NULL) {
+      free(p);
+      dreturn("%i", -1);
+      return -1;
+    }
+    if (fseek(f->fp, (fr + rout) * size, SEEK_SET) ||
+        (fread(buffer, size, nrec - (fr + rout), f->fp)
+         < (size_t)(nrec - (fr + rout))))
+    {
+      free(buffer);
+      free(p);
+      dreturn("%i", -1);
+      return -1;
+    }
+    if (fseek(f->fp, (fr + rin) * size, SEEK_SET) ||
+        (fwrite(buffer, size, nrec - (fr + rout), f->fp)
+         < (size_t)(nrec - (fr + rout))))
+    {
+      free(buffer);
+      free(p);
+      dreturn("%i", -1);
+      return -1;
+    }
+    free(buffer);
+  }
+
+  /* now insert the new records */
+  if (fseek(f->fp, fr * size, SEEK_SET) ||
+      (fwrite(p, size, rin, f->fp) < (size_t)rin))
+  {
+    free(p);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* truncate the file if necessary */
+  if (rin < rout) {
+    if (fflush(f->fp)) {
+      free(p);
+      dreturn("%i", -1);
+      return -1;
+    }
+    if (gd_truncate(fileno(f->fp), (nrec - rout + rin) * size)) {
+      free(p);
+      dreturn("%i", -1);
+      return -1;
+    }
+  }
+
+  /* update the current record */
+  memcpy(f->d, (char *)p + (rin - 1) * size, size);
+  if (rin > 1) 
+    f->bof = 0;
+  else
+    f->bof = 1;
+
+  f->p = f->s = FIXSEX(f->swap, f->d[0]);
+  f->r = fr + rin - 1;
+  f->have_l = 0;
+
+  DPRINTF;
+
+  free(p);
+
+  file->pos = f->p;
+  dreturn("%llu", (unsigned long long)nelem);
+  return nelem;
+}
+
+int _GD_SampIndSync(struct gd_raw_file_ *file)
+{
+  int ret;
+  struct gd_siedata *f = (struct gd_siedata*)(file->edata);
+
+  dtrace("%p", file);
+
+  ret = fflush(f->fp);
+
+  if (!ret)
+    ret = fsync(fileno(f->fp));
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+int _GD_SampIndClose(struct gd_raw_file_* file)
+{
+  int ret;
+  struct gd_siedata *f = (struct gd_siedata*)(file->edata);
+
+  dtrace("%p", file);
+
+  ret = fclose(f->fp);
+  if (ret != EOF) {
+    file->mode = 0;
+    file->idata = -1;
+    free(file->edata);
+    file->edata = NULL;
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  dreturn("%i", 1);
+  return 1;
+}
+
+off64_t _GD_SampIndSize(int dirfd, struct gd_raw_file_* file,
+    gd_type_t data_type, int swap)
+{
+  struct gd_siedata f;
+  ssize_t last_rec;
+  int64_t n;
+  const size_t size = sizeof(int64_t) + GD_SIZE(data_type);
+
+  dtrace("%i, %p, 0x%03x, %i", dirfd, file, data_type, swap);
+
+  /* open */
+  if (_GD_SampIndDoOpen(dirfd, file, &f, swap, GD_FILE_READ) < 0) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* find the last record */
+  last_rec = _GD_GetNRec(&f, size) - 1;
+
+  /* seek to this record */
+  if (fseeko64(f.fp, last_rec * size, SEEK_SET)) {
+    fclose(f.fp);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  /* read the sample index */
+  if (fread(&n, sizeof(uint64_t), 1, f.fp) != 1) {
+    fclose(f.fp);
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if (swap)
+    n = gd_swap64(n);
+
+  fclose(f.fp);
+
+  dreturn("%llx", (long long unsigned)n + 1);
+  return (off64_t)n + 1;
+}
diff --git a/src/slim.c b/src/slim.c
new file mode 100644
index 0000000..8499e05
--- /dev/null
+++ b/src/slim.c
@@ -0,0 +1,142 @@
+/* Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#ifdef HAVE_SLIMLIB_H
+#include <slimlib.h>
+#endif
+
+#ifdef USE_MODULES
+#define _GD_SlimOpen libgetdataslim_LTX_GD_SlimOpen
+#define _GD_SlimSeek libgetdataslim_LTX_GD_SlimSeek
+#define _GD_SlimRead libgetdataslim_LTX_GD_SlimRead
+#define _GD_SlimClose libgetdataslim_LTX_GD_SlimClose
+#define _GD_SlimSize libgetdataslim_LTX_GD_SlimSize
+#endif
+
+/* The slim encoding scheme uses edata as a slimfile pointer.  If a file is
+ * open, idata = 0 otherwise idata = -1. */
+
+int _GD_SlimOpen(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_SlimSeek(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_SlimRead(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_SlimClose(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_SlimSize(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;
+}
diff --git a/src/spf.c b/src/spf.c
new file mode 100644
index 0000000..f6e7057
--- /dev/null
+++ b/src/spf.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+/* _GD_GetSPF: Get samples per frame for field
+*/
+unsigned int _GD_GetSPF(DIRFILE *D, gd_entry_t *E)
+{
+  unsigned int spf = 0;
+
+  dtrace("%p, %p", D, E);
+
+  if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
+    _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
+    dreturn("%u", 0);
+    D->recurse_level--;
+    return 0;
+  }
+
+  switch(E->field_type) {
+    case GD_RAW_ENTRY:
+      if (!E->e->calculated)
+        _GD_CalculateEntry(D, E, 1);
+      if (!D->error)
+        spf = E->EN(raw,spf);
+      break;
+    case GD_LINCOM_ENTRY:
+    case GD_MULTIPLY_ENTRY:
+    case GD_DIVIDE_ENTRY:
+    case GD_RECIP_ENTRY:
+    case GD_BIT_ENTRY:
+    case GD_PHASE_ENTRY:
+    case GD_LINTERP_ENTRY:
+    case GD_POLYNOM_ENTRY:
+    case GD_SBIT_ENTRY:
+    case GD_WINDOW_ENTRY:
+    case GD_MPLEX_ENTRY:
+      if (_GD_BadInput(D, E, 0, 1))
+        break;
+
+      spf = _GD_GetSPF(D, E->e->entry[0]);
+      break;
+    case GD_INDEX_ENTRY:
+      spf = 1;
+      break;
+    case GD_CONST_ENTRY:
+    case GD_CARRAY_ENTRY:
+    case GD_STRING_ENTRY:
+    case GD_ALIAS_ENTRY:
+    case GD_NO_ENTRY:
+      _GD_InternalError(D);
+  }
+
+  D->recurse_level--;
+  dreturn("%u", spf);
+  return spf;
+}
+
+/* Get the number of samples for each frame for the given field
+*/
+unsigned int gd_spf(DIRFILE* D, const char *field_code_in) gd_nothrow
+{
+  unsigned int spf = 0;
+  gd_entry_t* entry;
+  char* field_code;
+  int repr;
+
+  dtrace("%p, \"%s\"", D, field_code_in);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%u", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  /* the representation is unimportant: it doesn't change the SPF of the field,
+   * yet we have to run the field code through here to potentially remove it
+   */
+  entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1,
+      1);
+
+  if (D->error) {
+    dreturn("%u", 0);
+    return 0;
+  }
+
+  if (entry->field_type & GD_SCALAR_ENTRY_BIT)
+    _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code);
+  else 
+    spf = _GD_GetSPF(D, entry);
+
+  if (field_code != field_code_in)
+    free(field_code);
+
+  dreturn("%u", spf);
+  return spf;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/string.c b/src/string.c
new file mode 100644
index 0000000..d52fc59
--- /dev/null
+++ b/src/string.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2008-2010 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+size_t gd_get_string(DIRFILE* D, const char *field_code, size_t len,
+    char *data_out) gd_nothrow
+{
+  size_t n_read = 0;
+  gd_entry_t *entry;
+
+  dtrace("%p, \"%s\", %" PRNsize_t ", %p", D, field_code, len, data_out);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
+    
+  if (entry == 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)
+    _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);
+
+    n_read = strlen(entry->e->u.string) + 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)
+{
+  char* ptr = E->e->u.string;
+
+  dtrace("%p, %p, %p", D, E, data_in);
+
+  /* check protection */
+  if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) {
+    _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0,
+        D->fragment[E->fragment_index].cname);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  E->e->u.string = _GD_Strdup(D, data_in);
+  if (E->e->u.string == NULL) {
+    E->e->u.string = ptr;
+    dreturn("%i", 0);
+    return 0;
+  }
+  free(ptr);
+  D->fragment[E->fragment_index].modified = 1;
+
+  dreturn("%" PRNsize_t, strlen(E->e->u.string) + 1);
+  return strlen(E->e->u.string) + 1;
+}
+
+/* this function is little more than a public boilerplate for _GD_DoFieldOut */
+size_t gd_put_string(DIRFILE* D, const char *field_code, const char *data_in)
+  gd_nothrow
+{
+  size_t n_wrote = 0;
+  gd_entry_t *entry;
+
+  dtrace("%p, \"%s\", \"%s\"", D, field_code, data_in);
+
+  if (D->flags & GD_INVALID) {/* don't crash */
+    _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  if ((D->flags & GD_ACCMODE) != GD_RDWR) {
+    _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL);
+    dreturn("%i", 0);
+    return 0;
+  }
+
+  _GD_ClearError(D);
+
+  entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL);
+
+  if (entry == NULL)
+    _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code);
+  else if (entry->field_type != GD_STRING_ENTRY)
+    _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code);
+  else 
+    n_wrote = _GD_DoStringOut(D, entry, data_in);
+
+  dreturn("%" PRNsize_t, n_wrote);
+  return n_wrote;
+}
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/types.c b/src/types.c
new file mode 100644
index 0000000..270dc02
--- /dev/null
+++ b/src/types.c
@@ -0,0 +1,688 @@
+/* Copyright (C) 2002-2005 C. Barth Netterfield
+ * Copyright (C) 2005-2010, 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#ifdef GD_NO_C99_API
+
+#define TO_COMPLEX(ot,it) \
+  do { \
+    for (i = 0; i < n; i++) { \
+      ((ot *)data_out)[2 * i] = (ot)((it *)data_in)[i]; \
+      ((ot *)data_out)[2 * i + 1] = 0; \
+    } \
+  } while (0)
+#define FROM_COMPLEX(ot,it) \
+  do { \
+    for (i = 0; i < n; i++) { \
+      ((ot *)data_out)[i] = (ot)((it *)data_in)[2 * i]; \
+    } \
+  } while (0)
+
+#else
+
+#define TO_COMPLEX(ot,it) \
+  do { \
+    for (i = 0; i < n; i++) { \
+      ((complex ot *)data_out)[i] = (complex ot)((it *)data_in)[i]; \
+    } \
+  } while (0)
+#define FROM_COMPLEX(ot,it) \
+  do { \
+    for (i = 0; i < n; i++) { \
+      ((ot *)data_out)[i] = (ot)((complex it *)data_in)[i]; \
+    } \
+  } while (0)
+
+#endif
+
+
+/* _GD_ConvertType: copy data to output buffer while converting type.
+*/
+void _GD_ConvertType(DIRFILE *restrict D, const void *restrict data_in,
+    gd_type_t in_type, void *restrict data_out, gd_type_t out_type, size_t n)
+gd_nothrow
+{
+  size_t i;
+
+  dtrace("%p, %p, 0x%x, %p, 0x%x, %" PRNsize_t, D, data_in, in_type, data_out,
+      out_type, n);
+  dreturnvoid();
+
+  if (out_type == GD_NULL) /* null return type: don't return data */
+    return;
+
+  switch (in_type) {
+    case GD_INT8:
+      switch (out_type) {
+        case GD_INT8:
+          memcpy(data_out, data_in, n * sizeof(int8_t));
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *)data_out)[i] = (uint8_t)((int8_t *)data_in)[i];
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((int8_t *)data_in)[i];
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((int8_t *)data_in)[i];
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((int8_t *)data_in)[i];
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (uint32_t)((int8_t *)data_in)[i];
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((int8_t *)data_in)[i];
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((uint64_t *)data_out)[i] = (uint64_t)((int8_t *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((int8_t *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((int8_t *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,int8_t);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,int8_t);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_UINT8:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *)data_out)[i] = (int8_t)((uint8_t *)data_in)[i];
+          return;
+        case GD_UINT8:
+          memcpy(data_out, data_in, n * sizeof(uint8_t));
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((uint8_t *)data_in)[i];
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((uint8_t *)data_in)[i];
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((uint8_t *)data_in)[i];
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (uint32_t)((uint8_t *)data_in)[i];
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((uint8_t *)data_in)[i];
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((uint64_t *)data_out)[i] = (uint64_t)((uint8_t *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((uint8_t *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((uint8_t *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,uint8_t);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,uint8_t);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_INT16:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *)data_out)[i] = (int8_t)((int16_t *)data_in)[i];
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *)data_out)[i] = (uint8_t)((int16_t *)data_in)[i];
+          return;
+        case GD_INT16:
+          memcpy(data_out, data_in, n * sizeof(int16_t));
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((int16_t *)data_in)[i];
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((int16_t *)data_in)[i];
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (uint32_t)((uint16_t *)data_in)[i];
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((int16_t *)data_in)[i];
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (uint64_t)((int16_t *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((int16_t *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((int16_t *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,int16_t);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,int16_t);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_UINT16:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *)data_out)[i] = (int8_t)((uint16_t *)data_in)[i];
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *)data_out)[i] = (uint8_t)((uint16_t *)data_in)[i];
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((uint16_t *)data_in)[i];
+          return;
+        case GD_UINT16:
+          memcpy(data_out, data_in, n * sizeof(uint16_t));
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((uint16_t *)data_in)[i];
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (uint32_t)((uint16_t *)data_in)[i];
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((uint16_t *)data_in)[i];
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((uint64_t *)data_out)[i] = (uint64_t)((uint16_t *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((uint16_t *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((uint16_t *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,uint16_t);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,uint16_t);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_INT32:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *) data_out)[i] = (int8_t)((int32_t *)data_in)[i];
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *) data_out)[i] = (uint8_t)((int32_t *)data_in)[i];
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((int32_t *)data_in)[i];
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((int32_t *)data_in)[i];
+          return;
+        case GD_INT32:
+          memcpy(data_out, data_in, n * sizeof(int32_t));
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (uint32_t)((int32_t *)data_in)[i];
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((int32_t *)data_in)[i];
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((uint64_t *)data_out)[i] = (uint64_t)((int32_t *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((int32_t *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((int32_t *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,int32_t);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,int32_t);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_UINT32:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *) data_out)[i] = (int8_t)((uint32_t *)data_in)[i];
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *) data_out)[i] = (uint8_t)((uint32_t *)data_in)[i];
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((uint32_t *)data_in)[i];
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((uint32_t *)data_in)[i];
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((uint32_t *)data_in)[i];
+          return;
+        case GD_UINT32:
+          memcpy(data_out, data_in, n * sizeof(uint32_t));
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((uint32_t *)data_in)[i];
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((uint64_t *)data_out)[i] = (uint64_t)((uint32_t *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((uint32_t *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((uint32_t *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,uint32_t);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,uint32_t);
+          return;
+        default:
+          break;
+      }
+      break;
+    case GD_INT64:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *) data_out)[i] = (int64_t)((int64_t *)data_in)[i];
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *) data_out)[i] = (uint8_t)((int64_t *)data_in)[i];
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((int64_t *)data_in)[i];
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((int64_t *)data_in)[i];
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((int64_t *)data_in)[i];
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (uint32_t)((int64_t *)data_in)[i];
+          return;
+        case GD_INT64:
+          memcpy(data_out, data_in, n * sizeof(int64_t));
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((uint64_t *)data_out)[i] = (uint64_t)((int64_t *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((int64_t *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((int64_t *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,int64_t);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,int64_t);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_UINT64:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *) data_out)[i] = (int8_t)((uint64_t *)data_in)[i];
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *) data_out)[i] = (uint8_t)((uint64_t *)data_in)[i];
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((uint64_t *)data_in)[i];
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((uint64_t *)data_in)[i];
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((uint64_t *)data_in)[i];
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (uint32_t)((uint64_t *)data_in)[i];
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((uint64_t *)data_in)[i];
+          return;
+        case GD_UINT64:
+          memcpy(data_out, data_in, n * sizeof(uint64_t));
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((uint64_t *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((uint64_t *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,uint64_t);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,uint64_t);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_FLOAT32:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *) data_out)[i] = (int8_t)((float *)data_in)[i];
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *) data_out)[i] = (uint8_t)((float *)data_in)[i];
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((float *)data_in)[i];
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((float *)data_in)[i];
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((float *)data_in)[i];
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (uint32_t)((float *)data_in)[i];
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((float *)data_in)[i];
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((uint64_t *)data_out)[i] = (uint64_t)((float *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          memcpy(data_out, data_in, n * sizeof(float));
+          return;
+        case GD_FLOAT64:
+          for (i = 0; i < n; i++)
+            ((double *)data_out)[i] = (double)((float *)data_in)[i];
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,float);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,float);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_FLOAT64:
+      switch (out_type) {
+        case GD_INT8:
+          for (i = 0; i < n; i++)
+            ((int8_t *) data_out)[i] = (int8_t)((double *)data_in)[i];
+          return;
+        case GD_UINT8:
+          for (i = 0; i < n; i++)
+            ((uint8_t *) data_out)[i] = (uint8_t)((double *)data_in)[i];
+          return;
+        case GD_INT16:
+          for (i = 0; i < n; i++)
+            ((int16_t *)data_out)[i] = (int16_t)((double *)data_in)[i];
+          return;
+        case GD_UINT16:
+          for (i = 0; i < n; i++)
+            ((uint16_t *)data_out)[i] = (uint16_t)((double *)data_in)[i];
+          return;
+        case GD_INT32:
+          for (i = 0; i < n; i++)
+            ((int32_t *)data_out)[i] = (int32_t)((double *)data_in)[i];
+          return;
+        case GD_UINT32:
+          for (i = 0; i < n; i++)
+            ((uint32_t *)data_out)[i] = (int32_t)((double *)data_in)[i];
+          return;
+        case GD_INT64:
+          for (i = 0; i < n; i++)
+            ((int64_t *)data_out)[i] = (int64_t)((double *)data_in)[i];
+          return;
+        case GD_UINT64:
+          for (i = 0; i < n; i++)
+            ((uint64_t *)data_out)[i] = (uint64_t)((double *)data_in)[i];
+          return;
+        case GD_FLOAT32:
+          for (i = 0; i < n; i++)
+            ((float *)data_out)[i] = (float)((double *)data_in)[i];
+          return;
+        case GD_FLOAT64:
+          memcpy(data_out, data_in, n * sizeof(double));
+          return;
+        case GD_COMPLEX64:
+          TO_COMPLEX(float,double);
+          return;
+        case GD_COMPLEX128:
+          TO_COMPLEX(double,double);
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_COMPLEX64:
+      switch (out_type) {
+        case GD_INT8:
+          FROM_COMPLEX(int8_t,float);
+          return;
+        case GD_UINT8:
+          FROM_COMPLEX(uint8_t,float);
+          return;
+        case GD_INT16:
+          FROM_COMPLEX(int16_t,float);
+          return;
+        case GD_UINT16:
+          FROM_COMPLEX(uint16_t,float);
+          return;
+        case GD_INT32:
+          FROM_COMPLEX(int32_t,float);
+          return;
+        case GD_UINT32:
+          FROM_COMPLEX(uint32_t,float);
+          return;
+        case GD_INT64:
+          FROM_COMPLEX(int64_t,float);
+          return;
+        case GD_UINT64:
+          FROM_COMPLEX(uint64_t,float);
+          return;
+        case GD_FLOAT32:
+          FROM_COMPLEX(float,float);
+          return;
+        case GD_FLOAT64:
+          FROM_COMPLEX(double,float);
+          return;
+        case GD_COMPLEX64:
+          memcpy(data_out, data_in, n * 2 * sizeof(float));
+          return;
+        case GD_COMPLEX128:
+          for (i = 0; i < 2 * n; i++)
+            ((double *)data_out)[i] = (double)((float *)data_in)[i];
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    case GD_COMPLEX128:
+      switch (out_type) {
+        case GD_INT8:
+          FROM_COMPLEX(int8_t,double);
+          return;
+        case GD_UINT8:
+          FROM_COMPLEX(uint8_t,double);
+          return;
+        case GD_INT16:
+          FROM_COMPLEX(int16_t,double);
+          return;
+        case GD_UINT16:
+          FROM_COMPLEX(uint16_t,double);
+          return;
+        case GD_INT32:
+          FROM_COMPLEX(int32_t,double);
+          return;
+        case GD_UINT32:
+          FROM_COMPLEX(uint32_t,double);
+          return;
+        case GD_INT64:
+          FROM_COMPLEX(int64_t,double);
+          return;
+        case GD_UINT64:
+          FROM_COMPLEX(uint64_t,double);
+          return;
+        case GD_FLOAT32:
+          FROM_COMPLEX(float,double);
+          return;
+        case GD_FLOAT64:
+          FROM_COMPLEX(double,double);
+          return;
+        case GD_COMPLEX64:
+          for (i = 0; i < 2 * n; i++)
+            ((float *)data_out)[i] = (float)((double *)data_in)[i];
+          return;
+        case GD_COMPLEX128:
+          memcpy(data_out, data_in, 2 * n * sizeof(double));
+          return;
+        default:
+          _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL);
+          break;
+      }
+      break;
+    default:
+      _GD_SetError(D, GD_E_BAD_TYPE, in_type, NULL, 0, NULL);
+      break;
+  }
+}
+
+/* vim: ts=2 sw=2 et tw=80
+*/
diff --git a/src/zzip.c b/src/zzip.c
new file mode 100644
index 0000000..176e3a6
--- /dev/null
+++ b/src/zzip.c
@@ -0,0 +1,222 @@
+/* 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"
+
+#ifdef HAVE_ZZIP_LIB_H
+#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. */
+
+int _GD_ZzipName(DIRFILE *restrict D, const char *restrict enc_data,
+    struct gd_raw_file_ *restrict file, const char *restrict base,
+    int temp gd_unused_, int resolv)
+{
+  size_t enc_len;
+
+  dtrace("%p, \"%s\", %p, \"%s\", <unused>, %i", D, enc_data, file, base,
+      resolv);
+
+  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");
+
+    dreturn("%i (%s)", 0, file->name);
+    return 0;
+  }
+
+  if (file->name == NULL) {
+    file->D = D;
+    file->name = (char *)malloc(strlen(base) + strlen(enc_data) + 2);
+    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);
+  }
+
+  dreturn("%i (%s)", 0, file->name);
+  return 0;
+}
+
+int _GD_ZzipOpen(int dirfd, struct gd_raw_file_* file, int swap gd_unused_,
+    unsigned int mode gd_unused_)
+{
+  char *ptr1, *ptr2;
+  size_t len;
+
+  dtrace("%i, %p, <unused>, <unused>", 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;
+  }
+
+  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);
+
+  file->edata = zzip_open(ptr2, O_RDONLY);
+  free(ptr2);
+
+  if (file->edata == NULL) {
+    file->idata = -1;
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  file->idata = 0;
+  file->mode = GD_FILE_READ;
+  dreturn("%i", 0);
+  return 0;
+}
+
+off64_t _GD_ZzipSeek(struct gd_raw_file_* file, off64_t count,
+    gd_type_t data_type, unsigned int mode gd_unused_)
+{
+  off64_t n;
+
+  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);
+
+  if (n >= 0)
+    n /= GD_SIZE(data_type);
+
+  dreturn("%lli", (long long)n);
+  return n;
+}
+
+ssize_t _GD_ZzipRead(struct gd_raw_file_ *restrict file, void *restrict data,
+    gd_type_t data_type, size_t nmemb)
+{
+  ssize_t n;
+
+  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);
+
+  if (n >= 0)
+    n /= GD_SIZE(data_type);
+
+  dreturn("%lli", (long long)n);
+  return n;
+}
+
+int _GD_ZzipClose(struct gd_raw_file_ *file)
+{
+  int ret;
+
+  dtrace("%p", file);
+
+  ret = zzip_close((ZZIP_FILE*)file->edata);
+
+  if (!ret) {
+    file->idata = -1;
+    file->edata = NULL;
+  }
+
+  dreturn("%i", ret);
+  return ret;
+}
+
+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;
+
+  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);
+
+  fp = zzip_open(ptr2, O_RDONLY);
+  free(ptr2);
+
+  if (fp == NULL) {
+    file->idata = -1;
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  if ((size = (off64_t)zzip_seek(fp, 0, SEEK_END)) == -1) {
+    dreturn("%i", -1);
+    return -1;
+  }
+
+  zzip_close(fp);
+
+  size /= GD_SIZE(data_type);
+
+  dreturn("%lli", (long long)size);
+  return size;
+}
diff --git a/src/zzslim.c b/src/zzslim.c
new file mode 100644
index 0000000..f126243
--- /dev/null
+++ b/src/zzslim.c
@@ -0,0 +1,181 @@
+/* Copyright (C) 2008, 2010, 2011, 2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "internal.h"
+
+#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)
+{
+  size_t enc_len;
+
+  dtrace("%p, \"%s\", %p, \"%s\", <unused>, %i", D, enc_data, file, base,
+      resolv);
+
+  if (enc_data == NULL)
+    enc_data = "raw";
+
+  enc_len = strlen(enc_data);
+  
+  /* Resolution is degenerate with the zzip encoding; so skip it for now */
+  if (resolv) {
+    dreturn("%i", 1);
+    return 1;
+  }
+
+  if (file->name == NULL) {
+    file->D = D;
+    file->name = (char *)malloc(strlen(base) + strlen(enc_data) + 6);
+    if (file->name == NULL) {
+      _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+      dreturn("%i", -1);
+      return -1;
+    }
+
+    strcpy(file->name, enc_data);
+    file->name[enc_len] = '/';
+    strcat(strcpy(file->name + enc_len + 1, base), ".slm");
+  }
+
+  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;
+}
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..c1a235b
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,418 @@
+# (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
+#
+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
+
+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_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_spec_directive add_spec_invalid add_spec_meta add_spec_resolv \
+					add_string add_string_affix add_type add_window add_window_op
+
+ALIAS_TESTS=alias_list alias_list_alias alias_list_missing alias_num \
+						alias_num_alias alias_num_missing alias_target alias_target_alias \
+						alias_target_missing
+
+ALTER_TESTS=alter_bit_bitnum alter_bit_numbits alter_carray_len \
+						alter_carray_type alter_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_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
+
+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
+
+CLOSE_TESTS=close close_bad close_discard close_null
+
+CONVERT_TESTS=convert_complex128_complex64 convert_complex128_float64 \
+							convert_complex128_int64 convert_complex128_uint64 \
+							convert_complex64_complex128 convert_complex64_float64 \
+							convert_complex64_int64 convert_complex64_uint64 \
+							convert_float32_complex128 convert_float32_complex64 \
+							convert_float32_float64 convert_float32_int16 \
+							convert_float32_int32 convert_float32_int64 convert_float32_int8 \
+							convert_float32_uint16 convert_float32_uint32 \
+							convert_float32_uint64 convert_float32_uint8 \
+							convert_float64_complex128 convert_float64_complex64 \
+							convert_float64_float32 convert_float64_int16 \
+							convert_float64_int32 convert_float64_int64 convert_float64_int8 \
+							convert_float64_uint16 convert_float64_uint32 \
+							convert_float64_uint64 convert_float64_uint8 \
+							convert_int16_complex128 convert_int16_complex64 \
+							convert_int16_float32 convert_int16_float64 convert_int16_int32 \
+							convert_int16_int64 convert_int16_int8 convert_int16_uint16 \
+							convert_int16_uint32 convert_int16_uint64 convert_int16_uint8 \
+							convert_int32_complex128 convert_int32_complex64 \
+							convert_int32_float32 convert_int32_float64 convert_int32_int16 \
+							convert_int32_int64 convert_int32_int8 convert_int32_uint16 \
+							convert_int32_uint32 convert_int32_uint64 convert_int32_uint8 \
+							convert_int64_complex128 convert_int64_complex64 \
+							convert_int64_float32 convert_int64_float64 convert_int64_int16 \
+							convert_int64_int32 convert_int64_int8 convert_int64_uint16 \
+							convert_int64_uint32 convert_int64_uint64 convert_int64_uint8 \
+							convert_int8_complex128 convert_int8_complex64 \
+							convert_int8_float32 convert_int8_float64 convert_int8_int16 \
+							convert_int8_int32 convert_int8_int64 convert_int8_uint16 \
+							convert_int8_uint32 convert_int8_uint64 convert_int8_uint8 \
+							convert_uint16_complex128 convert_uint16_complex64 \
+							convert_uint16_float32 convert_uint16_float64 \
+							convert_uint16_int16 convert_uint16_int32 convert_uint16_int64 \
+							convert_uint16_int8 convert_uint16_uint32 convert_uint16_uint64 \
+							convert_uint16_uint8 convert_uint32_complex128 \
+							convert_uint32_complex64 convert_uint32_float32 \
+							convert_uint32_float64 convert_uint32_int16 convert_uint32_int32 \
+							convert_uint32_int64 convert_uint32_int8 convert_uint32_uint16 \
+							convert_uint32_uint64 convert_uint32_uint8 \
+							convert_uint64_complex128 convert_uint64_complex64 \
+							convert_uint64_float32 convert_uint64_float64 \
+							convert_uint64_int16 convert_uint64_int32 convert_uint64_int64 \
+							convert_uint64_int8 convert_uint64_uint16 convert_uint64_uint32 \
+							convert_uint64_uint8 convert_uint8_complex128 \
+							convert_uint8_complex64 convert_uint8_float32 \
+							convert_uint8_float64 convert_uint8_int16 convert_uint8_int32 \
+							convert_uint8_int64 convert_uint8_int8 convert_uint8_uint16 \
+							convert_uint8_uint32 convert_uint8_uint64
+
+CREAT_TESTS=creat creat_excl creat_rdonly
+
+DEL_TESTS=del del_carray del_carray_deref del_const del_const_deref \
+					del_const_force del_data del_derived del_derived_after \
+					del_derived_force del_meta del_meta_force
+
+DFES_TESTS=dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \
+					 dfes_null dfes_phase dfes_raw dfes_recip dfes_zero
+
+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
+
+ENTRY_TESTS=entry_bad_code entry_bit entry_bit_scalar entry_divide \
+						entry_invalid entry_lincom entry_lincom_scalar entry_linterp \
+						entry_mplex entry_mplex_scalar entry_multiply entry_phase \
+						entry_phase_scalar entry_polynom entry_polynom_scalar entry_raw \
+						entry_raw_scalar entry_raw_scalar_code entry_raw_scalar_type \
+						entry_scalar_repr entry_recip entry_type entry_type_alias \
+						entry_window entry_window_scalar
+
+EOF_TESTS=eof eof_index eof_lincom eof_phase
+
+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
+
+FLUSH_TESTS=flush flush_all flush_bad_code flush_hex flush_invalid flush_meta \
+						flush_ref flush_spec
+
+FOFFS_TESTS=foffs_alter foffs_get foffs_move
+
+FRAGMENT_TESTS=fragment_affix fragment_affix_alter fragment_affix_alter2 \
+							 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_endian64 get_endian_complex128_arm get_endian_complex128_big \
+					get_endian_complex128_little get_endian_complex64_arm \
+					get_endian_complex64_big get_endian_complex64_little \
+					get_endian_float32_arm get_endian_float32_big \
+					get_endian_float32_little get_endian_float64_arm \
+					get_endian_float64_big get_endian_float64_little get_ff get_float32 \
+					get_float64 get_foffs get_foffs2 get_fs get_here get_here_foffs \
+					get_heres \
+					get_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_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
+
+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
+
+HEADER_TESTS=header_complex
+
+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
+
+if INCLUDE_LEGACY_API
+LEGACY_TESTS=legacy_get legacy_get_put legacy_get_rofs legacy_nframes \
+			legacy_nonexistent legacy_put legacy_spf
+endif
+
+LZMA_TESTS=lzma_get lzma_nframes
+
+MADD_TESTS=madd madd_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
+
+NENTRIES_TESTS=nentries_alias nentries_hidden nentries_noalias nentries_scalar
+
+NFIELDS_TESTS=nfields nfields_hidden nfields_invalid 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_off64 nframes_spf
+
+NMETA_TESTS=nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \
+						nmeta_type_hidden nmeta_type_invalid nmeta_type_parent \
+						nmeta_vectors nmeta_vectors_del nmeta_vectors_hidden \
+						nmeta_vectors_invalid nmeta_vectors_parent
+
+OPEN_TESTS=open 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
+
+PARSE_TESTS=parse_alias parse_alias_code parse_alias_dup parse_alias_meta \
+						parse_alias_missing parse_badline parse_bit parse_bit4 \
+						parse_bit_bitnum parse_bit_bitsize parse_bit_ncols \
+						parse_bit_numbits parse_bit_scalar parse_carray parse_carray_long \
+						parse_const parse_const_complex parse_const_ncols parse_divide \
+						parse_double parse_duplicate parse_duplicate_ignore \
+						parse_endian_bad parse_endian_big parse_endian_force \
+						parse_endian_little parse_endian_slash parse_eol parse_foffs \
+						parse_foffs_include parse_foffs_slash parse_hex parse_hidden \
+						parse_hidden_field parse_hidden_meta parse_include \
+						parse_include_absolute parse_include_absrel \
+						parse_include_affix_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_multiply parse_multiply_ncols parse_name parse_name_dot \
+						parse_name_ext parse_name_pedantic parse_ncols parse_phase \
+						parse_phase_ncols parse_phase_scalar parse_polynom \
+						parse_polynom_ncols1 parse_polynom_ncols2 parse_polynom_scalar \
+						parse_protect_all parse_protect_bad parse_protect_data \
+						parse_protect_format parse_protect_none parse_quote \
+						parse_quote_mismatch parse_raw parse_raw_char parse_raw_ncols \
+						parse_raw_scalar parse_raw_spf parse_raw_type parse_recip \
+						parse_ref parse_ref_nonexistent parse_sbit parse_sort parse_string \
+						parse_string_ncols parse_string_null parse_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 \
+					put_endian_complex128_arm put_endian_complex128_big \
+					put_endian_complex128_little put_endian_complex64_arm \
+					put_endian_complex64_big put_endian_complex64_little \
+					put_endian_float32_arm put_endian_float32_big \
+					put_endian_float32_little put_endian_float64_arm \
+					put_endian_float64_big put_endian_float64_little put_ff put_float32 \
+					put_float64 put_foffs put_fs put_here put_heres put_int8 put_int16 \
+					put_int32 put_int64 put_invalid put_lincom1 put_lincom2 \
+					put_lincom_noin put_linterp put_linterp_noin put_linterp_nomono \
+					put_linterp_notab put_linterp_reverse put_mplex put_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
+
+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
+
+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_put_pad sie_put_pad0 sie_put_trunc sie_put_trunc2 \
+					sie_put_trunc_nf sie_sync
+
+SLIM_TESTS=slim_get slim_nframes
+
+SVLIST_TESTS=svlist svlist_hidden svlist_invalid svlist_meta \
+						 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
+
+TABLE_TESTS=table table_code table_type
+
+TELL_TESTS=tell tell64 tell_multidiv
+
+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
+
+VERSION_TESTS=version_0 version_0_write version_1 version_1_write version_2 \
+							version_2_write version_3 version_3_write version_4 \
+							version_4_write version_5 version_5_strict version_5_write \
+							version_6 version_6_strict version_6_write version_7 \
+							version_7_strict version_7_write version_8 version_8_strict \
+							version_8_write version_9 version_9_strict version_9_write
+
+VLIST_TESTS=vlist vlist_alias vlist_hidden vlist_invalid vlist_meta \
+						vlist_meta_hidden vlist_meta_invalid
+
+XZ_TESTS=xz_get xz_nframes
+
+ZZIP_TESTS=zzip_data zzip_get zzip_get_get zzip_nframes
+
+ZZSLIM_TESTS=zzslim_get zzslim_nframes
+
+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)
+
+check_PROGRAMS=$(TESTS)
+
+# fast tests
+.PHONY: fastcheck
+fastcheck:
+	touch $(TESTS)
+	${MAKE} check
+
+# valgrind
+valgrind.log: $(TESTS)
+	rm -f $@; \
+		for x in $^; do ( \
+		echo $$x:; \
+		sed -e 's/exec "/exec valgrind --leak-check=full --track-origins=yes --track-fds=yes --suppressions=valgrind.suppressions "/' $$x | sh; \
+		echo $$x = $$? ); done &> $@;
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dir
+
+getdata-clean-dir:
+	rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dir
+	rm -rf *~
diff --git a/test/Makefile.in b/test/Makefile.in
new file mode 100644
index 0000000..dac0099
--- /dev/null
+++ b/test/Makefile.in
@@ -0,0 +1,10986 @@
+# 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@
+TESTS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
+	$(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
+	$(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \
+	$(am__EXEEXT_10) $(am__EXEEXT_11) $(am__EXEEXT_12) \
+	$(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) \
+	$(am__EXEEXT_16) $(am__EXEEXT_17) $(am__EXEEXT_18) \
+	$(am__EXEEXT_19) $(am__EXEEXT_20) $(am__EXEEXT_21) \
+	$(am__EXEEXT_22) $(am__EXEEXT_23) $(am__EXEEXT_24) \
+	$(am__EXEEXT_25) $(am__EXEEXT_26) $(am__EXEEXT_27) \
+	$(am__EXEEXT_28) $(am__EXEEXT_29) $(am__EXEEXT_30) \
+	$(am__EXEEXT_31) $(am__EXEEXT_32) $(am__EXEEXT_33) \
+	$(am__EXEEXT_34) $(am__EXEEXT_35) $(am__EXEEXT_36) \
+	$(am__EXEEXT_37) $(am__EXEEXT_38) $(am__EXEEXT_39) \
+	$(am__EXEEXT_40) $(am__EXEEXT_41) $(am__EXEEXT_42) \
+	$(am__EXEEXT_43) $(am__EXEEXT_44) $(am__EXEEXT_45) \
+	$(am__EXEEXT_46) $(am__EXEEXT_47) $(am__EXEEXT_48) \
+	$(am__EXEEXT_49) $(am__EXEEXT_50) $(am__EXEEXT_51) \
+	$(am__EXEEXT_52) $(am__EXEEXT_53) $(am__EXEEXT_54) \
+	$(am__EXEEXT_55) $(am__EXEEXT_56) $(am__EXEEXT_57) \
+	$(am__EXEEXT_58) $(am__EXEEXT_59) $(am__EXEEXT_60) \
+	$(am__EXEEXT_61)
+check_PROGRAMS = $(am__EXEEXT_62)
+subdir = test
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__EXEEXT_1 = add$(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_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_lincom_affix$(EXEEXT) add_lincom_invalid$(EXEEXT) \
+	add_lincom_nfields$(EXEEXT) add_linterp$(EXEEXT) \
+	add_linterp_invalid$(EXEEXT) add_meta$(EXEEXT) \
+	add_meta_alias$(EXEEXT) add_mplex$(EXEEXT) \
+	add_mplex_scalars$(EXEEXT) add_multiply$(EXEEXT) \
+	add_multiply_invalid$(EXEEXT) add_phase$(EXEEXT) \
+	add_phase_invalid$(EXEEXT) add_polynom$(EXEEXT) \
+	add_polynom_scalar$(EXEEXT) add_protect$(EXEEXT) \
+	add_raw$(EXEEXT) add_raw_include$(EXEEXT) \
+	add_raw_invalid$(EXEEXT) add_raw_spf$(EXEEXT) \
+	add_raw_spf_scalar$(EXEEXT) add_raw_type$(EXEEXT) \
+	add_rdonly$(EXEEXT) add_recip$(EXEEXT) add_resolv$(EXEEXT) \
+	add_sbit$(EXEEXT) add_scalar$(EXEEXT) \
+	add_scalar_carray$(EXEEXT) add_scalar_carray_bad$(EXEEXT) \
+	add_sort$(EXEEXT) add_spec$(EXEEXT) \
+	add_spec_directive$(EXEEXT) add_spec_invalid$(EXEEXT) \
+	add_spec_meta$(EXEEXT) add_spec_resolv$(EXEEXT) \
+	add_string$(EXEEXT) add_string_affix$(EXEEXT) \
+	add_type$(EXEEXT) add_window$(EXEEXT) add_window_op$(EXEEXT)
+am__EXEEXT_2 = alias_list$(EXEEXT) alias_list_alias$(EXEEXT) \
+	alias_list_missing$(EXEEXT) alias_num$(EXEEXT) \
+	alias_num_alias$(EXEEXT) alias_num_missing$(EXEEXT) \
+	alias_target$(EXEEXT) alias_target_alias$(EXEEXT) \
+	alias_target_missing$(EXEEXT)
+am__EXEEXT_3 = alter_bit_bitnum$(EXEEXT) alter_bit_numbits$(EXEEXT) \
+	alter_carray_len$(EXEEXT) alter_carray_type$(EXEEXT) \
+	alter_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_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)
+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) \
+	close_discard$(EXEEXT) close_null$(EXEEXT)
+am__EXEEXT_8 = convert_complex128_complex64$(EXEEXT) \
+	convert_complex128_float64$(EXEEXT) \
+	convert_complex128_int64$(EXEEXT) \
+	convert_complex128_uint64$(EXEEXT) \
+	convert_complex64_complex128$(EXEEXT) \
+	convert_complex64_float64$(EXEEXT) \
+	convert_complex64_int64$(EXEEXT) \
+	convert_complex64_uint64$(EXEEXT) \
+	convert_float32_complex128$(EXEEXT) \
+	convert_float32_complex64$(EXEEXT) \
+	convert_float32_float64$(EXEEXT) \
+	convert_float32_int16$(EXEEXT) convert_float32_int32$(EXEEXT) \
+	convert_float32_int64$(EXEEXT) convert_float32_int8$(EXEEXT) \
+	convert_float32_uint16$(EXEEXT) \
+	convert_float32_uint32$(EXEEXT) \
+	convert_float32_uint64$(EXEEXT) convert_float32_uint8$(EXEEXT) \
+	convert_float64_complex128$(EXEEXT) \
+	convert_float64_complex64$(EXEEXT) \
+	convert_float64_float32$(EXEEXT) \
+	convert_float64_int16$(EXEEXT) convert_float64_int32$(EXEEXT) \
+	convert_float64_int64$(EXEEXT) convert_float64_int8$(EXEEXT) \
+	convert_float64_uint16$(EXEEXT) \
+	convert_float64_uint32$(EXEEXT) \
+	convert_float64_uint64$(EXEEXT) convert_float64_uint8$(EXEEXT) \
+	convert_int16_complex128$(EXEEXT) \
+	convert_int16_complex64$(EXEEXT) \
+	convert_int16_float32$(EXEEXT) convert_int16_float64$(EXEEXT) \
+	convert_int16_int32$(EXEEXT) convert_int16_int64$(EXEEXT) \
+	convert_int16_int8$(EXEEXT) convert_int16_uint16$(EXEEXT) \
+	convert_int16_uint32$(EXEEXT) convert_int16_uint64$(EXEEXT) \
+	convert_int16_uint8$(EXEEXT) convert_int32_complex128$(EXEEXT) \
+	convert_int32_complex64$(EXEEXT) \
+	convert_int32_float32$(EXEEXT) convert_int32_float64$(EXEEXT) \
+	convert_int32_int16$(EXEEXT) convert_int32_int64$(EXEEXT) \
+	convert_int32_int8$(EXEEXT) convert_int32_uint16$(EXEEXT) \
+	convert_int32_uint32$(EXEEXT) convert_int32_uint64$(EXEEXT) \
+	convert_int32_uint8$(EXEEXT) convert_int64_complex128$(EXEEXT) \
+	convert_int64_complex64$(EXEEXT) \
+	convert_int64_float32$(EXEEXT) convert_int64_float64$(EXEEXT) \
+	convert_int64_int16$(EXEEXT) convert_int64_int32$(EXEEXT) \
+	convert_int64_int8$(EXEEXT) convert_int64_uint16$(EXEEXT) \
+	convert_int64_uint32$(EXEEXT) convert_int64_uint64$(EXEEXT) \
+	convert_int64_uint8$(EXEEXT) convert_int8_complex128$(EXEEXT) \
+	convert_int8_complex64$(EXEEXT) convert_int8_float32$(EXEEXT) \
+	convert_int8_float64$(EXEEXT) convert_int8_int16$(EXEEXT) \
+	convert_int8_int32$(EXEEXT) convert_int8_int64$(EXEEXT) \
+	convert_int8_uint16$(EXEEXT) convert_int8_uint32$(EXEEXT) \
+	convert_int8_uint64$(EXEEXT) convert_int8_uint8$(EXEEXT) \
+	convert_uint16_complex128$(EXEEXT) \
+	convert_uint16_complex64$(EXEEXT) \
+	convert_uint16_float32$(EXEEXT) \
+	convert_uint16_float64$(EXEEXT) convert_uint16_int16$(EXEEXT) \
+	convert_uint16_int32$(EXEEXT) convert_uint16_int64$(EXEEXT) \
+	convert_uint16_int8$(EXEEXT) convert_uint16_uint32$(EXEEXT) \
+	convert_uint16_uint64$(EXEEXT) convert_uint16_uint8$(EXEEXT) \
+	convert_uint32_complex128$(EXEEXT) \
+	convert_uint32_complex64$(EXEEXT) \
+	convert_uint32_float32$(EXEEXT) \
+	convert_uint32_float64$(EXEEXT) convert_uint32_int16$(EXEEXT) \
+	convert_uint32_int32$(EXEEXT) convert_uint32_int64$(EXEEXT) \
+	convert_uint32_int8$(EXEEXT) convert_uint32_uint16$(EXEEXT) \
+	convert_uint32_uint64$(EXEEXT) convert_uint32_uint8$(EXEEXT) \
+	convert_uint64_complex128$(EXEEXT) \
+	convert_uint64_complex64$(EXEEXT) \
+	convert_uint64_float32$(EXEEXT) \
+	convert_uint64_float64$(EXEEXT) convert_uint64_int16$(EXEEXT) \
+	convert_uint64_int32$(EXEEXT) convert_uint64_int64$(EXEEXT) \
+	convert_uint64_int8$(EXEEXT) convert_uint64_uint16$(EXEEXT) \
+	convert_uint64_uint32$(EXEEXT) convert_uint64_uint8$(EXEEXT) \
+	convert_uint8_complex128$(EXEEXT) \
+	convert_uint8_complex64$(EXEEXT) \
+	convert_uint8_float32$(EXEEXT) convert_uint8_float64$(EXEEXT) \
+	convert_uint8_int16$(EXEEXT) convert_uint8_int32$(EXEEXT) \
+	convert_uint8_int64$(EXEEXT) convert_uint8_int8$(EXEEXT) \
+	convert_uint8_uint16$(EXEEXT) convert_uint8_uint32$(EXEEXT) \
+	convert_uint8_uint64$(EXEEXT)
+am__EXEEXT_9 = creat$(EXEEXT) creat_excl$(EXEEXT) \
+	creat_rdonly$(EXEEXT)
+am__EXEEXT_10 = cvlist$(EXEEXT) cvlist_array$(EXEEXT) \
+	cvlist_array_hidden$(EXEEXT) cvlist_array_meta$(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) \
+	del_carray_deref$(EXEEXT) del_const$(EXEEXT) \
+	del_const_deref$(EXEEXT) del_const_force$(EXEEXT) \
+	del_data$(EXEEXT) del_derived$(EXEEXT) \
+	del_derived_after$(EXEEXT) del_derived_force$(EXEEXT) \
+	del_meta$(EXEEXT) del_meta_force$(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)
+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_17 = entry_bad_code$(EXEEXT) entry_bit$(EXEEXT) \
+	entry_bit_scalar$(EXEEXT) entry_divide$(EXEEXT) \
+	entry_invalid$(EXEEXT) entry_lincom$(EXEEXT) \
+	entry_lincom_scalar$(EXEEXT) entry_linterp$(EXEEXT) \
+	entry_mplex$(EXEEXT) entry_mplex_scalar$(EXEEXT) \
+	entry_multiply$(EXEEXT) entry_phase$(EXEEXT) \
+	entry_phase_scalar$(EXEEXT) entry_polynom$(EXEEXT) \
+	entry_polynom_scalar$(EXEEXT) entry_raw$(EXEEXT) \
+	entry_raw_scalar$(EXEEXT) entry_raw_scalar_code$(EXEEXT) \
+	entry_raw_scalar_type$(EXEEXT) entry_scalar_repr$(EXEEXT) \
+	entry_recip$(EXEEXT) entry_type$(EXEEXT) \
+	entry_type_alias$(EXEEXT) entry_window$(EXEEXT) \
+	entry_window_scalar$(EXEEXT)
+am__EXEEXT_18 = eof$(EXEEXT) eof_index$(EXEEXT) eof_lincom$(EXEEXT) \
+	eof_phase$(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) \
+	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) \
+	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) \
+	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_endian_complex128_big$(EXEEXT) \
+	get_endian_complex128_little$(EXEEXT) \
+	get_endian_complex64_arm$(EXEEXT) \
+	get_endian_complex64_big$(EXEEXT) \
+	get_endian_complex64_little$(EXEEXT) \
+	get_endian_float32_arm$(EXEEXT) \
+	get_endian_float32_big$(EXEEXT) \
+	get_endian_float32_little$(EXEEXT) \
+	get_endian_float64_arm$(EXEEXT) \
+	get_endian_float64_big$(EXEEXT) \
+	get_endian_float64_little$(EXEEXT) get_ff$(EXEEXT) \
+	get_float32$(EXEEXT) get_float64$(EXEEXT) get_foffs$(EXEEXT) \
+	get_foffs2$(EXEEXT) get_fs$(EXEEXT) get_here$(EXEEXT) \
+	get_here_foffs$(EXEEXT) get_heres$(EXEEXT) get_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_mplex_lball$(EXEEXT) get_mplex_nolb$(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_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) \
+	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) \
+	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) \
+	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) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_get_put$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_get_rofs$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_nframes$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_nonexistent$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_put$(EXEEXT) \
+ at INCLUDE_LEGACY_API_TRUE@	legacy_spf$(EXEEXT)
+am__EXEEXT_33 = lzma_get$(EXEEXT) lzma_nframes$(EXEEXT)
+am__EXEEXT_34 = madd$(EXEEXT) madd_affix$(EXEEXT) madd_alias$(EXEEXT) \
+	madd_alias_affix$(EXEEXT) madd_bit$(EXEEXT) \
+	madd_bit_invalid$(EXEEXT) madd_carray$(EXEEXT) \
+	madd_clincom$(EXEEXT) madd_const$(EXEEXT) \
+	madd_cpolynom$(EXEEXT) madd_crecip$(EXEEXT) \
+	madd_crecip89$(EXEEXT) madd_divide$(EXEEXT) \
+	madd_index$(EXEEXT) madd_lincom$(EXEEXT) \
+	madd_lincom_invalid$(EXEEXT) madd_linterp$(EXEEXT) \
+	madd_linterp_invalid$(EXEEXT) madd_mplex$(EXEEXT) \
+	madd_multiply$(EXEEXT) madd_multiply_invalid$(EXEEXT) \
+	madd_phase$(EXEEXT) madd_phase_invalid$(EXEEXT) \
+	madd_polynom$(EXEEXT) madd_recip$(EXEEXT) madd_sbit$(EXEEXT) \
+	madd_spec$(EXEEXT) madd_spec_directive$(EXEEXT) \
+	madd_spec_invalid$(EXEEXT) madd_spec_resolv$(EXEEXT) \
+	madd_string$(EXEEXT) madd_window$(EXEEXT)
+am__EXEEXT_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) \
+	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) \
+	nentries_noalias$(EXEEXT) nentries_scalar$(EXEEXT)
+am__EXEEXT_38 = nfields$(EXEEXT) nfields_hidden$(EXEEXT) \
+	nfields_invalid$(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) \
+	nframes_off64$(EXEEXT) nframes_spf$(EXEEXT)
+am__EXEEXT_40 = 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) \
+	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) \
+	parse_alias_dup$(EXEEXT) parse_alias_meta$(EXEEXT) \
+	parse_alias_missing$(EXEEXT) parse_badline$(EXEEXT) \
+	parse_bit$(EXEEXT) parse_bit4$(EXEEXT) \
+	parse_bit_bitnum$(EXEEXT) parse_bit_bitsize$(EXEEXT) \
+	parse_bit_ncols$(EXEEXT) parse_bit_numbits$(EXEEXT) \
+	parse_bit_scalar$(EXEEXT) parse_carray$(EXEEXT) \
+	parse_carray_long$(EXEEXT) parse_const$(EXEEXT) \
+	parse_const_complex$(EXEEXT) parse_const_ncols$(EXEEXT) \
+	parse_divide$(EXEEXT) parse_double$(EXEEXT) \
+	parse_duplicate$(EXEEXT) parse_duplicate_ignore$(EXEEXT) \
+	parse_endian_bad$(EXEEXT) parse_endian_big$(EXEEXT) \
+	parse_endian_force$(EXEEXT) parse_endian_little$(EXEEXT) \
+	parse_endian_slash$(EXEEXT) parse_eol$(EXEEXT) \
+	parse_foffs$(EXEEXT) parse_foffs_include$(EXEEXT) \
+	parse_foffs_slash$(EXEEXT) parse_hex$(EXEEXT) \
+	parse_hidden$(EXEEXT) parse_hidden_field$(EXEEXT) \
+	parse_hidden_meta$(EXEEXT) parse_include$(EXEEXT) \
+	parse_include_absolute$(EXEEXT) parse_include_absrel$(EXEEXT) \
+	parse_include_affix_ref$(EXEEXT) parse_include_dir$(EXEEXT) \
+	parse_include_loop$(EXEEXT) parse_include_nonexistent$(EXEEXT) \
+	parse_include_prefix$(EXEEXT) \
+	parse_include_prefix_dup$(EXEEXT) \
+	parse_include_preprefix$(EXEEXT) parse_include_ref$(EXEEXT) \
+	parse_include_relabs$(EXEEXT) parse_include_relrel$(EXEEXT) \
+	parse_include_slash$(EXEEXT) parse_include_suffix$(EXEEXT) \
+	parse_include_sufsuffix$(EXEEXT) parse_index$(EXEEXT) \
+	parse_lincom$(EXEEXT) parse_lincom_ncols1$(EXEEXT) \
+	parse_lincom_ncols2$(EXEEXT) parse_lincom_nfields$(EXEEXT) \
+	parse_lincom_nofields$(EXEEXT) parse_lincom_non$(EXEEXT) \
+	parse_lincom_non_ncols$(EXEEXT) parse_lincom_scalar$(EXEEXT) \
+	parse_linterp$(EXEEXT) parse_linterp_ncols$(EXEEXT) \
+	parse_malias$(EXEEXT) parse_malias_dup$(EXEEXT) \
+	parse_malias_meta$(EXEEXT) parse_meta$(EXEEXT) \
+	parse_meta_affix$(EXEEXT) parse_meta_alias$(EXEEXT) \
+	parse_meta_implicit$(EXEEXT) parse_meta_implicit2$(EXEEXT) \
+	parse_meta_implicit_affix$(EXEEXT) parse_meta_index$(EXEEXT) \
+	parse_meta_index2$(EXEEXT) parse_meta_jump$(EXEEXT) \
+	parse_meta_malias$(EXEEXT) parse_meta_meta$(EXEEXT) \
+	parse_meta_parent$(EXEEXT) parse_meta_raw$(EXEEXT) \
+	parse_mplex$(EXEEXT) parse_mplex_ncols$(EXEEXT) \
+	parse_mplex_nomax$(EXEEXT) parse_mplex_scalar$(EXEEXT) \
+	parse_multiply$(EXEEXT) parse_multiply_ncols$(EXEEXT) \
+	parse_name$(EXEEXT) parse_name_dot$(EXEEXT) \
+	parse_name_ext$(EXEEXT) parse_name_pedantic$(EXEEXT) \
+	parse_ncols$(EXEEXT) parse_phase$(EXEEXT) \
+	parse_phase_ncols$(EXEEXT) parse_phase_scalar$(EXEEXT) \
+	parse_polynom$(EXEEXT) parse_polynom_ncols1$(EXEEXT) \
+	parse_polynom_ncols2$(EXEEXT) parse_polynom_scalar$(EXEEXT) \
+	parse_protect_all$(EXEEXT) parse_protect_bad$(EXEEXT) \
+	parse_protect_data$(EXEEXT) parse_protect_format$(EXEEXT) \
+	parse_protect_none$(EXEEXT) parse_quote$(EXEEXT) \
+	parse_quote_mismatch$(EXEEXT) parse_raw$(EXEEXT) \
+	parse_raw_char$(EXEEXT) parse_raw_ncols$(EXEEXT) \
+	parse_raw_scalar$(EXEEXT) parse_raw_spf$(EXEEXT) \
+	parse_raw_type$(EXEEXT) parse_recip$(EXEEXT) \
+	parse_ref$(EXEEXT) parse_ref_nonexistent$(EXEEXT) \
+	parse_sbit$(EXEEXT) parse_sort$(EXEEXT) parse_string$(EXEEXT) \
+	parse_string_ncols$(EXEEXT) parse_string_null$(EXEEXT) \
+	parse_utf8$(EXEEXT) parse_utf8_invalid$(EXEEXT) \
+	parse_utf8_zero$(EXEEXT) parse_version$(EXEEXT) \
+	parse_version_89$(EXEEXT) parse_version_98$(EXEEXT) \
+	parse_version_include$(EXEEXT) \
+	parse_version_permissive$(EXEEXT) parse_version_p8$(EXEEXT) \
+	parse_version_p9$(EXEEXT) parse_version_slash$(EXEEXT) \
+	parse_whitespace$(EXEEXT) parse_window$(EXEEXT) \
+	parse_window_ncols$(EXEEXT) parse_window_op$(EXEEXT) \
+	parse_window_scalar$(EXEEXT)
+am__EXEEXT_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) \
+	put_endian8$(EXEEXT) put_endian16$(EXEEXT) \
+	put_endian32$(EXEEXT) put_endian64$(EXEEXT) \
+	put_endian_complex128_arm$(EXEEXT) \
+	put_endian_complex128_big$(EXEEXT) \
+	put_endian_complex128_little$(EXEEXT) \
+	put_endian_complex64_arm$(EXEEXT) \
+	put_endian_complex64_big$(EXEEXT) \
+	put_endian_complex64_little$(EXEEXT) \
+	put_endian_float32_arm$(EXEEXT) \
+	put_endian_float32_big$(EXEEXT) \
+	put_endian_float32_little$(EXEEXT) \
+	put_endian_float64_arm$(EXEEXT) \
+	put_endian_float64_big$(EXEEXT) \
+	put_endian_float64_little$(EXEEXT) put_ff$(EXEEXT) \
+	put_float32$(EXEEXT) put_float64$(EXEEXT) put_foffs$(EXEEXT) \
+	put_fs$(EXEEXT) put_here$(EXEEXT) put_heres$(EXEEXT) \
+	put_int8$(EXEEXT) put_int16$(EXEEXT) put_int32$(EXEEXT) \
+	put_int64$(EXEEXT) put_invalid$(EXEEXT) put_lincom1$(EXEEXT) \
+	put_lincom2$(EXEEXT) put_lincom_noin$(EXEEXT) \
+	put_linterp$(EXEEXT) put_linterp_noin$(EXEEXT) \
+	put_linterp_nomono$(EXEEXT) put_linterp_notab$(EXEEXT) \
+	put_linterp_reverse$(EXEEXT) put_mplex$(EXEEXT) \
+	put_multiply$(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_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) \
+	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_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) \
+	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) \
+	tok_quote$(EXEEXT)
+am__EXEEXT_55 = 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) \
+	version_1$(EXEEXT) version_1_write$(EXEEXT) version_2$(EXEEXT) \
+	version_2_write$(EXEEXT) version_3$(EXEEXT) \
+	version_3_write$(EXEEXT) version_4$(EXEEXT) \
+	version_4_write$(EXEEXT) version_5$(EXEEXT) \
+	version_5_strict$(EXEEXT) version_5_write$(EXEEXT) \
+	version_6$(EXEEXT) version_6_strict$(EXEEXT) \
+	version_6_write$(EXEEXT) version_7$(EXEEXT) \
+	version_7_strict$(EXEEXT) version_7_write$(EXEEXT) \
+	version_8$(EXEEXT) version_8_strict$(EXEEXT) \
+	version_8_write$(EXEEXT) version_9$(EXEEXT) \
+	version_9_strict$(EXEEXT) version_9_write$(EXEEXT)
+am__EXEEXT_58 = 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_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
+	$(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \
+	$(am__EXEEXT_10) $(am__EXEEXT_11) $(am__EXEEXT_12) \
+	$(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) \
+	$(am__EXEEXT_16) $(am__EXEEXT_17) $(am__EXEEXT_18) \
+	$(am__EXEEXT_19) $(am__EXEEXT_20) $(am__EXEEXT_21) \
+	$(am__EXEEXT_22) $(am__EXEEXT_23) $(am__EXEEXT_24) \
+	$(am__EXEEXT_25) $(am__EXEEXT_26) $(am__EXEEXT_27) \
+	$(am__EXEEXT_28) $(am__EXEEXT_29) $(am__EXEEXT_30) \
+	$(am__EXEEXT_31) $(am__EXEEXT_32) $(am__EXEEXT_33) \
+	$(am__EXEEXT_34) $(am__EXEEXT_35) $(am__EXEEXT_36) \
+	$(am__EXEEXT_37) $(am__EXEEXT_38) $(am__EXEEXT_39) \
+	$(am__EXEEXT_40) $(am__EXEEXT_41) $(am__EXEEXT_42) \
+	$(am__EXEEXT_43) $(am__EXEEXT_44) $(am__EXEEXT_45) \
+	$(am__EXEEXT_46) $(am__EXEEXT_47) $(am__EXEEXT_48) \
+	$(am__EXEEXT_49) $(am__EXEEXT_50) $(am__EXEEXT_51) \
+	$(am__EXEEXT_52) $(am__EXEEXT_53) $(am__EXEEXT_54) \
+	$(am__EXEEXT_55) $(am__EXEEXT_56) $(am__EXEEXT_57) \
+	$(am__EXEEXT_58) $(am__EXEEXT_59) $(am__EXEEXT_60) \
+	$(am__EXEEXT_61)
+add_SOURCES = add.c
+add_OBJECTS = add.$(OBJEXT)
+add_LDADD = $(LDADD)
+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
+am__v_lt_1 = 
+add_affix_SOURCES = add_affix.c
+add_affix_OBJECTS = add_affix.$(OBJEXT)
+add_affix_LDADD = $(LDADD)
+add_affix_DEPENDENCIES = ../src/libgetdata.la
+add_alias_SOURCES = add_alias.c
+add_alias_OBJECTS = add_alias.$(OBJEXT)
+add_alias_LDADD = $(LDADD)
+add_alias_DEPENDENCIES = ../src/libgetdata.la
+add_alias_affix_SOURCES = add_alias_affix.c
+add_alias_affix_OBJECTS = add_alias_affix.$(OBJEXT)
+add_alias_affix_LDADD = $(LDADD)
+add_alias_affix_DEPENDENCIES = ../src/libgetdata.la
+add_alias_meta_SOURCES = add_alias_meta.c
+add_alias_meta_OBJECTS = add_alias_meta.$(OBJEXT)
+add_alias_meta_LDADD = $(LDADD)
+add_alias_meta_DEPENDENCIES = ../src/libgetdata.la
+add_bit_SOURCES = add_bit.c
+add_bit_OBJECTS = add_bit.$(OBJEXT)
+add_bit_LDADD = $(LDADD)
+add_bit_DEPENDENCIES = ../src/libgetdata.la
+add_bit_bitnum_SOURCES = add_bit_bitnum.c
+add_bit_bitnum_OBJECTS = add_bit_bitnum.$(OBJEXT)
+add_bit_bitnum_LDADD = $(LDADD)
+add_bit_bitnum_DEPENDENCIES = ../src/libgetdata.la
+add_bit_bitsize_SOURCES = add_bit_bitsize.c
+add_bit_bitsize_OBJECTS = add_bit_bitsize.$(OBJEXT)
+add_bit_bitsize_LDADD = $(LDADD)
+add_bit_bitsize_DEPENDENCIES = ../src/libgetdata.la
+add_bit_invalid_SOURCES = add_bit_invalid.c
+add_bit_invalid_OBJECTS = add_bit_invalid.$(OBJEXT)
+add_bit_invalid_LDADD = $(LDADD)
+add_bit_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_bit_numbits_SOURCES = add_bit_numbits.c
+add_bit_numbits_OBJECTS = add_bit_numbits.$(OBJEXT)
+add_bit_numbits_LDADD = $(LDADD)
+add_bit_numbits_DEPENDENCIES = ../src/libgetdata.la
+add_bit_scalars_SOURCES = add_bit_scalars.c
+add_bit_scalars_OBJECTS = add_bit_scalars.$(OBJEXT)
+add_bit_scalars_LDADD = $(LDADD)
+add_bit_scalars_DEPENDENCIES = ../src/libgetdata.la
+add_carray_SOURCES = add_carray.c
+add_carray_OBJECTS = add_carray.$(OBJEXT)
+add_carray_LDADD = $(LDADD)
+add_carray_DEPENDENCIES = ../src/libgetdata.la
+add_clincom_SOURCES = add_clincom.c
+add_clincom_OBJECTS = add_clincom.$(OBJEXT)
+add_clincom_LDADD = $(LDADD)
+add_clincom_DEPENDENCIES = ../src/libgetdata.la
+add_code_SOURCES = add_code.c
+add_code_OBJECTS = add_code.$(OBJEXT)
+add_code_LDADD = $(LDADD)
+add_code_DEPENDENCIES = ../src/libgetdata.la
+add_const_SOURCES = add_const.c
+add_const_OBJECTS = add_const.$(OBJEXT)
+add_const_LDADD = $(LDADD)
+add_const_DEPENDENCIES = ../src/libgetdata.la
+add_cpolynom_SOURCES = add_cpolynom.c
+add_cpolynom_OBJECTS = add_cpolynom.$(OBJEXT)
+add_cpolynom_LDADD = $(LDADD)
+add_cpolynom_DEPENDENCIES = ../src/libgetdata.la
+add_crecip_SOURCES = add_crecip.c
+add_crecip_OBJECTS = add_crecip.$(OBJEXT)
+add_crecip_LDADD = $(LDADD)
+add_crecip_DEPENDENCIES = ../src/libgetdata.la
+add_crecip89_SOURCES = add_crecip89.c
+add_crecip89_OBJECTS = add_crecip89.$(OBJEXT)
+add_crecip89_LDADD = $(LDADD)
+add_crecip89_DEPENDENCIES = ../src/libgetdata.la
+add_dangle_dup_SOURCES = add_dangle_dup.c
+add_dangle_dup_OBJECTS = add_dangle_dup.$(OBJEXT)
+add_dangle_dup_LDADD = $(LDADD)
+add_dangle_dup_DEPENDENCIES = ../src/libgetdata.la
+add_divide_SOURCES = add_divide.c
+add_divide_OBJECTS = add_divide.$(OBJEXT)
+add_divide_LDADD = $(LDADD)
+add_divide_DEPENDENCIES = ../src/libgetdata.la
+add_divide_invalid_SOURCES = add_divide_invalid.c
+add_divide_invalid_OBJECTS = add_divide_invalid.$(OBJEXT)
+add_divide_invalid_LDADD = $(LDADD)
+add_divide_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_duplicate_SOURCES = add_duplicate.c
+add_duplicate_OBJECTS = add_duplicate.$(OBJEXT)
+add_duplicate_LDADD = $(LDADD)
+add_duplicate_DEPENDENCIES = ../src/libgetdata.la
+add_format_SOURCES = add_format.c
+add_format_OBJECTS = add_format.$(OBJEXT)
+add_format_LDADD = $(LDADD)
+add_format_DEPENDENCIES = ../src/libgetdata.la
+add_invalid_SOURCES = add_invalid.c
+add_invalid_OBJECTS = add_invalid.$(OBJEXT)
+add_invalid_LDADD = $(LDADD)
+add_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_lincom_SOURCES = add_lincom.c
+add_lincom_OBJECTS = add_lincom.$(OBJEXT)
+add_lincom_LDADD = $(LDADD)
+add_lincom_DEPENDENCIES = ../src/libgetdata.la
+add_lincom_affix_SOURCES = add_lincom_affix.c
+add_lincom_affix_OBJECTS = add_lincom_affix.$(OBJEXT)
+add_lincom_affix_LDADD = $(LDADD)
+add_lincom_affix_DEPENDENCIES = ../src/libgetdata.la
+add_lincom_invalid_SOURCES = add_lincom_invalid.c
+add_lincom_invalid_OBJECTS = add_lincom_invalid.$(OBJEXT)
+add_lincom_invalid_LDADD = $(LDADD)
+add_lincom_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_lincom_nfields_SOURCES = add_lincom_nfields.c
+add_lincom_nfields_OBJECTS = add_lincom_nfields.$(OBJEXT)
+add_lincom_nfields_LDADD = $(LDADD)
+add_lincom_nfields_DEPENDENCIES = ../src/libgetdata.la
+add_linterp_SOURCES = add_linterp.c
+add_linterp_OBJECTS = add_linterp.$(OBJEXT)
+add_linterp_LDADD = $(LDADD)
+add_linterp_DEPENDENCIES = ../src/libgetdata.la
+add_linterp_invalid_SOURCES = add_linterp_invalid.c
+add_linterp_invalid_OBJECTS = add_linterp_invalid.$(OBJEXT)
+add_linterp_invalid_LDADD = $(LDADD)
+add_linterp_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_meta_SOURCES = add_meta.c
+add_meta_OBJECTS = add_meta.$(OBJEXT)
+add_meta_LDADD = $(LDADD)
+add_meta_DEPENDENCIES = ../src/libgetdata.la
+add_meta_alias_SOURCES = add_meta_alias.c
+add_meta_alias_OBJECTS = add_meta_alias.$(OBJEXT)
+add_meta_alias_LDADD = $(LDADD)
+add_meta_alias_DEPENDENCIES = ../src/libgetdata.la
+add_mplex_SOURCES = add_mplex.c
+add_mplex_OBJECTS = add_mplex.$(OBJEXT)
+add_mplex_LDADD = $(LDADD)
+add_mplex_DEPENDENCIES = ../src/libgetdata.la
+add_mplex_scalars_SOURCES = add_mplex_scalars.c
+add_mplex_scalars_OBJECTS = add_mplex_scalars.$(OBJEXT)
+add_mplex_scalars_LDADD = $(LDADD)
+add_mplex_scalars_DEPENDENCIES = ../src/libgetdata.la
+add_multiply_SOURCES = add_multiply.c
+add_multiply_OBJECTS = add_multiply.$(OBJEXT)
+add_multiply_LDADD = $(LDADD)
+add_multiply_DEPENDENCIES = ../src/libgetdata.la
+add_multiply_invalid_SOURCES = add_multiply_invalid.c
+add_multiply_invalid_OBJECTS = add_multiply_invalid.$(OBJEXT)
+add_multiply_invalid_LDADD = $(LDADD)
+add_multiply_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_phase_SOURCES = add_phase.c
+add_phase_OBJECTS = add_phase.$(OBJEXT)
+add_phase_LDADD = $(LDADD)
+add_phase_DEPENDENCIES = ../src/libgetdata.la
+add_phase_invalid_SOURCES = add_phase_invalid.c
+add_phase_invalid_OBJECTS = add_phase_invalid.$(OBJEXT)
+add_phase_invalid_LDADD = $(LDADD)
+add_phase_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_polynom_SOURCES = add_polynom.c
+add_polynom_OBJECTS = add_polynom.$(OBJEXT)
+add_polynom_LDADD = $(LDADD)
+add_polynom_DEPENDENCIES = ../src/libgetdata.la
+add_polynom_scalar_SOURCES = add_polynom_scalar.c
+add_polynom_scalar_OBJECTS = add_polynom_scalar.$(OBJEXT)
+add_polynom_scalar_LDADD = $(LDADD)
+add_polynom_scalar_DEPENDENCIES = ../src/libgetdata.la
+add_protect_SOURCES = add_protect.c
+add_protect_OBJECTS = add_protect.$(OBJEXT)
+add_protect_LDADD = $(LDADD)
+add_protect_DEPENDENCIES = ../src/libgetdata.la
+add_raw_SOURCES = add_raw.c
+add_raw_OBJECTS = add_raw.$(OBJEXT)
+add_raw_LDADD = $(LDADD)
+add_raw_DEPENDENCIES = ../src/libgetdata.la
+add_raw_include_SOURCES = add_raw_include.c
+add_raw_include_OBJECTS = add_raw_include.$(OBJEXT)
+add_raw_include_LDADD = $(LDADD)
+add_raw_include_DEPENDENCIES = ../src/libgetdata.la
+add_raw_invalid_SOURCES = add_raw_invalid.c
+add_raw_invalid_OBJECTS = add_raw_invalid.$(OBJEXT)
+add_raw_invalid_LDADD = $(LDADD)
+add_raw_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_raw_spf_SOURCES = add_raw_spf.c
+add_raw_spf_OBJECTS = add_raw_spf.$(OBJEXT)
+add_raw_spf_LDADD = $(LDADD)
+add_raw_spf_DEPENDENCIES = ../src/libgetdata.la
+add_raw_spf_scalar_SOURCES = add_raw_spf_scalar.c
+add_raw_spf_scalar_OBJECTS = add_raw_spf_scalar.$(OBJEXT)
+add_raw_spf_scalar_LDADD = $(LDADD)
+add_raw_spf_scalar_DEPENDENCIES = ../src/libgetdata.la
+add_raw_type_SOURCES = add_raw_type.c
+add_raw_type_OBJECTS = add_raw_type.$(OBJEXT)
+add_raw_type_LDADD = $(LDADD)
+add_raw_type_DEPENDENCIES = ../src/libgetdata.la
+add_rdonly_SOURCES = add_rdonly.c
+add_rdonly_OBJECTS = add_rdonly.$(OBJEXT)
+add_rdonly_LDADD = $(LDADD)
+add_rdonly_DEPENDENCIES = ../src/libgetdata.la
+add_recip_SOURCES = add_recip.c
+add_recip_OBJECTS = add_recip.$(OBJEXT)
+add_recip_LDADD = $(LDADD)
+add_recip_DEPENDENCIES = ../src/libgetdata.la
+add_resolv_SOURCES = add_resolv.c
+add_resolv_OBJECTS = add_resolv.$(OBJEXT)
+add_resolv_LDADD = $(LDADD)
+add_resolv_DEPENDENCIES = ../src/libgetdata.la
+add_sbit_SOURCES = add_sbit.c
+add_sbit_OBJECTS = add_sbit.$(OBJEXT)
+add_sbit_LDADD = $(LDADD)
+add_sbit_DEPENDENCIES = ../src/libgetdata.la
+add_scalar_SOURCES = add_scalar.c
+add_scalar_OBJECTS = add_scalar.$(OBJEXT)
+add_scalar_LDADD = $(LDADD)
+add_scalar_DEPENDENCIES = ../src/libgetdata.la
+add_scalar_carray_SOURCES = add_scalar_carray.c
+add_scalar_carray_OBJECTS = add_scalar_carray.$(OBJEXT)
+add_scalar_carray_LDADD = $(LDADD)
+add_scalar_carray_DEPENDENCIES = ../src/libgetdata.la
+add_scalar_carray_bad_SOURCES = add_scalar_carray_bad.c
+add_scalar_carray_bad_OBJECTS = add_scalar_carray_bad.$(OBJEXT)
+add_scalar_carray_bad_LDADD = $(LDADD)
+add_scalar_carray_bad_DEPENDENCIES = ../src/libgetdata.la
+add_sort_SOURCES = add_sort.c
+add_sort_OBJECTS = add_sort.$(OBJEXT)
+add_sort_LDADD = $(LDADD)
+add_sort_DEPENDENCIES = ../src/libgetdata.la
+add_spec_SOURCES = add_spec.c
+add_spec_OBJECTS = add_spec.$(OBJEXT)
+add_spec_LDADD = $(LDADD)
+add_spec_DEPENDENCIES = ../src/libgetdata.la
+add_spec_directive_SOURCES = add_spec_directive.c
+add_spec_directive_OBJECTS = add_spec_directive.$(OBJEXT)
+add_spec_directive_LDADD = $(LDADD)
+add_spec_directive_DEPENDENCIES = ../src/libgetdata.la
+add_spec_invalid_SOURCES = add_spec_invalid.c
+add_spec_invalid_OBJECTS = add_spec_invalid.$(OBJEXT)
+add_spec_invalid_LDADD = $(LDADD)
+add_spec_invalid_DEPENDENCIES = ../src/libgetdata.la
+add_spec_meta_SOURCES = add_spec_meta.c
+add_spec_meta_OBJECTS = add_spec_meta.$(OBJEXT)
+add_spec_meta_LDADD = $(LDADD)
+add_spec_meta_DEPENDENCIES = ../src/libgetdata.la
+add_spec_resolv_SOURCES = add_spec_resolv.c
+add_spec_resolv_OBJECTS = add_spec_resolv.$(OBJEXT)
+add_spec_resolv_LDADD = $(LDADD)
+add_spec_resolv_DEPENDENCIES = ../src/libgetdata.la
+add_string_SOURCES = add_string.c
+add_string_OBJECTS = add_string.$(OBJEXT)
+add_string_LDADD = $(LDADD)
+add_string_DEPENDENCIES = ../src/libgetdata.la
+add_string_affix_SOURCES = add_string_affix.c
+add_string_affix_OBJECTS = add_string_affix.$(OBJEXT)
+add_string_affix_LDADD = $(LDADD)
+add_string_affix_DEPENDENCIES = ../src/libgetdata.la
+add_type_SOURCES = add_type.c
+add_type_OBJECTS = add_type.$(OBJEXT)
+add_type_LDADD = $(LDADD)
+add_type_DEPENDENCIES = ../src/libgetdata.la
+add_window_SOURCES = add_window.c
+add_window_OBJECTS = add_window.$(OBJEXT)
+add_window_LDADD = $(LDADD)
+add_window_DEPENDENCIES = ../src/libgetdata.la
+add_window_op_SOURCES = add_window_op.c
+add_window_op_OBJECTS = add_window_op.$(OBJEXT)
+add_window_op_LDADD = $(LDADD)
+add_window_op_DEPENDENCIES = ../src/libgetdata.la
+alias_list_SOURCES = alias_list.c
+alias_list_OBJECTS = alias_list.$(OBJEXT)
+alias_list_LDADD = $(LDADD)
+alias_list_DEPENDENCIES = ../src/libgetdata.la
+alias_list_alias_SOURCES = alias_list_alias.c
+alias_list_alias_OBJECTS = alias_list_alias.$(OBJEXT)
+alias_list_alias_LDADD = $(LDADD)
+alias_list_alias_DEPENDENCIES = ../src/libgetdata.la
+alias_list_missing_SOURCES = alias_list_missing.c
+alias_list_missing_OBJECTS = alias_list_missing.$(OBJEXT)
+alias_list_missing_LDADD = $(LDADD)
+alias_list_missing_DEPENDENCIES = ../src/libgetdata.la
+alias_num_SOURCES = alias_num.c
+alias_num_OBJECTS = alias_num.$(OBJEXT)
+alias_num_LDADD = $(LDADD)
+alias_num_DEPENDENCIES = ../src/libgetdata.la
+alias_num_alias_SOURCES = alias_num_alias.c
+alias_num_alias_OBJECTS = alias_num_alias.$(OBJEXT)
+alias_num_alias_LDADD = $(LDADD)
+alias_num_alias_DEPENDENCIES = ../src/libgetdata.la
+alias_num_missing_SOURCES = alias_num_missing.c
+alias_num_missing_OBJECTS = alias_num_missing.$(OBJEXT)
+alias_num_missing_LDADD = $(LDADD)
+alias_num_missing_DEPENDENCIES = ../src/libgetdata.la
+alias_target_SOURCES = alias_target.c
+alias_target_OBJECTS = alias_target.$(OBJEXT)
+alias_target_LDADD = $(LDADD)
+alias_target_DEPENDENCIES = ../src/libgetdata.la
+alias_target_alias_SOURCES = alias_target_alias.c
+alias_target_alias_OBJECTS = alias_target_alias.$(OBJEXT)
+alias_target_alias_LDADD = $(LDADD)
+alias_target_alias_DEPENDENCIES = ../src/libgetdata.la
+alias_target_missing_SOURCES = alias_target_missing.c
+alias_target_missing_OBJECTS = alias_target_missing.$(OBJEXT)
+alias_target_missing_LDADD = $(LDADD)
+alias_target_missing_DEPENDENCIES = ../src/libgetdata.la
+alter_bit_bitnum_SOURCES = alter_bit_bitnum.c
+alter_bit_bitnum_OBJECTS = alter_bit_bitnum.$(OBJEXT)
+alter_bit_bitnum_LDADD = $(LDADD)
+alter_bit_bitnum_DEPENDENCIES = ../src/libgetdata.la
+alter_bit_numbits_SOURCES = alter_bit_numbits.c
+alter_bit_numbits_OBJECTS = alter_bit_numbits.$(OBJEXT)
+alter_bit_numbits_LDADD = $(LDADD)
+alter_bit_numbits_DEPENDENCIES = ../src/libgetdata.la
+alter_carray_len_SOURCES = alter_carray_len.c
+alter_carray_len_OBJECTS = alter_carray_len.$(OBJEXT)
+alter_carray_len_LDADD = $(LDADD)
+alter_carray_len_DEPENDENCIES = ../src/libgetdata.la
+alter_carray_type_SOURCES = alter_carray_type.c
+alter_carray_type_OBJECTS = alter_carray_type.$(OBJEXT)
+alter_carray_type_LDADD = $(LDADD)
+alter_carray_type_DEPENDENCIES = ../src/libgetdata.la
+alter_const_SOURCES = alter_const.c
+alter_const_OBJECTS = alter_const.$(OBJEXT)
+alter_const_LDADD = $(LDADD)
+alter_const_DEPENDENCIES = ../src/libgetdata.la
+alter_const_c2r_SOURCES = alter_const_c2r.c
+alter_const_c2r_OBJECTS = alter_const_c2r.$(OBJEXT)
+alter_const_c2r_LDADD = $(LDADD)
+alter_const_c2r_DEPENDENCIES = ../src/libgetdata.la
+alter_cpolynom_SOURCES = alter_cpolynom.c
+alter_cpolynom_OBJECTS = alter_cpolynom.$(OBJEXT)
+alter_cpolynom_LDADD = $(LDADD)
+alter_cpolynom_DEPENDENCIES = ../src/libgetdata.la
+alter_crecip_SOURCES = alter_crecip.c
+alter_crecip_OBJECTS = alter_crecip.$(OBJEXT)
+alter_crecip_LDADD = $(LDADD)
+alter_crecip_DEPENDENCIES = ../src/libgetdata.la
+alter_crecip89_SOURCES = alter_crecip89.c
+alter_crecip89_OBJECTS = alter_crecip89.$(OBJEXT)
+alter_crecip89_LDADD = $(LDADD)
+alter_crecip89_DEPENDENCIES = ../src/libgetdata.la
+alter_crecip_zero_SOURCES = alter_crecip_zero.c
+alter_crecip_zero_OBJECTS = alter_crecip_zero.$(OBJEXT)
+alter_crecip_zero_LDADD = $(LDADD)
+alter_crecip_zero_DEPENDENCIES = ../src/libgetdata.la
+alter_divide_SOURCES = alter_divide.c
+alter_divide_OBJECTS = alter_divide.$(OBJEXT)
+alter_divide_LDADD = $(LDADD)
+alter_divide_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_SOURCES = alter_entry.c
+alter_entry_OBJECTS = alter_entry.$(OBJEXT)
+alter_entry_LDADD = $(LDADD)
+alter_entry_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_affix_SOURCES = alter_entry_affix.c
+alter_entry_affix_OBJECTS = alter_entry_affix.$(OBJEXT)
+alter_entry_affix_LDADD = $(LDADD)
+alter_entry_affix_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_hidden_SOURCES = alter_entry_hidden.c
+alter_entry_hidden_OBJECTS = alter_entry_hidden.$(OBJEXT)
+alter_entry_hidden_LDADD = $(LDADD)
+alter_entry_hidden_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_recode_SOURCES = alter_entry_recode.c
+alter_entry_recode_OBJECTS = alter_entry_recode.$(OBJEXT)
+alter_entry_recode_LDADD = $(LDADD)
+alter_entry_recode_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_scalar2a_SOURCES = alter_entry_scalar2a.c
+alter_entry_scalar2a_OBJECTS = alter_entry_scalar2a.$(OBJEXT)
+alter_entry_scalar2a_LDADD = $(LDADD)
+alter_entry_scalar2a_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_scalar2n_SOURCES = alter_entry_scalar2n.c
+alter_entry_scalar2n_OBJECTS = alter_entry_scalar2n.$(OBJEXT)
+alter_entry_scalar2n_LDADD = $(LDADD)
+alter_entry_scalar2n_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_scalar3_SOURCES = alter_entry_scalar3.c
+alter_entry_scalar3_OBJECTS = alter_entry_scalar3.$(OBJEXT)
+alter_entry_scalar3_LDADD = $(LDADD)
+alter_entry_scalar3_DEPENDENCIES = ../src/libgetdata.la
+alter_entry_scalar4_SOURCES = alter_entry_scalar4.c
+alter_entry_scalar4_OBJECTS = alter_entry_scalar4.$(OBJEXT)
+alter_entry_scalar4_LDADD = $(LDADD)
+alter_entry_scalar4_DEPENDENCIES = ../src/libgetdata.la
+alter_lincom_23_SOURCES = alter_lincom_23.c
+alter_lincom_23_OBJECTS = alter_lincom_23.$(OBJEXT)
+alter_lincom_23_LDADD = $(LDADD)
+alter_lincom_23_DEPENDENCIES = ../src/libgetdata.la
+alter_lincom_32_SOURCES = alter_lincom_32.c
+alter_lincom_32_OBJECTS = alter_lincom_32.$(OBJEXT)
+alter_lincom_32_LDADD = $(LDADD)
+alter_lincom_32_DEPENDENCIES = ../src/libgetdata.la
+alter_lincom_affix_SOURCES = alter_lincom_affix.c
+alter_lincom_affix_OBJECTS = alter_lincom_affix.$(OBJEXT)
+alter_lincom_affix_LDADD = $(LDADD)
+alter_lincom_affix_DEPENDENCIES = ../src/libgetdata.la
+alter_lincom_input_SOURCES = alter_lincom_input.c
+alter_lincom_input_OBJECTS = alter_lincom_input.$(OBJEXT)
+alter_lincom_input_LDADD = $(LDADD)
+alter_lincom_input_DEPENDENCIES = ../src/libgetdata.la
+alter_lincom_offset_SOURCES = alter_lincom_offset.c
+alter_lincom_offset_OBJECTS = alter_lincom_offset.$(OBJEXT)
+alter_lincom_offset_LDADD = $(LDADD)
+alter_lincom_offset_DEPENDENCIES = ../src/libgetdata.la
+alter_lincom_slope_SOURCES = alter_lincom_slope.c
+alter_lincom_slope_OBJECTS = alter_lincom_slope.$(OBJEXT)
+alter_lincom_slope_LDADD = $(LDADD)
+alter_lincom_slope_DEPENDENCIES = ../src/libgetdata.la
+alter_linterp_SOURCES = alter_linterp.c
+alter_linterp_OBJECTS = alter_linterp.$(OBJEXT)
+alter_linterp_LDADD = $(LDADD)
+alter_linterp_DEPENDENCIES = ../src/libgetdata.la
+alter_linterp_move_SOURCES = alter_linterp_move.c
+alter_linterp_move_OBJECTS = alter_linterp_move.$(OBJEXT)
+alter_linterp_move_LDADD = $(LDADD)
+alter_linterp_move_DEPENDENCIES = ../src/libgetdata.la
+alter_mplex_SOURCES = alter_mplex.c
+alter_mplex_OBJECTS = alter_mplex.$(OBJEXT)
+alter_mplex_LDADD = $(LDADD)
+alter_mplex_DEPENDENCIES = ../src/libgetdata.la
+alter_mspec_SOURCES = alter_mspec.c
+alter_mspec_OBJECTS = alter_mspec.$(OBJEXT)
+alter_mspec_LDADD = $(LDADD)
+alter_mspec_DEPENDENCIES = ../src/libgetdata.la
+alter_mspec_affix_SOURCES = alter_mspec_affix.c
+alter_mspec_affix_OBJECTS = alter_mspec_affix.$(OBJEXT)
+alter_mspec_affix_LDADD = $(LDADD)
+alter_mspec_affix_DEPENDENCIES = ../src/libgetdata.la
+alter_multiply_SOURCES = alter_multiply.c
+alter_multiply_OBJECTS = alter_multiply.$(OBJEXT)
+alter_multiply_LDADD = $(LDADD)
+alter_multiply_DEPENDENCIES = ../src/libgetdata.la
+alter_phase_SOURCES = alter_phase.c
+alter_phase_OBJECTS = alter_phase.$(OBJEXT)
+alter_phase_LDADD = $(LDADD)
+alter_phase_DEPENDENCIES = ../src/libgetdata.la
+alter_polynom_coeff_SOURCES = alter_polynom_coeff.c
+alter_polynom_coeff_OBJECTS = alter_polynom_coeff.$(OBJEXT)
+alter_polynom_coeff_LDADD = $(LDADD)
+alter_polynom_coeff_DEPENDENCIES = ../src/libgetdata.la
+alter_polynom_input_SOURCES = alter_polynom_input.c
+alter_polynom_input_OBJECTS = alter_polynom_input.$(OBJEXT)
+alter_polynom_input_LDADD = $(LDADD)
+alter_polynom_input_DEPENDENCIES = ../src/libgetdata.la
+alter_polynom_ord_SOURCES = alter_polynom_ord.c
+alter_polynom_ord_OBJECTS = alter_polynom_ord.$(OBJEXT)
+alter_polynom_ord_LDADD = $(LDADD)
+alter_polynom_ord_DEPENDENCIES = ../src/libgetdata.la
+alter_raw_spf_SOURCES = alter_raw_spf.c
+alter_raw_spf_OBJECTS = alter_raw_spf.$(OBJEXT)
+alter_raw_spf_LDADD = $(LDADD)
+alter_raw_spf_DEPENDENCIES = ../src/libgetdata.la
+alter_raw_type_SOURCES = alter_raw_type.c
+alter_raw_type_OBJECTS = alter_raw_type.$(OBJEXT)
+alter_raw_type_LDADD = $(LDADD)
+alter_raw_type_DEPENDENCIES = ../src/libgetdata.la
+alter_recip_SOURCES = alter_recip.c
+alter_recip_OBJECTS = alter_recip.$(OBJEXT)
+alter_recip_LDADD = $(LDADD)
+alter_recip_DEPENDENCIES = ../src/libgetdata.la
+alter_recip_zero_SOURCES = alter_recip_zero.c
+alter_recip_zero_OBJECTS = alter_recip_zero.$(OBJEXT)
+alter_recip_zero_LDADD = $(LDADD)
+alter_recip_zero_DEPENDENCIES = ../src/libgetdata.la
+alter_scalar_affix_SOURCES = alter_scalar_affix.c
+alter_scalar_affix_OBJECTS = alter_scalar_affix.$(OBJEXT)
+alter_scalar_affix_LDADD = $(LDADD)
+alter_scalar_affix_DEPENDENCIES = ../src/libgetdata.la
+alter_spec_SOURCES = alter_spec.c
+alter_spec_OBJECTS = alter_spec.$(OBJEXT)
+alter_spec_LDADD = $(LDADD)
+alter_spec_DEPENDENCIES = ../src/libgetdata.la
+alter_spec_affix_SOURCES = alter_spec_affix.c
+alter_spec_affix_OBJECTS = alter_spec_affix.$(OBJEXT)
+alter_spec_affix_LDADD = $(LDADD)
+alter_spec_affix_DEPENDENCIES = ../src/libgetdata.la
+alter_spec_meta_SOURCES = alter_spec_meta.c
+alter_spec_meta_OBJECTS = alter_spec_meta.$(OBJEXT)
+alter_spec_meta_LDADD = $(LDADD)
+alter_spec_meta_DEPENDENCIES = ../src/libgetdata.la
+alter_window_SOURCES = alter_window.c
+alter_window_OBJECTS = alter_window.$(OBJEXT)
+alter_window_LDADD = $(LDADD)
+alter_window_DEPENDENCIES = ../src/libgetdata.la
+ascii_add_SOURCES = ascii_add.c
+ascii_add_OBJECTS = ascii_add.$(OBJEXT)
+ascii_add_LDADD = $(LDADD)
+ascii_add_DEPENDENCIES = ../src/libgetdata.la
+ascii_get_SOURCES = ascii_get.c
+ascii_get_OBJECTS = ascii_get.$(OBJEXT)
+ascii_get_LDADD = $(LDADD)
+ascii_get_DEPENDENCIES = ../src/libgetdata.la
+ascii_get_get_SOURCES = ascii_get_get.c
+ascii_get_get_OBJECTS = ascii_get_get.$(OBJEXT)
+ascii_get_get_LDADD = $(LDADD)
+ascii_get_get_DEPENDENCIES = ../src/libgetdata.la
+ascii_nframes_SOURCES = ascii_nframes.c
+ascii_nframes_OBJECTS = ascii_nframes.$(OBJEXT)
+ascii_nframes_LDADD = $(LDADD)
+ascii_nframes_DEPENDENCIES = ../src/libgetdata.la
+ascii_put_SOURCES = ascii_put.c
+ascii_put_OBJECTS = ascii_put.$(OBJEXT)
+ascii_put_LDADD = $(LDADD)
+ascii_put_DEPENDENCIES = ../src/libgetdata.la
+bof_SOURCES = bof.c
+bof_OBJECTS = bof.$(OBJEXT)
+bof_LDADD = $(LDADD)
+bof_DEPENDENCIES = ../src/libgetdata.la
+bof_lincom_SOURCES = bof_lincom.c
+bof_lincom_OBJECTS = bof_lincom.$(OBJEXT)
+bof_lincom_LDADD = $(LDADD)
+bof_lincom_DEPENDENCIES = ../src/libgetdata.la
+bof_phase_SOURCES = bof_phase.c
+bof_phase_OBJECTS = bof_phase.$(OBJEXT)
+bof_phase_LDADD = $(LDADD)
+bof_phase_DEPENDENCIES = ../src/libgetdata.la
+bzip_get_SOURCES = bzip_get.c
+bzip_get_OBJECTS = bzip_get.$(OBJEXT)
+bzip_get_LDADD = $(LDADD)
+bzip_get_DEPENDENCIES = ../src/libgetdata.la
+bzip_get_get_SOURCES = bzip_get_get.c
+bzip_get_get_OBJECTS = bzip_get_get.$(OBJEXT)
+bzip_get_get_LDADD = $(LDADD)
+bzip_get_get_DEPENDENCIES = ../src/libgetdata.la
+bzip_move_from_SOURCES = bzip_move_from.c
+bzip_move_from_OBJECTS = bzip_move_from.$(OBJEXT)
+bzip_move_from_LDADD = $(LDADD)
+bzip_move_from_DEPENDENCIES = ../src/libgetdata.la
+bzip_nframes_SOURCES = bzip_nframes.c
+bzip_nframes_OBJECTS = bzip_nframes.$(OBJEXT)
+bzip_nframes_LDADD = $(LDADD)
+bzip_nframes_DEPENDENCIES = ../src/libgetdata.la
+close_SOURCES = close.c
+close_OBJECTS = close.$(OBJEXT)
+close_LDADD = $(LDADD)
+close_DEPENDENCIES = ../src/libgetdata.la
+close_bad_SOURCES = close_bad.c
+close_bad_OBJECTS = close_bad.$(OBJEXT)
+close_bad_LDADD = $(LDADD)
+close_bad_DEPENDENCIES = ../src/libgetdata.la
+close_discard_SOURCES = close_discard.c
+close_discard_OBJECTS = close_discard.$(OBJEXT)
+close_discard_LDADD = $(LDADD)
+close_discard_DEPENDENCIES = ../src/libgetdata.la
+close_null_SOURCES = close_null.c
+close_null_OBJECTS = close_null.$(OBJEXT)
+close_null_LDADD = $(LDADD)
+close_null_DEPENDENCIES = ../src/libgetdata.la
+convert_complex128_complex64_SOURCES = convert_complex128_complex64.c
+convert_complex128_complex64_OBJECTS =  \
+	convert_complex128_complex64.$(OBJEXT)
+convert_complex128_complex64_LDADD = $(LDADD)
+convert_complex128_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_complex128_float64_SOURCES = convert_complex128_float64.c
+convert_complex128_float64_OBJECTS =  \
+	convert_complex128_float64.$(OBJEXT)
+convert_complex128_float64_LDADD = $(LDADD)
+convert_complex128_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_complex128_int64_SOURCES = convert_complex128_int64.c
+convert_complex128_int64_OBJECTS = convert_complex128_int64.$(OBJEXT)
+convert_complex128_int64_LDADD = $(LDADD)
+convert_complex128_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_complex128_uint64_SOURCES = convert_complex128_uint64.c
+convert_complex128_uint64_OBJECTS =  \
+	convert_complex128_uint64.$(OBJEXT)
+convert_complex128_uint64_LDADD = $(LDADD)
+convert_complex128_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_complex64_complex128_SOURCES = convert_complex64_complex128.c
+convert_complex64_complex128_OBJECTS =  \
+	convert_complex64_complex128.$(OBJEXT)
+convert_complex64_complex128_LDADD = $(LDADD)
+convert_complex64_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_complex64_float64_SOURCES = convert_complex64_float64.c
+convert_complex64_float64_OBJECTS =  \
+	convert_complex64_float64.$(OBJEXT)
+convert_complex64_float64_LDADD = $(LDADD)
+convert_complex64_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_complex64_int64_SOURCES = convert_complex64_int64.c
+convert_complex64_int64_OBJECTS = convert_complex64_int64.$(OBJEXT)
+convert_complex64_int64_LDADD = $(LDADD)
+convert_complex64_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_complex64_uint64_SOURCES = convert_complex64_uint64.c
+convert_complex64_uint64_OBJECTS = convert_complex64_uint64.$(OBJEXT)
+convert_complex64_uint64_LDADD = $(LDADD)
+convert_complex64_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_complex128_SOURCES = convert_float32_complex128.c
+convert_float32_complex128_OBJECTS =  \
+	convert_float32_complex128.$(OBJEXT)
+convert_float32_complex128_LDADD = $(LDADD)
+convert_float32_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_complex64_SOURCES = convert_float32_complex64.c
+convert_float32_complex64_OBJECTS =  \
+	convert_float32_complex64.$(OBJEXT)
+convert_float32_complex64_LDADD = $(LDADD)
+convert_float32_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_float64_SOURCES = convert_float32_float64.c
+convert_float32_float64_OBJECTS = convert_float32_float64.$(OBJEXT)
+convert_float32_float64_LDADD = $(LDADD)
+convert_float32_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_int16_SOURCES = convert_float32_int16.c
+convert_float32_int16_OBJECTS = convert_float32_int16.$(OBJEXT)
+convert_float32_int16_LDADD = $(LDADD)
+convert_float32_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_int32_SOURCES = convert_float32_int32.c
+convert_float32_int32_OBJECTS = convert_float32_int32.$(OBJEXT)
+convert_float32_int32_LDADD = $(LDADD)
+convert_float32_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_int64_SOURCES = convert_float32_int64.c
+convert_float32_int64_OBJECTS = convert_float32_int64.$(OBJEXT)
+convert_float32_int64_LDADD = $(LDADD)
+convert_float32_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_int8_SOURCES = convert_float32_int8.c
+convert_float32_int8_OBJECTS = convert_float32_int8.$(OBJEXT)
+convert_float32_int8_LDADD = $(LDADD)
+convert_float32_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_uint16_SOURCES = convert_float32_uint16.c
+convert_float32_uint16_OBJECTS = convert_float32_uint16.$(OBJEXT)
+convert_float32_uint16_LDADD = $(LDADD)
+convert_float32_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_uint32_SOURCES = convert_float32_uint32.c
+convert_float32_uint32_OBJECTS = convert_float32_uint32.$(OBJEXT)
+convert_float32_uint32_LDADD = $(LDADD)
+convert_float32_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_uint64_SOURCES = convert_float32_uint64.c
+convert_float32_uint64_OBJECTS = convert_float32_uint64.$(OBJEXT)
+convert_float32_uint64_LDADD = $(LDADD)
+convert_float32_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_float32_uint8_SOURCES = convert_float32_uint8.c
+convert_float32_uint8_OBJECTS = convert_float32_uint8.$(OBJEXT)
+convert_float32_uint8_LDADD = $(LDADD)
+convert_float32_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_complex128_SOURCES = convert_float64_complex128.c
+convert_float64_complex128_OBJECTS =  \
+	convert_float64_complex128.$(OBJEXT)
+convert_float64_complex128_LDADD = $(LDADD)
+convert_float64_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_complex64_SOURCES = convert_float64_complex64.c
+convert_float64_complex64_OBJECTS =  \
+	convert_float64_complex64.$(OBJEXT)
+convert_float64_complex64_LDADD = $(LDADD)
+convert_float64_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_float32_SOURCES = convert_float64_float32.c
+convert_float64_float32_OBJECTS = convert_float64_float32.$(OBJEXT)
+convert_float64_float32_LDADD = $(LDADD)
+convert_float64_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_int16_SOURCES = convert_float64_int16.c
+convert_float64_int16_OBJECTS = convert_float64_int16.$(OBJEXT)
+convert_float64_int16_LDADD = $(LDADD)
+convert_float64_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_int32_SOURCES = convert_float64_int32.c
+convert_float64_int32_OBJECTS = convert_float64_int32.$(OBJEXT)
+convert_float64_int32_LDADD = $(LDADD)
+convert_float64_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_int64_SOURCES = convert_float64_int64.c
+convert_float64_int64_OBJECTS = convert_float64_int64.$(OBJEXT)
+convert_float64_int64_LDADD = $(LDADD)
+convert_float64_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_int8_SOURCES = convert_float64_int8.c
+convert_float64_int8_OBJECTS = convert_float64_int8.$(OBJEXT)
+convert_float64_int8_LDADD = $(LDADD)
+convert_float64_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_uint16_SOURCES = convert_float64_uint16.c
+convert_float64_uint16_OBJECTS = convert_float64_uint16.$(OBJEXT)
+convert_float64_uint16_LDADD = $(LDADD)
+convert_float64_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_uint32_SOURCES = convert_float64_uint32.c
+convert_float64_uint32_OBJECTS = convert_float64_uint32.$(OBJEXT)
+convert_float64_uint32_LDADD = $(LDADD)
+convert_float64_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_uint64_SOURCES = convert_float64_uint64.c
+convert_float64_uint64_OBJECTS = convert_float64_uint64.$(OBJEXT)
+convert_float64_uint64_LDADD = $(LDADD)
+convert_float64_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_float64_uint8_SOURCES = convert_float64_uint8.c
+convert_float64_uint8_OBJECTS = convert_float64_uint8.$(OBJEXT)
+convert_float64_uint8_LDADD = $(LDADD)
+convert_float64_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_complex128_SOURCES = convert_int16_complex128.c
+convert_int16_complex128_OBJECTS = convert_int16_complex128.$(OBJEXT)
+convert_int16_complex128_LDADD = $(LDADD)
+convert_int16_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_complex64_SOURCES = convert_int16_complex64.c
+convert_int16_complex64_OBJECTS = convert_int16_complex64.$(OBJEXT)
+convert_int16_complex64_LDADD = $(LDADD)
+convert_int16_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_float32_SOURCES = convert_int16_float32.c
+convert_int16_float32_OBJECTS = convert_int16_float32.$(OBJEXT)
+convert_int16_float32_LDADD = $(LDADD)
+convert_int16_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_float64_SOURCES = convert_int16_float64.c
+convert_int16_float64_OBJECTS = convert_int16_float64.$(OBJEXT)
+convert_int16_float64_LDADD = $(LDADD)
+convert_int16_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_int32_SOURCES = convert_int16_int32.c
+convert_int16_int32_OBJECTS = convert_int16_int32.$(OBJEXT)
+convert_int16_int32_LDADD = $(LDADD)
+convert_int16_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_int64_SOURCES = convert_int16_int64.c
+convert_int16_int64_OBJECTS = convert_int16_int64.$(OBJEXT)
+convert_int16_int64_LDADD = $(LDADD)
+convert_int16_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_int8_SOURCES = convert_int16_int8.c
+convert_int16_int8_OBJECTS = convert_int16_int8.$(OBJEXT)
+convert_int16_int8_LDADD = $(LDADD)
+convert_int16_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_uint16_SOURCES = convert_int16_uint16.c
+convert_int16_uint16_OBJECTS = convert_int16_uint16.$(OBJEXT)
+convert_int16_uint16_LDADD = $(LDADD)
+convert_int16_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_uint32_SOURCES = convert_int16_uint32.c
+convert_int16_uint32_OBJECTS = convert_int16_uint32.$(OBJEXT)
+convert_int16_uint32_LDADD = $(LDADD)
+convert_int16_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_uint64_SOURCES = convert_int16_uint64.c
+convert_int16_uint64_OBJECTS = convert_int16_uint64.$(OBJEXT)
+convert_int16_uint64_LDADD = $(LDADD)
+convert_int16_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_int16_uint8_SOURCES = convert_int16_uint8.c
+convert_int16_uint8_OBJECTS = convert_int16_uint8.$(OBJEXT)
+convert_int16_uint8_LDADD = $(LDADD)
+convert_int16_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_complex128_SOURCES = convert_int32_complex128.c
+convert_int32_complex128_OBJECTS = convert_int32_complex128.$(OBJEXT)
+convert_int32_complex128_LDADD = $(LDADD)
+convert_int32_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_complex64_SOURCES = convert_int32_complex64.c
+convert_int32_complex64_OBJECTS = convert_int32_complex64.$(OBJEXT)
+convert_int32_complex64_LDADD = $(LDADD)
+convert_int32_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_float32_SOURCES = convert_int32_float32.c
+convert_int32_float32_OBJECTS = convert_int32_float32.$(OBJEXT)
+convert_int32_float32_LDADD = $(LDADD)
+convert_int32_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_float64_SOURCES = convert_int32_float64.c
+convert_int32_float64_OBJECTS = convert_int32_float64.$(OBJEXT)
+convert_int32_float64_LDADD = $(LDADD)
+convert_int32_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_int16_SOURCES = convert_int32_int16.c
+convert_int32_int16_OBJECTS = convert_int32_int16.$(OBJEXT)
+convert_int32_int16_LDADD = $(LDADD)
+convert_int32_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_int64_SOURCES = convert_int32_int64.c
+convert_int32_int64_OBJECTS = convert_int32_int64.$(OBJEXT)
+convert_int32_int64_LDADD = $(LDADD)
+convert_int32_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_int8_SOURCES = convert_int32_int8.c
+convert_int32_int8_OBJECTS = convert_int32_int8.$(OBJEXT)
+convert_int32_int8_LDADD = $(LDADD)
+convert_int32_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_uint16_SOURCES = convert_int32_uint16.c
+convert_int32_uint16_OBJECTS = convert_int32_uint16.$(OBJEXT)
+convert_int32_uint16_LDADD = $(LDADD)
+convert_int32_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_uint32_SOURCES = convert_int32_uint32.c
+convert_int32_uint32_OBJECTS = convert_int32_uint32.$(OBJEXT)
+convert_int32_uint32_LDADD = $(LDADD)
+convert_int32_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_uint64_SOURCES = convert_int32_uint64.c
+convert_int32_uint64_OBJECTS = convert_int32_uint64.$(OBJEXT)
+convert_int32_uint64_LDADD = $(LDADD)
+convert_int32_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_int32_uint8_SOURCES = convert_int32_uint8.c
+convert_int32_uint8_OBJECTS = convert_int32_uint8.$(OBJEXT)
+convert_int32_uint8_LDADD = $(LDADD)
+convert_int32_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_complex128_SOURCES = convert_int64_complex128.c
+convert_int64_complex128_OBJECTS = convert_int64_complex128.$(OBJEXT)
+convert_int64_complex128_LDADD = $(LDADD)
+convert_int64_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_complex64_SOURCES = convert_int64_complex64.c
+convert_int64_complex64_OBJECTS = convert_int64_complex64.$(OBJEXT)
+convert_int64_complex64_LDADD = $(LDADD)
+convert_int64_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_float32_SOURCES = convert_int64_float32.c
+convert_int64_float32_OBJECTS = convert_int64_float32.$(OBJEXT)
+convert_int64_float32_LDADD = $(LDADD)
+convert_int64_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_float64_SOURCES = convert_int64_float64.c
+convert_int64_float64_OBJECTS = convert_int64_float64.$(OBJEXT)
+convert_int64_float64_LDADD = $(LDADD)
+convert_int64_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_int16_SOURCES = convert_int64_int16.c
+convert_int64_int16_OBJECTS = convert_int64_int16.$(OBJEXT)
+convert_int64_int16_LDADD = $(LDADD)
+convert_int64_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_int32_SOURCES = convert_int64_int32.c
+convert_int64_int32_OBJECTS = convert_int64_int32.$(OBJEXT)
+convert_int64_int32_LDADD = $(LDADD)
+convert_int64_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_int8_SOURCES = convert_int64_int8.c
+convert_int64_int8_OBJECTS = convert_int64_int8.$(OBJEXT)
+convert_int64_int8_LDADD = $(LDADD)
+convert_int64_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_uint16_SOURCES = convert_int64_uint16.c
+convert_int64_uint16_OBJECTS = convert_int64_uint16.$(OBJEXT)
+convert_int64_uint16_LDADD = $(LDADD)
+convert_int64_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_uint32_SOURCES = convert_int64_uint32.c
+convert_int64_uint32_OBJECTS = convert_int64_uint32.$(OBJEXT)
+convert_int64_uint32_LDADD = $(LDADD)
+convert_int64_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_uint64_SOURCES = convert_int64_uint64.c
+convert_int64_uint64_OBJECTS = convert_int64_uint64.$(OBJEXT)
+convert_int64_uint64_LDADD = $(LDADD)
+convert_int64_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_int64_uint8_SOURCES = convert_int64_uint8.c
+convert_int64_uint8_OBJECTS = convert_int64_uint8.$(OBJEXT)
+convert_int64_uint8_LDADD = $(LDADD)
+convert_int64_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_complex128_SOURCES = convert_int8_complex128.c
+convert_int8_complex128_OBJECTS = convert_int8_complex128.$(OBJEXT)
+convert_int8_complex128_LDADD = $(LDADD)
+convert_int8_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_complex64_SOURCES = convert_int8_complex64.c
+convert_int8_complex64_OBJECTS = convert_int8_complex64.$(OBJEXT)
+convert_int8_complex64_LDADD = $(LDADD)
+convert_int8_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_float32_SOURCES = convert_int8_float32.c
+convert_int8_float32_OBJECTS = convert_int8_float32.$(OBJEXT)
+convert_int8_float32_LDADD = $(LDADD)
+convert_int8_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_float64_SOURCES = convert_int8_float64.c
+convert_int8_float64_OBJECTS = convert_int8_float64.$(OBJEXT)
+convert_int8_float64_LDADD = $(LDADD)
+convert_int8_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_int16_SOURCES = convert_int8_int16.c
+convert_int8_int16_OBJECTS = convert_int8_int16.$(OBJEXT)
+convert_int8_int16_LDADD = $(LDADD)
+convert_int8_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_int32_SOURCES = convert_int8_int32.c
+convert_int8_int32_OBJECTS = convert_int8_int32.$(OBJEXT)
+convert_int8_int32_LDADD = $(LDADD)
+convert_int8_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_int64_SOURCES = convert_int8_int64.c
+convert_int8_int64_OBJECTS = convert_int8_int64.$(OBJEXT)
+convert_int8_int64_LDADD = $(LDADD)
+convert_int8_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_uint16_SOURCES = convert_int8_uint16.c
+convert_int8_uint16_OBJECTS = convert_int8_uint16.$(OBJEXT)
+convert_int8_uint16_LDADD = $(LDADD)
+convert_int8_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_uint32_SOURCES = convert_int8_uint32.c
+convert_int8_uint32_OBJECTS = convert_int8_uint32.$(OBJEXT)
+convert_int8_uint32_LDADD = $(LDADD)
+convert_int8_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_uint64_SOURCES = convert_int8_uint64.c
+convert_int8_uint64_OBJECTS = convert_int8_uint64.$(OBJEXT)
+convert_int8_uint64_LDADD = $(LDADD)
+convert_int8_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_int8_uint8_SOURCES = convert_int8_uint8.c
+convert_int8_uint8_OBJECTS = convert_int8_uint8.$(OBJEXT)
+convert_int8_uint8_LDADD = $(LDADD)
+convert_int8_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_complex128_SOURCES = convert_uint16_complex128.c
+convert_uint16_complex128_OBJECTS =  \
+	convert_uint16_complex128.$(OBJEXT)
+convert_uint16_complex128_LDADD = $(LDADD)
+convert_uint16_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_complex64_SOURCES = convert_uint16_complex64.c
+convert_uint16_complex64_OBJECTS = convert_uint16_complex64.$(OBJEXT)
+convert_uint16_complex64_LDADD = $(LDADD)
+convert_uint16_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_float32_SOURCES = convert_uint16_float32.c
+convert_uint16_float32_OBJECTS = convert_uint16_float32.$(OBJEXT)
+convert_uint16_float32_LDADD = $(LDADD)
+convert_uint16_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_float64_SOURCES = convert_uint16_float64.c
+convert_uint16_float64_OBJECTS = convert_uint16_float64.$(OBJEXT)
+convert_uint16_float64_LDADD = $(LDADD)
+convert_uint16_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_int16_SOURCES = convert_uint16_int16.c
+convert_uint16_int16_OBJECTS = convert_uint16_int16.$(OBJEXT)
+convert_uint16_int16_LDADD = $(LDADD)
+convert_uint16_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_int32_SOURCES = convert_uint16_int32.c
+convert_uint16_int32_OBJECTS = convert_uint16_int32.$(OBJEXT)
+convert_uint16_int32_LDADD = $(LDADD)
+convert_uint16_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_int64_SOURCES = convert_uint16_int64.c
+convert_uint16_int64_OBJECTS = convert_uint16_int64.$(OBJEXT)
+convert_uint16_int64_LDADD = $(LDADD)
+convert_uint16_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_int8_SOURCES = convert_uint16_int8.c
+convert_uint16_int8_OBJECTS = convert_uint16_int8.$(OBJEXT)
+convert_uint16_int8_LDADD = $(LDADD)
+convert_uint16_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_uint32_SOURCES = convert_uint16_uint32.c
+convert_uint16_uint32_OBJECTS = convert_uint16_uint32.$(OBJEXT)
+convert_uint16_uint32_LDADD = $(LDADD)
+convert_uint16_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_uint64_SOURCES = convert_uint16_uint64.c
+convert_uint16_uint64_OBJECTS = convert_uint16_uint64.$(OBJEXT)
+convert_uint16_uint64_LDADD = $(LDADD)
+convert_uint16_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint16_uint8_SOURCES = convert_uint16_uint8.c
+convert_uint16_uint8_OBJECTS = convert_uint16_uint8.$(OBJEXT)
+convert_uint16_uint8_LDADD = $(LDADD)
+convert_uint16_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_complex128_SOURCES = convert_uint32_complex128.c
+convert_uint32_complex128_OBJECTS =  \
+	convert_uint32_complex128.$(OBJEXT)
+convert_uint32_complex128_LDADD = $(LDADD)
+convert_uint32_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_complex64_SOURCES = convert_uint32_complex64.c
+convert_uint32_complex64_OBJECTS = convert_uint32_complex64.$(OBJEXT)
+convert_uint32_complex64_LDADD = $(LDADD)
+convert_uint32_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_float32_SOURCES = convert_uint32_float32.c
+convert_uint32_float32_OBJECTS = convert_uint32_float32.$(OBJEXT)
+convert_uint32_float32_LDADD = $(LDADD)
+convert_uint32_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_float64_SOURCES = convert_uint32_float64.c
+convert_uint32_float64_OBJECTS = convert_uint32_float64.$(OBJEXT)
+convert_uint32_float64_LDADD = $(LDADD)
+convert_uint32_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_int16_SOURCES = convert_uint32_int16.c
+convert_uint32_int16_OBJECTS = convert_uint32_int16.$(OBJEXT)
+convert_uint32_int16_LDADD = $(LDADD)
+convert_uint32_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_int32_SOURCES = convert_uint32_int32.c
+convert_uint32_int32_OBJECTS = convert_uint32_int32.$(OBJEXT)
+convert_uint32_int32_LDADD = $(LDADD)
+convert_uint32_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_int64_SOURCES = convert_uint32_int64.c
+convert_uint32_int64_OBJECTS = convert_uint32_int64.$(OBJEXT)
+convert_uint32_int64_LDADD = $(LDADD)
+convert_uint32_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_int8_SOURCES = convert_uint32_int8.c
+convert_uint32_int8_OBJECTS = convert_uint32_int8.$(OBJEXT)
+convert_uint32_int8_LDADD = $(LDADD)
+convert_uint32_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_uint16_SOURCES = convert_uint32_uint16.c
+convert_uint32_uint16_OBJECTS = convert_uint32_uint16.$(OBJEXT)
+convert_uint32_uint16_LDADD = $(LDADD)
+convert_uint32_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_uint64_SOURCES = convert_uint32_uint64.c
+convert_uint32_uint64_OBJECTS = convert_uint32_uint64.$(OBJEXT)
+convert_uint32_uint64_LDADD = $(LDADD)
+convert_uint32_uint64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint32_uint8_SOURCES = convert_uint32_uint8.c
+convert_uint32_uint8_OBJECTS = convert_uint32_uint8.$(OBJEXT)
+convert_uint32_uint8_LDADD = $(LDADD)
+convert_uint32_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_complex128_SOURCES = convert_uint64_complex128.c
+convert_uint64_complex128_OBJECTS =  \
+	convert_uint64_complex128.$(OBJEXT)
+convert_uint64_complex128_LDADD = $(LDADD)
+convert_uint64_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_complex64_SOURCES = convert_uint64_complex64.c
+convert_uint64_complex64_OBJECTS = convert_uint64_complex64.$(OBJEXT)
+convert_uint64_complex64_LDADD = $(LDADD)
+convert_uint64_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_float32_SOURCES = convert_uint64_float32.c
+convert_uint64_float32_OBJECTS = convert_uint64_float32.$(OBJEXT)
+convert_uint64_float32_LDADD = $(LDADD)
+convert_uint64_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_float64_SOURCES = convert_uint64_float64.c
+convert_uint64_float64_OBJECTS = convert_uint64_float64.$(OBJEXT)
+convert_uint64_float64_LDADD = $(LDADD)
+convert_uint64_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_int16_SOURCES = convert_uint64_int16.c
+convert_uint64_int16_OBJECTS = convert_uint64_int16.$(OBJEXT)
+convert_uint64_int16_LDADD = $(LDADD)
+convert_uint64_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_int32_SOURCES = convert_uint64_int32.c
+convert_uint64_int32_OBJECTS = convert_uint64_int32.$(OBJEXT)
+convert_uint64_int32_LDADD = $(LDADD)
+convert_uint64_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_int64_SOURCES = convert_uint64_int64.c
+convert_uint64_int64_OBJECTS = convert_uint64_int64.$(OBJEXT)
+convert_uint64_int64_LDADD = $(LDADD)
+convert_uint64_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_int8_SOURCES = convert_uint64_int8.c
+convert_uint64_int8_OBJECTS = convert_uint64_int8.$(OBJEXT)
+convert_uint64_int8_LDADD = $(LDADD)
+convert_uint64_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_uint16_SOURCES = convert_uint64_uint16.c
+convert_uint64_uint16_OBJECTS = convert_uint64_uint16.$(OBJEXT)
+convert_uint64_uint16_LDADD = $(LDADD)
+convert_uint64_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_uint32_SOURCES = convert_uint64_uint32.c
+convert_uint64_uint32_OBJECTS = convert_uint64_uint32.$(OBJEXT)
+convert_uint64_uint32_LDADD = $(LDADD)
+convert_uint64_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint64_uint8_SOURCES = convert_uint64_uint8.c
+convert_uint64_uint8_OBJECTS = convert_uint64_uint8.$(OBJEXT)
+convert_uint64_uint8_LDADD = $(LDADD)
+convert_uint64_uint8_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_complex128_SOURCES = convert_uint8_complex128.c
+convert_uint8_complex128_OBJECTS = convert_uint8_complex128.$(OBJEXT)
+convert_uint8_complex128_LDADD = $(LDADD)
+convert_uint8_complex128_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_complex64_SOURCES = convert_uint8_complex64.c
+convert_uint8_complex64_OBJECTS = convert_uint8_complex64.$(OBJEXT)
+convert_uint8_complex64_LDADD = $(LDADD)
+convert_uint8_complex64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_float32_SOURCES = convert_uint8_float32.c
+convert_uint8_float32_OBJECTS = convert_uint8_float32.$(OBJEXT)
+convert_uint8_float32_LDADD = $(LDADD)
+convert_uint8_float32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_float64_SOURCES = convert_uint8_float64.c
+convert_uint8_float64_OBJECTS = convert_uint8_float64.$(OBJEXT)
+convert_uint8_float64_LDADD = $(LDADD)
+convert_uint8_float64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_int16_SOURCES = convert_uint8_int16.c
+convert_uint8_int16_OBJECTS = convert_uint8_int16.$(OBJEXT)
+convert_uint8_int16_LDADD = $(LDADD)
+convert_uint8_int16_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_int32_SOURCES = convert_uint8_int32.c
+convert_uint8_int32_OBJECTS = convert_uint8_int32.$(OBJEXT)
+convert_uint8_int32_LDADD = $(LDADD)
+convert_uint8_int32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_int64_SOURCES = convert_uint8_int64.c
+convert_uint8_int64_OBJECTS = convert_uint8_int64.$(OBJEXT)
+convert_uint8_int64_LDADD = $(LDADD)
+convert_uint8_int64_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_int8_SOURCES = convert_uint8_int8.c
+convert_uint8_int8_OBJECTS = convert_uint8_int8.$(OBJEXT)
+convert_uint8_int8_LDADD = $(LDADD)
+convert_uint8_int8_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_uint16_SOURCES = convert_uint8_uint16.c
+convert_uint8_uint16_OBJECTS = convert_uint8_uint16.$(OBJEXT)
+convert_uint8_uint16_LDADD = $(LDADD)
+convert_uint8_uint16_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_uint32_SOURCES = convert_uint8_uint32.c
+convert_uint8_uint32_OBJECTS = convert_uint8_uint32.$(OBJEXT)
+convert_uint8_uint32_LDADD = $(LDADD)
+convert_uint8_uint32_DEPENDENCIES = ../src/libgetdata.la
+convert_uint8_uint64_SOURCES = convert_uint8_uint64.c
+convert_uint8_uint64_OBJECTS = convert_uint8_uint64.$(OBJEXT)
+convert_uint8_uint64_LDADD = $(LDADD)
+convert_uint8_uint64_DEPENDENCIES = ../src/libgetdata.la
+creat_SOURCES = creat.c
+creat_OBJECTS = creat.$(OBJEXT)
+creat_LDADD = $(LDADD)
+creat_DEPENDENCIES = ../src/libgetdata.la
+creat_excl_SOURCES = creat_excl.c
+creat_excl_OBJECTS = creat_excl.$(OBJEXT)
+creat_excl_LDADD = $(LDADD)
+creat_excl_DEPENDENCIES = ../src/libgetdata.la
+creat_rdonly_SOURCES = creat_rdonly.c
+creat_rdonly_OBJECTS = creat_rdonly.$(OBJEXT)
+creat_rdonly_LDADD = $(LDADD)
+creat_rdonly_DEPENDENCIES = ../src/libgetdata.la
+cvlist_SOURCES = cvlist.c
+cvlist_OBJECTS = cvlist.$(OBJEXT)
+cvlist_LDADD = $(LDADD)
+cvlist_DEPENDENCIES = ../src/libgetdata.la
+cvlist_array_SOURCES = cvlist_array.c
+cvlist_array_OBJECTS = cvlist_array.$(OBJEXT)
+cvlist_array_LDADD = $(LDADD)
+cvlist_array_DEPENDENCIES = ../src/libgetdata.la
+cvlist_array_hidden_SOURCES = cvlist_array_hidden.c
+cvlist_array_hidden_OBJECTS = cvlist_array_hidden.$(OBJEXT)
+cvlist_array_hidden_LDADD = $(LDADD)
+cvlist_array_hidden_DEPENDENCIES = ../src/libgetdata.la
+cvlist_array_meta_SOURCES = cvlist_array_meta.c
+cvlist_array_meta_OBJECTS = cvlist_array_meta.$(OBJEXT)
+cvlist_array_meta_LDADD = $(LDADD)
+cvlist_array_meta_DEPENDENCIES = ../src/libgetdata.la
+cvlist_array_meta_hidden_SOURCES = cvlist_array_meta_hidden.c
+cvlist_array_meta_hidden_OBJECTS = cvlist_array_meta_hidden.$(OBJEXT)
+cvlist_array_meta_hidden_LDADD = $(LDADD)
+cvlist_array_meta_hidden_DEPENDENCIES = ../src/libgetdata.la
+cvlist_hidden_SOURCES = cvlist_hidden.c
+cvlist_hidden_OBJECTS = cvlist_hidden.$(OBJEXT)
+cvlist_hidden_LDADD = $(LDADD)
+cvlist_hidden_DEPENDENCIES = ../src/libgetdata.la
+cvlist_invalid_SOURCES = cvlist_invalid.c
+cvlist_invalid_OBJECTS = cvlist_invalid.$(OBJEXT)
+cvlist_invalid_LDADD = $(LDADD)
+cvlist_invalid_DEPENDENCIES = ../src/libgetdata.la
+cvlist_meta_SOURCES = cvlist_meta.c
+cvlist_meta_OBJECTS = cvlist_meta.$(OBJEXT)
+cvlist_meta_LDADD = $(LDADD)
+cvlist_meta_DEPENDENCIES = ../src/libgetdata.la
+cvlist_meta_hidden_SOURCES = cvlist_meta_hidden.c
+cvlist_meta_hidden_OBJECTS = cvlist_meta_hidden.$(OBJEXT)
+cvlist_meta_hidden_LDADD = $(LDADD)
+cvlist_meta_hidden_DEPENDENCIES = ../src/libgetdata.la
+cvlist_meta_invalid_SOURCES = cvlist_meta_invalid.c
+cvlist_meta_invalid_OBJECTS = cvlist_meta_invalid.$(OBJEXT)
+cvlist_meta_invalid_LDADD = $(LDADD)
+cvlist_meta_invalid_DEPENDENCIES = ../src/libgetdata.la
+del_SOURCES = del.c
+del_OBJECTS = del.$(OBJEXT)
+del_LDADD = $(LDADD)
+del_DEPENDENCIES = ../src/libgetdata.la
+del_carray_SOURCES = del_carray.c
+del_carray_OBJECTS = del_carray.$(OBJEXT)
+del_carray_LDADD = $(LDADD)
+del_carray_DEPENDENCIES = ../src/libgetdata.la
+del_carray_deref_SOURCES = del_carray_deref.c
+del_carray_deref_OBJECTS = del_carray_deref.$(OBJEXT)
+del_carray_deref_LDADD = $(LDADD)
+del_carray_deref_DEPENDENCIES = ../src/libgetdata.la
+del_const_SOURCES = del_const.c
+del_const_OBJECTS = del_const.$(OBJEXT)
+del_const_LDADD = $(LDADD)
+del_const_DEPENDENCIES = ../src/libgetdata.la
+del_const_deref_SOURCES = del_const_deref.c
+del_const_deref_OBJECTS = del_const_deref.$(OBJEXT)
+del_const_deref_LDADD = $(LDADD)
+del_const_deref_DEPENDENCIES = ../src/libgetdata.la
+del_const_force_SOURCES = del_const_force.c
+del_const_force_OBJECTS = del_const_force.$(OBJEXT)
+del_const_force_LDADD = $(LDADD)
+del_const_force_DEPENDENCIES = ../src/libgetdata.la
+del_data_SOURCES = del_data.c
+del_data_OBJECTS = del_data.$(OBJEXT)
+del_data_LDADD = $(LDADD)
+del_data_DEPENDENCIES = ../src/libgetdata.la
+del_derived_SOURCES = del_derived.c
+del_derived_OBJECTS = del_derived.$(OBJEXT)
+del_derived_LDADD = $(LDADD)
+del_derived_DEPENDENCIES = ../src/libgetdata.la
+del_derived_after_SOURCES = del_derived_after.c
+del_derived_after_OBJECTS = del_derived_after.$(OBJEXT)
+del_derived_after_LDADD = $(LDADD)
+del_derived_after_DEPENDENCIES = ../src/libgetdata.la
+del_derived_force_SOURCES = del_derived_force.c
+del_derived_force_OBJECTS = del_derived_force.$(OBJEXT)
+del_derived_force_LDADD = $(LDADD)
+del_derived_force_DEPENDENCIES = ../src/libgetdata.la
+del_meta_SOURCES = del_meta.c
+del_meta_OBJECTS = del_meta.$(OBJEXT)
+del_meta_LDADD = $(LDADD)
+del_meta_DEPENDENCIES = ../src/libgetdata.la
+del_meta_force_SOURCES = del_meta_force.c
+del_meta_force_OBJECTS = del_meta_force.$(OBJEXT)
+del_meta_force_LDADD = $(LDADD)
+del_meta_force_DEPENDENCIES = ../src/libgetdata.la
+desync_SOURCES = desync.c
+desync_OBJECTS = desync.$(OBJEXT)
+desync_LDADD = $(LDADD)
+desync_DEPENDENCIES = ../src/libgetdata.la
+desync_flush_SOURCES = desync_flush.c
+desync_flush_OBJECTS = desync_flush.$(OBJEXT)
+desync_flush_LDADD = $(LDADD)
+desync_flush_DEPENDENCIES = ../src/libgetdata.la
+desync_reopen_SOURCES = desync_reopen.c
+desync_reopen_OBJECTS = desync_reopen.$(OBJEXT)
+desync_reopen_LDADD = $(LDADD)
+desync_reopen_DEPENDENCIES = ../src/libgetdata.la
+desync_reopen_inv_SOURCES = desync_reopen_inv.c
+desync_reopen_inv_OBJECTS = desync_reopen_inv.$(OBJEXT)
+desync_reopen_inv_LDADD = $(LDADD)
+desync_reopen_inv_DEPENDENCIES = ../src/libgetdata.la
+dfes_bit_SOURCES = dfes_bit.c
+dfes_bit_OBJECTS = dfes_bit.$(OBJEXT)
+dfes_bit_LDADD = $(LDADD)
+dfes_bit_DEPENDENCIES = ../src/libgetdata.la
+dfes_divide_SOURCES = dfes_divide.c
+dfes_divide_OBJECTS = dfes_divide.$(OBJEXT)
+dfes_divide_LDADD = $(LDADD)
+dfes_divide_DEPENDENCIES = ../src/libgetdata.la
+dfes_lincom_SOURCES = dfes_lincom.c
+dfes_lincom_OBJECTS = dfes_lincom.$(OBJEXT)
+dfes_lincom_LDADD = $(LDADD)
+dfes_lincom_DEPENDENCIES = ../src/libgetdata.la
+dfes_linterp_SOURCES = dfes_linterp.c
+dfes_linterp_OBJECTS = dfes_linterp.$(OBJEXT)
+dfes_linterp_LDADD = $(LDADD)
+dfes_linterp_DEPENDENCIES = ../src/libgetdata.la
+dfes_multiply_SOURCES = dfes_multiply.c
+dfes_multiply_OBJECTS = dfes_multiply.$(OBJEXT)
+dfes_multiply_LDADD = $(LDADD)
+dfes_multiply_DEPENDENCIES = ../src/libgetdata.la
+dfes_null_SOURCES = dfes_null.c
+dfes_null_OBJECTS = dfes_null.$(OBJEXT)
+dfes_null_LDADD = $(LDADD)
+dfes_null_DEPENDENCIES = ../src/libgetdata.la
+dfes_phase_SOURCES = dfes_phase.c
+dfes_phase_OBJECTS = dfes_phase.$(OBJEXT)
+dfes_phase_LDADD = $(LDADD)
+dfes_phase_DEPENDENCIES = ../src/libgetdata.la
+dfes_raw_SOURCES = dfes_raw.c
+dfes_raw_OBJECTS = dfes_raw.$(OBJEXT)
+dfes_raw_LDADD = $(LDADD)
+dfes_raw_DEPENDENCIES = ../src/libgetdata.la
+dfes_recip_SOURCES = dfes_recip.c
+dfes_recip_OBJECTS = dfes_recip.$(OBJEXT)
+dfes_recip_LDADD = $(LDADD)
+dfes_recip_DEPENDENCIES = ../src/libgetdata.la
+dfes_zero_SOURCES = dfes_zero.c
+dfes_zero_OBJECTS = dfes_zero.$(OBJEXT)
+dfes_zero_LDADD = $(LDADD)
+dfes_zero_DEPENDENCIES = ../src/libgetdata.la
+elist_alias_SOURCES = elist_alias.c
+elist_alias_OBJECTS = elist_alias.$(OBJEXT)
+elist_alias_LDADD = $(LDADD)
+elist_alias_DEPENDENCIES = ../src/libgetdata.la
+elist_hidden_SOURCES = elist_hidden.c
+elist_hidden_OBJECTS = elist_hidden.$(OBJEXT)
+elist_hidden_LDADD = $(LDADD)
+elist_hidden_DEPENDENCIES = ../src/libgetdata.la
+elist_noalias_SOURCES = elist_noalias.c
+elist_noalias_OBJECTS = elist_noalias.$(OBJEXT)
+elist_noalias_LDADD = $(LDADD)
+elist_noalias_DEPENDENCIES = ../src/libgetdata.la
+elist_scalar_SOURCES = elist_scalar.c
+elist_scalar_OBJECTS = elist_scalar.$(OBJEXT)
+elist_scalar_LDADD = $(LDADD)
+elist_scalar_DEPENDENCIES = ../src/libgetdata.la
+encode_alter_SOURCES = encode_alter.c
+encode_alter_OBJECTS = encode_alter.$(OBJEXT)
+encode_alter_LDADD = $(LDADD)
+encode_alter_DEPENDENCIES = ../src/libgetdata.la
+encode_get_SOURCES = encode_get.c
+encode_get_OBJECTS = encode_get.$(OBJEXT)
+encode_get_LDADD = $(LDADD)
+encode_get_DEPENDENCIES = ../src/libgetdata.la
+encode_move_SOURCES = encode_move.c
+encode_move_OBJECTS = encode_move.$(OBJEXT)
+encode_move_LDADD = $(LDADD)
+encode_move_DEPENDENCIES = ../src/libgetdata.la
+endian_alter_SOURCES = endian_alter.c
+endian_alter_OBJECTS = endian_alter.$(OBJEXT)
+endian_alter_LDADD = $(LDADD)
+endian_alter_DEPENDENCIES = ../src/libgetdata.la
+endian_alter_sie_SOURCES = endian_alter_sie.c
+endian_alter_sie_OBJECTS = endian_alter_sie.$(OBJEXT)
+endian_alter_sie_LDADD = $(LDADD)
+endian_alter_sie_DEPENDENCIES = ../src/libgetdata.la
+endian_get_SOURCES = endian_get.c
+endian_get_OBJECTS = endian_get.$(OBJEXT)
+endian_get_LDADD = $(LDADD)
+endian_get_DEPENDENCIES = ../src/libgetdata.la
+endian_move_SOURCES = endian_move.c
+endian_move_OBJECTS = endian_move.$(OBJEXT)
+endian_move_LDADD = $(LDADD)
+endian_move_DEPENDENCIES = ../src/libgetdata.la
+entry_bad_code_SOURCES = entry_bad_code.c
+entry_bad_code_OBJECTS = entry_bad_code.$(OBJEXT)
+entry_bad_code_LDADD = $(LDADD)
+entry_bad_code_DEPENDENCIES = ../src/libgetdata.la
+entry_bit_SOURCES = entry_bit.c
+entry_bit_OBJECTS = entry_bit.$(OBJEXT)
+entry_bit_LDADD = $(LDADD)
+entry_bit_DEPENDENCIES = ../src/libgetdata.la
+entry_bit_scalar_SOURCES = entry_bit_scalar.c
+entry_bit_scalar_OBJECTS = entry_bit_scalar.$(OBJEXT)
+entry_bit_scalar_LDADD = $(LDADD)
+entry_bit_scalar_DEPENDENCIES = ../src/libgetdata.la
+entry_divide_SOURCES = entry_divide.c
+entry_divide_OBJECTS = entry_divide.$(OBJEXT)
+entry_divide_LDADD = $(LDADD)
+entry_divide_DEPENDENCIES = ../src/libgetdata.la
+entry_invalid_SOURCES = entry_invalid.c
+entry_invalid_OBJECTS = entry_invalid.$(OBJEXT)
+entry_invalid_LDADD = $(LDADD)
+entry_invalid_DEPENDENCIES = ../src/libgetdata.la
+entry_lincom_SOURCES = entry_lincom.c
+entry_lincom_OBJECTS = entry_lincom.$(OBJEXT)
+entry_lincom_LDADD = $(LDADD)
+entry_lincom_DEPENDENCIES = ../src/libgetdata.la
+entry_lincom_scalar_SOURCES = entry_lincom_scalar.c
+entry_lincom_scalar_OBJECTS = entry_lincom_scalar.$(OBJEXT)
+entry_lincom_scalar_LDADD = $(LDADD)
+entry_lincom_scalar_DEPENDENCIES = ../src/libgetdata.la
+entry_linterp_SOURCES = entry_linterp.c
+entry_linterp_OBJECTS = entry_linterp.$(OBJEXT)
+entry_linterp_LDADD = $(LDADD)
+entry_linterp_DEPENDENCIES = ../src/libgetdata.la
+entry_mplex_SOURCES = entry_mplex.c
+entry_mplex_OBJECTS = entry_mplex.$(OBJEXT)
+entry_mplex_LDADD = $(LDADD)
+entry_mplex_DEPENDENCIES = ../src/libgetdata.la
+entry_mplex_scalar_SOURCES = entry_mplex_scalar.c
+entry_mplex_scalar_OBJECTS = entry_mplex_scalar.$(OBJEXT)
+entry_mplex_scalar_LDADD = $(LDADD)
+entry_mplex_scalar_DEPENDENCIES = ../src/libgetdata.la
+entry_multiply_SOURCES = entry_multiply.c
+entry_multiply_OBJECTS = entry_multiply.$(OBJEXT)
+entry_multiply_LDADD = $(LDADD)
+entry_multiply_DEPENDENCIES = ../src/libgetdata.la
+entry_phase_SOURCES = entry_phase.c
+entry_phase_OBJECTS = entry_phase.$(OBJEXT)
+entry_phase_LDADD = $(LDADD)
+entry_phase_DEPENDENCIES = ../src/libgetdata.la
+entry_phase_scalar_SOURCES = entry_phase_scalar.c
+entry_phase_scalar_OBJECTS = entry_phase_scalar.$(OBJEXT)
+entry_phase_scalar_LDADD = $(LDADD)
+entry_phase_scalar_DEPENDENCIES = ../src/libgetdata.la
+entry_polynom_SOURCES = entry_polynom.c
+entry_polynom_OBJECTS = entry_polynom.$(OBJEXT)
+entry_polynom_LDADD = $(LDADD)
+entry_polynom_DEPENDENCIES = ../src/libgetdata.la
+entry_polynom_scalar_SOURCES = entry_polynom_scalar.c
+entry_polynom_scalar_OBJECTS = entry_polynom_scalar.$(OBJEXT)
+entry_polynom_scalar_LDADD = $(LDADD)
+entry_polynom_scalar_DEPENDENCIES = ../src/libgetdata.la
+entry_raw_SOURCES = entry_raw.c
+entry_raw_OBJECTS = entry_raw.$(OBJEXT)
+entry_raw_LDADD = $(LDADD)
+entry_raw_DEPENDENCIES = ../src/libgetdata.la
+entry_raw_scalar_SOURCES = entry_raw_scalar.c
+entry_raw_scalar_OBJECTS = entry_raw_scalar.$(OBJEXT)
+entry_raw_scalar_LDADD = $(LDADD)
+entry_raw_scalar_DEPENDENCIES = ../src/libgetdata.la
+entry_raw_scalar_code_SOURCES = entry_raw_scalar_code.c
+entry_raw_scalar_code_OBJECTS = entry_raw_scalar_code.$(OBJEXT)
+entry_raw_scalar_code_LDADD = $(LDADD)
+entry_raw_scalar_code_DEPENDENCIES = ../src/libgetdata.la
+entry_raw_scalar_type_SOURCES = entry_raw_scalar_type.c
+entry_raw_scalar_type_OBJECTS = entry_raw_scalar_type.$(OBJEXT)
+entry_raw_scalar_type_LDADD = $(LDADD)
+entry_raw_scalar_type_DEPENDENCIES = ../src/libgetdata.la
+entry_recip_SOURCES = entry_recip.c
+entry_recip_OBJECTS = entry_recip.$(OBJEXT)
+entry_recip_LDADD = $(LDADD)
+entry_recip_DEPENDENCIES = ../src/libgetdata.la
+entry_scalar_repr_SOURCES = entry_scalar_repr.c
+entry_scalar_repr_OBJECTS = entry_scalar_repr.$(OBJEXT)
+entry_scalar_repr_LDADD = $(LDADD)
+entry_scalar_repr_DEPENDENCIES = ../src/libgetdata.la
+entry_type_SOURCES = entry_type.c
+entry_type_OBJECTS = entry_type.$(OBJEXT)
+entry_type_LDADD = $(LDADD)
+entry_type_DEPENDENCIES = ../src/libgetdata.la
+entry_type_alias_SOURCES = entry_type_alias.c
+entry_type_alias_OBJECTS = entry_type_alias.$(OBJEXT)
+entry_type_alias_LDADD = $(LDADD)
+entry_type_alias_DEPENDENCIES = ../src/libgetdata.la
+entry_window_SOURCES = entry_window.c
+entry_window_OBJECTS = entry_window.$(OBJEXT)
+entry_window_LDADD = $(LDADD)
+entry_window_DEPENDENCIES = ../src/libgetdata.la
+entry_window_scalar_SOURCES = entry_window_scalar.c
+entry_window_scalar_OBJECTS = entry_window_scalar.$(OBJEXT)
+entry_window_scalar_LDADD = $(LDADD)
+entry_window_scalar_DEPENDENCIES = ../src/libgetdata.la
+eof_SOURCES = eof.c
+eof_OBJECTS = eof.$(OBJEXT)
+eof_LDADD = $(LDADD)
+eof_DEPENDENCIES = ../src/libgetdata.la
+eof_index_SOURCES = eof_index.c
+eof_index_OBJECTS = eof_index.$(OBJEXT)
+eof_index_LDADD = $(LDADD)
+eof_index_DEPENDENCIES = ../src/libgetdata.la
+eof_lincom_SOURCES = eof_lincom.c
+eof_lincom_OBJECTS = eof_lincom.$(OBJEXT)
+eof_lincom_LDADD = $(LDADD)
+eof_lincom_DEPENDENCIES = ../src/libgetdata.la
+eof_phase_SOURCES = eof_phase.c
+eof_phase_OBJECTS = eof_phase.$(OBJEXT)
+eof_phase_LDADD = $(LDADD)
+eof_phase_DEPENDENCIES = ../src/libgetdata.la
+error_SOURCES = error.c
+error_OBJECTS = error.$(OBJEXT)
+error_LDADD = $(LDADD)
+error_DEPENDENCIES = ../src/libgetdata.la
+error_error_SOURCES = error_error.c
+error_error_OBJECTS = error_error.$(OBJEXT)
+error_error_LDADD = $(LDADD)
+error_error_DEPENDENCIES = ../src/libgetdata.la
+error_num_SOURCES = error_num.c
+error_num_OBJECTS = error_num.$(OBJEXT)
+error_num_LDADD = $(LDADD)
+error_num_DEPENDENCIES = ../src/libgetdata.la
+error_short_SOURCES = error_short.c
+error_short_OBJECTS = error_short.$(OBJEXT)
+error_short_LDADD = $(LDADD)
+error_short_DEPENDENCIES = ../src/libgetdata.la
+error_verbose_SOURCES = error_verbose.c
+error_verbose_OBJECTS = error_verbose.$(OBJEXT)
+error_verbose_LDADD = $(LDADD)
+error_verbose_DEPENDENCIES = ../src/libgetdata.la
+error_verbose_prefix_SOURCES = error_verbose_prefix.c
+error_verbose_prefix_OBJECTS = error_verbose_prefix.$(OBJEXT)
+error_verbose_prefix_LDADD = $(LDADD)
+error_verbose_prefix_DEPENDENCIES = ../src/libgetdata.la
+file_SOURCES = file.c
+file_OBJECTS = file.$(OBJEXT)
+file_LDADD = $(LDADD)
+file_DEPENDENCIES = ../src/libgetdata.la
+file_code_SOURCES = file_code.c
+file_code_OBJECTS = file_code.$(OBJEXT)
+file_code_LDADD = $(LDADD)
+file_code_DEPENDENCIES = ../src/libgetdata.la
+file_type_SOURCES = file_type.c
+file_type_OBJECTS = file_type.$(OBJEXT)
+file_type_LDADD = $(LDADD)
+file_type_DEPENDENCIES = ../src/libgetdata.la
+flist_SOURCES = flist.c
+flist_OBJECTS = flist.$(OBJEXT)
+flist_LDADD = $(LDADD)
+flist_DEPENDENCIES = ../src/libgetdata.la
+flist_hidden_SOURCES = flist_hidden.c
+flist_hidden_OBJECTS = flist_hidden.$(OBJEXT)
+flist_hidden_LDADD = $(LDADD)
+flist_hidden_DEPENDENCIES = ../src/libgetdata.la
+flist_invalid_SOURCES = flist_invalid.c
+flist_invalid_OBJECTS = flist_invalid.$(OBJEXT)
+flist_invalid_LDADD = $(LDADD)
+flist_invalid_DEPENDENCIES = ../src/libgetdata.la
+flist_meta_SOURCES = flist_meta.c
+flist_meta_OBJECTS = flist_meta.$(OBJEXT)
+flist_meta_LDADD = $(LDADD)
+flist_meta_DEPENDENCIES = ../src/libgetdata.la
+flist_meta_hidden_SOURCES = flist_meta_hidden.c
+flist_meta_hidden_OBJECTS = flist_meta_hidden.$(OBJEXT)
+flist_meta_hidden_LDADD = $(LDADD)
+flist_meta_hidden_DEPENDENCIES = ../src/libgetdata.la
+flist_meta_invalid_SOURCES = flist_meta_invalid.c
+flist_meta_invalid_OBJECTS = flist_meta_invalid.$(OBJEXT)
+flist_meta_invalid_LDADD = $(LDADD)
+flist_meta_invalid_DEPENDENCIES = ../src/libgetdata.la
+flist_type_SOURCES = flist_type.c
+flist_type_OBJECTS = flist_type.$(OBJEXT)
+flist_type_LDADD = $(LDADD)
+flist_type_DEPENDENCIES = ../src/libgetdata.la
+flist_type_hidden_SOURCES = flist_type_hidden.c
+flist_type_hidden_OBJECTS = flist_type_hidden.$(OBJEXT)
+flist_type_hidden_LDADD = $(LDADD)
+flist_type_hidden_DEPENDENCIES = ../src/libgetdata.la
+flist_type_invalid_SOURCES = flist_type_invalid.c
+flist_type_invalid_OBJECTS = flist_type_invalid.$(OBJEXT)
+flist_type_invalid_LDADD = $(LDADD)
+flist_type_invalid_DEPENDENCIES = ../src/libgetdata.la
+flist_type_meta_SOURCES = flist_type_meta.c
+flist_type_meta_OBJECTS = flist_type_meta.$(OBJEXT)
+flist_type_meta_LDADD = $(LDADD)
+flist_type_meta_DEPENDENCIES = ../src/libgetdata.la
+flist_type_meta_hidden_SOURCES = flist_type_meta_hidden.c
+flist_type_meta_hidden_OBJECTS = flist_type_meta_hidden.$(OBJEXT)
+flist_type_meta_hidden_LDADD = $(LDADD)
+flist_type_meta_hidden_DEPENDENCIES = ../src/libgetdata.la
+flist_type_meta_invalid_SOURCES = flist_type_meta_invalid.c
+flist_type_meta_invalid_OBJECTS = flist_type_meta_invalid.$(OBJEXT)
+flist_type_meta_invalid_LDADD = $(LDADD)
+flist_type_meta_invalid_DEPENDENCIES = ../src/libgetdata.la
+flush_SOURCES = flush.c
+flush_OBJECTS = flush.$(OBJEXT)
+flush_LDADD = $(LDADD)
+flush_DEPENDENCIES = ../src/libgetdata.la
+flush_all_SOURCES = flush_all.c
+flush_all_OBJECTS = flush_all.$(OBJEXT)
+flush_all_LDADD = $(LDADD)
+flush_all_DEPENDENCIES = ../src/libgetdata.la
+flush_bad_code_SOURCES = flush_bad_code.c
+flush_bad_code_OBJECTS = flush_bad_code.$(OBJEXT)
+flush_bad_code_LDADD = $(LDADD)
+flush_bad_code_DEPENDENCIES = ../src/libgetdata.la
+flush_hex_SOURCES = flush_hex.c
+flush_hex_OBJECTS = flush_hex.$(OBJEXT)
+flush_hex_LDADD = $(LDADD)
+flush_hex_DEPENDENCIES = ../src/libgetdata.la
+flush_invalid_SOURCES = flush_invalid.c
+flush_invalid_OBJECTS = flush_invalid.$(OBJEXT)
+flush_invalid_LDADD = $(LDADD)
+flush_invalid_DEPENDENCIES = ../src/libgetdata.la
+flush_meta_SOURCES = flush_meta.c
+flush_meta_OBJECTS = flush_meta.$(OBJEXT)
+flush_meta_LDADD = $(LDADD)
+flush_meta_DEPENDENCIES = ../src/libgetdata.la
+flush_ref_SOURCES = flush_ref.c
+flush_ref_OBJECTS = flush_ref.$(OBJEXT)
+flush_ref_LDADD = $(LDADD)
+flush_ref_DEPENDENCIES = ../src/libgetdata.la
+flush_spec_SOURCES = flush_spec.c
+flush_spec_OBJECTS = flush_spec.$(OBJEXT)
+flush_spec_LDADD = $(LDADD)
+flush_spec_DEPENDENCIES = ../src/libgetdata.la
+foffs_alter_SOURCES = foffs_alter.c
+foffs_alter_OBJECTS = foffs_alter.$(OBJEXT)
+foffs_alter_LDADD = $(LDADD)
+foffs_alter_DEPENDENCIES = ../src/libgetdata.la
+foffs_get_SOURCES = foffs_get.c
+foffs_get_OBJECTS = foffs_get.$(OBJEXT)
+foffs_get_LDADD = $(LDADD)
+foffs_get_DEPENDENCIES = ../src/libgetdata.la
+foffs_move_SOURCES = foffs_move.c
+foffs_move_OBJECTS = foffs_move.$(OBJEXT)
+foffs_move_LDADD = $(LDADD)
+foffs_move_DEPENDENCIES = ../src/libgetdata.la
+fragment_affix_SOURCES = fragment_affix.c
+fragment_affix_OBJECTS = fragment_affix.$(OBJEXT)
+fragment_affix_LDADD = $(LDADD)
+fragment_affix_DEPENDENCIES = ../src/libgetdata.la
+fragment_affix_alter_SOURCES = fragment_affix_alter.c
+fragment_affix_alter_OBJECTS = fragment_affix_alter.$(OBJEXT)
+fragment_affix_alter_LDADD = $(LDADD)
+fragment_affix_alter_DEPENDENCIES = ../src/libgetdata.la
+fragment_affix_alter2_SOURCES = fragment_affix_alter2.c
+fragment_affix_alter2_OBJECTS = fragment_affix_alter2.$(OBJEXT)
+fragment_affix_alter2_LDADD = $(LDADD)
+fragment_affix_alter2_DEPENDENCIES = ../src/libgetdata.la
+fragment_affix_dup_SOURCES = fragment_affix_dup.c
+fragment_affix_dup_OBJECTS = fragment_affix_dup.$(OBJEXT)
+fragment_affix_dup_LDADD = $(LDADD)
+fragment_affix_dup_DEPENDENCIES = ../src/libgetdata.la
+fragment_index_SOURCES = fragment_index.c
+fragment_index_OBJECTS = fragment_index.$(OBJEXT)
+fragment_index_LDADD = $(LDADD)
+fragment_index_DEPENDENCIES = ../src/libgetdata.la
+fragment_index_alias_SOURCES = fragment_index_alias.c
+fragment_index_alias_OBJECTS = fragment_index_alias.$(OBJEXT)
+fragment_index_alias_LDADD = $(LDADD)
+fragment_index_alias_DEPENDENCIES = ../src/libgetdata.la
+fragment_name_SOURCES = fragment_name.c
+fragment_name_OBJECTS = fragment_name.$(OBJEXT)
+fragment_name_LDADD = $(LDADD)
+fragment_name_DEPENDENCIES = ../src/libgetdata.la
+fragment_name_oor_SOURCES = fragment_name_oor.c
+fragment_name_oor_OBJECTS = fragment_name_oor.$(OBJEXT)
+fragment_name_oor_LDADD = $(LDADD)
+fragment_name_oor_DEPENDENCIES = ../src/libgetdata.la
+fragment_num_SOURCES = fragment_num.c
+fragment_num_OBJECTS = fragment_num.$(OBJEXT)
+fragment_num_LDADD = $(LDADD)
+fragment_num_DEPENDENCIES = ../src/libgetdata.la
+fragment_parent_SOURCES = fragment_parent.c
+fragment_parent_OBJECTS = fragment_parent.$(OBJEXT)
+fragment_parent_LDADD = $(LDADD)
+fragment_parent_DEPENDENCIES = ../src/libgetdata.la
+get64_SOURCES = get64.c
+get64_OBJECTS = get64.$(OBJEXT)
+get64_LDADD = $(LDADD)
+get64_DEPENDENCIES = ../src/libgetdata.la
+get_affix_SOURCES = get_affix.c
+get_affix_OBJECTS = get_affix.$(OBJEXT)
+get_affix_LDADD = $(LDADD)
+get_affix_DEPENDENCIES = ../src/libgetdata.la
+get_bad_code_SOURCES = get_bad_code.c
+get_bad_code_OBJECTS = get_bad_code.$(OBJEXT)
+get_bad_code_LDADD = $(LDADD)
+get_bad_code_DEPENDENCIES = ../src/libgetdata.la
+get_bit_SOURCES = get_bit.c
+get_bit_OBJECTS = get_bit.$(OBJEXT)
+get_bit_LDADD = $(LDADD)
+get_bit_DEPENDENCIES = ../src/libgetdata.la
+get_carray_SOURCES = get_carray.c
+get_carray_OBJECTS = get_carray.$(OBJEXT)
+get_carray_LDADD = $(LDADD)
+get_carray_DEPENDENCIES = ../src/libgetdata.la
+get_carray_c2r_SOURCES = get_carray_c2r.c
+get_carray_c2r_OBJECTS = get_carray_c2r.$(OBJEXT)
+get_carray_c2r_LDADD = $(LDADD)
+get_carray_c2r_DEPENDENCIES = ../src/libgetdata.la
+get_carray_len_SOURCES = get_carray_len.c
+get_carray_len_OBJECTS = get_carray_len.$(OBJEXT)
+get_carray_len_LDADD = $(LDADD)
+get_carray_len_DEPENDENCIES = ../src/libgetdata.la
+get_carray_slice_SOURCES = get_carray_slice.c
+get_carray_slice_OBJECTS = get_carray_slice.$(OBJEXT)
+get_carray_slice_LDADD = $(LDADD)
+get_carray_slice_DEPENDENCIES = ../src/libgetdata.la
+get_char_SOURCES = get_char.c
+get_char_OBJECTS = get_char.$(OBJEXT)
+get_char_LDADD = $(LDADD)
+get_char_DEPENDENCIES = ../src/libgetdata.la
+get_clincom_SOURCES = get_clincom.c
+get_clincom_OBJECTS = get_clincom.$(OBJEXT)
+get_clincom_LDADD = $(LDADD)
+get_clincom_DEPENDENCIES = ../src/libgetdata.la
+get_complex128_SOURCES = get_complex128.c
+get_complex128_OBJECTS = get_complex128.$(OBJEXT)
+get_complex128_LDADD = $(LDADD)
+get_complex128_DEPENDENCIES = ../src/libgetdata.la
+get_complex64_SOURCES = get_complex64.c
+get_complex64_OBJECTS = get_complex64.$(OBJEXT)
+get_complex64_LDADD = $(LDADD)
+get_complex64_DEPENDENCIES = ../src/libgetdata.la
+get_const_SOURCES = get_const.c
+get_const_OBJECTS = get_const.$(OBJEXT)
+get_const_LDADD = $(LDADD)
+get_const_DEPENDENCIES = ../src/libgetdata.la
+get_const_complex_SOURCES = get_const_complex.c
+get_const_complex_OBJECTS = get_const_complex.$(OBJEXT)
+get_const_complex_LDADD = $(LDADD)
+get_const_complex_DEPENDENCIES = ../src/libgetdata.la
+get_const_repr_SOURCES = get_const_repr.c
+get_const_repr_OBJECTS = get_const_repr.$(OBJEXT)
+get_const_repr_LDADD = $(LDADD)
+get_const_repr_DEPENDENCIES = ../src/libgetdata.la
+get_cpolynom_SOURCES = get_cpolynom.c
+get_cpolynom_OBJECTS = get_cpolynom.$(OBJEXT)
+get_cpolynom_LDADD = $(LDADD)
+get_cpolynom_DEPENDENCIES = ../src/libgetdata.la
+get_cpolynom1_SOURCES = get_cpolynom1.c
+get_cpolynom1_OBJECTS = get_cpolynom1.$(OBJEXT)
+get_cpolynom1_LDADD = $(LDADD)
+get_cpolynom1_DEPENDENCIES = ../src/libgetdata.la
+get_cpolynom_int_SOURCES = get_cpolynom_int.c
+get_cpolynom_int_OBJECTS = get_cpolynom_int.$(OBJEXT)
+get_cpolynom_int_LDADD = $(LDADD)
+get_cpolynom_int_DEPENDENCIES = ../src/libgetdata.la
+get_divide_SOURCES = get_divide.c
+get_divide_OBJECTS = get_divide.$(OBJEXT)
+get_divide_LDADD = $(LDADD)
+get_divide_DEPENDENCIES = ../src/libgetdata.la
+get_divide_ccin_SOURCES = get_divide_ccin.c
+get_divide_ccin_OBJECTS = get_divide_ccin.$(OBJEXT)
+get_divide_ccin_LDADD = $(LDADD)
+get_divide_ccin_DEPENDENCIES = ../src/libgetdata.la
+get_divide_crin_SOURCES = get_divide_crin.c
+get_divide_crin_OBJECTS = get_divide_crin.$(OBJEXT)
+get_divide_crin_LDADD = $(LDADD)
+get_divide_crin_DEPENDENCIES = ../src/libgetdata.la
+get_divide_crinr_SOURCES = get_divide_crinr.c
+get_divide_crinr_OBJECTS = get_divide_crinr.$(OBJEXT)
+get_divide_crinr_LDADD = $(LDADD)
+get_divide_crinr_DEPENDENCIES = ../src/libgetdata.la
+get_divide_rcin_SOURCES = get_divide_rcin.c
+get_divide_rcin_OBJECTS = get_divide_rcin.$(OBJEXT)
+get_divide_rcin_LDADD = $(LDADD)
+get_divide_rcin_DEPENDENCIES = ../src/libgetdata.la
+get_divide_s_SOURCES = get_divide_s.c
+get_divide_s_OBJECTS = get_divide_s.$(OBJEXT)
+get_divide_s_LDADD = $(LDADD)
+get_divide_s_DEPENDENCIES = ../src/libgetdata.la
+get_endian16_SOURCES = get_endian16.c
+get_endian16_OBJECTS = get_endian16.$(OBJEXT)
+get_endian16_LDADD = $(LDADD)
+get_endian16_DEPENDENCIES = ../src/libgetdata.la
+get_endian32_SOURCES = get_endian32.c
+get_endian32_OBJECTS = get_endian32.$(OBJEXT)
+get_endian32_LDADD = $(LDADD)
+get_endian32_DEPENDENCIES = ../src/libgetdata.la
+get_endian64_SOURCES = get_endian64.c
+get_endian64_OBJECTS = get_endian64.$(OBJEXT)
+get_endian64_LDADD = $(LDADD)
+get_endian64_DEPENDENCIES = ../src/libgetdata.la
+get_endian8_SOURCES = get_endian8.c
+get_endian8_OBJECTS = get_endian8.$(OBJEXT)
+get_endian8_LDADD = $(LDADD)
+get_endian8_DEPENDENCIES = ../src/libgetdata.la
+get_endian_complex128_arm_SOURCES = get_endian_complex128_arm.c
+get_endian_complex128_arm_OBJECTS =  \
+	get_endian_complex128_arm.$(OBJEXT)
+get_endian_complex128_arm_LDADD = $(LDADD)
+get_endian_complex128_arm_DEPENDENCIES = ../src/libgetdata.la
+get_endian_complex128_big_SOURCES = get_endian_complex128_big.c
+get_endian_complex128_big_OBJECTS =  \
+	get_endian_complex128_big.$(OBJEXT)
+get_endian_complex128_big_LDADD = $(LDADD)
+get_endian_complex128_big_DEPENDENCIES = ../src/libgetdata.la
+get_endian_complex128_little_SOURCES = get_endian_complex128_little.c
+get_endian_complex128_little_OBJECTS =  \
+	get_endian_complex128_little.$(OBJEXT)
+get_endian_complex128_little_LDADD = $(LDADD)
+get_endian_complex128_little_DEPENDENCIES = ../src/libgetdata.la
+get_endian_complex64_arm_SOURCES = get_endian_complex64_arm.c
+get_endian_complex64_arm_OBJECTS = get_endian_complex64_arm.$(OBJEXT)
+get_endian_complex64_arm_LDADD = $(LDADD)
+get_endian_complex64_arm_DEPENDENCIES = ../src/libgetdata.la
+get_endian_complex64_big_SOURCES = get_endian_complex64_big.c
+get_endian_complex64_big_OBJECTS = get_endian_complex64_big.$(OBJEXT)
+get_endian_complex64_big_LDADD = $(LDADD)
+get_endian_complex64_big_DEPENDENCIES = ../src/libgetdata.la
+get_endian_complex64_little_SOURCES = get_endian_complex64_little.c
+get_endian_complex64_little_OBJECTS =  \
+	get_endian_complex64_little.$(OBJEXT)
+get_endian_complex64_little_LDADD = $(LDADD)
+get_endian_complex64_little_DEPENDENCIES = ../src/libgetdata.la
+get_endian_float32_arm_SOURCES = get_endian_float32_arm.c
+get_endian_float32_arm_OBJECTS = get_endian_float32_arm.$(OBJEXT)
+get_endian_float32_arm_LDADD = $(LDADD)
+get_endian_float32_arm_DEPENDENCIES = ../src/libgetdata.la
+get_endian_float32_big_SOURCES = get_endian_float32_big.c
+get_endian_float32_big_OBJECTS = get_endian_float32_big.$(OBJEXT)
+get_endian_float32_big_LDADD = $(LDADD)
+get_endian_float32_big_DEPENDENCIES = ../src/libgetdata.la
+get_endian_float32_little_SOURCES = get_endian_float32_little.c
+get_endian_float32_little_OBJECTS =  \
+	get_endian_float32_little.$(OBJEXT)
+get_endian_float32_little_LDADD = $(LDADD)
+get_endian_float32_little_DEPENDENCIES = ../src/libgetdata.la
+get_endian_float64_arm_SOURCES = get_endian_float64_arm.c
+get_endian_float64_arm_OBJECTS = get_endian_float64_arm.$(OBJEXT)
+get_endian_float64_arm_LDADD = $(LDADD)
+get_endian_float64_arm_DEPENDENCIES = ../src/libgetdata.la
+get_endian_float64_big_SOURCES = get_endian_float64_big.c
+get_endian_float64_big_OBJECTS = get_endian_float64_big.$(OBJEXT)
+get_endian_float64_big_LDADD = $(LDADD)
+get_endian_float64_big_DEPENDENCIES = ../src/libgetdata.la
+get_endian_float64_little_SOURCES = get_endian_float64_little.c
+get_endian_float64_little_OBJECTS =  \
+	get_endian_float64_little.$(OBJEXT)
+get_endian_float64_little_LDADD = $(LDADD)
+get_endian_float64_little_DEPENDENCIES = ../src/libgetdata.la
+get_ff_SOURCES = get_ff.c
+get_ff_OBJECTS = get_ff.$(OBJEXT)
+get_ff_LDADD = $(LDADD)
+get_ff_DEPENDENCIES = ../src/libgetdata.la
+get_float32_SOURCES = get_float32.c
+get_float32_OBJECTS = get_float32.$(OBJEXT)
+get_float32_LDADD = $(LDADD)
+get_float32_DEPENDENCIES = ../src/libgetdata.la
+get_float64_SOURCES = get_float64.c
+get_float64_OBJECTS = get_float64.$(OBJEXT)
+get_float64_LDADD = $(LDADD)
+get_float64_DEPENDENCIES = ../src/libgetdata.la
+get_foffs_SOURCES = get_foffs.c
+get_foffs_OBJECTS = get_foffs.$(OBJEXT)
+get_foffs_LDADD = $(LDADD)
+get_foffs_DEPENDENCIES = ../src/libgetdata.la
+get_foffs2_SOURCES = get_foffs2.c
+get_foffs2_OBJECTS = get_foffs2.$(OBJEXT)
+get_foffs2_LDADD = $(LDADD)
+get_foffs2_DEPENDENCIES = ../src/libgetdata.la
+get_fs_SOURCES = get_fs.c
+get_fs_OBJECTS = get_fs.$(OBJEXT)
+get_fs_LDADD = $(LDADD)
+get_fs_DEPENDENCIES = ../src/libgetdata.la
+get_here_SOURCES = get_here.c
+get_here_OBJECTS = get_here.$(OBJEXT)
+get_here_LDADD = $(LDADD)
+get_here_DEPENDENCIES = ../src/libgetdata.la
+get_here_foffs_SOURCES = get_here_foffs.c
+get_here_foffs_OBJECTS = get_here_foffs.$(OBJEXT)
+get_here_foffs_LDADD = $(LDADD)
+get_here_foffs_DEPENDENCIES = ../src/libgetdata.la
+get_heres_SOURCES = get_heres.c
+get_heres_OBJECTS = get_heres.$(OBJEXT)
+get_heres_LDADD = $(LDADD)
+get_heres_DEPENDENCIES = ../src/libgetdata.la
+get_int16_SOURCES = get_int16.c
+get_int16_OBJECTS = get_int16.$(OBJEXT)
+get_int16_LDADD = $(LDADD)
+get_int16_DEPENDENCIES = ../src/libgetdata.la
+get_int32_SOURCES = get_int32.c
+get_int32_OBJECTS = get_int32.$(OBJEXT)
+get_int32_LDADD = $(LDADD)
+get_int32_DEPENDENCIES = ../src/libgetdata.la
+get_int64_SOURCES = get_int64.c
+get_int64_OBJECTS = get_int64.$(OBJEXT)
+get_int64_LDADD = $(LDADD)
+get_int64_DEPENDENCIES = ../src/libgetdata.la
+get_int8_SOURCES = get_int8.c
+get_int8_OBJECTS = get_int8.$(OBJEXT)
+get_int8_LDADD = $(LDADD)
+get_int8_DEPENDENCIES = ../src/libgetdata.la
+get_invalid_SOURCES = get_invalid.c
+get_invalid_OBJECTS = get_invalid.$(OBJEXT)
+get_invalid_LDADD = $(LDADD)
+get_invalid_DEPENDENCIES = ../src/libgetdata.la
+get_lincom1_SOURCES = get_lincom1.c
+get_lincom1_OBJECTS = get_lincom1.$(OBJEXT)
+get_lincom1_LDADD = $(LDADD)
+get_lincom1_DEPENDENCIES = ../src/libgetdata.la
+get_lincom2_SOURCES = get_lincom2.c
+get_lincom2_OBJECTS = get_lincom2.$(OBJEXT)
+get_lincom2_LDADD = $(LDADD)
+get_lincom2_DEPENDENCIES = ../src/libgetdata.la
+get_lincom3_SOURCES = get_lincom3.c
+get_lincom3_OBJECTS = get_lincom3.$(OBJEXT)
+get_lincom3_LDADD = $(LDADD)
+get_lincom3_DEPENDENCIES = ../src/libgetdata.la
+get_lincom_noin_SOURCES = get_lincom_noin.c
+get_lincom_noin_OBJECTS = get_lincom_noin.$(OBJEXT)
+get_lincom_noin_LDADD = $(LDADD)
+get_lincom_noin_DEPENDENCIES = ../src/libgetdata.la
+get_lincom_non_SOURCES = get_lincom_non.c
+get_lincom_non_OBJECTS = get_lincom_non.$(OBJEXT)
+get_lincom_non_LDADD = $(LDADD)
+get_lincom_non_DEPENDENCIES = ../src/libgetdata.la
+get_lincom_null_SOURCES = get_lincom_null.c
+get_lincom_null_OBJECTS = get_lincom_null.$(OBJEXT)
+get_lincom_null_LDADD = $(LDADD)
+get_lincom_null_DEPENDENCIES = ../src/libgetdata.la
+get_lincom_spf_SOURCES = get_lincom_spf.c
+get_lincom_spf_OBJECTS = get_lincom_spf.$(OBJEXT)
+get_lincom_spf_LDADD = $(LDADD)
+get_lincom_spf_DEPENDENCIES = ../src/libgetdata.la
+get_linterp_SOURCES = get_linterp.c
+get_linterp_OBJECTS = get_linterp.$(OBJEXT)
+get_linterp_LDADD = $(LDADD)
+get_linterp_DEPENDENCIES = ../src/libgetdata.la
+get_linterp_noin_SOURCES = get_linterp_noin.c
+get_linterp_noin_OBJECTS = get_linterp_noin.$(OBJEXT)
+get_linterp_noin_LDADD = $(LDADD)
+get_linterp_noin_DEPENDENCIES = ../src/libgetdata.la
+get_linterp_notab_SOURCES = get_linterp_notab.c
+get_linterp_notab_OBJECTS = get_linterp_notab.$(OBJEXT)
+get_linterp_notab_LDADD = $(LDADD)
+get_linterp_notab_DEPENDENCIES = ../src/libgetdata.la
+get_linterp_sort_SOURCES = get_linterp_sort.c
+get_linterp_sort_OBJECTS = get_linterp_sort.$(OBJEXT)
+get_linterp_sort_LDADD = $(LDADD)
+get_linterp_sort_DEPENDENCIES = ../src/libgetdata.la
+get_mplex_SOURCES = get_mplex.c
+get_mplex_OBJECTS = get_mplex.$(OBJEXT)
+get_mplex_LDADD = $(LDADD)
+get_mplex_DEPENDENCIES = ../src/libgetdata.la
+get_mplex_bof_SOURCES = get_mplex_bof.c
+get_mplex_bof_OBJECTS = get_mplex_bof.$(OBJEXT)
+get_mplex_bof_LDADD = $(LDADD)
+get_mplex_bof_DEPENDENCIES = ../src/libgetdata.la
+get_mplex_lb_SOURCES = get_mplex_lb.c
+get_mplex_lb_OBJECTS = get_mplex_lb.$(OBJEXT)
+get_mplex_lb_LDADD = $(LDADD)
+get_mplex_lb_DEPENDENCIES = ../src/libgetdata.la
+get_mplex_lball_SOURCES = get_mplex_lball.c
+get_mplex_lball_OBJECTS = get_mplex_lball.$(OBJEXT)
+get_mplex_lball_LDADD = $(LDADD)
+get_mplex_lball_DEPENDENCIES = ../src/libgetdata.la
+get_mplex_nolb_SOURCES = get_mplex_nolb.c
+get_mplex_nolb_OBJECTS = get_mplex_nolb.$(OBJEXT)
+get_mplex_nolb_LDADD = $(LDADD)
+get_mplex_nolb_DEPENDENCIES = ../src/libgetdata.la
+get_multiply_SOURCES = get_multiply.c
+get_multiply_OBJECTS = get_multiply.$(OBJEXT)
+get_multiply_LDADD = $(LDADD)
+get_multiply_DEPENDENCIES = ../src/libgetdata.la
+get_multiply_ccin_SOURCES = get_multiply_ccin.c
+get_multiply_ccin_OBJECTS = get_multiply_ccin.$(OBJEXT)
+get_multiply_ccin_LDADD = $(LDADD)
+get_multiply_ccin_DEPENDENCIES = ../src/libgetdata.la
+get_multiply_crin_SOURCES = get_multiply_crin.c
+get_multiply_crin_OBJECTS = get_multiply_crin.$(OBJEXT)
+get_multiply_crin_LDADD = $(LDADD)
+get_multiply_crin_DEPENDENCIES = ../src/libgetdata.la
+get_multiply_crinr_SOURCES = get_multiply_crinr.c
+get_multiply_crinr_OBJECTS = get_multiply_crinr.$(OBJEXT)
+get_multiply_crinr_LDADD = $(LDADD)
+get_multiply_crinr_DEPENDENCIES = ../src/libgetdata.la
+get_multiply_noin_SOURCES = get_multiply_noin.c
+get_multiply_noin_OBJECTS = get_multiply_noin.$(OBJEXT)
+get_multiply_noin_LDADD = $(LDADD)
+get_multiply_noin_DEPENDENCIES = ../src/libgetdata.la
+get_multiply_rcin_SOURCES = get_multiply_rcin.c
+get_multiply_rcin_OBJECTS = get_multiply_rcin.$(OBJEXT)
+get_multiply_rcin_LDADD = $(LDADD)
+get_multiply_rcin_DEPENDENCIES = ../src/libgetdata.la
+get_multiply_s_SOURCES = get_multiply_s.c
+get_multiply_s_OBJECTS = get_multiply_s.$(OBJEXT)
+get_multiply_s_LDADD = $(LDADD)
+get_multiply_s_DEPENDENCIES = ../src/libgetdata.la
+get_nonexistent_SOURCES = get_nonexistent.c
+get_nonexistent_OBJECTS = get_nonexistent.$(OBJEXT)
+get_nonexistent_LDADD = $(LDADD)
+get_nonexistent_DEPENDENCIES = ../src/libgetdata.la
+get_null_SOURCES = get_null.c
+get_null_OBJECTS = get_null.$(OBJEXT)
+get_null_LDADD = $(LDADD)
+get_null_DEPENDENCIES = ../src/libgetdata.la
+get_off64_SOURCES = get_off64.c
+get_off64_OBJECTS = get_off64.$(OBJEXT)
+get_off64_LDADD = $(LDADD)
+get_off64_DEPENDENCIES = ../src/libgetdata.la
+get_phase_SOURCES = get_phase.c
+get_phase_OBJECTS = get_phase.$(OBJEXT)
+get_phase_LDADD = $(LDADD)
+get_phase_DEPENDENCIES = ../src/libgetdata.la
+get_phase_affix_SOURCES = get_phase_affix.c
+get_phase_affix_OBJECTS = get_phase_affix.$(OBJEXT)
+get_phase_affix_LDADD = $(LDADD)
+get_phase_affix_DEPENDENCIES = ../src/libgetdata.la
+get_polynom_SOURCES = get_polynom.c
+get_polynom_OBJECTS = get_polynom.$(OBJEXT)
+get_polynom_LDADD = $(LDADD)
+get_polynom_DEPENDENCIES = ../src/libgetdata.la
+get_polynom_cmpin_SOURCES = get_polynom_cmpin.c
+get_polynom_cmpin_OBJECTS = get_polynom_cmpin.$(OBJEXT)
+get_polynom_cmpin_LDADD = $(LDADD)
+get_polynom_cmpin_DEPENDENCIES = ../src/libgetdata.la
+get_polynom_noin_SOURCES = get_polynom_noin.c
+get_polynom_noin_OBJECTS = get_polynom_noin.$(OBJEXT)
+get_polynom_noin_LDADD = $(LDADD)
+get_polynom_noin_DEPENDENCIES = ../src/libgetdata.la
+get_recip_SOURCES = get_recip.c
+get_recip_OBJECTS = get_recip.$(OBJEXT)
+get_recip_LDADD = $(LDADD)
+get_recip_DEPENDENCIES = ../src/libgetdata.la
+get_recip_const_SOURCES = get_recip_const.c
+get_recip_const_OBJECTS = get_recip_const.$(OBJEXT)
+get_recip_const_LDADD = $(LDADD)
+get_recip_const_DEPENDENCIES = ../src/libgetdata.la
+get_recurse_SOURCES = get_recurse.c
+get_recurse_OBJECTS = get_recurse.$(OBJEXT)
+get_recurse_LDADD = $(LDADD)
+get_recurse_DEPENDENCIES = ../src/libgetdata.la
+get_rofs_SOURCES = get_rofs.c
+get_rofs_OBJECTS = get_rofs.$(OBJEXT)
+get_rofs_LDADD = $(LDADD)
+get_rofs_DEPENDENCIES = ../src/libgetdata.la
+get_sbit_SOURCES = get_sbit.c
+get_sbit_OBJECTS = get_sbit.$(OBJEXT)
+get_sbit_LDADD = $(LDADD)
+get_sbit_DEPENDENCIES = ../src/libgetdata.la
+get_sf_SOURCES = get_sf.c
+get_sf_OBJECTS = get_sf.$(OBJEXT)
+get_sf_LDADD = $(LDADD)
+get_sf_DEPENDENCIES = ../src/libgetdata.la
+get_ss_SOURCES = get_ss.c
+get_ss_OBJECTS = get_ss.$(OBJEXT)
+get_ss_LDADD = $(LDADD)
+get_ss_DEPENDENCIES = ../src/libgetdata.la
+get_type_SOURCES = get_type.c
+get_type_OBJECTS = get_type.$(OBJEXT)
+get_type_LDADD = $(LDADD)
+get_type_DEPENDENCIES = ../src/libgetdata.la
+get_uint16_SOURCES = get_uint16.c
+get_uint16_OBJECTS = get_uint16.$(OBJEXT)
+get_uint16_LDADD = $(LDADD)
+get_uint16_DEPENDENCIES = ../src/libgetdata.la
+get_uint32_SOURCES = get_uint32.c
+get_uint32_OBJECTS = get_uint32.$(OBJEXT)
+get_uint32_LDADD = $(LDADD)
+get_uint32_DEPENDENCIES = ../src/libgetdata.la
+get_uint64_SOURCES = get_uint64.c
+get_uint64_OBJECTS = get_uint64.$(OBJEXT)
+get_uint64_LDADD = $(LDADD)
+get_uint64_DEPENDENCIES = ../src/libgetdata.la
+get_window_SOURCES = get_window.c
+get_window_OBJECTS = get_window.$(OBJEXT)
+get_window_LDADD = $(LDADD)
+get_window_DEPENDENCIES = ../src/libgetdata.la
+get_window_clr_SOURCES = get_window_clr.c
+get_window_clr_OBJECTS = get_window_clr.$(OBJEXT)
+get_window_clr_LDADD = $(LDADD)
+get_window_clr_DEPENDENCIES = ../src/libgetdata.la
+get_window_ge_SOURCES = get_window_ge.c
+get_window_ge_OBJECTS = get_window_ge.$(OBJEXT)
+get_window_ge_LDADD = $(LDADD)
+get_window_ge_DEPENDENCIES = ../src/libgetdata.la
+get_window_gt_SOURCES = get_window_gt.c
+get_window_gt_OBJECTS = get_window_gt.$(OBJEXT)
+get_window_gt_LDADD = $(LDADD)
+get_window_gt_DEPENDENCIES = ../src/libgetdata.la
+get_window_le_SOURCES = get_window_le.c
+get_window_le_OBJECTS = get_window_le.$(OBJEXT)
+get_window_le_LDADD = $(LDADD)
+get_window_le_DEPENDENCIES = ../src/libgetdata.la
+get_window_lt_SOURCES = get_window_lt.c
+get_window_lt_OBJECTS = get_window_lt.$(OBJEXT)
+get_window_lt_LDADD = $(LDADD)
+get_window_lt_DEPENDENCIES = ../src/libgetdata.la
+get_window_ne_SOURCES = get_window_ne.c
+get_window_ne_OBJECTS = get_window_ne.$(OBJEXT)
+get_window_ne_LDADD = $(LDADD)
+get_window_ne_DEPENDENCIES = ../src/libgetdata.la
+get_window_set_SOURCES = get_window_set.c
+get_window_set_OBJECTS = get_window_set.$(OBJEXT)
+get_window_set_LDADD = $(LDADD)
+get_window_set_DEPENDENCIES = ../src/libgetdata.la
+get_zero_SOURCES = get_zero.c
+get_zero_OBJECTS = get_zero.$(OBJEXT)
+get_zero_LDADD = $(LDADD)
+get_zero_DEPENDENCIES = ../src/libgetdata.la
+global_flags_SOURCES = global_flags.c
+global_flags_OBJECTS = global_flags.$(OBJEXT)
+global_flags_LDADD = $(LDADD)
+global_flags_DEPENDENCIES = ../src/libgetdata.la
+global_name_SOURCES = global_name.c
+global_name_OBJECTS = global_name.$(OBJEXT)
+global_name_LDADD = $(LDADD)
+global_name_DEPENDENCIES = ../src/libgetdata.la
+global_ref_SOURCES = global_ref.c
+global_ref_OBJECTS = global_ref.$(OBJEXT)
+global_ref_LDADD = $(LDADD)
+global_ref_DEPENDENCIES = ../src/libgetdata.la
+global_ref_empty_SOURCES = global_ref_empty.c
+global_ref_empty_OBJECTS = global_ref_empty.$(OBJEXT)
+global_ref_empty_LDADD = $(LDADD)
+global_ref_empty_DEPENDENCIES = ../src/libgetdata.la
+global_ref_set_SOURCES = global_ref_set.c
+global_ref_set_OBJECTS = global_ref_set.$(OBJEXT)
+global_ref_set_LDADD = $(LDADD)
+global_ref_set_DEPENDENCIES = ../src/libgetdata.la
+gzip_add_SOURCES = gzip_add.c
+gzip_add_OBJECTS = gzip_add.$(OBJEXT)
+gzip_add_LDADD = $(LDADD)
+gzip_add_DEPENDENCIES = ../src/libgetdata.la
+gzip_get_SOURCES = gzip_get.c
+gzip_get_OBJECTS = gzip_get.$(OBJEXT)
+gzip_get_LDADD = $(LDADD)
+gzip_get_DEPENDENCIES = ../src/libgetdata.la
+gzip_get_get_SOURCES = gzip_get_get.c
+gzip_get_get_OBJECTS = gzip_get_get.$(OBJEXT)
+gzip_get_get_LDADD = $(LDADD)
+gzip_get_get_DEPENDENCIES = ../src/libgetdata.la
+gzip_get_get2_SOURCES = gzip_get_get2.c
+gzip_get_get2_OBJECTS = gzip_get_get2.$(OBJEXT)
+gzip_get_get2_LDADD = $(LDADD)
+gzip_get_get2_DEPENDENCIES = ../src/libgetdata.la
+gzip_get_put_SOURCES = gzip_get_put.c
+gzip_get_put_OBJECTS = gzip_get_put.$(OBJEXT)
+gzip_get_put_LDADD = $(LDADD)
+gzip_get_put_DEPENDENCIES = ../src/libgetdata.la
+gzip_move_from_SOURCES = gzip_move_from.c
+gzip_move_from_OBJECTS = gzip_move_from.$(OBJEXT)
+gzip_move_from_LDADD = $(LDADD)
+gzip_move_from_DEPENDENCIES = ../src/libgetdata.la
+gzip_move_to_SOURCES = gzip_move_to.c
+gzip_move_to_OBJECTS = gzip_move_to.$(OBJEXT)
+gzip_move_to_LDADD = $(LDADD)
+gzip_move_to_DEPENDENCIES = ../src/libgetdata.la
+gzip_nframes_SOURCES = gzip_nframes.c
+gzip_nframes_OBJECTS = gzip_nframes.$(OBJEXT)
+gzip_nframes_LDADD = $(LDADD)
+gzip_nframes_DEPENDENCIES = ../src/libgetdata.la
+gzip_put_SOURCES = gzip_put.c
+gzip_put_OBJECTS = gzip_put.$(OBJEXT)
+gzip_put_LDADD = $(LDADD)
+gzip_put_DEPENDENCIES = ../src/libgetdata.la
+gzip_put_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
+header_complex_SOURCES = header_complex.c
+header_complex_OBJECTS = header_complex.$(OBJEXT)
+header_complex_LDADD = $(LDADD)
+header_complex_DEPENDENCIES = ../src/libgetdata.la
+hide_SOURCES = hide.c
+hide_OBJECTS = hide.$(OBJEXT)
+hide_LDADD = $(LDADD)
+hide_DEPENDENCIES = ../src/libgetdata.la
+hide_hidden_SOURCES = hide_hidden.c
+hide_hidden_OBJECTS = hide_hidden.$(OBJEXT)
+hide_hidden_LDADD = $(LDADD)
+hide_hidden_DEPENDENCIES = ../src/libgetdata.la
+hide_unhide_SOURCES = hide_unhide.c
+hide_unhide_OBJECTS = hide_unhide.$(OBJEXT)
+hide_unhide_LDADD = $(LDADD)
+hide_unhide_DEPENDENCIES = ../src/libgetdata.la
+include_SOURCES = include.c
+include_OBJECTS = include.$(OBJEXT)
+include_LDADD = $(LDADD)
+include_DEPENDENCIES = ../src/libgetdata.la
+include_accmode_SOURCES = include_accmode.c
+include_accmode_OBJECTS = include_accmode.$(OBJEXT)
+include_accmode_LDADD = $(LDADD)
+include_accmode_DEPENDENCIES = ../src/libgetdata.la
+include_affix_SOURCES = include_affix.c
+include_affix_OBJECTS = include_affix.$(OBJEXT)
+include_affix_LDADD = $(LDADD)
+include_affix_DEPENDENCIES = ../src/libgetdata.la
+include_auto_SOURCES = include_auto.c
+include_auto_OBJECTS = include_auto.$(OBJEXT)
+include_auto_LDADD = $(LDADD)
+include_auto_DEPENDENCIES = ../src/libgetdata.la
+include_cb_SOURCES = include_cb.c
+include_cb_OBJECTS = include_cb.$(OBJEXT)
+include_cb_LDADD = $(LDADD)
+include_cb_DEPENDENCIES = ../src/libgetdata.la
+include_creat_SOURCES = include_creat.c
+include_creat_OBJECTS = include_creat.$(OBJEXT)
+include_creat_LDADD = $(LDADD)
+include_creat_DEPENDENCIES = ../src/libgetdata.la
+include_ignore_SOURCES = include_ignore.c
+include_ignore_OBJECTS = include_ignore.$(OBJEXT)
+include_ignore_LDADD = $(LDADD)
+include_ignore_DEPENDENCIES = ../src/libgetdata.la
+include_index_SOURCES = include_index.c
+include_index_OBJECTS = include_index.$(OBJEXT)
+include_index_LDADD = $(LDADD)
+include_index_DEPENDENCIES = ../src/libgetdata.la
+include_invalid_SOURCES = include_invalid.c
+include_invalid_OBJECTS = include_invalid.$(OBJEXT)
+include_invalid_LDADD = $(LDADD)
+include_invalid_DEPENDENCIES = ../src/libgetdata.la
+include_nonexistent_SOURCES = include_nonexistent.c
+include_nonexistent_OBJECTS = include_nonexistent.$(OBJEXT)
+include_nonexistent_LDADD = $(LDADD)
+include_nonexistent_DEPENDENCIES = ../src/libgetdata.la
+include_pc_SOURCES = include_pc.c
+include_pc_OBJECTS = include_pc.$(OBJEXT)
+include_pc_LDADD = $(LDADD)
+include_pc_DEPENDENCIES = ../src/libgetdata.la
+include_ref_SOURCES = include_ref.c
+include_ref_OBJECTS = include_ref.$(OBJEXT)
+include_ref_LDADD = $(LDADD)
+include_ref_DEPENDENCIES = ../src/libgetdata.la
+include_sub_SOURCES = include_sub.c
+include_sub_OBJECTS = include_sub.$(OBJEXT)
+include_sub_LDADD = $(LDADD)
+include_sub_DEPENDENCIES = ../src/libgetdata.la
+include_syntax_SOURCES = include_syntax.c
+include_syntax_OBJECTS = include_syntax.$(OBJEXT)
+include_syntax_LDADD = $(LDADD)
+include_syntax_DEPENDENCIES = ../src/libgetdata.la
+index_SOURCES = index.c
+index_OBJECTS = index.$(OBJEXT)
+index_LDADD = $(LDADD)
+index_DEPENDENCIES = ../src/libgetdata.la
+index_domain_SOURCES = index_domain.c
+index_domain_OBJECTS = index_domain.$(OBJEXT)
+index_domain_LDADD = $(LDADD)
+index_domain_DEPENDENCIES = ../src/libgetdata.la
+index_range_SOURCES = index_range.c
+index_range_OBJECTS = index_range.$(OBJEXT)
+index_range_LDADD = $(LDADD)
+index_range_DEPENDENCIES = ../src/libgetdata.la
+legacy_get_SOURCES = legacy_get.c
+legacy_get_OBJECTS = legacy_get.$(OBJEXT)
+legacy_get_LDADD = $(LDADD)
+legacy_get_DEPENDENCIES = ../src/libgetdata.la
+legacy_get_put_SOURCES = legacy_get_put.c
+legacy_get_put_OBJECTS = legacy_get_put.$(OBJEXT)
+legacy_get_put_LDADD = $(LDADD)
+legacy_get_put_DEPENDENCIES = ../src/libgetdata.la
+legacy_get_rofs_SOURCES = legacy_get_rofs.c
+legacy_get_rofs_OBJECTS = legacy_get_rofs.$(OBJEXT)
+legacy_get_rofs_LDADD = $(LDADD)
+legacy_get_rofs_DEPENDENCIES = ../src/libgetdata.la
+legacy_nframes_SOURCES = legacy_nframes.c
+legacy_nframes_OBJECTS = legacy_nframes.$(OBJEXT)
+legacy_nframes_LDADD = $(LDADD)
+legacy_nframes_DEPENDENCIES = ../src/libgetdata.la
+legacy_nonexistent_SOURCES = legacy_nonexistent.c
+legacy_nonexistent_OBJECTS = legacy_nonexistent.$(OBJEXT)
+legacy_nonexistent_LDADD = $(LDADD)
+legacy_nonexistent_DEPENDENCIES = ../src/libgetdata.la
+legacy_put_SOURCES = legacy_put.c
+legacy_put_OBJECTS = legacy_put.$(OBJEXT)
+legacy_put_LDADD = $(LDADD)
+legacy_put_DEPENDENCIES = ../src/libgetdata.la
+legacy_spf_SOURCES = legacy_spf.c
+legacy_spf_OBJECTS = legacy_spf.$(OBJEXT)
+legacy_spf_LDADD = $(LDADD)
+legacy_spf_DEPENDENCIES = ../src/libgetdata.la
+lzma_get_SOURCES = lzma_get.c
+lzma_get_OBJECTS = lzma_get.$(OBJEXT)
+lzma_get_LDADD = $(LDADD)
+lzma_get_DEPENDENCIES = ../src/libgetdata.la
+lzma_nframes_SOURCES = lzma_nframes.c
+lzma_nframes_OBJECTS = lzma_nframes.$(OBJEXT)
+lzma_nframes_LDADD = $(LDADD)
+lzma_nframes_DEPENDENCIES = ../src/libgetdata.la
+madd_SOURCES = madd.c
+madd_OBJECTS = madd.$(OBJEXT)
+madd_LDADD = $(LDADD)
+madd_DEPENDENCIES = ../src/libgetdata.la
+madd_affix_SOURCES = madd_affix.c
+madd_affix_OBJECTS = madd_affix.$(OBJEXT)
+madd_affix_LDADD = $(LDADD)
+madd_affix_DEPENDENCIES = ../src/libgetdata.la
+madd_alias_SOURCES = madd_alias.c
+madd_alias_OBJECTS = madd_alias.$(OBJEXT)
+madd_alias_LDADD = $(LDADD)
+madd_alias_DEPENDENCIES = ../src/libgetdata.la
+madd_alias_affix_SOURCES = madd_alias_affix.c
+madd_alias_affix_OBJECTS = madd_alias_affix.$(OBJEXT)
+madd_alias_affix_LDADD = $(LDADD)
+madd_alias_affix_DEPENDENCIES = ../src/libgetdata.la
+madd_bit_SOURCES = madd_bit.c
+madd_bit_OBJECTS = madd_bit.$(OBJEXT)
+madd_bit_LDADD = $(LDADD)
+madd_bit_DEPENDENCIES = ../src/libgetdata.la
+madd_bit_invalid_SOURCES = madd_bit_invalid.c
+madd_bit_invalid_OBJECTS = madd_bit_invalid.$(OBJEXT)
+madd_bit_invalid_LDADD = $(LDADD)
+madd_bit_invalid_DEPENDENCIES = ../src/libgetdata.la
+madd_carray_SOURCES = madd_carray.c
+madd_carray_OBJECTS = madd_carray.$(OBJEXT)
+madd_carray_LDADD = $(LDADD)
+madd_carray_DEPENDENCIES = ../src/libgetdata.la
+madd_clincom_SOURCES = madd_clincom.c
+madd_clincom_OBJECTS = madd_clincom.$(OBJEXT)
+madd_clincom_LDADD = $(LDADD)
+madd_clincom_DEPENDENCIES = ../src/libgetdata.la
+madd_const_SOURCES = madd_const.c
+madd_const_OBJECTS = madd_const.$(OBJEXT)
+madd_const_LDADD = $(LDADD)
+madd_const_DEPENDENCIES = ../src/libgetdata.la
+madd_cpolynom_SOURCES = madd_cpolynom.c
+madd_cpolynom_OBJECTS = madd_cpolynom.$(OBJEXT)
+madd_cpolynom_LDADD = $(LDADD)
+madd_cpolynom_DEPENDENCIES = ../src/libgetdata.la
+madd_crecip_SOURCES = madd_crecip.c
+madd_crecip_OBJECTS = madd_crecip.$(OBJEXT)
+madd_crecip_LDADD = $(LDADD)
+madd_crecip_DEPENDENCIES = ../src/libgetdata.la
+madd_crecip89_SOURCES = madd_crecip89.c
+madd_crecip89_OBJECTS = madd_crecip89.$(OBJEXT)
+madd_crecip89_LDADD = $(LDADD)
+madd_crecip89_DEPENDENCIES = ../src/libgetdata.la
+madd_divide_SOURCES = madd_divide.c
+madd_divide_OBJECTS = madd_divide.$(OBJEXT)
+madd_divide_LDADD = $(LDADD)
+madd_divide_DEPENDENCIES = ../src/libgetdata.la
+madd_index_SOURCES = madd_index.c
+madd_index_OBJECTS = madd_index.$(OBJEXT)
+madd_index_LDADD = $(LDADD)
+madd_index_DEPENDENCIES = ../src/libgetdata.la
+madd_lincom_SOURCES = madd_lincom.c
+madd_lincom_OBJECTS = madd_lincom.$(OBJEXT)
+madd_lincom_LDADD = $(LDADD)
+madd_lincom_DEPENDENCIES = ../src/libgetdata.la
+madd_lincom_invalid_SOURCES = madd_lincom_invalid.c
+madd_lincom_invalid_OBJECTS = madd_lincom_invalid.$(OBJEXT)
+madd_lincom_invalid_LDADD = $(LDADD)
+madd_lincom_invalid_DEPENDENCIES = ../src/libgetdata.la
+madd_linterp_SOURCES = madd_linterp.c
+madd_linterp_OBJECTS = madd_linterp.$(OBJEXT)
+madd_linterp_LDADD = $(LDADD)
+madd_linterp_DEPENDENCIES = ../src/libgetdata.la
+madd_linterp_invalid_SOURCES = madd_linterp_invalid.c
+madd_linterp_invalid_OBJECTS = madd_linterp_invalid.$(OBJEXT)
+madd_linterp_invalid_LDADD = $(LDADD)
+madd_linterp_invalid_DEPENDENCIES = ../src/libgetdata.la
+madd_mplex_SOURCES = madd_mplex.c
+madd_mplex_OBJECTS = madd_mplex.$(OBJEXT)
+madd_mplex_LDADD = $(LDADD)
+madd_mplex_DEPENDENCIES = ../src/libgetdata.la
+madd_multiply_SOURCES = madd_multiply.c
+madd_multiply_OBJECTS = madd_multiply.$(OBJEXT)
+madd_multiply_LDADD = $(LDADD)
+madd_multiply_DEPENDENCIES = ../src/libgetdata.la
+madd_multiply_invalid_SOURCES = madd_multiply_invalid.c
+madd_multiply_invalid_OBJECTS = madd_multiply_invalid.$(OBJEXT)
+madd_multiply_invalid_LDADD = $(LDADD)
+madd_multiply_invalid_DEPENDENCIES = ../src/libgetdata.la
+madd_phase_SOURCES = madd_phase.c
+madd_phase_OBJECTS = madd_phase.$(OBJEXT)
+madd_phase_LDADD = $(LDADD)
+madd_phase_DEPENDENCIES = ../src/libgetdata.la
+madd_phase_invalid_SOURCES = madd_phase_invalid.c
+madd_phase_invalid_OBJECTS = madd_phase_invalid.$(OBJEXT)
+madd_phase_invalid_LDADD = $(LDADD)
+madd_phase_invalid_DEPENDENCIES = ../src/libgetdata.la
+madd_polynom_SOURCES = madd_polynom.c
+madd_polynom_OBJECTS = madd_polynom.$(OBJEXT)
+madd_polynom_LDADD = $(LDADD)
+madd_polynom_DEPENDENCIES = ../src/libgetdata.la
+madd_recip_SOURCES = madd_recip.c
+madd_recip_OBJECTS = madd_recip.$(OBJEXT)
+madd_recip_LDADD = $(LDADD)
+madd_recip_DEPENDENCIES = ../src/libgetdata.la
+madd_sbit_SOURCES = madd_sbit.c
+madd_sbit_OBJECTS = madd_sbit.$(OBJEXT)
+madd_sbit_LDADD = $(LDADD)
+madd_sbit_DEPENDENCIES = ../src/libgetdata.la
+madd_spec_SOURCES = madd_spec.c
+madd_spec_OBJECTS = madd_spec.$(OBJEXT)
+madd_spec_LDADD = $(LDADD)
+madd_spec_DEPENDENCIES = ../src/libgetdata.la
+madd_spec_directive_SOURCES = madd_spec_directive.c
+madd_spec_directive_OBJECTS = madd_spec_directive.$(OBJEXT)
+madd_spec_directive_LDADD = $(LDADD)
+madd_spec_directive_DEPENDENCIES = ../src/libgetdata.la
+madd_spec_invalid_SOURCES = madd_spec_invalid.c
+madd_spec_invalid_OBJECTS = madd_spec_invalid.$(OBJEXT)
+madd_spec_invalid_LDADD = $(LDADD)
+madd_spec_invalid_DEPENDENCIES = ../src/libgetdata.la
+madd_spec_resolv_SOURCES = madd_spec_resolv.c
+madd_spec_resolv_OBJECTS = madd_spec_resolv.$(OBJEXT)
+madd_spec_resolv_LDADD = $(LDADD)
+madd_spec_resolv_DEPENDENCIES = ../src/libgetdata.la
+madd_string_SOURCES = madd_string.c
+madd_string_OBJECTS = madd_string.$(OBJEXT)
+madd_string_LDADD = $(LDADD)
+madd_string_DEPENDENCIES = ../src/libgetdata.la
+madd_window_SOURCES = madd_window.c
+madd_window_OBJECTS = madd_window.$(OBJEXT)
+madd_window_LDADD = $(LDADD)
+madd_window_DEPENDENCIES = ../src/libgetdata.la
+move_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)
+move_affix_DEPENDENCIES = ../src/libgetdata.la
+move_affix_dup_SOURCES = move_affix_dup.c
+move_affix_dup_OBJECTS = move_affix_dup.$(OBJEXT)
+move_affix_dup_LDADD = $(LDADD)
+move_affix_dup_DEPENDENCIES = ../src/libgetdata.la
+move_alias_SOURCES = move_alias.c
+move_alias_OBJECTS = move_alias.$(OBJEXT)
+move_alias_LDADD = $(LDADD)
+move_alias_DEPENDENCIES = ../src/libgetdata.la
+move_data_enc_ar_SOURCES = move_data_enc_ar.c
+move_data_enc_ar_OBJECTS = move_data_enc_ar.$(OBJEXT)
+move_data_enc_ar_LDADD = $(LDADD)
+move_data_enc_ar_DEPENDENCIES = ../src/libgetdata.la
+move_data_enc_ra_SOURCES = move_data_enc_ra.c
+move_data_enc_ra_OBJECTS = move_data_enc_ra.$(OBJEXT)
+move_data_enc_ra_LDADD = $(LDADD)
+move_data_enc_ra_DEPENDENCIES = ../src/libgetdata.la
+move_data_endian_SOURCES = move_data_endian.c
+move_data_endian_OBJECTS = move_data_endian.$(OBJEXT)
+move_data_endian_LDADD = $(LDADD)
+move_data_endian_DEPENDENCIES = ../src/libgetdata.la
+move_data_foffs_SOURCES = move_data_foffs.c
+move_data_foffs_OBJECTS = move_data_foffs.$(OBJEXT)
+move_data_foffs_LDADD = $(LDADD)
+move_data_foffs_DEPENDENCIES = ../src/libgetdata.la
+move_data_nop_SOURCES = move_data_nop.c
+move_data_nop_OBJECTS = move_data_nop.$(OBJEXT)
+move_data_nop_LDADD = $(LDADD)
+move_data_nop_DEPENDENCIES = ../src/libgetdata.la
+move_index_SOURCES = move_index.c
+move_index_OBJECTS = move_index.$(OBJEXT)
+move_index_LDADD = $(LDADD)
+move_index_DEPENDENCIES = ../src/libgetdata.la
+move_meta_SOURCES = move_meta.c
+move_meta_OBJECTS = move_meta.$(OBJEXT)
+move_meta_LDADD = $(LDADD)
+move_meta_DEPENDENCIES = ../src/libgetdata.la
+move_protect_SOURCES = move_protect.c
+move_protect_OBJECTS = move_protect.$(OBJEXT)
+move_protect_LDADD = $(LDADD)
+move_protect_DEPENDENCIES = ../src/libgetdata.la
+move_subdir_SOURCES = move_subdir.c
+move_subdir_OBJECTS = move_subdir.$(OBJEXT)
+move_subdir_LDADD = $(LDADD)
+move_subdir_DEPENDENCIES = ../src/libgetdata.la
+name_SOURCES = name.c
+name_OBJECTS = name.$(OBJEXT)
+name_LDADD = $(LDADD)
+name_DEPENDENCIES = ../src/libgetdata.la
+name_affix_SOURCES = name_affix.c
+name_affix_OBJECTS = name_affix.$(OBJEXT)
+name_affix_LDADD = $(LDADD)
+name_affix_DEPENDENCIES = ../src/libgetdata.la
+name_affix_bad_SOURCES = name_affix_bad.c
+name_affix_bad_OBJECTS = name_affix_bad.$(OBJEXT)
+name_affix_bad_LDADD = $(LDADD)
+name_affix_bad_DEPENDENCIES = ../src/libgetdata.la
+name_alias_SOURCES = name_alias.c
+name_alias_OBJECTS = name_alias.$(OBJEXT)
+name_alias_LDADD = $(LDADD)
+name_alias_DEPENDENCIES = ../src/libgetdata.la
+name_dup_SOURCES = name_dup.c
+name_dup_OBJECTS = name_dup.$(OBJEXT)
+name_dup_LDADD = $(LDADD)
+name_dup_DEPENDENCIES = ../src/libgetdata.la
+name_move_SOURCES = name_move.c
+name_move_OBJECTS = name_move.$(OBJEXT)
+name_move_LDADD = $(LDADD)
+name_move_DEPENDENCIES = ../src/libgetdata.la
+name_move_alias_SOURCES = name_move_alias.c
+name_move_alias_OBJECTS = name_move_alias.$(OBJEXT)
+name_move_alias_LDADD = $(LDADD)
+name_move_alias_DEPENDENCIES = ../src/libgetdata.la
+name_updb_SOURCES = name_updb.c
+name_updb_OBJECTS = name_updb.$(OBJEXT)
+name_updb_LDADD = $(LDADD)
+name_updb_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_const_SOURCES = name_updb_const.c
+name_updb_const_OBJECTS = name_updb_const.$(OBJEXT)
+name_updb_const_LDADD = $(LDADD)
+name_updb_const_DEPENDENCIES = ../src/libgetdata.la
+name_updb_const_alias_SOURCES = name_updb_const_alias.c
+name_updb_const_alias_OBJECTS = name_updb_const_alias.$(OBJEXT)
+name_updb_const_alias_LDADD = $(LDADD)
+name_updb_const_alias_DEPENDENCIES = ../src/libgetdata.la
+nentries_alias_SOURCES = nentries_alias.c
+nentries_alias_OBJECTS = nentries_alias.$(OBJEXT)
+nentries_alias_LDADD = $(LDADD)
+nentries_alias_DEPENDENCIES = ../src/libgetdata.la
+nentries_hidden_SOURCES = nentries_hidden.c
+nentries_hidden_OBJECTS = nentries_hidden.$(OBJEXT)
+nentries_hidden_LDADD = $(LDADD)
+nentries_hidden_DEPENDENCIES = ../src/libgetdata.la
+nentries_noalias_SOURCES = nentries_noalias.c
+nentries_noalias_OBJECTS = nentries_noalias.$(OBJEXT)
+nentries_noalias_LDADD = $(LDADD)
+nentries_noalias_DEPENDENCIES = ../src/libgetdata.la
+nentries_scalar_SOURCES = nentries_scalar.c
+nentries_scalar_OBJECTS = nentries_scalar.$(OBJEXT)
+nentries_scalar_LDADD = $(LDADD)
+nentries_scalar_DEPENDENCIES = ../src/libgetdata.la
+nfields_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)
+nfields_hidden_DEPENDENCIES = ../src/libgetdata.la
+nfields_invalid_SOURCES = nfields_invalid.c
+nfields_invalid_OBJECTS = nfields_invalid.$(OBJEXT)
+nfields_invalid_LDADD = $(LDADD)
+nfields_invalid_DEPENDENCIES = ../src/libgetdata.la
+nfields_type_SOURCES = nfields_type.c
+nfields_type_OBJECTS = nfields_type.$(OBJEXT)
+nfields_type_LDADD = $(LDADD)
+nfields_type_DEPENDENCIES = ../src/libgetdata.la
+nfields_type_hidden_SOURCES = nfields_type_hidden.c
+nfields_type_hidden_OBJECTS = nfields_type_hidden.$(OBJEXT)
+nfields_type_hidden_LDADD = $(LDADD)
+nfields_type_hidden_DEPENDENCIES = ../src/libgetdata.la
+nfields_type_invalid_SOURCES = nfields_type_invalid.c
+nfields_type_invalid_OBJECTS = nfields_type_invalid.$(OBJEXT)
+nfields_type_invalid_LDADD = $(LDADD)
+nfields_type_invalid_DEPENDENCIES = ../src/libgetdata.la
+nfields_vector_SOURCES = nfields_vector.c
+nfields_vector_OBJECTS = nfields_vector.$(OBJEXT)
+nfields_vector_LDADD = $(LDADD)
+nfields_vector_DEPENDENCIES = ../src/libgetdata.la
+nfields_vector_hidden_SOURCES = nfields_vector_hidden.c
+nfields_vector_hidden_OBJECTS = nfields_vector_hidden.$(OBJEXT)
+nfields_vector_hidden_LDADD = $(LDADD)
+nfields_vector_hidden_DEPENDENCIES = ../src/libgetdata.la
+nfields_vector_invalid_SOURCES = nfields_vector_invalid.c
+nfields_vector_invalid_OBJECTS = nfields_vector_invalid.$(OBJEXT)
+nfields_vector_invalid_LDADD = $(LDADD)
+nfields_vector_invalid_DEPENDENCIES = ../src/libgetdata.la
+nframes_SOURCES = nframes.c
+nframes_OBJECTS = nframes.$(OBJEXT)
+nframes_LDADD = $(LDADD)
+nframes_DEPENDENCIES = ../src/libgetdata.la
+nframes64_SOURCES = nframes64.c
+nframes64_OBJECTS = nframes64.$(OBJEXT)
+nframes64_LDADD = $(LDADD)
+nframes64_DEPENDENCIES = ../src/libgetdata.la
+nframes_empty_SOURCES = nframes_empty.c
+nframes_empty_OBJECTS = nframes_empty.$(OBJEXT)
+nframes_empty_LDADD = $(LDADD)
+nframes_empty_DEPENDENCIES = ../src/libgetdata.la
+nframes_invalid_SOURCES = nframes_invalid.c
+nframes_invalid_OBJECTS = nframes_invalid.$(OBJEXT)
+nframes_invalid_LDADD = $(LDADD)
+nframes_invalid_DEPENDENCIES = ../src/libgetdata.la
+nframes_off64_SOURCES = nframes_off64.c
+nframes_off64_OBJECTS = nframes_off64.$(OBJEXT)
+nframes_off64_LDADD = $(LDADD)
+nframes_off64_DEPENDENCIES = ../src/libgetdata.la
+nframes_spf_SOURCES = nframes_spf.c
+nframes_spf_OBJECTS = nframes_spf.$(OBJEXT)
+nframes_spf_LDADD = $(LDADD)
+nframes_spf_DEPENDENCIES = ../src/libgetdata.la
+nmeta_SOURCES = nmeta.c
+nmeta_OBJECTS = nmeta.$(OBJEXT)
+nmeta_LDADD = $(LDADD)
+nmeta_DEPENDENCIES = ../src/libgetdata.la
+nmeta_hidden_SOURCES = nmeta_hidden.c
+nmeta_hidden_OBJECTS = nmeta_hidden.$(OBJEXT)
+nmeta_hidden_LDADD = $(LDADD)
+nmeta_hidden_DEPENDENCIES = ../src/libgetdata.la
+nmeta_invalid_SOURCES = nmeta_invalid.c
+nmeta_invalid_OBJECTS = nmeta_invalid.$(OBJEXT)
+nmeta_invalid_LDADD = $(LDADD)
+nmeta_invalid_DEPENDENCIES = ../src/libgetdata.la
+nmeta_parent_SOURCES = nmeta_parent.c
+nmeta_parent_OBJECTS = nmeta_parent.$(OBJEXT)
+nmeta_parent_LDADD = $(LDADD)
+nmeta_parent_DEPENDENCIES = ../src/libgetdata.la
+nmeta_type_SOURCES = nmeta_type.c
+nmeta_type_OBJECTS = nmeta_type.$(OBJEXT)
+nmeta_type_LDADD = $(LDADD)
+nmeta_type_DEPENDENCIES = ../src/libgetdata.la
+nmeta_type_hidden_SOURCES = nmeta_type_hidden.c
+nmeta_type_hidden_OBJECTS = nmeta_type_hidden.$(OBJEXT)
+nmeta_type_hidden_LDADD = $(LDADD)
+nmeta_type_hidden_DEPENDENCIES = ../src/libgetdata.la
+nmeta_type_invalid_SOURCES = nmeta_type_invalid.c
+nmeta_type_invalid_OBJECTS = nmeta_type_invalid.$(OBJEXT)
+nmeta_type_invalid_LDADD = $(LDADD)
+nmeta_type_invalid_DEPENDENCIES = ../src/libgetdata.la
+nmeta_type_parent_SOURCES = nmeta_type_parent.c
+nmeta_type_parent_OBJECTS = nmeta_type_parent.$(OBJEXT)
+nmeta_type_parent_LDADD = $(LDADD)
+nmeta_type_parent_DEPENDENCIES = ../src/libgetdata.la
+nmeta_vectors_SOURCES = nmeta_vectors.c
+nmeta_vectors_OBJECTS = nmeta_vectors.$(OBJEXT)
+nmeta_vectors_LDADD = $(LDADD)
+nmeta_vectors_DEPENDENCIES = ../src/libgetdata.la
+nmeta_vectors_del_SOURCES = nmeta_vectors_del.c
+nmeta_vectors_del_OBJECTS = nmeta_vectors_del.$(OBJEXT)
+nmeta_vectors_del_LDADD = $(LDADD)
+nmeta_vectors_del_DEPENDENCIES = ../src/libgetdata.la
+nmeta_vectors_hidden_SOURCES = nmeta_vectors_hidden.c
+nmeta_vectors_hidden_OBJECTS = nmeta_vectors_hidden.$(OBJEXT)
+nmeta_vectors_hidden_LDADD = $(LDADD)
+nmeta_vectors_hidden_DEPENDENCIES = ../src/libgetdata.la
+nmeta_vectors_invalid_SOURCES = nmeta_vectors_invalid.c
+nmeta_vectors_invalid_OBJECTS = nmeta_vectors_invalid.$(OBJEXT)
+nmeta_vectors_invalid_LDADD = $(LDADD)
+nmeta_vectors_invalid_DEPENDENCIES = ../src/libgetdata.la
+nmeta_vectors_parent_SOURCES = nmeta_vectors_parent.c
+nmeta_vectors_parent_OBJECTS = nmeta_vectors_parent.$(OBJEXT)
+nmeta_vectors_parent_LDADD = $(LDADD)
+nmeta_vectors_parent_DEPENDENCIES = ../src/libgetdata.la
+open_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)
+open_abs_DEPENDENCIES = ../src/libgetdata.la
+open_cb_abort_SOURCES = open_cb_abort.c
+open_cb_abort_OBJECTS = open_cb_abort.$(OBJEXT)
+open_cb_abort_LDADD = $(LDADD)
+open_cb_abort_DEPENDENCIES = ../src/libgetdata.la
+open_cb_cont_SOURCES = open_cb_cont.c
+open_cb_cont_OBJECTS = open_cb_cont.$(OBJEXT)
+open_cb_cont_LDADD = $(LDADD)
+open_cb_cont_DEPENDENCIES = ../src/libgetdata.la
+open_cb_ignore_SOURCES = open_cb_ignore.c
+open_cb_ignore_OBJECTS = open_cb_ignore.$(OBJEXT)
+open_cb_ignore_LDADD = $(LDADD)
+open_cb_ignore_DEPENDENCIES = ../src/libgetdata.la
+open_cb_invalid_SOURCES = open_cb_invalid.c
+open_cb_invalid_OBJECTS = open_cb_invalid.$(OBJEXT)
+open_cb_invalid_LDADD = $(LDADD)
+open_cb_invalid_DEPENDENCIES = ../src/libgetdata.la
+open_cb_rescan_SOURCES = open_cb_rescan.c
+open_cb_rescan_OBJECTS = open_cb_rescan.$(OBJEXT)
+open_cb_rescan_LDADD = $(LDADD)
+open_cb_rescan_DEPENDENCIES = ../src/libgetdata.la
+open_eaccess_SOURCES = open_eaccess.c
+open_eaccess_OBJECTS = open_eaccess.$(OBJEXT)
+open_eaccess_LDADD = $(LDADD)
+open_eaccess_DEPENDENCIES = ../src/libgetdata.la
+open_nonexistent_SOURCES = open_nonexistent.c
+open_nonexistent_OBJECTS = open_nonexistent.$(OBJEXT)
+open_nonexistent_LDADD = $(LDADD)
+open_nonexistent_DEPENDENCIES = ../src/libgetdata.la
+open_notdirfile_SOURCES = open_notdirfile.c
+open_notdirfile_OBJECTS = open_notdirfile.$(OBJEXT)
+open_notdirfile_LDADD = $(LDADD)
+open_notdirfile_DEPENDENCIES = ../src/libgetdata.la
+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)
+open_sym_al_DEPENDENCIES = ../src/libgetdata.la
+open_sym_at_SOURCES = open_sym_at.c
+open_sym_at_OBJECTS = open_sym_at.$(OBJEXT)
+open_sym_at_LDADD = $(LDADD)
+open_sym_at_DEPENDENCIES = ../src/libgetdata.la
+open_sym_c_SOURCES = open_sym_c.c
+open_sym_c_OBJECTS = open_sym_c.$(OBJEXT)
+open_sym_c_LDADD = $(LDADD)
+open_sym_c_DEPENDENCIES = ../src/libgetdata.la
+open_sym_cl_SOURCES = open_sym_cl.c
+open_sym_cl_OBJECTS = open_sym_cl.$(OBJEXT)
+open_sym_cl_LDADD = $(LDADD)
+open_sym_cl_DEPENDENCIES = ../src/libgetdata.la
+open_sym_ct_SOURCES = open_sym_ct.c
+open_sym_ct_OBJECTS = open_sym_ct.$(OBJEXT)
+open_sym_ct_LDADD = $(LDADD)
+open_sym_ct_DEPENDENCIES = ../src/libgetdata.la
+open_sym_p_SOURCES = open_sym_p.c
+open_sym_p_OBJECTS = open_sym_p.$(OBJEXT)
+open_sym_p_LDADD = $(LDADD)
+open_sym_p_DEPENDENCIES = ../src/libgetdata.la
+open_sym_pl_SOURCES = open_sym_pl.c
+open_sym_pl_OBJECTS = open_sym_pl.$(OBJEXT)
+open_sym_pl_LDADD = $(LDADD)
+open_sym_pl_DEPENDENCIES = ../src/libgetdata.la
+open_sym_pt_SOURCES = open_sym_pt.c
+open_sym_pt_OBJECTS = open_sym_pt.$(OBJEXT)
+open_sym_pt_LDADD = $(LDADD)
+open_sym_pt_DEPENDENCIES = ../src/libgetdata.la
+parse_alias_SOURCES = parse_alias.c
+parse_alias_OBJECTS = parse_alias.$(OBJEXT)
+parse_alias_LDADD = $(LDADD)
+parse_alias_DEPENDENCIES = ../src/libgetdata.la
+parse_alias_code_SOURCES = parse_alias_code.c
+parse_alias_code_OBJECTS = parse_alias_code.$(OBJEXT)
+parse_alias_code_LDADD = $(LDADD)
+parse_alias_code_DEPENDENCIES = ../src/libgetdata.la
+parse_alias_dup_SOURCES = parse_alias_dup.c
+parse_alias_dup_OBJECTS = parse_alias_dup.$(OBJEXT)
+parse_alias_dup_LDADD = $(LDADD)
+parse_alias_dup_DEPENDENCIES = ../src/libgetdata.la
+parse_alias_meta_SOURCES = parse_alias_meta.c
+parse_alias_meta_OBJECTS = parse_alias_meta.$(OBJEXT)
+parse_alias_meta_LDADD = $(LDADD)
+parse_alias_meta_DEPENDENCIES = ../src/libgetdata.la
+parse_alias_missing_SOURCES = parse_alias_missing.c
+parse_alias_missing_OBJECTS = parse_alias_missing.$(OBJEXT)
+parse_alias_missing_LDADD = $(LDADD)
+parse_alias_missing_DEPENDENCIES = ../src/libgetdata.la
+parse_badline_SOURCES = parse_badline.c
+parse_badline_OBJECTS = parse_badline.$(OBJEXT)
+parse_badline_LDADD = $(LDADD)
+parse_badline_DEPENDENCIES = ../src/libgetdata.la
+parse_bit_SOURCES = parse_bit.c
+parse_bit_OBJECTS = parse_bit.$(OBJEXT)
+parse_bit_LDADD = $(LDADD)
+parse_bit_DEPENDENCIES = ../src/libgetdata.la
+parse_bit4_SOURCES = parse_bit4.c
+parse_bit4_OBJECTS = parse_bit4.$(OBJEXT)
+parse_bit4_LDADD = $(LDADD)
+parse_bit4_DEPENDENCIES = ../src/libgetdata.la
+parse_bit_bitnum_SOURCES = parse_bit_bitnum.c
+parse_bit_bitnum_OBJECTS = parse_bit_bitnum.$(OBJEXT)
+parse_bit_bitnum_LDADD = $(LDADD)
+parse_bit_bitnum_DEPENDENCIES = ../src/libgetdata.la
+parse_bit_bitsize_SOURCES = parse_bit_bitsize.c
+parse_bit_bitsize_OBJECTS = parse_bit_bitsize.$(OBJEXT)
+parse_bit_bitsize_LDADD = $(LDADD)
+parse_bit_bitsize_DEPENDENCIES = ../src/libgetdata.la
+parse_bit_ncols_SOURCES = parse_bit_ncols.c
+parse_bit_ncols_OBJECTS = parse_bit_ncols.$(OBJEXT)
+parse_bit_ncols_LDADD = $(LDADD)
+parse_bit_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_bit_numbits_SOURCES = parse_bit_numbits.c
+parse_bit_numbits_OBJECTS = parse_bit_numbits.$(OBJEXT)
+parse_bit_numbits_LDADD = $(LDADD)
+parse_bit_numbits_DEPENDENCIES = ../src/libgetdata.la
+parse_bit_scalar_SOURCES = parse_bit_scalar.c
+parse_bit_scalar_OBJECTS = parse_bit_scalar.$(OBJEXT)
+parse_bit_scalar_LDADD = $(LDADD)
+parse_bit_scalar_DEPENDENCIES = ../src/libgetdata.la
+parse_carray_SOURCES = parse_carray.c
+parse_carray_OBJECTS = parse_carray.$(OBJEXT)
+parse_carray_LDADD = $(LDADD)
+parse_carray_DEPENDENCIES = ../src/libgetdata.la
+parse_carray_long_SOURCES = parse_carray_long.c
+parse_carray_long_OBJECTS = parse_carray_long.$(OBJEXT)
+parse_carray_long_LDADD = $(LDADD)
+parse_carray_long_DEPENDENCIES = ../src/libgetdata.la
+parse_const_SOURCES = parse_const.c
+parse_const_OBJECTS = parse_const.$(OBJEXT)
+parse_const_LDADD = $(LDADD)
+parse_const_DEPENDENCIES = ../src/libgetdata.la
+parse_const_complex_SOURCES = parse_const_complex.c
+parse_const_complex_OBJECTS = parse_const_complex.$(OBJEXT)
+parse_const_complex_LDADD = $(LDADD)
+parse_const_complex_DEPENDENCIES = ../src/libgetdata.la
+parse_const_ncols_SOURCES = parse_const_ncols.c
+parse_const_ncols_OBJECTS = parse_const_ncols.$(OBJEXT)
+parse_const_ncols_LDADD = $(LDADD)
+parse_const_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_divide_SOURCES = parse_divide.c
+parse_divide_OBJECTS = parse_divide.$(OBJEXT)
+parse_divide_LDADD = $(LDADD)
+parse_divide_DEPENDENCIES = ../src/libgetdata.la
+parse_double_SOURCES = parse_double.c
+parse_double_OBJECTS = parse_double.$(OBJEXT)
+parse_double_LDADD = $(LDADD)
+parse_double_DEPENDENCIES = ../src/libgetdata.la
+parse_duplicate_SOURCES = parse_duplicate.c
+parse_duplicate_OBJECTS = parse_duplicate.$(OBJEXT)
+parse_duplicate_LDADD = $(LDADD)
+parse_duplicate_DEPENDENCIES = ../src/libgetdata.la
+parse_duplicate_ignore_SOURCES = parse_duplicate_ignore.c
+parse_duplicate_ignore_OBJECTS = parse_duplicate_ignore.$(OBJEXT)
+parse_duplicate_ignore_LDADD = $(LDADD)
+parse_duplicate_ignore_DEPENDENCIES = ../src/libgetdata.la
+parse_endian_bad_SOURCES = parse_endian_bad.c
+parse_endian_bad_OBJECTS = parse_endian_bad.$(OBJEXT)
+parse_endian_bad_LDADD = $(LDADD)
+parse_endian_bad_DEPENDENCIES = ../src/libgetdata.la
+parse_endian_big_SOURCES = parse_endian_big.c
+parse_endian_big_OBJECTS = parse_endian_big.$(OBJEXT)
+parse_endian_big_LDADD = $(LDADD)
+parse_endian_big_DEPENDENCIES = ../src/libgetdata.la
+parse_endian_force_SOURCES = parse_endian_force.c
+parse_endian_force_OBJECTS = parse_endian_force.$(OBJEXT)
+parse_endian_force_LDADD = $(LDADD)
+parse_endian_force_DEPENDENCIES = ../src/libgetdata.la
+parse_endian_little_SOURCES = parse_endian_little.c
+parse_endian_little_OBJECTS = parse_endian_little.$(OBJEXT)
+parse_endian_little_LDADD = $(LDADD)
+parse_endian_little_DEPENDENCIES = ../src/libgetdata.la
+parse_endian_slash_SOURCES = parse_endian_slash.c
+parse_endian_slash_OBJECTS = parse_endian_slash.$(OBJEXT)
+parse_endian_slash_LDADD = $(LDADD)
+parse_endian_slash_DEPENDENCIES = ../src/libgetdata.la
+parse_eol_SOURCES = parse_eol.c
+parse_eol_OBJECTS = parse_eol.$(OBJEXT)
+parse_eol_LDADD = $(LDADD)
+parse_eol_DEPENDENCIES = ../src/libgetdata.la
+parse_foffs_SOURCES = parse_foffs.c
+parse_foffs_OBJECTS = parse_foffs.$(OBJEXT)
+parse_foffs_LDADD = $(LDADD)
+parse_foffs_DEPENDENCIES = ../src/libgetdata.la
+parse_foffs_include_SOURCES = parse_foffs_include.c
+parse_foffs_include_OBJECTS = parse_foffs_include.$(OBJEXT)
+parse_foffs_include_LDADD = $(LDADD)
+parse_foffs_include_DEPENDENCIES = ../src/libgetdata.la
+parse_foffs_slash_SOURCES = parse_foffs_slash.c
+parse_foffs_slash_OBJECTS = parse_foffs_slash.$(OBJEXT)
+parse_foffs_slash_LDADD = $(LDADD)
+parse_foffs_slash_DEPENDENCIES = ../src/libgetdata.la
+parse_hex_SOURCES = parse_hex.c
+parse_hex_OBJECTS = parse_hex.$(OBJEXT)
+parse_hex_LDADD = $(LDADD)
+parse_hex_DEPENDENCIES = ../src/libgetdata.la
+parse_hidden_SOURCES = parse_hidden.c
+parse_hidden_OBJECTS = parse_hidden.$(OBJEXT)
+parse_hidden_LDADD = $(LDADD)
+parse_hidden_DEPENDENCIES = ../src/libgetdata.la
+parse_hidden_field_SOURCES = parse_hidden_field.c
+parse_hidden_field_OBJECTS = parse_hidden_field.$(OBJEXT)
+parse_hidden_field_LDADD = $(LDADD)
+parse_hidden_field_DEPENDENCIES = ../src/libgetdata.la
+parse_hidden_meta_SOURCES = parse_hidden_meta.c
+parse_hidden_meta_OBJECTS = parse_hidden_meta.$(OBJEXT)
+parse_hidden_meta_LDADD = $(LDADD)
+parse_hidden_meta_DEPENDENCIES = ../src/libgetdata.la
+parse_include_SOURCES = parse_include.c
+parse_include_OBJECTS = parse_include.$(OBJEXT)
+parse_include_LDADD = $(LDADD)
+parse_include_DEPENDENCIES = ../src/libgetdata.la
+parse_include_absolute_SOURCES = parse_include_absolute.c
+parse_include_absolute_OBJECTS = parse_include_absolute.$(OBJEXT)
+parse_include_absolute_LDADD = $(LDADD)
+parse_include_absolute_DEPENDENCIES = ../src/libgetdata.la
+parse_include_absrel_SOURCES = parse_include_absrel.c
+parse_include_absrel_OBJECTS = parse_include_absrel.$(OBJEXT)
+parse_include_absrel_LDADD = $(LDADD)
+parse_include_absrel_DEPENDENCIES = ../src/libgetdata.la
+parse_include_affix_ref_SOURCES = parse_include_affix_ref.c
+parse_include_affix_ref_OBJECTS = parse_include_affix_ref.$(OBJEXT)
+parse_include_affix_ref_LDADD = $(LDADD)
+parse_include_affix_ref_DEPENDENCIES = ../src/libgetdata.la
+parse_include_dir_SOURCES = parse_include_dir.c
+parse_include_dir_OBJECTS = parse_include_dir.$(OBJEXT)
+parse_include_dir_LDADD = $(LDADD)
+parse_include_dir_DEPENDENCIES = ../src/libgetdata.la
+parse_include_loop_SOURCES = parse_include_loop.c
+parse_include_loop_OBJECTS = parse_include_loop.$(OBJEXT)
+parse_include_loop_LDADD = $(LDADD)
+parse_include_loop_DEPENDENCIES = ../src/libgetdata.la
+parse_include_nonexistent_SOURCES = parse_include_nonexistent.c
+parse_include_nonexistent_OBJECTS =  \
+	parse_include_nonexistent.$(OBJEXT)
+parse_include_nonexistent_LDADD = $(LDADD)
+parse_include_nonexistent_DEPENDENCIES = ../src/libgetdata.la
+parse_include_prefix_SOURCES = parse_include_prefix.c
+parse_include_prefix_OBJECTS = parse_include_prefix.$(OBJEXT)
+parse_include_prefix_LDADD = $(LDADD)
+parse_include_prefix_DEPENDENCIES = ../src/libgetdata.la
+parse_include_prefix_dup_SOURCES = parse_include_prefix_dup.c
+parse_include_prefix_dup_OBJECTS = parse_include_prefix_dup.$(OBJEXT)
+parse_include_prefix_dup_LDADD = $(LDADD)
+parse_include_prefix_dup_DEPENDENCIES = ../src/libgetdata.la
+parse_include_preprefix_SOURCES = parse_include_preprefix.c
+parse_include_preprefix_OBJECTS = parse_include_preprefix.$(OBJEXT)
+parse_include_preprefix_LDADD = $(LDADD)
+parse_include_preprefix_DEPENDENCIES = ../src/libgetdata.la
+parse_include_ref_SOURCES = parse_include_ref.c
+parse_include_ref_OBJECTS = parse_include_ref.$(OBJEXT)
+parse_include_ref_LDADD = $(LDADD)
+parse_include_ref_DEPENDENCIES = ../src/libgetdata.la
+parse_include_relabs_SOURCES = parse_include_relabs.c
+parse_include_relabs_OBJECTS = parse_include_relabs.$(OBJEXT)
+parse_include_relabs_LDADD = $(LDADD)
+parse_include_relabs_DEPENDENCIES = ../src/libgetdata.la
+parse_include_relrel_SOURCES = parse_include_relrel.c
+parse_include_relrel_OBJECTS = parse_include_relrel.$(OBJEXT)
+parse_include_relrel_LDADD = $(LDADD)
+parse_include_relrel_DEPENDENCIES = ../src/libgetdata.la
+parse_include_slash_SOURCES = parse_include_slash.c
+parse_include_slash_OBJECTS = parse_include_slash.$(OBJEXT)
+parse_include_slash_LDADD = $(LDADD)
+parse_include_slash_DEPENDENCIES = ../src/libgetdata.la
+parse_include_suffix_SOURCES = parse_include_suffix.c
+parse_include_suffix_OBJECTS = parse_include_suffix.$(OBJEXT)
+parse_include_suffix_LDADD = $(LDADD)
+parse_include_suffix_DEPENDENCIES = ../src/libgetdata.la
+parse_include_sufsuffix_SOURCES = parse_include_sufsuffix.c
+parse_include_sufsuffix_OBJECTS = parse_include_sufsuffix.$(OBJEXT)
+parse_include_sufsuffix_LDADD = $(LDADD)
+parse_include_sufsuffix_DEPENDENCIES = ../src/libgetdata.la
+parse_index_SOURCES = parse_index.c
+parse_index_OBJECTS = parse_index.$(OBJEXT)
+parse_index_LDADD = $(LDADD)
+parse_index_DEPENDENCIES = ../src/libgetdata.la
+parse_lincom_SOURCES = parse_lincom.c
+parse_lincom_OBJECTS = parse_lincom.$(OBJEXT)
+parse_lincom_LDADD = $(LDADD)
+parse_lincom_DEPENDENCIES = ../src/libgetdata.la
+parse_lincom_ncols1_SOURCES = parse_lincom_ncols1.c
+parse_lincom_ncols1_OBJECTS = parse_lincom_ncols1.$(OBJEXT)
+parse_lincom_ncols1_LDADD = $(LDADD)
+parse_lincom_ncols1_DEPENDENCIES = ../src/libgetdata.la
+parse_lincom_ncols2_SOURCES = parse_lincom_ncols2.c
+parse_lincom_ncols2_OBJECTS = parse_lincom_ncols2.$(OBJEXT)
+parse_lincom_ncols2_LDADD = $(LDADD)
+parse_lincom_ncols2_DEPENDENCIES = ../src/libgetdata.la
+parse_lincom_nfields_SOURCES = parse_lincom_nfields.c
+parse_lincom_nfields_OBJECTS = parse_lincom_nfields.$(OBJEXT)
+parse_lincom_nfields_LDADD = $(LDADD)
+parse_lincom_nfields_DEPENDENCIES = ../src/libgetdata.la
+parse_lincom_nofields_SOURCES = parse_lincom_nofields.c
+parse_lincom_nofields_OBJECTS = parse_lincom_nofields.$(OBJEXT)
+parse_lincom_nofields_LDADD = $(LDADD)
+parse_lincom_nofields_DEPENDENCIES = ../src/libgetdata.la
+parse_lincom_non_SOURCES = parse_lincom_non.c
+parse_lincom_non_OBJECTS = parse_lincom_non.$(OBJEXT)
+parse_lincom_non_LDADD = $(LDADD)
+parse_lincom_non_DEPENDENCIES = ../src/libgetdata.la
+parse_lincom_non_ncols_SOURCES = parse_lincom_non_ncols.c
+parse_lincom_non_ncols_OBJECTS = parse_lincom_non_ncols.$(OBJEXT)
+parse_lincom_non_ncols_LDADD = $(LDADD)
+parse_lincom_non_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_lincom_scalar_SOURCES = parse_lincom_scalar.c
+parse_lincom_scalar_OBJECTS = parse_lincom_scalar.$(OBJEXT)
+parse_lincom_scalar_LDADD = $(LDADD)
+parse_lincom_scalar_DEPENDENCIES = ../src/libgetdata.la
+parse_linterp_SOURCES = parse_linterp.c
+parse_linterp_OBJECTS = parse_linterp.$(OBJEXT)
+parse_linterp_LDADD = $(LDADD)
+parse_linterp_DEPENDENCIES = ../src/libgetdata.la
+parse_linterp_ncols_SOURCES = parse_linterp_ncols.c
+parse_linterp_ncols_OBJECTS = parse_linterp_ncols.$(OBJEXT)
+parse_linterp_ncols_LDADD = $(LDADD)
+parse_linterp_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_malias_SOURCES = parse_malias.c
+parse_malias_OBJECTS = parse_malias.$(OBJEXT)
+parse_malias_LDADD = $(LDADD)
+parse_malias_DEPENDENCIES = ../src/libgetdata.la
+parse_malias_dup_SOURCES = parse_malias_dup.c
+parse_malias_dup_OBJECTS = parse_malias_dup.$(OBJEXT)
+parse_malias_dup_LDADD = $(LDADD)
+parse_malias_dup_DEPENDENCIES = ../src/libgetdata.la
+parse_malias_meta_SOURCES = parse_malias_meta.c
+parse_malias_meta_OBJECTS = parse_malias_meta.$(OBJEXT)
+parse_malias_meta_LDADD = $(LDADD)
+parse_malias_meta_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_SOURCES = parse_meta.c
+parse_meta_OBJECTS = parse_meta.$(OBJEXT)
+parse_meta_LDADD = $(LDADD)
+parse_meta_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_affix_SOURCES = parse_meta_affix.c
+parse_meta_affix_OBJECTS = parse_meta_affix.$(OBJEXT)
+parse_meta_affix_LDADD = $(LDADD)
+parse_meta_affix_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_alias_SOURCES = parse_meta_alias.c
+parse_meta_alias_OBJECTS = parse_meta_alias.$(OBJEXT)
+parse_meta_alias_LDADD = $(LDADD)
+parse_meta_alias_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_implicit_SOURCES = parse_meta_implicit.c
+parse_meta_implicit_OBJECTS = parse_meta_implicit.$(OBJEXT)
+parse_meta_implicit_LDADD = $(LDADD)
+parse_meta_implicit_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_implicit2_SOURCES = parse_meta_implicit2.c
+parse_meta_implicit2_OBJECTS = parse_meta_implicit2.$(OBJEXT)
+parse_meta_implicit2_LDADD = $(LDADD)
+parse_meta_implicit2_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_implicit_affix_SOURCES = parse_meta_implicit_affix.c
+parse_meta_implicit_affix_OBJECTS =  \
+	parse_meta_implicit_affix.$(OBJEXT)
+parse_meta_implicit_affix_LDADD = $(LDADD)
+parse_meta_implicit_affix_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_index_SOURCES = parse_meta_index.c
+parse_meta_index_OBJECTS = parse_meta_index.$(OBJEXT)
+parse_meta_index_LDADD = $(LDADD)
+parse_meta_index_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_index2_SOURCES = parse_meta_index2.c
+parse_meta_index2_OBJECTS = parse_meta_index2.$(OBJEXT)
+parse_meta_index2_LDADD = $(LDADD)
+parse_meta_index2_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_jump_SOURCES = parse_meta_jump.c
+parse_meta_jump_OBJECTS = parse_meta_jump.$(OBJEXT)
+parse_meta_jump_LDADD = $(LDADD)
+parse_meta_jump_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_malias_SOURCES = parse_meta_malias.c
+parse_meta_malias_OBJECTS = parse_meta_malias.$(OBJEXT)
+parse_meta_malias_LDADD = $(LDADD)
+parse_meta_malias_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_meta_SOURCES = parse_meta_meta.c
+parse_meta_meta_OBJECTS = parse_meta_meta.$(OBJEXT)
+parse_meta_meta_LDADD = $(LDADD)
+parse_meta_meta_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_parent_SOURCES = parse_meta_parent.c
+parse_meta_parent_OBJECTS = parse_meta_parent.$(OBJEXT)
+parse_meta_parent_LDADD = $(LDADD)
+parse_meta_parent_DEPENDENCIES = ../src/libgetdata.la
+parse_meta_raw_SOURCES = parse_meta_raw.c
+parse_meta_raw_OBJECTS = parse_meta_raw.$(OBJEXT)
+parse_meta_raw_LDADD = $(LDADD)
+parse_meta_raw_DEPENDENCIES = ../src/libgetdata.la
+parse_mplex_SOURCES = parse_mplex.c
+parse_mplex_OBJECTS = parse_mplex.$(OBJEXT)
+parse_mplex_LDADD = $(LDADD)
+parse_mplex_DEPENDENCIES = ../src/libgetdata.la
+parse_mplex_ncols_SOURCES = parse_mplex_ncols.c
+parse_mplex_ncols_OBJECTS = parse_mplex_ncols.$(OBJEXT)
+parse_mplex_ncols_LDADD = $(LDADD)
+parse_mplex_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_mplex_nomax_SOURCES = parse_mplex_nomax.c
+parse_mplex_nomax_OBJECTS = parse_mplex_nomax.$(OBJEXT)
+parse_mplex_nomax_LDADD = $(LDADD)
+parse_mplex_nomax_DEPENDENCIES = ../src/libgetdata.la
+parse_mplex_scalar_SOURCES = parse_mplex_scalar.c
+parse_mplex_scalar_OBJECTS = parse_mplex_scalar.$(OBJEXT)
+parse_mplex_scalar_LDADD = $(LDADD)
+parse_mplex_scalar_DEPENDENCIES = ../src/libgetdata.la
+parse_multiply_SOURCES = parse_multiply.c
+parse_multiply_OBJECTS = parse_multiply.$(OBJEXT)
+parse_multiply_LDADD = $(LDADD)
+parse_multiply_DEPENDENCIES = ../src/libgetdata.la
+parse_multiply_ncols_SOURCES = parse_multiply_ncols.c
+parse_multiply_ncols_OBJECTS = parse_multiply_ncols.$(OBJEXT)
+parse_multiply_ncols_LDADD = $(LDADD)
+parse_multiply_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_name_SOURCES = parse_name.c
+parse_name_OBJECTS = parse_name.$(OBJEXT)
+parse_name_LDADD = $(LDADD)
+parse_name_DEPENDENCIES = ../src/libgetdata.la
+parse_name_dot_SOURCES = parse_name_dot.c
+parse_name_dot_OBJECTS = parse_name_dot.$(OBJEXT)
+parse_name_dot_LDADD = $(LDADD)
+parse_name_dot_DEPENDENCIES = ../src/libgetdata.la
+parse_name_ext_SOURCES = parse_name_ext.c
+parse_name_ext_OBJECTS = parse_name_ext.$(OBJEXT)
+parse_name_ext_LDADD = $(LDADD)
+parse_name_ext_DEPENDENCIES = ../src/libgetdata.la
+parse_name_pedantic_SOURCES = parse_name_pedantic.c
+parse_name_pedantic_OBJECTS = parse_name_pedantic.$(OBJEXT)
+parse_name_pedantic_LDADD = $(LDADD)
+parse_name_pedantic_DEPENDENCIES = ../src/libgetdata.la
+parse_ncols_SOURCES = parse_ncols.c
+parse_ncols_OBJECTS = parse_ncols.$(OBJEXT)
+parse_ncols_LDADD = $(LDADD)
+parse_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_phase_SOURCES = parse_phase.c
+parse_phase_OBJECTS = parse_phase.$(OBJEXT)
+parse_phase_LDADD = $(LDADD)
+parse_phase_DEPENDENCIES = ../src/libgetdata.la
+parse_phase_ncols_SOURCES = parse_phase_ncols.c
+parse_phase_ncols_OBJECTS = parse_phase_ncols.$(OBJEXT)
+parse_phase_ncols_LDADD = $(LDADD)
+parse_phase_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_phase_scalar_SOURCES = parse_phase_scalar.c
+parse_phase_scalar_OBJECTS = parse_phase_scalar.$(OBJEXT)
+parse_phase_scalar_LDADD = $(LDADD)
+parse_phase_scalar_DEPENDENCIES = ../src/libgetdata.la
+parse_polynom_SOURCES = parse_polynom.c
+parse_polynom_OBJECTS = parse_polynom.$(OBJEXT)
+parse_polynom_LDADD = $(LDADD)
+parse_polynom_DEPENDENCIES = ../src/libgetdata.la
+parse_polynom_ncols1_SOURCES = parse_polynom_ncols1.c
+parse_polynom_ncols1_OBJECTS = parse_polynom_ncols1.$(OBJEXT)
+parse_polynom_ncols1_LDADD = $(LDADD)
+parse_polynom_ncols1_DEPENDENCIES = ../src/libgetdata.la
+parse_polynom_ncols2_SOURCES = parse_polynom_ncols2.c
+parse_polynom_ncols2_OBJECTS = parse_polynom_ncols2.$(OBJEXT)
+parse_polynom_ncols2_LDADD = $(LDADD)
+parse_polynom_ncols2_DEPENDENCIES = ../src/libgetdata.la
+parse_polynom_scalar_SOURCES = parse_polynom_scalar.c
+parse_polynom_scalar_OBJECTS = parse_polynom_scalar.$(OBJEXT)
+parse_polynom_scalar_LDADD = $(LDADD)
+parse_polynom_scalar_DEPENDENCIES = ../src/libgetdata.la
+parse_protect_all_SOURCES = parse_protect_all.c
+parse_protect_all_OBJECTS = parse_protect_all.$(OBJEXT)
+parse_protect_all_LDADD = $(LDADD)
+parse_protect_all_DEPENDENCIES = ../src/libgetdata.la
+parse_protect_bad_SOURCES = parse_protect_bad.c
+parse_protect_bad_OBJECTS = parse_protect_bad.$(OBJEXT)
+parse_protect_bad_LDADD = $(LDADD)
+parse_protect_bad_DEPENDENCIES = ../src/libgetdata.la
+parse_protect_data_SOURCES = parse_protect_data.c
+parse_protect_data_OBJECTS = parse_protect_data.$(OBJEXT)
+parse_protect_data_LDADD = $(LDADD)
+parse_protect_data_DEPENDENCIES = ../src/libgetdata.la
+parse_protect_format_SOURCES = parse_protect_format.c
+parse_protect_format_OBJECTS = parse_protect_format.$(OBJEXT)
+parse_protect_format_LDADD = $(LDADD)
+parse_protect_format_DEPENDENCIES = ../src/libgetdata.la
+parse_protect_none_SOURCES = parse_protect_none.c
+parse_protect_none_OBJECTS = parse_protect_none.$(OBJEXT)
+parse_protect_none_LDADD = $(LDADD)
+parse_protect_none_DEPENDENCIES = ../src/libgetdata.la
+parse_quote_SOURCES = parse_quote.c
+parse_quote_OBJECTS = parse_quote.$(OBJEXT)
+parse_quote_LDADD = $(LDADD)
+parse_quote_DEPENDENCIES = ../src/libgetdata.la
+parse_quote_mismatch_SOURCES = parse_quote_mismatch.c
+parse_quote_mismatch_OBJECTS = parse_quote_mismatch.$(OBJEXT)
+parse_quote_mismatch_LDADD = $(LDADD)
+parse_quote_mismatch_DEPENDENCIES = ../src/libgetdata.la
+parse_raw_SOURCES = parse_raw.c
+parse_raw_OBJECTS = parse_raw.$(OBJEXT)
+parse_raw_LDADD = $(LDADD)
+parse_raw_DEPENDENCIES = ../src/libgetdata.la
+parse_raw_char_SOURCES = parse_raw_char.c
+parse_raw_char_OBJECTS = parse_raw_char.$(OBJEXT)
+parse_raw_char_LDADD = $(LDADD)
+parse_raw_char_DEPENDENCIES = ../src/libgetdata.la
+parse_raw_ncols_SOURCES = parse_raw_ncols.c
+parse_raw_ncols_OBJECTS = parse_raw_ncols.$(OBJEXT)
+parse_raw_ncols_LDADD = $(LDADD)
+parse_raw_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_raw_scalar_SOURCES = parse_raw_scalar.c
+parse_raw_scalar_OBJECTS = parse_raw_scalar.$(OBJEXT)
+parse_raw_scalar_LDADD = $(LDADD)
+parse_raw_scalar_DEPENDENCIES = ../src/libgetdata.la
+parse_raw_spf_SOURCES = parse_raw_spf.c
+parse_raw_spf_OBJECTS = parse_raw_spf.$(OBJEXT)
+parse_raw_spf_LDADD = $(LDADD)
+parse_raw_spf_DEPENDENCIES = ../src/libgetdata.la
+parse_raw_type_SOURCES = parse_raw_type.c
+parse_raw_type_OBJECTS = parse_raw_type.$(OBJEXT)
+parse_raw_type_LDADD = $(LDADD)
+parse_raw_type_DEPENDENCIES = ../src/libgetdata.la
+parse_recip_SOURCES = parse_recip.c
+parse_recip_OBJECTS = parse_recip.$(OBJEXT)
+parse_recip_LDADD = $(LDADD)
+parse_recip_DEPENDENCIES = ../src/libgetdata.la
+parse_ref_SOURCES = parse_ref.c
+parse_ref_OBJECTS = parse_ref.$(OBJEXT)
+parse_ref_LDADD = $(LDADD)
+parse_ref_DEPENDENCIES = ../src/libgetdata.la
+parse_ref_nonexistent_SOURCES = parse_ref_nonexistent.c
+parse_ref_nonexistent_OBJECTS = parse_ref_nonexistent.$(OBJEXT)
+parse_ref_nonexistent_LDADD = $(LDADD)
+parse_ref_nonexistent_DEPENDENCIES = ../src/libgetdata.la
+parse_sbit_SOURCES = parse_sbit.c
+parse_sbit_OBJECTS = parse_sbit.$(OBJEXT)
+parse_sbit_LDADD = $(LDADD)
+parse_sbit_DEPENDENCIES = ../src/libgetdata.la
+parse_sort_SOURCES = parse_sort.c
+parse_sort_OBJECTS = parse_sort.$(OBJEXT)
+parse_sort_LDADD = $(LDADD)
+parse_sort_DEPENDENCIES = ../src/libgetdata.la
+parse_string_SOURCES = parse_string.c
+parse_string_OBJECTS = parse_string.$(OBJEXT)
+parse_string_LDADD = $(LDADD)
+parse_string_DEPENDENCIES = ../src/libgetdata.la
+parse_string_ncols_SOURCES = parse_string_ncols.c
+parse_string_ncols_OBJECTS = parse_string_ncols.$(OBJEXT)
+parse_string_ncols_LDADD = $(LDADD)
+parse_string_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_string_null_SOURCES = parse_string_null.c
+parse_string_null_OBJECTS = parse_string_null.$(OBJEXT)
+parse_string_null_LDADD = $(LDADD)
+parse_string_null_DEPENDENCIES = ../src/libgetdata.la
+parse_utf8_SOURCES = parse_utf8.c
+parse_utf8_OBJECTS = parse_utf8.$(OBJEXT)
+parse_utf8_LDADD = $(LDADD)
+parse_utf8_DEPENDENCIES = ../src/libgetdata.la
+parse_utf8_invalid_SOURCES = parse_utf8_invalid.c
+parse_utf8_invalid_OBJECTS = parse_utf8_invalid.$(OBJEXT)
+parse_utf8_invalid_LDADD = $(LDADD)
+parse_utf8_invalid_DEPENDENCIES = ../src/libgetdata.la
+parse_utf8_zero_SOURCES = parse_utf8_zero.c
+parse_utf8_zero_OBJECTS = parse_utf8_zero.$(OBJEXT)
+parse_utf8_zero_LDADD = $(LDADD)
+parse_utf8_zero_DEPENDENCIES = ../src/libgetdata.la
+parse_version_SOURCES = parse_version.c
+parse_version_OBJECTS = parse_version.$(OBJEXT)
+parse_version_LDADD = $(LDADD)
+parse_version_DEPENDENCIES = ../src/libgetdata.la
+parse_version_89_SOURCES = parse_version_89.c
+parse_version_89_OBJECTS = parse_version_89.$(OBJEXT)
+parse_version_89_LDADD = $(LDADD)
+parse_version_89_DEPENDENCIES = ../src/libgetdata.la
+parse_version_98_SOURCES = parse_version_98.c
+parse_version_98_OBJECTS = parse_version_98.$(OBJEXT)
+parse_version_98_LDADD = $(LDADD)
+parse_version_98_DEPENDENCIES = ../src/libgetdata.la
+parse_version_include_SOURCES = parse_version_include.c
+parse_version_include_OBJECTS = parse_version_include.$(OBJEXT)
+parse_version_include_LDADD = $(LDADD)
+parse_version_include_DEPENDENCIES = ../src/libgetdata.la
+parse_version_p8_SOURCES = parse_version_p8.c
+parse_version_p8_OBJECTS = parse_version_p8.$(OBJEXT)
+parse_version_p8_LDADD = $(LDADD)
+parse_version_p8_DEPENDENCIES = ../src/libgetdata.la
+parse_version_p9_SOURCES = parse_version_p9.c
+parse_version_p9_OBJECTS = parse_version_p9.$(OBJEXT)
+parse_version_p9_LDADD = $(LDADD)
+parse_version_p9_DEPENDENCIES = ../src/libgetdata.la
+parse_version_permissive_SOURCES = parse_version_permissive.c
+parse_version_permissive_OBJECTS = parse_version_permissive.$(OBJEXT)
+parse_version_permissive_LDADD = $(LDADD)
+parse_version_permissive_DEPENDENCIES = ../src/libgetdata.la
+parse_version_slash_SOURCES = parse_version_slash.c
+parse_version_slash_OBJECTS = parse_version_slash.$(OBJEXT)
+parse_version_slash_LDADD = $(LDADD)
+parse_version_slash_DEPENDENCIES = ../src/libgetdata.la
+parse_whitespace_SOURCES = parse_whitespace.c
+parse_whitespace_OBJECTS = parse_whitespace.$(OBJEXT)
+parse_whitespace_LDADD = $(LDADD)
+parse_whitespace_DEPENDENCIES = ../src/libgetdata.la
+parse_window_SOURCES = parse_window.c
+parse_window_OBJECTS = parse_window.$(OBJEXT)
+parse_window_LDADD = $(LDADD)
+parse_window_DEPENDENCIES = ../src/libgetdata.la
+parse_window_ncols_SOURCES = parse_window_ncols.c
+parse_window_ncols_OBJECTS = parse_window_ncols.$(OBJEXT)
+parse_window_ncols_LDADD = $(LDADD)
+parse_window_ncols_DEPENDENCIES = ../src/libgetdata.la
+parse_window_op_SOURCES = parse_window_op.c
+parse_window_op_OBJECTS = parse_window_op.$(OBJEXT)
+parse_window_op_LDADD = $(LDADD)
+parse_window_op_DEPENDENCIES = ../src/libgetdata.la
+parse_window_scalar_SOURCES = parse_window_scalar.c
+parse_window_scalar_OBJECTS = parse_window_scalar.$(OBJEXT)
+parse_window_scalar_LDADD = $(LDADD)
+parse_window_scalar_DEPENDENCIES = ../src/libgetdata.la
+protect_alter_SOURCES = protect_alter.c
+protect_alter_OBJECTS = protect_alter.$(OBJEXT)
+protect_alter_LDADD = $(LDADD)
+protect_alter_DEPENDENCIES = ../src/libgetdata.la
+protect_get_SOURCES = protect_get.c
+protect_get_OBJECTS = protect_get.$(OBJEXT)
+protect_get_LDADD = $(LDADD)
+protect_get_DEPENDENCIES = ../src/libgetdata.la
+put64_SOURCES = put64.c
+put64_OBJECTS = put64.$(OBJEXT)
+put64_LDADD = $(LDADD)
+put64_DEPENDENCIES = ../src/libgetdata.la
+put_bad_code_SOURCES = put_bad_code.c
+put_bad_code_OBJECTS = put_bad_code.$(OBJEXT)
+put_bad_code_LDADD = $(LDADD)
+put_bad_code_DEPENDENCIES = ../src/libgetdata.la
+put_bit_SOURCES = put_bit.c
+put_bit_OBJECTS = put_bit.$(OBJEXT)
+put_bit_LDADD = $(LDADD)
+put_bit_DEPENDENCIES = ../src/libgetdata.la
+put_bof_SOURCES = put_bof.c
+put_bof_OBJECTS = put_bof.$(OBJEXT)
+put_bof_LDADD = $(LDADD)
+put_bof_DEPENDENCIES = ../src/libgetdata.la
+put_carray_SOURCES = put_carray.c
+put_carray_OBJECTS = put_carray.$(OBJEXT)
+put_carray_LDADD = $(LDADD)
+put_carray_DEPENDENCIES = ../src/libgetdata.la
+put_carray_slice_SOURCES = put_carray_slice.c
+put_carray_slice_OBJECTS = put_carray_slice.$(OBJEXT)
+put_carray_slice_LDADD = $(LDADD)
+put_carray_slice_DEPENDENCIES = ../src/libgetdata.la
+put_char_SOURCES = put_char.c
+put_char_OBJECTS = put_char.$(OBJEXT)
+put_char_LDADD = $(LDADD)
+put_char_DEPENDENCIES = ../src/libgetdata.la
+put_complex128_SOURCES = put_complex128.c
+put_complex128_OBJECTS = put_complex128.$(OBJEXT)
+put_complex128_LDADD = $(LDADD)
+put_complex128_DEPENDENCIES = ../src/libgetdata.la
+put_complex64_SOURCES = put_complex64.c
+put_complex64_OBJECTS = put_complex64.$(OBJEXT)
+put_complex64_LDADD = $(LDADD)
+put_complex64_DEPENDENCIES = ../src/libgetdata.la
+put_const_SOURCES = put_const.c
+put_const_OBJECTS = put_const.$(OBJEXT)
+put_const_LDADD = $(LDADD)
+put_const_DEPENDENCIES = ../src/libgetdata.la
+put_const_protect_SOURCES = put_const_protect.c
+put_const_protect_OBJECTS = put_const_protect.$(OBJEXT)
+put_const_protect_LDADD = $(LDADD)
+put_const_protect_DEPENDENCIES = ../src/libgetdata.la
+put_divide_SOURCES = put_divide.c
+put_divide_OBJECTS = put_divide.$(OBJEXT)
+put_divide_LDADD = $(LDADD)
+put_divide_DEPENDENCIES = ../src/libgetdata.la
+put_endian16_SOURCES = put_endian16.c
+put_endian16_OBJECTS = put_endian16.$(OBJEXT)
+put_endian16_LDADD = $(LDADD)
+put_endian16_DEPENDENCIES = ../src/libgetdata.la
+put_endian32_SOURCES = put_endian32.c
+put_endian32_OBJECTS = put_endian32.$(OBJEXT)
+put_endian32_LDADD = $(LDADD)
+put_endian32_DEPENDENCIES = ../src/libgetdata.la
+put_endian64_SOURCES = put_endian64.c
+put_endian64_OBJECTS = put_endian64.$(OBJEXT)
+put_endian64_LDADD = $(LDADD)
+put_endian64_DEPENDENCIES = ../src/libgetdata.la
+put_endian8_SOURCES = put_endian8.c
+put_endian8_OBJECTS = put_endian8.$(OBJEXT)
+put_endian8_LDADD = $(LDADD)
+put_endian8_DEPENDENCIES = ../src/libgetdata.la
+put_endian_complex128_arm_SOURCES = put_endian_complex128_arm.c
+put_endian_complex128_arm_OBJECTS =  \
+	put_endian_complex128_arm.$(OBJEXT)
+put_endian_complex128_arm_LDADD = $(LDADD)
+put_endian_complex128_arm_DEPENDENCIES = ../src/libgetdata.la
+put_endian_complex128_big_SOURCES = put_endian_complex128_big.c
+put_endian_complex128_big_OBJECTS =  \
+	put_endian_complex128_big.$(OBJEXT)
+put_endian_complex128_big_LDADD = $(LDADD)
+put_endian_complex128_big_DEPENDENCIES = ../src/libgetdata.la
+put_endian_complex128_little_SOURCES = put_endian_complex128_little.c
+put_endian_complex128_little_OBJECTS =  \
+	put_endian_complex128_little.$(OBJEXT)
+put_endian_complex128_little_LDADD = $(LDADD)
+put_endian_complex128_little_DEPENDENCIES = ../src/libgetdata.la
+put_endian_complex64_arm_SOURCES = put_endian_complex64_arm.c
+put_endian_complex64_arm_OBJECTS = put_endian_complex64_arm.$(OBJEXT)
+put_endian_complex64_arm_LDADD = $(LDADD)
+put_endian_complex64_arm_DEPENDENCIES = ../src/libgetdata.la
+put_endian_complex64_big_SOURCES = put_endian_complex64_big.c
+put_endian_complex64_big_OBJECTS = put_endian_complex64_big.$(OBJEXT)
+put_endian_complex64_big_LDADD = $(LDADD)
+put_endian_complex64_big_DEPENDENCIES = ../src/libgetdata.la
+put_endian_complex64_little_SOURCES = put_endian_complex64_little.c
+put_endian_complex64_little_OBJECTS =  \
+	put_endian_complex64_little.$(OBJEXT)
+put_endian_complex64_little_LDADD = $(LDADD)
+put_endian_complex64_little_DEPENDENCIES = ../src/libgetdata.la
+put_endian_float32_arm_SOURCES = put_endian_float32_arm.c
+put_endian_float32_arm_OBJECTS = put_endian_float32_arm.$(OBJEXT)
+put_endian_float32_arm_LDADD = $(LDADD)
+put_endian_float32_arm_DEPENDENCIES = ../src/libgetdata.la
+put_endian_float32_big_SOURCES = put_endian_float32_big.c
+put_endian_float32_big_OBJECTS = put_endian_float32_big.$(OBJEXT)
+put_endian_float32_big_LDADD = $(LDADD)
+put_endian_float32_big_DEPENDENCIES = ../src/libgetdata.la
+put_endian_float32_little_SOURCES = put_endian_float32_little.c
+put_endian_float32_little_OBJECTS =  \
+	put_endian_float32_little.$(OBJEXT)
+put_endian_float32_little_LDADD = $(LDADD)
+put_endian_float32_little_DEPENDENCIES = ../src/libgetdata.la
+put_endian_float64_arm_SOURCES = put_endian_float64_arm.c
+put_endian_float64_arm_OBJECTS = put_endian_float64_arm.$(OBJEXT)
+put_endian_float64_arm_LDADD = $(LDADD)
+put_endian_float64_arm_DEPENDENCIES = ../src/libgetdata.la
+put_endian_float64_big_SOURCES = put_endian_float64_big.c
+put_endian_float64_big_OBJECTS = put_endian_float64_big.$(OBJEXT)
+put_endian_float64_big_LDADD = $(LDADD)
+put_endian_float64_big_DEPENDENCIES = ../src/libgetdata.la
+put_endian_float64_little_SOURCES = put_endian_float64_little.c
+put_endian_float64_little_OBJECTS =  \
+	put_endian_float64_little.$(OBJEXT)
+put_endian_float64_little_LDADD = $(LDADD)
+put_endian_float64_little_DEPENDENCIES = ../src/libgetdata.la
+put_ff_SOURCES = put_ff.c
+put_ff_OBJECTS = put_ff.$(OBJEXT)
+put_ff_LDADD = $(LDADD)
+put_ff_DEPENDENCIES = ../src/libgetdata.la
+put_float32_SOURCES = put_float32.c
+put_float32_OBJECTS = put_float32.$(OBJEXT)
+put_float32_LDADD = $(LDADD)
+put_float32_DEPENDENCIES = ../src/libgetdata.la
+put_float64_SOURCES = put_float64.c
+put_float64_OBJECTS = put_float64.$(OBJEXT)
+put_float64_LDADD = $(LDADD)
+put_float64_DEPENDENCIES = ../src/libgetdata.la
+put_foffs_SOURCES = put_foffs.c
+put_foffs_OBJECTS = put_foffs.$(OBJEXT)
+put_foffs_LDADD = $(LDADD)
+put_foffs_DEPENDENCIES = ../src/libgetdata.la
+put_fs_SOURCES = put_fs.c
+put_fs_OBJECTS = put_fs.$(OBJEXT)
+put_fs_LDADD = $(LDADD)
+put_fs_DEPENDENCIES = ../src/libgetdata.la
+put_here_SOURCES = put_here.c
+put_here_OBJECTS = put_here.$(OBJEXT)
+put_here_LDADD = $(LDADD)
+put_here_DEPENDENCIES = ../src/libgetdata.la
+put_heres_SOURCES = put_heres.c
+put_heres_OBJECTS = put_heres.$(OBJEXT)
+put_heres_LDADD = $(LDADD)
+put_heres_DEPENDENCIES = ../src/libgetdata.la
+put_int16_SOURCES = put_int16.c
+put_int16_OBJECTS = put_int16.$(OBJEXT)
+put_int16_LDADD = $(LDADD)
+put_int16_DEPENDENCIES = ../src/libgetdata.la
+put_int32_SOURCES = put_int32.c
+put_int32_OBJECTS = put_int32.$(OBJEXT)
+put_int32_LDADD = $(LDADD)
+put_int32_DEPENDENCIES = ../src/libgetdata.la
+put_int64_SOURCES = put_int64.c
+put_int64_OBJECTS = put_int64.$(OBJEXT)
+put_int64_LDADD = $(LDADD)
+put_int64_DEPENDENCIES = ../src/libgetdata.la
+put_int8_SOURCES = put_int8.c
+put_int8_OBJECTS = put_int8.$(OBJEXT)
+put_int8_LDADD = $(LDADD)
+put_int8_DEPENDENCIES = ../src/libgetdata.la
+put_invalid_SOURCES = put_invalid.c
+put_invalid_OBJECTS = put_invalid.$(OBJEXT)
+put_invalid_LDADD = $(LDADD)
+put_invalid_DEPENDENCIES = ../src/libgetdata.la
+put_lincom1_SOURCES = put_lincom1.c
+put_lincom1_OBJECTS = put_lincom1.$(OBJEXT)
+put_lincom1_LDADD = $(LDADD)
+put_lincom1_DEPENDENCIES = ../src/libgetdata.la
+put_lincom2_SOURCES = put_lincom2.c
+put_lincom2_OBJECTS = put_lincom2.$(OBJEXT)
+put_lincom2_LDADD = $(LDADD)
+put_lincom2_DEPENDENCIES = ../src/libgetdata.la
+put_lincom_noin_SOURCES = put_lincom_noin.c
+put_lincom_noin_OBJECTS = put_lincom_noin.$(OBJEXT)
+put_lincom_noin_LDADD = $(LDADD)
+put_lincom_noin_DEPENDENCIES = ../src/libgetdata.la
+put_linterp_SOURCES = put_linterp.c
+put_linterp_OBJECTS = put_linterp.$(OBJEXT)
+put_linterp_LDADD = $(LDADD)
+put_linterp_DEPENDENCIES = ../src/libgetdata.la
+put_linterp_noin_SOURCES = put_linterp_noin.c
+put_linterp_noin_OBJECTS = put_linterp_noin.$(OBJEXT)
+put_linterp_noin_LDADD = $(LDADD)
+put_linterp_noin_DEPENDENCIES = ../src/libgetdata.la
+put_linterp_nomono_SOURCES = put_linterp_nomono.c
+put_linterp_nomono_OBJECTS = put_linterp_nomono.$(OBJEXT)
+put_linterp_nomono_LDADD = $(LDADD)
+put_linterp_nomono_DEPENDENCIES = ../src/libgetdata.la
+put_linterp_notab_SOURCES = put_linterp_notab.c
+put_linterp_notab_OBJECTS = put_linterp_notab.$(OBJEXT)
+put_linterp_notab_LDADD = $(LDADD)
+put_linterp_notab_DEPENDENCIES = ../src/libgetdata.la
+put_linterp_reverse_SOURCES = put_linterp_reverse.c
+put_linterp_reverse_OBJECTS = put_linterp_reverse.$(OBJEXT)
+put_linterp_reverse_LDADD = $(LDADD)
+put_linterp_reverse_DEPENDENCIES = ../src/libgetdata.la
+put_mplex_SOURCES = put_mplex.c
+put_mplex_OBJECTS = put_mplex.$(OBJEXT)
+put_mplex_LDADD = $(LDADD)
+put_mplex_DEPENDENCIES = ../src/libgetdata.la
+put_multiply_SOURCES = put_multiply.c
+put_multiply_OBJECTS = put_multiply.$(OBJEXT)
+put_multiply_LDADD = $(LDADD)
+put_multiply_DEPENDENCIES = ../src/libgetdata.la
+put_null_SOURCES = put_null.c
+put_null_OBJECTS = put_null.$(OBJEXT)
+put_null_LDADD = $(LDADD)
+put_null_DEPENDENCIES = ../src/libgetdata.la
+put_off64_SOURCES = put_off64.c
+put_off64_OBJECTS = put_off64.$(OBJEXT)
+put_off64_LDADD = $(LDADD)
+put_off64_DEPENDENCIES = ../src/libgetdata.la
+put_phase_SOURCES = put_phase.c
+put_phase_OBJECTS = put_phase.$(OBJEXT)
+put_phase_LDADD = $(LDADD)
+put_phase_DEPENDENCIES = ../src/libgetdata.la
+put_phase_noin_SOURCES = put_phase_noin.c
+put_phase_noin_OBJECTS = put_phase_noin.$(OBJEXT)
+put_phase_noin_LDADD = $(LDADD)
+put_phase_noin_DEPENDENCIES = ../src/libgetdata.la
+put_polynom1_SOURCES = put_polynom1.c
+put_polynom1_OBJECTS = put_polynom1.$(OBJEXT)
+put_polynom1_LDADD = $(LDADD)
+put_polynom1_DEPENDENCIES = ../src/libgetdata.la
+put_polynom2_SOURCES = put_polynom2.c
+put_polynom2_OBJECTS = put_polynom2.$(OBJEXT)
+put_polynom2_LDADD = $(LDADD)
+put_polynom2_DEPENDENCIES = ../src/libgetdata.la
+put_polynom_noin_SOURCES = put_polynom_noin.c
+put_polynom_noin_OBJECTS = put_polynom_noin.$(OBJEXT)
+put_polynom_noin_LDADD = $(LDADD)
+put_polynom_noin_DEPENDENCIES = ../src/libgetdata.la
+put_protect_SOURCES = put_protect.c
+put_protect_OBJECTS = put_protect.$(OBJEXT)
+put_protect_LDADD = $(LDADD)
+put_protect_DEPENDENCIES = ../src/libgetdata.la
+put_rdonly_SOURCES = put_rdonly.c
+put_rdonly_OBJECTS = put_rdonly.$(OBJEXT)
+put_rdonly_LDADD = $(LDADD)
+put_rdonly_DEPENDENCIES = ../src/libgetdata.la
+put_recip_SOURCES = put_recip.c
+put_recip_OBJECTS = put_recip.$(OBJEXT)
+put_recip_LDADD = $(LDADD)
+put_recip_DEPENDENCIES = ../src/libgetdata.la
+put_recurse_SOURCES = put_recurse.c
+put_recurse_OBJECTS = put_recurse.$(OBJEXT)
+put_recurse_LDADD = $(LDADD)
+put_recurse_DEPENDENCIES = ../src/libgetdata.la
+put_repr_SOURCES = put_repr.c
+put_repr_OBJECTS = put_repr.$(OBJEXT)
+put_repr_LDADD = $(LDADD)
+put_repr_DEPENDENCIES = ../src/libgetdata.la
+put_rofs_SOURCES = put_rofs.c
+put_rofs_OBJECTS = put_rofs.$(OBJEXT)
+put_rofs_LDADD = $(LDADD)
+put_rofs_DEPENDENCIES = ../src/libgetdata.la
+put_sbit_SOURCES = put_sbit.c
+put_sbit_OBJECTS = put_sbit.$(OBJEXT)
+put_sbit_LDADD = $(LDADD)
+put_sbit_DEPENDENCIES = ../src/libgetdata.la
+put_sf_SOURCES = put_sf.c
+put_sf_OBJECTS = put_sf.$(OBJEXT)
+put_sf_LDADD = $(LDADD)
+put_sf_DEPENDENCIES = ../src/libgetdata.la
+put_ss_SOURCES = put_ss.c
+put_ss_OBJECTS = put_ss.$(OBJEXT)
+put_ss_LDADD = $(LDADD)
+put_ss_DEPENDENCIES = ../src/libgetdata.la
+put_string_SOURCES = put_string.c
+put_string_OBJECTS = put_string.$(OBJEXT)
+put_string_LDADD = $(LDADD)
+put_string_DEPENDENCIES = ../src/libgetdata.la
+put_string_protect_SOURCES = put_string_protect.c
+put_string_protect_OBJECTS = put_string_protect.$(OBJEXT)
+put_string_protect_LDADD = $(LDADD)
+put_string_protect_DEPENDENCIES = ../src/libgetdata.la
+put_type_SOURCES = put_type.c
+put_type_OBJECTS = put_type.$(OBJEXT)
+put_type_LDADD = $(LDADD)
+put_type_DEPENDENCIES = ../src/libgetdata.la
+put_uint16_SOURCES = put_uint16.c
+put_uint16_OBJECTS = put_uint16.$(OBJEXT)
+put_uint16_LDADD = $(LDADD)
+put_uint16_DEPENDENCIES = ../src/libgetdata.la
+put_uint32_SOURCES = put_uint32.c
+put_uint32_OBJECTS = put_uint32.$(OBJEXT)
+put_uint32_LDADD = $(LDADD)
+put_uint32_DEPENDENCIES = ../src/libgetdata.la
+put_uint64_SOURCES = put_uint64.c
+put_uint64_OBJECTS = put_uint64.$(OBJEXT)
+put_uint64_LDADD = $(LDADD)
+put_uint64_DEPENDENCIES = ../src/libgetdata.la
+put_window_SOURCES = put_window.c
+put_window_OBJECTS = put_window.$(OBJEXT)
+put_window_LDADD = $(LDADD)
+put_window_DEPENDENCIES = ../src/libgetdata.la
+put_zero_SOURCES = put_zero.c
+put_zero_OBJECTS = put_zero.$(OBJEXT)
+put_zero_LDADD = $(LDADD)
+put_zero_DEPENDENCIES = ../src/libgetdata.la
+ref_SOURCES = ref.c
+ref_OBJECTS = ref.$(OBJEXT)
+ref_LDADD = $(LDADD)
+ref_DEPENDENCIES = ../src/libgetdata.la
+ref_none_SOURCES = ref_none.c
+ref_none_OBJECTS = ref_none.$(OBJEXT)
+ref_none_LDADD = $(LDADD)
+ref_none_DEPENDENCIES = ../src/libgetdata.la
+ref_two_SOURCES = ref_two.c
+ref_two_OBJECTS = ref_two.$(OBJEXT)
+ref_two_LDADD = $(LDADD)
+ref_two_DEPENDENCIES = ../src/libgetdata.la
+repr_a_SOURCES = repr_a.c
+repr_a_OBJECTS = repr_a.$(OBJEXT)
+repr_a_LDADD = $(LDADD)
+repr_a_DEPENDENCIES = ../src/libgetdata.la
+repr_float32_SOURCES = repr_float32.c
+repr_float32_OBJECTS = repr_float32.$(OBJEXT)
+repr_float32_LDADD = $(LDADD)
+repr_float32_DEPENDENCIES = ../src/libgetdata.la
+repr_float64_SOURCES = repr_float64.c
+repr_float64_OBJECTS = repr_float64.$(OBJEXT)
+repr_float64_LDADD = $(LDADD)
+repr_float64_DEPENDENCIES = ../src/libgetdata.la
+repr_i_SOURCES = repr_i.c
+repr_i_OBJECTS = repr_i.$(OBJEXT)
+repr_i_LDADD = $(LDADD)
+repr_i_DEPENDENCIES = ../src/libgetdata.la
+repr_int16_SOURCES = repr_int16.c
+repr_int16_OBJECTS = repr_int16.$(OBJEXT)
+repr_int16_LDADD = $(LDADD)
+repr_int16_DEPENDENCIES = ../src/libgetdata.la
+repr_int32_SOURCES = repr_int32.c
+repr_int32_OBJECTS = repr_int32.$(OBJEXT)
+repr_int32_LDADD = $(LDADD)
+repr_int32_DEPENDENCIES = ../src/libgetdata.la
+repr_int64_SOURCES = repr_int64.c
+repr_int64_OBJECTS = repr_int64.$(OBJEXT)
+repr_int64_LDADD = $(LDADD)
+repr_int64_DEPENDENCIES = ../src/libgetdata.la
+repr_int8_SOURCES = repr_int8.c
+repr_int8_OBJECTS = repr_int8.$(OBJEXT)
+repr_int8_LDADD = $(LDADD)
+repr_int8_DEPENDENCIES = ../src/libgetdata.la
+repr_m_SOURCES = repr_m.c
+repr_m_OBJECTS = repr_m.$(OBJEXT)
+repr_m_LDADD = $(LDADD)
+repr_m_DEPENDENCIES = ../src/libgetdata.la
+repr_r_SOURCES = repr_r.c
+repr_r_OBJECTS = repr_r.$(OBJEXT)
+repr_r_LDADD = $(LDADD)
+repr_r_DEPENDENCIES = ../src/libgetdata.la
+repr_real_a_SOURCES = repr_real_a.c
+repr_real_a_OBJECTS = repr_real_a.$(OBJEXT)
+repr_real_a_LDADD = $(LDADD)
+repr_real_a_DEPENDENCIES = ../src/libgetdata.la
+repr_real_i_SOURCES = repr_real_i.c
+repr_real_i_OBJECTS = repr_real_i.$(OBJEXT)
+repr_real_i_LDADD = $(LDADD)
+repr_real_i_DEPENDENCIES = ../src/libgetdata.la
+repr_real_m_SOURCES = repr_real_m.c
+repr_real_m_OBJECTS = repr_real_m.$(OBJEXT)
+repr_real_m_LDADD = $(LDADD)
+repr_real_m_DEPENDENCIES = ../src/libgetdata.la
+repr_real_r_SOURCES = repr_real_r.c
+repr_real_r_OBJECTS = repr_real_r.$(OBJEXT)
+repr_real_r_LDADD = $(LDADD)
+repr_real_r_DEPENDENCIES = ../src/libgetdata.la
+repr_uint16_SOURCES = repr_uint16.c
+repr_uint16_OBJECTS = repr_uint16.$(OBJEXT)
+repr_uint16_LDADD = $(LDADD)
+repr_uint16_DEPENDENCIES = ../src/libgetdata.la
+repr_uint32_SOURCES = repr_uint32.c
+repr_uint32_OBJECTS = repr_uint32.$(OBJEXT)
+repr_uint32_LDADD = $(LDADD)
+repr_uint32_DEPENDENCIES = ../src/libgetdata.la
+repr_uint64_SOURCES = repr_uint64.c
+repr_uint64_OBJECTS = repr_uint64.$(OBJEXT)
+repr_uint64_LDADD = $(LDADD)
+repr_uint64_DEPENDENCIES = ../src/libgetdata.la
+repr_uint8_SOURCES = repr_uint8.c
+repr_uint8_OBJECTS = repr_uint8.$(OBJEXT)
+repr_uint8_LDADD = $(LDADD)
+repr_uint8_DEPENDENCIES = ../src/libgetdata.la
+seek64_SOURCES = seek64.c
+seek64_OBJECTS = seek64.$(OBJEXT)
+seek64_LDADD = $(LDADD)
+seek64_DEPENDENCIES = ../src/libgetdata.la
+seek_cur_SOURCES = seek_cur.c
+seek_cur_OBJECTS = seek_cur.$(OBJEXT)
+seek_cur_LDADD = $(LDADD)
+seek_cur_DEPENDENCIES = ../src/libgetdata.la
+seek_end_SOURCES = seek_end.c
+seek_end_OBJECTS = seek_end.$(OBJEXT)
+seek_end_LDADD = $(LDADD)
+seek_end_DEPENDENCIES = ../src/libgetdata.la
+seek_foffs_SOURCES = seek_foffs.c
+seek_foffs_OBJECTS = seek_foffs.$(OBJEXT)
+seek_foffs_LDADD = $(LDADD)
+seek_foffs_DEPENDENCIES = ../src/libgetdata.la
+seek_foffs2_SOURCES = seek_foffs2.c
+seek_foffs2_OBJECTS = seek_foffs2.$(OBJEXT)
+seek_foffs2_LDADD = $(LDADD)
+seek_foffs2_DEPENDENCIES = ../src/libgetdata.la
+seek_neg_SOURCES = seek_neg.c
+seek_neg_OBJECTS = seek_neg.$(OBJEXT)
+seek_neg_LDADD = $(LDADD)
+seek_neg_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
+sie_get_big_SOURCES = sie_get_big.c
+sie_get_big_OBJECTS = sie_get_big.$(OBJEXT)
+sie_get_big_LDADD = $(LDADD)
+sie_get_big_DEPENDENCIES = ../src/libgetdata.la
+sie_get_little_SOURCES = sie_get_little.c
+sie_get_little_OBJECTS = sie_get_little.$(OBJEXT)
+sie_get_little_LDADD = $(LDADD)
+sie_get_little_DEPENDENCIES = ../src/libgetdata.la
+sie_move_from_SOURCES = sie_move_from.c
+sie_move_from_OBJECTS = sie_move_from.$(OBJEXT)
+sie_move_from_LDADD = $(LDADD)
+sie_move_from_DEPENDENCIES = ../src/libgetdata.la
+sie_move_to_SOURCES = sie_move_to.c
+sie_move_to_OBJECTS = sie_move_to.$(OBJEXT)
+sie_move_to_LDADD = $(LDADD)
+sie_move_to_DEPENDENCIES = ../src/libgetdata.la
+sie_nframes_big_SOURCES = sie_nframes_big.c
+sie_nframes_big_OBJECTS = sie_nframes_big.$(OBJEXT)
+sie_nframes_big_LDADD = $(LDADD)
+sie_nframes_big_DEPENDENCIES = ../src/libgetdata.la
+sie_nframes_little_SOURCES = sie_nframes_little.c
+sie_nframes_little_OBJECTS = sie_nframes_little.$(OBJEXT)
+sie_nframes_little_LDADD = $(LDADD)
+sie_nframes_little_DEPENDENCIES = ../src/libgetdata.la
+sie_put_append_SOURCES = sie_put_append.c
+sie_put_append_OBJECTS = sie_put_append.$(OBJEXT)
+sie_put_append_LDADD = $(LDADD)
+sie_put_append_DEPENDENCIES = ../src/libgetdata.la
+sie_put_append2_SOURCES = sie_put_append2.c
+sie_put_append2_OBJECTS = sie_put_append2.$(OBJEXT)
+sie_put_append2_LDADD = $(LDADD)
+sie_put_append2_DEPENDENCIES = ../src/libgetdata.la
+sie_put_back_SOURCES = sie_put_back.c
+sie_put_back_OBJECTS = sie_put_back.$(OBJEXT)
+sie_put_back_LDADD = $(LDADD)
+sie_put_back_DEPENDENCIES = ../src/libgetdata.la
+sie_put_big_SOURCES = sie_put_big.c
+sie_put_big_OBJECTS = sie_put_big.$(OBJEXT)
+sie_put_big_LDADD = $(LDADD)
+sie_put_big_DEPENDENCIES = ../src/libgetdata.la
+sie_put_little_SOURCES = sie_put_little.c
+sie_put_little_OBJECTS = sie_put_little.$(OBJEXT)
+sie_put_little_LDADD = $(LDADD)
+sie_put_little_DEPENDENCIES = ../src/libgetdata.la
+sie_put_many_SOURCES = sie_put_many.c
+sie_put_many_OBJECTS = sie_put_many.$(OBJEXT)
+sie_put_many_LDADD = $(LDADD)
+sie_put_many_DEPENDENCIES = ../src/libgetdata.la
+sie_put_newo_SOURCES = sie_put_newo.c
+sie_put_newo_OBJECTS = sie_put_newo.$(OBJEXT)
+sie_put_newo_LDADD = $(LDADD)
+sie_put_newo_DEPENDENCIES = ../src/libgetdata.la
+sie_put_newo0_SOURCES = sie_put_newo0.c
+sie_put_newo0_OBJECTS = sie_put_newo0.$(OBJEXT)
+sie_put_newo0_LDADD = $(LDADD)
+sie_put_newo0_DEPENDENCIES = ../src/libgetdata.la
+sie_put_pad_SOURCES = sie_put_pad.c
+sie_put_pad_OBJECTS = sie_put_pad.$(OBJEXT)
+sie_put_pad_LDADD = $(LDADD)
+sie_put_pad_DEPENDENCIES = ../src/libgetdata.la
+sie_put_pad0_SOURCES = sie_put_pad0.c
+sie_put_pad0_OBJECTS = sie_put_pad0.$(OBJEXT)
+sie_put_pad0_LDADD = $(LDADD)
+sie_put_pad0_DEPENDENCIES = ../src/libgetdata.la
+sie_put_trunc_SOURCES = sie_put_trunc.c
+sie_put_trunc_OBJECTS = sie_put_trunc.$(OBJEXT)
+sie_put_trunc_LDADD = $(LDADD)
+sie_put_trunc_DEPENDENCIES = ../src/libgetdata.la
+sie_put_trunc2_SOURCES = sie_put_trunc2.c
+sie_put_trunc2_OBJECTS = sie_put_trunc2.$(OBJEXT)
+sie_put_trunc2_LDADD = $(LDADD)
+sie_put_trunc2_DEPENDENCIES = ../src/libgetdata.la
+sie_put_trunc_nf_SOURCES = sie_put_trunc_nf.c
+sie_put_trunc_nf_OBJECTS = sie_put_trunc_nf.$(OBJEXT)
+sie_put_trunc_nf_LDADD = $(LDADD)
+sie_put_trunc_nf_DEPENDENCIES = ../src/libgetdata.la
+sie_sync_SOURCES = sie_sync.c
+sie_sync_OBJECTS = sie_sync.$(OBJEXT)
+sie_sync_LDADD = $(LDADD)
+sie_sync_DEPENDENCIES = ../src/libgetdata.la
+slim_get_SOURCES = slim_get.c
+slim_get_OBJECTS = slim_get.$(OBJEXT)
+slim_get_LDADD = $(LDADD)
+slim_get_DEPENDENCIES = ../src/libgetdata.la
+slim_nframes_SOURCES = slim_nframes.c
+slim_nframes_OBJECTS = slim_nframes.$(OBJEXT)
+slim_nframes_LDADD = $(LDADD)
+slim_nframes_DEPENDENCIES = ../src/libgetdata.la
+spf_SOURCES = spf.c
+spf_OBJECTS = spf.$(OBJEXT)
+spf_LDADD = $(LDADD)
+spf_DEPENDENCIES = ../src/libgetdata.la
+spf_alias_SOURCES = spf_alias.c
+spf_alias_OBJECTS = spf_alias.$(OBJEXT)
+spf_alias_LDADD = $(LDADD)
+spf_alias_DEPENDENCIES = ../src/libgetdata.la
+spf_alias_meta_SOURCES = spf_alias_meta.c
+spf_alias_meta_OBJECTS = spf_alias_meta.$(OBJEXT)
+spf_alias_meta_LDADD = $(LDADD)
+spf_alias_meta_DEPENDENCIES = ../src/libgetdata.la
+spf_alias_missing_SOURCES = spf_alias_missing.c
+spf_alias_missing_OBJECTS = spf_alias_missing.$(OBJEXT)
+spf_alias_missing_LDADD = $(LDADD)
+spf_alias_missing_DEPENDENCIES = ../src/libgetdata.la
+spf_divide_SOURCES = spf_divide.c
+spf_divide_OBJECTS = spf_divide.$(OBJEXT)
+spf_divide_LDADD = $(LDADD)
+spf_divide_DEPENDENCIES = ../src/libgetdata.la
+spf_lincom_SOURCES = spf_lincom.c
+spf_lincom_OBJECTS = spf_lincom.$(OBJEXT)
+spf_lincom_LDADD = $(LDADD)
+spf_lincom_DEPENDENCIES = ../src/libgetdata.la
+spf_multiply_SOURCES = spf_multiply.c
+spf_multiply_OBJECTS = spf_multiply.$(OBJEXT)
+spf_multiply_LDADD = $(LDADD)
+spf_multiply_DEPENDENCIES = ../src/libgetdata.la
+spf_polynom_SOURCES = spf_polynom.c
+spf_polynom_OBJECTS = spf_polynom.$(OBJEXT)
+spf_polynom_LDADD = $(LDADD)
+spf_polynom_DEPENDENCIES = ../src/libgetdata.la
+spf_recip_SOURCES = spf_recip.c
+spf_recip_OBJECTS = spf_recip.$(OBJEXT)
+spf_recip_LDADD = $(LDADD)
+spf_recip_DEPENDENCIES = ../src/libgetdata.la
+spf_recurse_SOURCES = spf_recurse.c
+spf_recurse_OBJECTS = spf_recurse.$(OBJEXT)
+spf_recurse_LDADD = $(LDADD)
+spf_recurse_DEPENDENCIES = ../src/libgetdata.la
+svlist_SOURCES = svlist.c
+svlist_OBJECTS = svlist.$(OBJEXT)
+svlist_LDADD = $(LDADD)
+svlist_DEPENDENCIES = ../src/libgetdata.la
+svlist_hidden_SOURCES = svlist_hidden.c
+svlist_hidden_OBJECTS = svlist_hidden.$(OBJEXT)
+svlist_hidden_LDADD = $(LDADD)
+svlist_hidden_DEPENDENCIES = ../src/libgetdata.la
+svlist_invalid_SOURCES = svlist_invalid.c
+svlist_invalid_OBJECTS = svlist_invalid.$(OBJEXT)
+svlist_invalid_LDADD = $(LDADD)
+svlist_invalid_DEPENDENCIES = ../src/libgetdata.la
+svlist_meta_SOURCES = svlist_meta.c
+svlist_meta_OBJECTS = svlist_meta.$(OBJEXT)
+svlist_meta_LDADD = $(LDADD)
+svlist_meta_DEPENDENCIES = ../src/libgetdata.la
+svlist_meta_hidden_SOURCES = svlist_meta_hidden.c
+svlist_meta_hidden_OBJECTS = svlist_meta_hidden.$(OBJEXT)
+svlist_meta_hidden_LDADD = $(LDADD)
+svlist_meta_hidden_DEPENDENCIES = ../src/libgetdata.la
+svlist_meta_invalid_SOURCES = svlist_meta_invalid.c
+svlist_meta_invalid_OBJECTS = svlist_meta_invalid.$(OBJEXT)
+svlist_meta_invalid_LDADD = $(LDADD)
+svlist_meta_invalid_DEPENDENCIES = ../src/libgetdata.la
+table_SOURCES = table.c
+table_OBJECTS = table.$(OBJEXT)
+table_LDADD = $(LDADD)
+table_DEPENDENCIES = ../src/libgetdata.la
+table_code_SOURCES = table_code.c
+table_code_OBJECTS = table_code.$(OBJEXT)
+table_code_LDADD = $(LDADD)
+table_code_DEPENDENCIES = ../src/libgetdata.la
+table_type_SOURCES = table_type.c
+table_type_OBJECTS = table_type.$(OBJEXT)
+table_type_LDADD = $(LDADD)
+table_type_DEPENDENCIES = ../src/libgetdata.la
+tell_SOURCES = tell.c
+tell_OBJECTS = tell.$(OBJEXT)
+tell_LDADD = $(LDADD)
+tell_DEPENDENCIES = ../src/libgetdata.la
+tell64_SOURCES = tell64.c
+tell64_OBJECTS = tell64.$(OBJEXT)
+tell64_LDADD = $(LDADD)
+tell64_DEPENDENCIES = ../src/libgetdata.la
+tell_multidiv_SOURCES = tell_multidiv.c
+tell_multidiv_OBJECTS = tell_multidiv.$(OBJEXT)
+tell_multidiv_LDADD = $(LDADD)
+tell_multidiv_DEPENDENCIES = ../src/libgetdata.la
+tok_arg_SOURCES = tok_arg.c
+tok_arg_OBJECTS = tok_arg.$(OBJEXT)
+tok_arg_LDADD = $(LDADD)
+tok_arg_DEPENDENCIES = ../src/libgetdata.la
+tok_escape_SOURCES = tok_escape.c
+tok_escape_OBJECTS = tok_escape.$(OBJEXT)
+tok_escape_LDADD = $(LDADD)
+tok_escape_DEPENDENCIES = ../src/libgetdata.la
+tok_quote_SOURCES = tok_quote.c
+tok_quote_OBJECTS = tok_quote.$(OBJEXT)
+tok_quote_LDADD = $(LDADD)
+tok_quote_DEPENDENCIES = ../src/libgetdata.la
+trunc_SOURCES = trunc.c
+trunc_OBJECTS = trunc.$(OBJEXT)
+trunc_LDADD = $(LDADD)
+trunc_DEPENDENCIES = ../src/libgetdata.la
+trunc_dir_SOURCES = trunc_dir.c
+trunc_dir_OBJECTS = trunc_dir.$(OBJEXT)
+trunc_dir_LDADD = $(LDADD)
+trunc_dir_DEPENDENCIES = ../src/libgetdata.la
+trunc_rdonly_SOURCES = trunc_rdonly.c
+trunc_rdonly_OBJECTS = trunc_rdonly.$(OBJEXT)
+trunc_rdonly_LDADD = $(LDADD)
+trunc_rdonly_DEPENDENCIES = ../src/libgetdata.la
+trunc_rofs_SOURCES = trunc_rofs.c
+trunc_rofs_OBJECTS = trunc_rofs.$(OBJEXT)
+trunc_rofs_LDADD = $(LDADD)
+trunc_rofs_DEPENDENCIES = ../src/libgetdata.la
+trunc_truncsub_SOURCES = trunc_truncsub.c
+trunc_truncsub_OBJECTS = trunc_truncsub.$(OBJEXT)
+trunc_truncsub_LDADD = $(LDADD)
+trunc_truncsub_DEPENDENCIES = ../src/libgetdata.la
+unclude_SOURCES = unclude.c
+unclude_OBJECTS = unclude.$(OBJEXT)
+unclude_LDADD = $(LDADD)
+unclude_DEPENDENCIES = ../src/libgetdata.la
+unclude_del_SOURCES = unclude_del.c
+unclude_del_OBJECTS = unclude_del.$(OBJEXT)
+unclude_del_LDADD = $(LDADD)
+unclude_del_DEPENDENCIES = ../src/libgetdata.la
+unclude_move_SOURCES = unclude_move.c
+unclude_move_OBJECTS = unclude_move.$(OBJEXT)
+unclude_move_LDADD = $(LDADD)
+unclude_move_DEPENDENCIES = ../src/libgetdata.la
+version_0_SOURCES = version_0.c
+version_0_OBJECTS = version_0.$(OBJEXT)
+version_0_LDADD = $(LDADD)
+version_0_DEPENDENCIES = ../src/libgetdata.la
+version_0_write_SOURCES = version_0_write.c
+version_0_write_OBJECTS = version_0_write.$(OBJEXT)
+version_0_write_LDADD = $(LDADD)
+version_0_write_DEPENDENCIES = ../src/libgetdata.la
+version_1_SOURCES = version_1.c
+version_1_OBJECTS = version_1.$(OBJEXT)
+version_1_LDADD = $(LDADD)
+version_1_DEPENDENCIES = ../src/libgetdata.la
+version_1_write_SOURCES = version_1_write.c
+version_1_write_OBJECTS = version_1_write.$(OBJEXT)
+version_1_write_LDADD = $(LDADD)
+version_1_write_DEPENDENCIES = ../src/libgetdata.la
+version_2_SOURCES = version_2.c
+version_2_OBJECTS = version_2.$(OBJEXT)
+version_2_LDADD = $(LDADD)
+version_2_DEPENDENCIES = ../src/libgetdata.la
+version_2_write_SOURCES = version_2_write.c
+version_2_write_OBJECTS = version_2_write.$(OBJEXT)
+version_2_write_LDADD = $(LDADD)
+version_2_write_DEPENDENCIES = ../src/libgetdata.la
+version_3_SOURCES = version_3.c
+version_3_OBJECTS = version_3.$(OBJEXT)
+version_3_LDADD = $(LDADD)
+version_3_DEPENDENCIES = ../src/libgetdata.la
+version_3_write_SOURCES = version_3_write.c
+version_3_write_OBJECTS = version_3_write.$(OBJEXT)
+version_3_write_LDADD = $(LDADD)
+version_3_write_DEPENDENCIES = ../src/libgetdata.la
+version_4_SOURCES = version_4.c
+version_4_OBJECTS = version_4.$(OBJEXT)
+version_4_LDADD = $(LDADD)
+version_4_DEPENDENCIES = ../src/libgetdata.la
+version_4_write_SOURCES = version_4_write.c
+version_4_write_OBJECTS = version_4_write.$(OBJEXT)
+version_4_write_LDADD = $(LDADD)
+version_4_write_DEPENDENCIES = ../src/libgetdata.la
+version_5_SOURCES = version_5.c
+version_5_OBJECTS = version_5.$(OBJEXT)
+version_5_LDADD = $(LDADD)
+version_5_DEPENDENCIES = ../src/libgetdata.la
+version_5_strict_SOURCES = version_5_strict.c
+version_5_strict_OBJECTS = version_5_strict.$(OBJEXT)
+version_5_strict_LDADD = $(LDADD)
+version_5_strict_DEPENDENCIES = ../src/libgetdata.la
+version_5_write_SOURCES = version_5_write.c
+version_5_write_OBJECTS = version_5_write.$(OBJEXT)
+version_5_write_LDADD = $(LDADD)
+version_5_write_DEPENDENCIES = ../src/libgetdata.la
+version_6_SOURCES = version_6.c
+version_6_OBJECTS = version_6.$(OBJEXT)
+version_6_LDADD = $(LDADD)
+version_6_DEPENDENCIES = ../src/libgetdata.la
+version_6_strict_SOURCES = version_6_strict.c
+version_6_strict_OBJECTS = version_6_strict.$(OBJEXT)
+version_6_strict_LDADD = $(LDADD)
+version_6_strict_DEPENDENCIES = ../src/libgetdata.la
+version_6_write_SOURCES = version_6_write.c
+version_6_write_OBJECTS = version_6_write.$(OBJEXT)
+version_6_write_LDADD = $(LDADD)
+version_6_write_DEPENDENCIES = ../src/libgetdata.la
+version_7_SOURCES = version_7.c
+version_7_OBJECTS = version_7.$(OBJEXT)
+version_7_LDADD = $(LDADD)
+version_7_DEPENDENCIES = ../src/libgetdata.la
+version_7_strict_SOURCES = version_7_strict.c
+version_7_strict_OBJECTS = version_7_strict.$(OBJEXT)
+version_7_strict_LDADD = $(LDADD)
+version_7_strict_DEPENDENCIES = ../src/libgetdata.la
+version_7_write_SOURCES = version_7_write.c
+version_7_write_OBJECTS = version_7_write.$(OBJEXT)
+version_7_write_LDADD = $(LDADD)
+version_7_write_DEPENDENCIES = ../src/libgetdata.la
+version_8_SOURCES = version_8.c
+version_8_OBJECTS = version_8.$(OBJEXT)
+version_8_LDADD = $(LDADD)
+version_8_DEPENDENCIES = ../src/libgetdata.la
+version_8_strict_SOURCES = version_8_strict.c
+version_8_strict_OBJECTS = version_8_strict.$(OBJEXT)
+version_8_strict_LDADD = $(LDADD)
+version_8_strict_DEPENDENCIES = ../src/libgetdata.la
+version_8_write_SOURCES = version_8_write.c
+version_8_write_OBJECTS = version_8_write.$(OBJEXT)
+version_8_write_LDADD = $(LDADD)
+version_8_write_DEPENDENCIES = ../src/libgetdata.la
+version_9_SOURCES = version_9.c
+version_9_OBJECTS = version_9.$(OBJEXT)
+version_9_LDADD = $(LDADD)
+version_9_DEPENDENCIES = ../src/libgetdata.la
+version_9_strict_SOURCES = version_9_strict.c
+version_9_strict_OBJECTS = version_9_strict.$(OBJEXT)
+version_9_strict_LDADD = $(LDADD)
+version_9_strict_DEPENDENCIES = ../src/libgetdata.la
+version_9_write_SOURCES = version_9_write.c
+version_9_write_OBJECTS = version_9_write.$(OBJEXT)
+version_9_write_LDADD = $(LDADD)
+version_9_write_DEPENDENCIES = ../src/libgetdata.la
+vlist_SOURCES = vlist.c
+vlist_OBJECTS = vlist.$(OBJEXT)
+vlist_LDADD = $(LDADD)
+vlist_DEPENDENCIES = ../src/libgetdata.la
+vlist_alias_SOURCES = vlist_alias.c
+vlist_alias_OBJECTS = vlist_alias.$(OBJEXT)
+vlist_alias_LDADD = $(LDADD)
+vlist_alias_DEPENDENCIES = ../src/libgetdata.la
+vlist_hidden_SOURCES = vlist_hidden.c
+vlist_hidden_OBJECTS = vlist_hidden.$(OBJEXT)
+vlist_hidden_LDADD = $(LDADD)
+vlist_hidden_DEPENDENCIES = ../src/libgetdata.la
+vlist_invalid_SOURCES = vlist_invalid.c
+vlist_invalid_OBJECTS = vlist_invalid.$(OBJEXT)
+vlist_invalid_LDADD = $(LDADD)
+vlist_invalid_DEPENDENCIES = ../src/libgetdata.la
+vlist_meta_SOURCES = vlist_meta.c
+vlist_meta_OBJECTS = vlist_meta.$(OBJEXT)
+vlist_meta_LDADD = $(LDADD)
+vlist_meta_DEPENDENCIES = ../src/libgetdata.la
+vlist_meta_hidden_SOURCES = vlist_meta_hidden.c
+vlist_meta_hidden_OBJECTS = vlist_meta_hidden.$(OBJEXT)
+vlist_meta_hidden_LDADD = $(LDADD)
+vlist_meta_hidden_DEPENDENCIES = ../src/libgetdata.la
+vlist_meta_invalid_SOURCES = vlist_meta_invalid.c
+vlist_meta_invalid_OBJECTS = vlist_meta_invalid.$(OBJEXT)
+vlist_meta_invalid_LDADD = $(LDADD)
+vlist_meta_invalid_DEPENDENCIES = ../src/libgetdata.la
+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)
+zzip_data_DEPENDENCIES = ../src/libgetdata.la
+zzip_get_SOURCES = zzip_get.c
+zzip_get_OBJECTS = zzip_get.$(OBJEXT)
+zzip_get_LDADD = $(LDADD)
+zzip_get_DEPENDENCIES = ../src/libgetdata.la
+zzip_get_get_SOURCES = zzip_get_get.c
+zzip_get_get_OBJECTS = zzip_get_get.$(OBJEXT)
+zzip_get_get_LDADD = $(LDADD)
+zzip_get_get_DEPENDENCIES = ../src/libgetdata.la
+zzip_nframes_SOURCES = zzip_nframes.c
+zzip_nframes_OBJECTS = zzip_nframes.$(OBJEXT)
+zzip_nframes_LDADD = $(LDADD)
+zzip_nframes_DEPENDENCIES = ../src/libgetdata.la
+zzslim_get_SOURCES = zzslim_get.c
+zzslim_get_OBJECTS = zzslim_get.$(OBJEXT)
+zzslim_get_LDADD = $(LDADD)
+zzslim_get_DEPENDENCIES = ../src/libgetdata.la
+zzslim_nframes_SOURCES = zzslim_nframes.c
+zzslim_nframes_OBJECTS = zzslim_nframes.$(OBJEXT)
+zzslim_nframes_LDADD = $(LDADD)
+zzslim_nframes_DEPENDENCIES = ../src/libgetdata.la
+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 = 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 \
+	add_raw_type.c add_rdonly.c add_recip.c add_resolv.c \
+	add_sbit.c add_scalar.c add_scalar_carray.c \
+	add_scalar_carray_bad.c add_sort.c add_spec.c \
+	add_spec_directive.c add_spec_invalid.c add_spec_meta.c \
+	add_spec_resolv.c add_string.c add_string_affix.c add_type.c \
+	add_window.c add_window_op.c alias_list.c alias_list_alias.c \
+	alias_list_missing.c alias_num.c alias_num_alias.c \
+	alias_num_missing.c alias_target.c alias_target_alias.c \
+	alias_target_missing.c alter_bit_bitnum.c alter_bit_numbits.c \
+	alter_carray_len.c alter_carray_type.c alter_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_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_lincom_offset.c alter_lincom_slope.c alter_linterp.c \
+	alter_linterp_move.c alter_mplex.c alter_mspec.c \
+	alter_mspec_affix.c alter_multiply.c alter_phase.c \
+	alter_polynom_coeff.c alter_polynom_input.c \
+	alter_polynom_ord.c alter_raw_spf.c alter_raw_type.c \
+	alter_recip.c alter_recip_zero.c alter_scalar_affix.c \
+	alter_spec.c alter_spec_affix.c alter_spec_meta.c \
+	alter_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 \
+	convert_int8_uint16.c convert_int8_uint32.c \
+	convert_int8_uint64.c convert_int8_uint8.c \
+	convert_uint16_complex128.c convert_uint16_complex64.c \
+	convert_uint16_float32.c convert_uint16_float64.c \
+	convert_uint16_int16.c convert_uint16_int32.c \
+	convert_uint16_int64.c convert_uint16_int8.c \
+	convert_uint16_uint32.c convert_uint16_uint64.c \
+	convert_uint16_uint8.c convert_uint32_complex128.c \
+	convert_uint32_complex64.c convert_uint32_float32.c \
+	convert_uint32_float64.c convert_uint32_int16.c \
+	convert_uint32_int32.c convert_uint32_int64.c \
+	convert_uint32_int8.c convert_uint32_uint16.c \
+	convert_uint32_uint64.c convert_uint32_uint8.c \
+	convert_uint64_complex128.c convert_uint64_complex64.c \
+	convert_uint64_float32.c convert_uint64_float64.c \
+	convert_uint64_int16.c convert_uint64_int32.c \
+	convert_uint64_int64.c convert_uint64_int8.c \
+	convert_uint64_uint16.c convert_uint64_uint32.c \
+	convert_uint64_uint8.c convert_uint8_complex128.c \
+	convert_uint8_complex64.c convert_uint8_float32.c \
+	convert_uint8_float64.c convert_uint8_int16.c \
+	convert_uint8_int32.c convert_uint8_int64.c \
+	convert_uint8_int8.c convert_uint8_uint16.c \
+	convert_uint8_uint32.c convert_uint8_uint64.c creat.c \
+	creat_excl.c creat_rdonly.c cvlist.c cvlist_array.c \
+	cvlist_array_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 \
+	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 \
+	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 \
+	get_const_complex.c get_const_repr.c get_cpolynom.c \
+	get_cpolynom1.c get_cpolynom_int.c get_divide.c \
+	get_divide_ccin.c get_divide_crin.c get_divide_crinr.c \
+	get_divide_rcin.c get_divide_s.c get_endian16.c get_endian32.c \
+	get_endian64.c get_endian8.c get_endian_complex128_arm.c \
+	get_endian_complex128_big.c get_endian_complex128_little.c \
+	get_endian_complex64_arm.c get_endian_complex64_big.c \
+	get_endian_complex64_little.c get_endian_float32_arm.c \
+	get_endian_float32_big.c get_endian_float32_little.c \
+	get_endian_float64_arm.c get_endian_float64_big.c \
+	get_endian_float64_little.c get_ff.c get_float32.c \
+	get_float64.c get_foffs.c get_foffs2.c get_fs.c get_here.c \
+	get_here_foffs.c get_heres.c get_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_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_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 \
+	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 \
+	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 \
+	madd_alias.c madd_alias_affix.c madd_bit.c madd_bit_invalid.c \
+	madd_carray.c madd_clincom.c madd_const.c madd_cpolynom.c \
+	madd_crecip.c madd_crecip89.c madd_divide.c madd_index.c \
+	madd_lincom.c madd_lincom_invalid.c madd_linterp.c \
+	madd_linterp_invalid.c madd_mplex.c madd_multiply.c \
+	madd_multiply_invalid.c madd_phase.c madd_phase_invalid.c \
+	madd_polynom.c madd_recip.c madd_sbit.c madd_spec.c \
+	madd_spec_directive.c madd_spec_invalid.c madd_spec_resolv.c \
+	madd_string.c madd_window.c move.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 \
+	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 \
+	parse_bit_bitsize.c parse_bit_ncols.c parse_bit_numbits.c \
+	parse_bit_scalar.c parse_carray.c parse_carray_long.c \
+	parse_const.c parse_const_complex.c parse_const_ncols.c \
+	parse_divide.c parse_double.c parse_duplicate.c \
+	parse_duplicate_ignore.c parse_endian_bad.c parse_endian_big.c \
+	parse_endian_force.c parse_endian_little.c \
+	parse_endian_slash.c parse_eol.c parse_foffs.c \
+	parse_foffs_include.c parse_foffs_slash.c parse_hex.c \
+	parse_hidden.c parse_hidden_field.c parse_hidden_meta.c \
+	parse_include.c parse_include_absolute.c \
+	parse_include_absrel.c parse_include_affix_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 \
+	put_endian64.c put_endian8.c put_endian_complex128_arm.c \
+	put_endian_complex128_big.c put_endian_complex128_little.c \
+	put_endian_complex64_arm.c put_endian_complex64_big.c \
+	put_endian_complex64_little.c put_endian_float32_arm.c \
+	put_endian_float32_big.c put_endian_float32_little.c \
+	put_endian_float64_arm.c put_endian_float64_big.c \
+	put_endian_float64_little.c put_ff.c put_float32.c \
+	put_float64.c put_foffs.c put_fs.c put_here.c put_heres.c \
+	put_int16.c put_int32.c put_int64.c put_int8.c put_invalid.c \
+	put_lincom1.c put_lincom2.c put_lincom_noin.c put_linterp.c \
+	put_linterp_noin.c put_linterp_nomono.c put_linterp_notab.c \
+	put_linterp_reverse.c put_mplex.c put_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 \
+	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 \
+	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 \
+	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 \
+	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 \
+	add_raw_type.c add_rdonly.c add_recip.c add_resolv.c \
+	add_sbit.c add_scalar.c add_scalar_carray.c \
+	add_scalar_carray_bad.c add_sort.c add_spec.c \
+	add_spec_directive.c add_spec_invalid.c add_spec_meta.c \
+	add_spec_resolv.c add_string.c add_string_affix.c add_type.c \
+	add_window.c add_window_op.c alias_list.c alias_list_alias.c \
+	alias_list_missing.c alias_num.c alias_num_alias.c \
+	alias_num_missing.c alias_target.c alias_target_alias.c \
+	alias_target_missing.c alter_bit_bitnum.c alter_bit_numbits.c \
+	alter_carray_len.c alter_carray_type.c alter_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_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_lincom_offset.c alter_lincom_slope.c alter_linterp.c \
+	alter_linterp_move.c alter_mplex.c alter_mspec.c \
+	alter_mspec_affix.c alter_multiply.c alter_phase.c \
+	alter_polynom_coeff.c alter_polynom_input.c \
+	alter_polynom_ord.c alter_raw_spf.c alter_raw_type.c \
+	alter_recip.c alter_recip_zero.c alter_scalar_affix.c \
+	alter_spec.c alter_spec_affix.c alter_spec_meta.c \
+	alter_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 \
+	convert_int8_uint16.c convert_int8_uint32.c \
+	convert_int8_uint64.c convert_int8_uint8.c \
+	convert_uint16_complex128.c convert_uint16_complex64.c \
+	convert_uint16_float32.c convert_uint16_float64.c \
+	convert_uint16_int16.c convert_uint16_int32.c \
+	convert_uint16_int64.c convert_uint16_int8.c \
+	convert_uint16_uint32.c convert_uint16_uint64.c \
+	convert_uint16_uint8.c convert_uint32_complex128.c \
+	convert_uint32_complex64.c convert_uint32_float32.c \
+	convert_uint32_float64.c convert_uint32_int16.c \
+	convert_uint32_int32.c convert_uint32_int64.c \
+	convert_uint32_int8.c convert_uint32_uint16.c \
+	convert_uint32_uint64.c convert_uint32_uint8.c \
+	convert_uint64_complex128.c convert_uint64_complex64.c \
+	convert_uint64_float32.c convert_uint64_float64.c \
+	convert_uint64_int16.c convert_uint64_int32.c \
+	convert_uint64_int64.c convert_uint64_int8.c \
+	convert_uint64_uint16.c convert_uint64_uint32.c \
+	convert_uint64_uint8.c convert_uint8_complex128.c \
+	convert_uint8_complex64.c convert_uint8_float32.c \
+	convert_uint8_float64.c convert_uint8_int16.c \
+	convert_uint8_int32.c convert_uint8_int64.c \
+	convert_uint8_int8.c convert_uint8_uint16.c \
+	convert_uint8_uint32.c convert_uint8_uint64.c creat.c \
+	creat_excl.c creat_rdonly.c cvlist.c cvlist_array.c \
+	cvlist_array_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 \
+	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 \
+	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 \
+	get_const_complex.c get_const_repr.c get_cpolynom.c \
+	get_cpolynom1.c get_cpolynom_int.c get_divide.c \
+	get_divide_ccin.c get_divide_crin.c get_divide_crinr.c \
+	get_divide_rcin.c get_divide_s.c get_endian16.c get_endian32.c \
+	get_endian64.c get_endian8.c get_endian_complex128_arm.c \
+	get_endian_complex128_big.c get_endian_complex128_little.c \
+	get_endian_complex64_arm.c get_endian_complex64_big.c \
+	get_endian_complex64_little.c get_endian_float32_arm.c \
+	get_endian_float32_big.c get_endian_float32_little.c \
+	get_endian_float64_arm.c get_endian_float64_big.c \
+	get_endian_float64_little.c get_ff.c get_float32.c \
+	get_float64.c get_foffs.c get_foffs2.c get_fs.c get_here.c \
+	get_here_foffs.c get_heres.c get_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_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_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 \
+	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 \
+	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 \
+	madd_alias.c madd_alias_affix.c madd_bit.c madd_bit_invalid.c \
+	madd_carray.c madd_clincom.c madd_const.c madd_cpolynom.c \
+	madd_crecip.c madd_crecip89.c madd_divide.c madd_index.c \
+	madd_lincom.c madd_lincom_invalid.c madd_linterp.c \
+	madd_linterp_invalid.c madd_mplex.c madd_multiply.c \
+	madd_multiply_invalid.c madd_phase.c madd_phase_invalid.c \
+	madd_polynom.c madd_recip.c madd_sbit.c madd_spec.c \
+	madd_spec_directive.c madd_spec_invalid.c madd_spec_resolv.c \
+	madd_string.c madd_window.c move.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 \
+	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 \
+	parse_bit_bitsize.c parse_bit_ncols.c parse_bit_numbits.c \
+	parse_bit_scalar.c parse_carray.c parse_carray_long.c \
+	parse_const.c parse_const_complex.c parse_const_ncols.c \
+	parse_divide.c parse_double.c parse_duplicate.c \
+	parse_duplicate_ignore.c parse_endian_bad.c parse_endian_big.c \
+	parse_endian_force.c parse_endian_little.c \
+	parse_endian_slash.c parse_eol.c parse_foffs.c \
+	parse_foffs_include.c parse_foffs_slash.c parse_hex.c \
+	parse_hidden.c parse_hidden_field.c parse_hidden_meta.c \
+	parse_include.c parse_include_absolute.c \
+	parse_include_absrel.c parse_include_affix_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 \
+	put_endian64.c put_endian8.c put_endian_complex128_arm.c \
+	put_endian_complex128_big.c put_endian_complex128_little.c \
+	put_endian_complex64_arm.c put_endian_complex64_big.c \
+	put_endian_complex64_little.c put_endian_float32_arm.c \
+	put_endian_float32_big.c put_endian_float32_little.c \
+	put_endian_float64_arm.c put_endian_float64_big.c \
+	put_endian_float64_little.c put_ff.c put_float32.c \
+	put_float64.c put_foffs.c put_fs.c put_here.c put_heres.c \
+	put_int16.c put_int32.c put_int64.c put_int8.c put_invalid.c \
+	put_lincom1.c put_lincom2.c put_lincom_noin.c put_linterp.c \
+	put_linterp_noin.c put_linterp_nomono.c put_linterp_notab.c \
+	put_linterp_reverse.c put_mplex.c put_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 \
+	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 \
+	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 \
+	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 \
+	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
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# (C) 2008-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
+#
+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
+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_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_spec_directive add_spec_invalid add_spec_meta add_spec_resolv \
+					add_string add_string_affix add_type add_window add_window_op
+
+ALIAS_TESTS = alias_list alias_list_alias alias_list_missing alias_num \
+						alias_num_alias alias_num_missing alias_target alias_target_alias \
+						alias_target_missing
+
+ALTER_TESTS = alter_bit_bitnum alter_bit_numbits alter_carray_len \
+						alter_carray_type alter_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_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
+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
+
+CLOSE_TESTS = close close_bad close_discard close_null
+CONVERT_TESTS = convert_complex128_complex64 convert_complex128_float64 \
+							convert_complex128_int64 convert_complex128_uint64 \
+							convert_complex64_complex128 convert_complex64_float64 \
+							convert_complex64_int64 convert_complex64_uint64 \
+							convert_float32_complex128 convert_float32_complex64 \
+							convert_float32_float64 convert_float32_int16 \
+							convert_float32_int32 convert_float32_int64 convert_float32_int8 \
+							convert_float32_uint16 convert_float32_uint32 \
+							convert_float32_uint64 convert_float32_uint8 \
+							convert_float64_complex128 convert_float64_complex64 \
+							convert_float64_float32 convert_float64_int16 \
+							convert_float64_int32 convert_float64_int64 convert_float64_int8 \
+							convert_float64_uint16 convert_float64_uint32 \
+							convert_float64_uint64 convert_float64_uint8 \
+							convert_int16_complex128 convert_int16_complex64 \
+							convert_int16_float32 convert_int16_float64 convert_int16_int32 \
+							convert_int16_int64 convert_int16_int8 convert_int16_uint16 \
+							convert_int16_uint32 convert_int16_uint64 convert_int16_uint8 \
+							convert_int32_complex128 convert_int32_complex64 \
+							convert_int32_float32 convert_int32_float64 convert_int32_int16 \
+							convert_int32_int64 convert_int32_int8 convert_int32_uint16 \
+							convert_int32_uint32 convert_int32_uint64 convert_int32_uint8 \
+							convert_int64_complex128 convert_int64_complex64 \
+							convert_int64_float32 convert_int64_float64 convert_int64_int16 \
+							convert_int64_int32 convert_int64_int8 convert_int64_uint16 \
+							convert_int64_uint32 convert_int64_uint64 convert_int64_uint8 \
+							convert_int8_complex128 convert_int8_complex64 \
+							convert_int8_float32 convert_int8_float64 convert_int8_int16 \
+							convert_int8_int32 convert_int8_int64 convert_int8_uint16 \
+							convert_int8_uint32 convert_int8_uint64 convert_int8_uint8 \
+							convert_uint16_complex128 convert_uint16_complex64 \
+							convert_uint16_float32 convert_uint16_float64 \
+							convert_uint16_int16 convert_uint16_int32 convert_uint16_int64 \
+							convert_uint16_int8 convert_uint16_uint32 convert_uint16_uint64 \
+							convert_uint16_uint8 convert_uint32_complex128 \
+							convert_uint32_complex64 convert_uint32_float32 \
+							convert_uint32_float64 convert_uint32_int16 convert_uint32_int32 \
+							convert_uint32_int64 convert_uint32_int8 convert_uint32_uint16 \
+							convert_uint32_uint64 convert_uint32_uint8 \
+							convert_uint64_complex128 convert_uint64_complex64 \
+							convert_uint64_float32 convert_uint64_float64 \
+							convert_uint64_int16 convert_uint64_int32 convert_uint64_int64 \
+							convert_uint64_int8 convert_uint64_uint16 convert_uint64_uint32 \
+							convert_uint64_uint8 convert_uint8_complex128 \
+							convert_uint8_complex64 convert_uint8_float32 \
+							convert_uint8_float64 convert_uint8_int16 convert_uint8_int32 \
+							convert_uint8_int64 convert_uint8_int8 convert_uint8_uint16 \
+							convert_uint8_uint32 convert_uint8_uint64
+
+CREAT_TESTS = creat creat_excl creat_rdonly
+DEL_TESTS = del del_carray del_carray_deref del_const del_const_deref \
+					del_const_force del_data del_derived del_derived_after \
+					del_derived_force del_meta del_meta_force
+
+DFES_TESTS = dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \
+					 dfes_null dfes_phase dfes_raw dfes_recip dfes_zero
+
+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
+ENTRY_TESTS = entry_bad_code entry_bit entry_bit_scalar entry_divide \
+						entry_invalid entry_lincom entry_lincom_scalar entry_linterp \
+						entry_mplex entry_mplex_scalar entry_multiply entry_phase \
+						entry_phase_scalar entry_polynom entry_polynom_scalar entry_raw \
+						entry_raw_scalar entry_raw_scalar_code entry_raw_scalar_type \
+						entry_scalar_repr entry_recip entry_type entry_type_alias \
+						entry_window entry_window_scalar
+
+EOF_TESTS = eof eof_index eof_lincom eof_phase
+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
+
+FLUSH_TESTS = flush flush_all flush_bad_code flush_hex flush_invalid flush_meta \
+						flush_ref flush_spec
+
+FOFFS_TESTS = foffs_alter foffs_get foffs_move
+FRAGMENT_TESTS = fragment_affix fragment_affix_alter fragment_affix_alter2 \
+							 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_endian64 get_endian_complex128_arm get_endian_complex128_big \
+					get_endian_complex128_little get_endian_complex64_arm \
+					get_endian_complex64_big get_endian_complex64_little \
+					get_endian_float32_arm get_endian_float32_big \
+					get_endian_float32_little get_endian_float64_arm \
+					get_endian_float64_big get_endian_float64_little get_ff get_float32 \
+					get_float64 get_foffs get_foffs2 get_fs get_here get_here_foffs \
+					get_heres \
+					get_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_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
+
+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
+
+HEADER_TESTS = header_complex
+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
+
+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
+
+NENTRIES_TESTS = nentries_alias nentries_hidden nentries_noalias nentries_scalar
+NFIELDS_TESTS = nfields nfields_hidden nfields_invalid 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_off64 nframes_spf
+
+NMETA_TESTS = nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \
+						nmeta_type_hidden nmeta_type_invalid nmeta_type_parent \
+						nmeta_vectors nmeta_vectors_del nmeta_vectors_hidden \
+						nmeta_vectors_invalid nmeta_vectors_parent
+
+OPEN_TESTS = open 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
+
+PARSE_TESTS = parse_alias parse_alias_code parse_alias_dup parse_alias_meta \
+						parse_alias_missing parse_badline parse_bit parse_bit4 \
+						parse_bit_bitnum parse_bit_bitsize parse_bit_ncols \
+						parse_bit_numbits parse_bit_scalar parse_carray parse_carray_long \
+						parse_const parse_const_complex parse_const_ncols parse_divide \
+						parse_double parse_duplicate parse_duplicate_ignore \
+						parse_endian_bad parse_endian_big parse_endian_force \
+						parse_endian_little parse_endian_slash parse_eol parse_foffs \
+						parse_foffs_include parse_foffs_slash parse_hex parse_hidden \
+						parse_hidden_field parse_hidden_meta parse_include \
+						parse_include_absolute parse_include_absrel \
+						parse_include_affix_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_multiply parse_multiply_ncols parse_name parse_name_dot \
+						parse_name_ext parse_name_pedantic parse_ncols parse_phase \
+						parse_phase_ncols parse_phase_scalar parse_polynom \
+						parse_polynom_ncols1 parse_polynom_ncols2 parse_polynom_scalar \
+						parse_protect_all parse_protect_bad parse_protect_data \
+						parse_protect_format parse_protect_none parse_quote \
+						parse_quote_mismatch parse_raw parse_raw_char parse_raw_ncols \
+						parse_raw_scalar parse_raw_spf parse_raw_type parse_recip \
+						parse_ref parse_ref_nonexistent parse_sbit parse_sort parse_string \
+						parse_string_ncols parse_string_null parse_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 \
+					put_endian_complex128_arm put_endian_complex128_big \
+					put_endian_complex128_little put_endian_complex64_arm \
+					put_endian_complex64_big put_endian_complex64_little \
+					put_endian_float32_arm put_endian_float32_big \
+					put_endian_float32_little put_endian_float64_arm \
+					put_endian_float64_big put_endian_float64_little put_ff put_float32 \
+					put_float64 put_foffs put_fs put_here put_heres put_int8 put_int16 \
+					put_int32 put_int64 put_invalid put_lincom1 put_lincom2 \
+					put_lincom_noin put_linterp put_linterp_noin put_linterp_nomono \
+					put_linterp_notab put_linterp_reverse put_mplex put_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
+
+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
+
+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_put_pad sie_put_pad0 sie_put_trunc sie_put_trunc2 \
+					sie_put_trunc_nf sie_sync
+
+SLIM_TESTS = slim_get slim_nframes
+SVLIST_TESTS = svlist svlist_hidden svlist_invalid svlist_meta \
+						 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
+
+TABLE_TESTS = table table_code table_type
+TELL_TESTS = tell tell64 tell_multidiv
+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
+VERSION_TESTS = version_0 version_0_write version_1 version_1_write version_2 \
+							version_2_write version_3 version_3_write version_4 \
+							version_4_write version_5 version_5_strict version_5_write \
+							version_6 version_6_strict version_6_write version_7 \
+							version_7_strict version_7_write version_8 version_8_strict \
+							version_8_write version_9 version_9_strict version_9_write
+
+VLIST_TESTS = vlist vlist_alias vlist_hidden vlist_invalid vlist_meta \
+						vlist_meta_hidden vlist_meta_invalid
+
+XZ_TESTS = xz_get xz_nframes
+ZZIP_TESTS = zzip_data zzip_get zzip_get_get zzip_nframes
+ZZSLIM_TESTS = zzslim_get zzslim_nframes
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+add$(EXEEXT): $(add_OBJECTS) $(add_DEPENDENCIES) $(EXTRA_add_DEPENDENCIES) 
+	@rm -f add$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_OBJECTS) $(add_LDADD) $(LIBS)
+
+add_affix$(EXEEXT): $(add_affix_OBJECTS) $(add_affix_DEPENDENCIES) $(EXTRA_add_affix_DEPENDENCIES) 
+	@rm -f add_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_affix_OBJECTS) $(add_affix_LDADD) $(LIBS)
+
+add_alias$(EXEEXT): $(add_alias_OBJECTS) $(add_alias_DEPENDENCIES) $(EXTRA_add_alias_DEPENDENCIES) 
+	@rm -f add_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_alias_OBJECTS) $(add_alias_LDADD) $(LIBS)
+
+add_alias_affix$(EXEEXT): $(add_alias_affix_OBJECTS) $(add_alias_affix_DEPENDENCIES) $(EXTRA_add_alias_affix_DEPENDENCIES) 
+	@rm -f add_alias_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_alias_affix_OBJECTS) $(add_alias_affix_LDADD) $(LIBS)
+
+add_alias_meta$(EXEEXT): $(add_alias_meta_OBJECTS) $(add_alias_meta_DEPENDENCIES) $(EXTRA_add_alias_meta_DEPENDENCIES) 
+	@rm -f add_alias_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_alias_meta_OBJECTS) $(add_alias_meta_LDADD) $(LIBS)
+
+add_bit$(EXEEXT): $(add_bit_OBJECTS) $(add_bit_DEPENDENCIES) $(EXTRA_add_bit_DEPENDENCIES) 
+	@rm -f add_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_bit_OBJECTS) $(add_bit_LDADD) $(LIBS)
+
+add_bit_bitnum$(EXEEXT): $(add_bit_bitnum_OBJECTS) $(add_bit_bitnum_DEPENDENCIES) $(EXTRA_add_bit_bitnum_DEPENDENCIES) 
+	@rm -f add_bit_bitnum$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_bit_bitnum_OBJECTS) $(add_bit_bitnum_LDADD) $(LIBS)
+
+add_bit_bitsize$(EXEEXT): $(add_bit_bitsize_OBJECTS) $(add_bit_bitsize_DEPENDENCIES) $(EXTRA_add_bit_bitsize_DEPENDENCIES) 
+	@rm -f add_bit_bitsize$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_bit_bitsize_OBJECTS) $(add_bit_bitsize_LDADD) $(LIBS)
+
+add_bit_invalid$(EXEEXT): $(add_bit_invalid_OBJECTS) $(add_bit_invalid_DEPENDENCIES) $(EXTRA_add_bit_invalid_DEPENDENCIES) 
+	@rm -f add_bit_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_bit_invalid_OBJECTS) $(add_bit_invalid_LDADD) $(LIBS)
+
+add_bit_numbits$(EXEEXT): $(add_bit_numbits_OBJECTS) $(add_bit_numbits_DEPENDENCIES) $(EXTRA_add_bit_numbits_DEPENDENCIES) 
+	@rm -f add_bit_numbits$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_bit_numbits_OBJECTS) $(add_bit_numbits_LDADD) $(LIBS)
+
+add_bit_scalars$(EXEEXT): $(add_bit_scalars_OBJECTS) $(add_bit_scalars_DEPENDENCIES) $(EXTRA_add_bit_scalars_DEPENDENCIES) 
+	@rm -f add_bit_scalars$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_bit_scalars_OBJECTS) $(add_bit_scalars_LDADD) $(LIBS)
+
+add_carray$(EXEEXT): $(add_carray_OBJECTS) $(add_carray_DEPENDENCIES) $(EXTRA_add_carray_DEPENDENCIES) 
+	@rm -f add_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_carray_OBJECTS) $(add_carray_LDADD) $(LIBS)
+
+add_clincom$(EXEEXT): $(add_clincom_OBJECTS) $(add_clincom_DEPENDENCIES) $(EXTRA_add_clincom_DEPENDENCIES) 
+	@rm -f add_clincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_clincom_OBJECTS) $(add_clincom_LDADD) $(LIBS)
+
+add_code$(EXEEXT): $(add_code_OBJECTS) $(add_code_DEPENDENCIES) $(EXTRA_add_code_DEPENDENCIES) 
+	@rm -f add_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_code_OBJECTS) $(add_code_LDADD) $(LIBS)
+
+add_const$(EXEEXT): $(add_const_OBJECTS) $(add_const_DEPENDENCIES) $(EXTRA_add_const_DEPENDENCIES) 
+	@rm -f add_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_const_OBJECTS) $(add_const_LDADD) $(LIBS)
+
+add_cpolynom$(EXEEXT): $(add_cpolynom_OBJECTS) $(add_cpolynom_DEPENDENCIES) $(EXTRA_add_cpolynom_DEPENDENCIES) 
+	@rm -f add_cpolynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_cpolynom_OBJECTS) $(add_cpolynom_LDADD) $(LIBS)
+
+add_crecip$(EXEEXT): $(add_crecip_OBJECTS) $(add_crecip_DEPENDENCIES) $(EXTRA_add_crecip_DEPENDENCIES) 
+	@rm -f add_crecip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_crecip_OBJECTS) $(add_crecip_LDADD) $(LIBS)
+
+add_crecip89$(EXEEXT): $(add_crecip89_OBJECTS) $(add_crecip89_DEPENDENCIES) $(EXTRA_add_crecip89_DEPENDENCIES) 
+	@rm -f add_crecip89$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_crecip89_OBJECTS) $(add_crecip89_LDADD) $(LIBS)
+
+add_dangle_dup$(EXEEXT): $(add_dangle_dup_OBJECTS) $(add_dangle_dup_DEPENDENCIES) $(EXTRA_add_dangle_dup_DEPENDENCIES) 
+	@rm -f add_dangle_dup$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_dangle_dup_OBJECTS) $(add_dangle_dup_LDADD) $(LIBS)
+
+add_divide$(EXEEXT): $(add_divide_OBJECTS) $(add_divide_DEPENDENCIES) $(EXTRA_add_divide_DEPENDENCIES) 
+	@rm -f add_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_divide_OBJECTS) $(add_divide_LDADD) $(LIBS)
+
+add_divide_invalid$(EXEEXT): $(add_divide_invalid_OBJECTS) $(add_divide_invalid_DEPENDENCIES) $(EXTRA_add_divide_invalid_DEPENDENCIES) 
+	@rm -f add_divide_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_divide_invalid_OBJECTS) $(add_divide_invalid_LDADD) $(LIBS)
+
+add_duplicate$(EXEEXT): $(add_duplicate_OBJECTS) $(add_duplicate_DEPENDENCIES) $(EXTRA_add_duplicate_DEPENDENCIES) 
+	@rm -f add_duplicate$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_duplicate_OBJECTS) $(add_duplicate_LDADD) $(LIBS)
+
+add_format$(EXEEXT): $(add_format_OBJECTS) $(add_format_DEPENDENCIES) $(EXTRA_add_format_DEPENDENCIES) 
+	@rm -f add_format$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_format_OBJECTS) $(add_format_LDADD) $(LIBS)
+
+add_invalid$(EXEEXT): $(add_invalid_OBJECTS) $(add_invalid_DEPENDENCIES) $(EXTRA_add_invalid_DEPENDENCIES) 
+	@rm -f add_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_invalid_OBJECTS) $(add_invalid_LDADD) $(LIBS)
+
+add_lincom$(EXEEXT): $(add_lincom_OBJECTS) $(add_lincom_DEPENDENCIES) $(EXTRA_add_lincom_DEPENDENCIES) 
+	@rm -f add_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_lincom_OBJECTS) $(add_lincom_LDADD) $(LIBS)
+
+add_lincom_affix$(EXEEXT): $(add_lincom_affix_OBJECTS) $(add_lincom_affix_DEPENDENCIES) $(EXTRA_add_lincom_affix_DEPENDENCIES) 
+	@rm -f add_lincom_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_lincom_affix_OBJECTS) $(add_lincom_affix_LDADD) $(LIBS)
+
+add_lincom_invalid$(EXEEXT): $(add_lincom_invalid_OBJECTS) $(add_lincom_invalid_DEPENDENCIES) $(EXTRA_add_lincom_invalid_DEPENDENCIES) 
+	@rm -f add_lincom_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_lincom_invalid_OBJECTS) $(add_lincom_invalid_LDADD) $(LIBS)
+
+add_lincom_nfields$(EXEEXT): $(add_lincom_nfields_OBJECTS) $(add_lincom_nfields_DEPENDENCIES) $(EXTRA_add_lincom_nfields_DEPENDENCIES) 
+	@rm -f add_lincom_nfields$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_lincom_nfields_OBJECTS) $(add_lincom_nfields_LDADD) $(LIBS)
+
+add_linterp$(EXEEXT): $(add_linterp_OBJECTS) $(add_linterp_DEPENDENCIES) $(EXTRA_add_linterp_DEPENDENCIES) 
+	@rm -f add_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_linterp_OBJECTS) $(add_linterp_LDADD) $(LIBS)
+
+add_linterp_invalid$(EXEEXT): $(add_linterp_invalid_OBJECTS) $(add_linterp_invalid_DEPENDENCIES) $(EXTRA_add_linterp_invalid_DEPENDENCIES) 
+	@rm -f add_linterp_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_linterp_invalid_OBJECTS) $(add_linterp_invalid_LDADD) $(LIBS)
+
+add_meta$(EXEEXT): $(add_meta_OBJECTS) $(add_meta_DEPENDENCIES) $(EXTRA_add_meta_DEPENDENCIES) 
+	@rm -f add_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_meta_OBJECTS) $(add_meta_LDADD) $(LIBS)
+
+add_meta_alias$(EXEEXT): $(add_meta_alias_OBJECTS) $(add_meta_alias_DEPENDENCIES) $(EXTRA_add_meta_alias_DEPENDENCIES) 
+	@rm -f add_meta_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_meta_alias_OBJECTS) $(add_meta_alias_LDADD) $(LIBS)
+
+add_mplex$(EXEEXT): $(add_mplex_OBJECTS) $(add_mplex_DEPENDENCIES) $(EXTRA_add_mplex_DEPENDENCIES) 
+	@rm -f add_mplex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_mplex_OBJECTS) $(add_mplex_LDADD) $(LIBS)
+
+add_mplex_scalars$(EXEEXT): $(add_mplex_scalars_OBJECTS) $(add_mplex_scalars_DEPENDENCIES) $(EXTRA_add_mplex_scalars_DEPENDENCIES) 
+	@rm -f add_mplex_scalars$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_mplex_scalars_OBJECTS) $(add_mplex_scalars_LDADD) $(LIBS)
+
+add_multiply$(EXEEXT): $(add_multiply_OBJECTS) $(add_multiply_DEPENDENCIES) $(EXTRA_add_multiply_DEPENDENCIES) 
+	@rm -f add_multiply$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_multiply_OBJECTS) $(add_multiply_LDADD) $(LIBS)
+
+add_multiply_invalid$(EXEEXT): $(add_multiply_invalid_OBJECTS) $(add_multiply_invalid_DEPENDENCIES) $(EXTRA_add_multiply_invalid_DEPENDENCIES) 
+	@rm -f add_multiply_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_multiply_invalid_OBJECTS) $(add_multiply_invalid_LDADD) $(LIBS)
+
+add_phase$(EXEEXT): $(add_phase_OBJECTS) $(add_phase_DEPENDENCIES) $(EXTRA_add_phase_DEPENDENCIES) 
+	@rm -f add_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_phase_OBJECTS) $(add_phase_LDADD) $(LIBS)
+
+add_phase_invalid$(EXEEXT): $(add_phase_invalid_OBJECTS) $(add_phase_invalid_DEPENDENCIES) $(EXTRA_add_phase_invalid_DEPENDENCIES) 
+	@rm -f add_phase_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_phase_invalid_OBJECTS) $(add_phase_invalid_LDADD) $(LIBS)
+
+add_polynom$(EXEEXT): $(add_polynom_OBJECTS) $(add_polynom_DEPENDENCIES) $(EXTRA_add_polynom_DEPENDENCIES) 
+	@rm -f add_polynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_polynom_OBJECTS) $(add_polynom_LDADD) $(LIBS)
+
+add_polynom_scalar$(EXEEXT): $(add_polynom_scalar_OBJECTS) $(add_polynom_scalar_DEPENDENCIES) $(EXTRA_add_polynom_scalar_DEPENDENCIES) 
+	@rm -f add_polynom_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_polynom_scalar_OBJECTS) $(add_polynom_scalar_LDADD) $(LIBS)
+
+add_protect$(EXEEXT): $(add_protect_OBJECTS) $(add_protect_DEPENDENCIES) $(EXTRA_add_protect_DEPENDENCIES) 
+	@rm -f add_protect$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_protect_OBJECTS) $(add_protect_LDADD) $(LIBS)
+
+add_raw$(EXEEXT): $(add_raw_OBJECTS) $(add_raw_DEPENDENCIES) $(EXTRA_add_raw_DEPENDENCIES) 
+	@rm -f add_raw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_raw_OBJECTS) $(add_raw_LDADD) $(LIBS)
+
+add_raw_include$(EXEEXT): $(add_raw_include_OBJECTS) $(add_raw_include_DEPENDENCIES) $(EXTRA_add_raw_include_DEPENDENCIES) 
+	@rm -f add_raw_include$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_raw_include_OBJECTS) $(add_raw_include_LDADD) $(LIBS)
+
+add_raw_invalid$(EXEEXT): $(add_raw_invalid_OBJECTS) $(add_raw_invalid_DEPENDENCIES) $(EXTRA_add_raw_invalid_DEPENDENCIES) 
+	@rm -f add_raw_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_raw_invalid_OBJECTS) $(add_raw_invalid_LDADD) $(LIBS)
+
+add_raw_spf$(EXEEXT): $(add_raw_spf_OBJECTS) $(add_raw_spf_DEPENDENCIES) $(EXTRA_add_raw_spf_DEPENDENCIES) 
+	@rm -f add_raw_spf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_raw_spf_OBJECTS) $(add_raw_spf_LDADD) $(LIBS)
+
+add_raw_spf_scalar$(EXEEXT): $(add_raw_spf_scalar_OBJECTS) $(add_raw_spf_scalar_DEPENDENCIES) $(EXTRA_add_raw_spf_scalar_DEPENDENCIES) 
+	@rm -f add_raw_spf_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_raw_spf_scalar_OBJECTS) $(add_raw_spf_scalar_LDADD) $(LIBS)
+
+add_raw_type$(EXEEXT): $(add_raw_type_OBJECTS) $(add_raw_type_DEPENDENCIES) $(EXTRA_add_raw_type_DEPENDENCIES) 
+	@rm -f add_raw_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_raw_type_OBJECTS) $(add_raw_type_LDADD) $(LIBS)
+
+add_rdonly$(EXEEXT): $(add_rdonly_OBJECTS) $(add_rdonly_DEPENDENCIES) $(EXTRA_add_rdonly_DEPENDENCIES) 
+	@rm -f add_rdonly$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_rdonly_OBJECTS) $(add_rdonly_LDADD) $(LIBS)
+
+add_recip$(EXEEXT): $(add_recip_OBJECTS) $(add_recip_DEPENDENCIES) $(EXTRA_add_recip_DEPENDENCIES) 
+	@rm -f add_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_recip_OBJECTS) $(add_recip_LDADD) $(LIBS)
+
+add_resolv$(EXEEXT): $(add_resolv_OBJECTS) $(add_resolv_DEPENDENCIES) $(EXTRA_add_resolv_DEPENDENCIES) 
+	@rm -f add_resolv$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_resolv_OBJECTS) $(add_resolv_LDADD) $(LIBS)
+
+add_sbit$(EXEEXT): $(add_sbit_OBJECTS) $(add_sbit_DEPENDENCIES) $(EXTRA_add_sbit_DEPENDENCIES) 
+	@rm -f add_sbit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_sbit_OBJECTS) $(add_sbit_LDADD) $(LIBS)
+
+add_scalar$(EXEEXT): $(add_scalar_OBJECTS) $(add_scalar_DEPENDENCIES) $(EXTRA_add_scalar_DEPENDENCIES) 
+	@rm -f add_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_scalar_OBJECTS) $(add_scalar_LDADD) $(LIBS)
+
+add_scalar_carray$(EXEEXT): $(add_scalar_carray_OBJECTS) $(add_scalar_carray_DEPENDENCIES) $(EXTRA_add_scalar_carray_DEPENDENCIES) 
+	@rm -f add_scalar_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_scalar_carray_OBJECTS) $(add_scalar_carray_LDADD) $(LIBS)
+
+add_scalar_carray_bad$(EXEEXT): $(add_scalar_carray_bad_OBJECTS) $(add_scalar_carray_bad_DEPENDENCIES) $(EXTRA_add_scalar_carray_bad_DEPENDENCIES) 
+	@rm -f add_scalar_carray_bad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_scalar_carray_bad_OBJECTS) $(add_scalar_carray_bad_LDADD) $(LIBS)
+
+add_sort$(EXEEXT): $(add_sort_OBJECTS) $(add_sort_DEPENDENCIES) $(EXTRA_add_sort_DEPENDENCIES) 
+	@rm -f add_sort$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_sort_OBJECTS) $(add_sort_LDADD) $(LIBS)
+
+add_spec$(EXEEXT): $(add_spec_OBJECTS) $(add_spec_DEPENDENCIES) $(EXTRA_add_spec_DEPENDENCIES) 
+	@rm -f add_spec$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_spec_OBJECTS) $(add_spec_LDADD) $(LIBS)
+
+add_spec_directive$(EXEEXT): $(add_spec_directive_OBJECTS) $(add_spec_directive_DEPENDENCIES) $(EXTRA_add_spec_directive_DEPENDENCIES) 
+	@rm -f add_spec_directive$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_spec_directive_OBJECTS) $(add_spec_directive_LDADD) $(LIBS)
+
+add_spec_invalid$(EXEEXT): $(add_spec_invalid_OBJECTS) $(add_spec_invalid_DEPENDENCIES) $(EXTRA_add_spec_invalid_DEPENDENCIES) 
+	@rm -f add_spec_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_spec_invalid_OBJECTS) $(add_spec_invalid_LDADD) $(LIBS)
+
+add_spec_meta$(EXEEXT): $(add_spec_meta_OBJECTS) $(add_spec_meta_DEPENDENCIES) $(EXTRA_add_spec_meta_DEPENDENCIES) 
+	@rm -f add_spec_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_spec_meta_OBJECTS) $(add_spec_meta_LDADD) $(LIBS)
+
+add_spec_resolv$(EXEEXT): $(add_spec_resolv_OBJECTS) $(add_spec_resolv_DEPENDENCIES) $(EXTRA_add_spec_resolv_DEPENDENCIES) 
+	@rm -f add_spec_resolv$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_spec_resolv_OBJECTS) $(add_spec_resolv_LDADD) $(LIBS)
+
+add_string$(EXEEXT): $(add_string_OBJECTS) $(add_string_DEPENDENCIES) $(EXTRA_add_string_DEPENDENCIES) 
+	@rm -f add_string$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_string_OBJECTS) $(add_string_LDADD) $(LIBS)
+
+add_string_affix$(EXEEXT): $(add_string_affix_OBJECTS) $(add_string_affix_DEPENDENCIES) $(EXTRA_add_string_affix_DEPENDENCIES) 
+	@rm -f add_string_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_string_affix_OBJECTS) $(add_string_affix_LDADD) $(LIBS)
+
+add_type$(EXEEXT): $(add_type_OBJECTS) $(add_type_DEPENDENCIES) $(EXTRA_add_type_DEPENDENCIES) 
+	@rm -f add_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_type_OBJECTS) $(add_type_LDADD) $(LIBS)
+
+add_window$(EXEEXT): $(add_window_OBJECTS) $(add_window_DEPENDENCIES) $(EXTRA_add_window_DEPENDENCIES) 
+	@rm -f add_window$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_window_OBJECTS) $(add_window_LDADD) $(LIBS)
+
+add_window_op$(EXEEXT): $(add_window_op_OBJECTS) $(add_window_op_DEPENDENCIES) $(EXTRA_add_window_op_DEPENDENCIES) 
+	@rm -f add_window_op$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(add_window_op_OBJECTS) $(add_window_op_LDADD) $(LIBS)
+
+alias_list$(EXEEXT): $(alias_list_OBJECTS) $(alias_list_DEPENDENCIES) $(EXTRA_alias_list_DEPENDENCIES) 
+	@rm -f alias_list$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_list_OBJECTS) $(alias_list_LDADD) $(LIBS)
+
+alias_list_alias$(EXEEXT): $(alias_list_alias_OBJECTS) $(alias_list_alias_DEPENDENCIES) $(EXTRA_alias_list_alias_DEPENDENCIES) 
+	@rm -f alias_list_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_list_alias_OBJECTS) $(alias_list_alias_LDADD) $(LIBS)
+
+alias_list_missing$(EXEEXT): $(alias_list_missing_OBJECTS) $(alias_list_missing_DEPENDENCIES) $(EXTRA_alias_list_missing_DEPENDENCIES) 
+	@rm -f alias_list_missing$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_list_missing_OBJECTS) $(alias_list_missing_LDADD) $(LIBS)
+
+alias_num$(EXEEXT): $(alias_num_OBJECTS) $(alias_num_DEPENDENCIES) $(EXTRA_alias_num_DEPENDENCIES) 
+	@rm -f alias_num$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_num_OBJECTS) $(alias_num_LDADD) $(LIBS)
+
+alias_num_alias$(EXEEXT): $(alias_num_alias_OBJECTS) $(alias_num_alias_DEPENDENCIES) $(EXTRA_alias_num_alias_DEPENDENCIES) 
+	@rm -f alias_num_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_num_alias_OBJECTS) $(alias_num_alias_LDADD) $(LIBS)
+
+alias_num_missing$(EXEEXT): $(alias_num_missing_OBJECTS) $(alias_num_missing_DEPENDENCIES) $(EXTRA_alias_num_missing_DEPENDENCIES) 
+	@rm -f alias_num_missing$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_num_missing_OBJECTS) $(alias_num_missing_LDADD) $(LIBS)
+
+alias_target$(EXEEXT): $(alias_target_OBJECTS) $(alias_target_DEPENDENCIES) $(EXTRA_alias_target_DEPENDENCIES) 
+	@rm -f alias_target$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_target_OBJECTS) $(alias_target_LDADD) $(LIBS)
+
+alias_target_alias$(EXEEXT): $(alias_target_alias_OBJECTS) $(alias_target_alias_DEPENDENCIES) $(EXTRA_alias_target_alias_DEPENDENCIES) 
+	@rm -f alias_target_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_target_alias_OBJECTS) $(alias_target_alias_LDADD) $(LIBS)
+
+alias_target_missing$(EXEEXT): $(alias_target_missing_OBJECTS) $(alias_target_missing_DEPENDENCIES) $(EXTRA_alias_target_missing_DEPENDENCIES) 
+	@rm -f alias_target_missing$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alias_target_missing_OBJECTS) $(alias_target_missing_LDADD) $(LIBS)
+
+alter_bit_bitnum$(EXEEXT): $(alter_bit_bitnum_OBJECTS) $(alter_bit_bitnum_DEPENDENCIES) $(EXTRA_alter_bit_bitnum_DEPENDENCIES) 
+	@rm -f alter_bit_bitnum$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_bit_bitnum_OBJECTS) $(alter_bit_bitnum_LDADD) $(LIBS)
+
+alter_bit_numbits$(EXEEXT): $(alter_bit_numbits_OBJECTS) $(alter_bit_numbits_DEPENDENCIES) $(EXTRA_alter_bit_numbits_DEPENDENCIES) 
+	@rm -f alter_bit_numbits$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_bit_numbits_OBJECTS) $(alter_bit_numbits_LDADD) $(LIBS)
+
+alter_carray_len$(EXEEXT): $(alter_carray_len_OBJECTS) $(alter_carray_len_DEPENDENCIES) $(EXTRA_alter_carray_len_DEPENDENCIES) 
+	@rm -f alter_carray_len$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_carray_len_OBJECTS) $(alter_carray_len_LDADD) $(LIBS)
+
+alter_carray_type$(EXEEXT): $(alter_carray_type_OBJECTS) $(alter_carray_type_DEPENDENCIES) $(EXTRA_alter_carray_type_DEPENDENCIES) 
+	@rm -f alter_carray_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_carray_type_OBJECTS) $(alter_carray_type_LDADD) $(LIBS)
+
+alter_const$(EXEEXT): $(alter_const_OBJECTS) $(alter_const_DEPENDENCIES) $(EXTRA_alter_const_DEPENDENCIES) 
+	@rm -f alter_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_const_OBJECTS) $(alter_const_LDADD) $(LIBS)
+
+alter_const_c2r$(EXEEXT): $(alter_const_c2r_OBJECTS) $(alter_const_c2r_DEPENDENCIES) $(EXTRA_alter_const_c2r_DEPENDENCIES) 
+	@rm -f alter_const_c2r$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_const_c2r_OBJECTS) $(alter_const_c2r_LDADD) $(LIBS)
+
+alter_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_crecip$(EXEEXT): $(alter_crecip_OBJECTS) $(alter_crecip_DEPENDENCIES) $(EXTRA_alter_crecip_DEPENDENCIES) 
+	@rm -f alter_crecip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_crecip_OBJECTS) $(alter_crecip_LDADD) $(LIBS)
+
+alter_crecip89$(EXEEXT): $(alter_crecip89_OBJECTS) $(alter_crecip89_DEPENDENCIES) $(EXTRA_alter_crecip89_DEPENDENCIES) 
+	@rm -f alter_crecip89$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_crecip89_OBJECTS) $(alter_crecip89_LDADD) $(LIBS)
+
+alter_crecip_zero$(EXEEXT): $(alter_crecip_zero_OBJECTS) $(alter_crecip_zero_DEPENDENCIES) $(EXTRA_alter_crecip_zero_DEPENDENCIES) 
+	@rm -f alter_crecip_zero$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_crecip_zero_OBJECTS) $(alter_crecip_zero_LDADD) $(LIBS)
+
+alter_divide$(EXEEXT): $(alter_divide_OBJECTS) $(alter_divide_DEPENDENCIES) $(EXTRA_alter_divide_DEPENDENCIES) 
+	@rm -f alter_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_divide_OBJECTS) $(alter_divide_LDADD) $(LIBS)
+
+alter_entry$(EXEEXT): $(alter_entry_OBJECTS) $(alter_entry_DEPENDENCIES) $(EXTRA_alter_entry_DEPENDENCIES) 
+	@rm -f alter_entry$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_OBJECTS) $(alter_entry_LDADD) $(LIBS)
+
+alter_entry_affix$(EXEEXT): $(alter_entry_affix_OBJECTS) $(alter_entry_affix_DEPENDENCIES) $(EXTRA_alter_entry_affix_DEPENDENCIES) 
+	@rm -f alter_entry_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_affix_OBJECTS) $(alter_entry_affix_LDADD) $(LIBS)
+
+alter_entry_hidden$(EXEEXT): $(alter_entry_hidden_OBJECTS) $(alter_entry_hidden_DEPENDENCIES) $(EXTRA_alter_entry_hidden_DEPENDENCIES) 
+	@rm -f alter_entry_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_hidden_OBJECTS) $(alter_entry_hidden_LDADD) $(LIBS)
+
+alter_entry_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_scalar2a$(EXEEXT): $(alter_entry_scalar2a_OBJECTS) $(alter_entry_scalar2a_DEPENDENCIES) $(EXTRA_alter_entry_scalar2a_DEPENDENCIES) 
+	@rm -f alter_entry_scalar2a$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar2a_OBJECTS) $(alter_entry_scalar2a_LDADD) $(LIBS)
+
+alter_entry_scalar2n$(EXEEXT): $(alter_entry_scalar2n_OBJECTS) $(alter_entry_scalar2n_DEPENDENCIES) $(EXTRA_alter_entry_scalar2n_DEPENDENCIES) 
+	@rm -f alter_entry_scalar2n$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar2n_OBJECTS) $(alter_entry_scalar2n_LDADD) $(LIBS)
+
+alter_entry_scalar3$(EXEEXT): $(alter_entry_scalar3_OBJECTS) $(alter_entry_scalar3_DEPENDENCIES) $(EXTRA_alter_entry_scalar3_DEPENDENCIES) 
+	@rm -f alter_entry_scalar3$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_entry_scalar3_OBJECTS) $(alter_entry_scalar3_LDADD) $(LIBS)
+
+alter_entry_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_lincom_23$(EXEEXT): $(alter_lincom_23_OBJECTS) $(alter_lincom_23_DEPENDENCIES) $(EXTRA_alter_lincom_23_DEPENDENCIES) 
+	@rm -f alter_lincom_23$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_lincom_23_OBJECTS) $(alter_lincom_23_LDADD) $(LIBS)
+
+alter_lincom_32$(EXEEXT): $(alter_lincom_32_OBJECTS) $(alter_lincom_32_DEPENDENCIES) $(EXTRA_alter_lincom_32_DEPENDENCIES) 
+	@rm -f alter_lincom_32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_lincom_32_OBJECTS) $(alter_lincom_32_LDADD) $(LIBS)
+
+alter_lincom_affix$(EXEEXT): $(alter_lincom_affix_OBJECTS) $(alter_lincom_affix_DEPENDENCIES) $(EXTRA_alter_lincom_affix_DEPENDENCIES) 
+	@rm -f alter_lincom_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_lincom_affix_OBJECTS) $(alter_lincom_affix_LDADD) $(LIBS)
+
+alter_lincom_input$(EXEEXT): $(alter_lincom_input_OBJECTS) $(alter_lincom_input_DEPENDENCIES) $(EXTRA_alter_lincom_input_DEPENDENCIES) 
+	@rm -f alter_lincom_input$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_lincom_input_OBJECTS) $(alter_lincom_input_LDADD) $(LIBS)
+
+alter_lincom_offset$(EXEEXT): $(alter_lincom_offset_OBJECTS) $(alter_lincom_offset_DEPENDENCIES) $(EXTRA_alter_lincom_offset_DEPENDENCIES) 
+	@rm -f alter_lincom_offset$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_lincom_offset_OBJECTS) $(alter_lincom_offset_LDADD) $(LIBS)
+
+alter_lincom_slope$(EXEEXT): $(alter_lincom_slope_OBJECTS) $(alter_lincom_slope_DEPENDENCIES) $(EXTRA_alter_lincom_slope_DEPENDENCIES) 
+	@rm -f alter_lincom_slope$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_lincom_slope_OBJECTS) $(alter_lincom_slope_LDADD) $(LIBS)
+
+alter_linterp$(EXEEXT): $(alter_linterp_OBJECTS) $(alter_linterp_DEPENDENCIES) $(EXTRA_alter_linterp_DEPENDENCIES) 
+	@rm -f alter_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_linterp_OBJECTS) $(alter_linterp_LDADD) $(LIBS)
+
+alter_linterp_move$(EXEEXT): $(alter_linterp_move_OBJECTS) $(alter_linterp_move_DEPENDENCIES) $(EXTRA_alter_linterp_move_DEPENDENCIES) 
+	@rm -f alter_linterp_move$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_linterp_move_OBJECTS) $(alter_linterp_move_LDADD) $(LIBS)
+
+alter_mplex$(EXEEXT): $(alter_mplex_OBJECTS) $(alter_mplex_DEPENDENCIES) $(EXTRA_alter_mplex_DEPENDENCIES) 
+	@rm -f alter_mplex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_mplex_OBJECTS) $(alter_mplex_LDADD) $(LIBS)
+
+alter_mspec$(EXEEXT): $(alter_mspec_OBJECTS) $(alter_mspec_DEPENDENCIES) $(EXTRA_alter_mspec_DEPENDENCIES) 
+	@rm -f alter_mspec$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_mspec_OBJECTS) $(alter_mspec_LDADD) $(LIBS)
+
+alter_mspec_affix$(EXEEXT): $(alter_mspec_affix_OBJECTS) $(alter_mspec_affix_DEPENDENCIES) $(EXTRA_alter_mspec_affix_DEPENDENCIES) 
+	@rm -f alter_mspec_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_mspec_affix_OBJECTS) $(alter_mspec_affix_LDADD) $(LIBS)
+
+alter_multiply$(EXEEXT): $(alter_multiply_OBJECTS) $(alter_multiply_DEPENDENCIES) $(EXTRA_alter_multiply_DEPENDENCIES) 
+	@rm -f alter_multiply$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_multiply_OBJECTS) $(alter_multiply_LDADD) $(LIBS)
+
+alter_phase$(EXEEXT): $(alter_phase_OBJECTS) $(alter_phase_DEPENDENCIES) $(EXTRA_alter_phase_DEPENDENCIES) 
+	@rm -f alter_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_phase_OBJECTS) $(alter_phase_LDADD) $(LIBS)
+
+alter_polynom_coeff$(EXEEXT): $(alter_polynom_coeff_OBJECTS) $(alter_polynom_coeff_DEPENDENCIES) $(EXTRA_alter_polynom_coeff_DEPENDENCIES) 
+	@rm -f alter_polynom_coeff$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_polynom_coeff_OBJECTS) $(alter_polynom_coeff_LDADD) $(LIBS)
+
+alter_polynom_input$(EXEEXT): $(alter_polynom_input_OBJECTS) $(alter_polynom_input_DEPENDENCIES) $(EXTRA_alter_polynom_input_DEPENDENCIES) 
+	@rm -f alter_polynom_input$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_polynom_input_OBJECTS) $(alter_polynom_input_LDADD) $(LIBS)
+
+alter_polynom_ord$(EXEEXT): $(alter_polynom_ord_OBJECTS) $(alter_polynom_ord_DEPENDENCIES) $(EXTRA_alter_polynom_ord_DEPENDENCIES) 
+	@rm -f alter_polynom_ord$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_polynom_ord_OBJECTS) $(alter_polynom_ord_LDADD) $(LIBS)
+
+alter_raw_spf$(EXEEXT): $(alter_raw_spf_OBJECTS) $(alter_raw_spf_DEPENDENCIES) $(EXTRA_alter_raw_spf_DEPENDENCIES) 
+	@rm -f alter_raw_spf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_raw_spf_OBJECTS) $(alter_raw_spf_LDADD) $(LIBS)
+
+alter_raw_type$(EXEEXT): $(alter_raw_type_OBJECTS) $(alter_raw_type_DEPENDENCIES) $(EXTRA_alter_raw_type_DEPENDENCIES) 
+	@rm -f alter_raw_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_raw_type_OBJECTS) $(alter_raw_type_LDADD) $(LIBS)
+
+alter_recip$(EXEEXT): $(alter_recip_OBJECTS) $(alter_recip_DEPENDENCIES) $(EXTRA_alter_recip_DEPENDENCIES) 
+	@rm -f alter_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_recip_OBJECTS) $(alter_recip_LDADD) $(LIBS)
+
+alter_recip_zero$(EXEEXT): $(alter_recip_zero_OBJECTS) $(alter_recip_zero_DEPENDENCIES) $(EXTRA_alter_recip_zero_DEPENDENCIES) 
+	@rm -f alter_recip_zero$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_recip_zero_OBJECTS) $(alter_recip_zero_LDADD) $(LIBS)
+
+alter_scalar_affix$(EXEEXT): $(alter_scalar_affix_OBJECTS) $(alter_scalar_affix_DEPENDENCIES) $(EXTRA_alter_scalar_affix_DEPENDENCIES) 
+	@rm -f alter_scalar_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_scalar_affix_OBJECTS) $(alter_scalar_affix_LDADD) $(LIBS)
+
+alter_spec$(EXEEXT): $(alter_spec_OBJECTS) $(alter_spec_DEPENDENCIES) $(EXTRA_alter_spec_DEPENDENCIES) 
+	@rm -f alter_spec$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_spec_OBJECTS) $(alter_spec_LDADD) $(LIBS)
+
+alter_spec_affix$(EXEEXT): $(alter_spec_affix_OBJECTS) $(alter_spec_affix_DEPENDENCIES) $(EXTRA_alter_spec_affix_DEPENDENCIES) 
+	@rm -f alter_spec_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_spec_affix_OBJECTS) $(alter_spec_affix_LDADD) $(LIBS)
+
+alter_spec_meta$(EXEEXT): $(alter_spec_meta_OBJECTS) $(alter_spec_meta_DEPENDENCIES) $(EXTRA_alter_spec_meta_DEPENDENCIES) 
+	@rm -f alter_spec_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_spec_meta_OBJECTS) $(alter_spec_meta_LDADD) $(LIBS)
+
+alter_window$(EXEEXT): $(alter_window_OBJECTS) $(alter_window_DEPENDENCIES) $(EXTRA_alter_window_DEPENDENCIES) 
+	@rm -f alter_window$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(alter_window_OBJECTS) $(alter_window_LDADD) $(LIBS)
+
+ascii_add$(EXEEXT): $(ascii_add_OBJECTS) $(ascii_add_DEPENDENCIES) $(EXTRA_ascii_add_DEPENDENCIES) 
+	@rm -f ascii_add$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_add_OBJECTS) $(ascii_add_LDADD) $(LIBS)
+
+ascii_get$(EXEEXT): $(ascii_get_OBJECTS) $(ascii_get_DEPENDENCIES) $(EXTRA_ascii_get_DEPENDENCIES) 
+	@rm -f ascii_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_get_OBJECTS) $(ascii_get_LDADD) $(LIBS)
+
+ascii_get_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_nframes$(EXEEXT): $(ascii_nframes_OBJECTS) $(ascii_nframes_DEPENDENCIES) $(EXTRA_ascii_nframes_DEPENDENCIES) 
+	@rm -f ascii_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_nframes_OBJECTS) $(ascii_nframes_LDADD) $(LIBS)
+
+ascii_put$(EXEEXT): $(ascii_put_OBJECTS) $(ascii_put_DEPENDENCIES) $(EXTRA_ascii_put_DEPENDENCIES) 
+	@rm -f ascii_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ascii_put_OBJECTS) $(ascii_put_LDADD) $(LIBS)
+
+bof$(EXEEXT): $(bof_OBJECTS) $(bof_DEPENDENCIES) $(EXTRA_bof_DEPENDENCIES) 
+	@rm -f bof$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bof_OBJECTS) $(bof_LDADD) $(LIBS)
+
+bof_lincom$(EXEEXT): $(bof_lincom_OBJECTS) $(bof_lincom_DEPENDENCIES) $(EXTRA_bof_lincom_DEPENDENCIES) 
+	@rm -f bof_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bof_lincom_OBJECTS) $(bof_lincom_LDADD) $(LIBS)
+
+bof_phase$(EXEEXT): $(bof_phase_OBJECTS) $(bof_phase_DEPENDENCIES) $(EXTRA_bof_phase_DEPENDENCIES) 
+	@rm -f bof_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(bof_phase_OBJECTS) $(bof_phase_LDADD) $(LIBS)
+
+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_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_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_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)
+
+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_discard$(EXEEXT): $(close_discard_OBJECTS) $(close_discard_DEPENDENCIES) $(EXTRA_close_discard_DEPENDENCIES) 
+	@rm -f close_discard$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(close_discard_OBJECTS) $(close_discard_LDADD) $(LIBS)
+
+close_null$(EXEEXT): $(close_null_OBJECTS) $(close_null_DEPENDENCIES) $(EXTRA_close_null_DEPENDENCIES) 
+	@rm -f close_null$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(close_null_OBJECTS) $(close_null_LDADD) $(LIBS)
+
+convert_complex128_complex64$(EXEEXT): $(convert_complex128_complex64_OBJECTS) $(convert_complex128_complex64_DEPENDENCIES) $(EXTRA_convert_complex128_complex64_DEPENDENCIES) 
+	@rm -f convert_complex128_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_complex128_complex64_OBJECTS) $(convert_complex128_complex64_LDADD) $(LIBS)
+
+convert_complex128_float64$(EXEEXT): $(convert_complex128_float64_OBJECTS) $(convert_complex128_float64_DEPENDENCIES) $(EXTRA_convert_complex128_float64_DEPENDENCIES) 
+	@rm -f convert_complex128_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_complex128_float64_OBJECTS) $(convert_complex128_float64_LDADD) $(LIBS)
+
+convert_complex128_int64$(EXEEXT): $(convert_complex128_int64_OBJECTS) $(convert_complex128_int64_DEPENDENCIES) $(EXTRA_convert_complex128_int64_DEPENDENCIES) 
+	@rm -f convert_complex128_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_complex128_int64_OBJECTS) $(convert_complex128_int64_LDADD) $(LIBS)
+
+convert_complex128_uint64$(EXEEXT): $(convert_complex128_uint64_OBJECTS) $(convert_complex128_uint64_DEPENDENCIES) $(EXTRA_convert_complex128_uint64_DEPENDENCIES) 
+	@rm -f convert_complex128_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_complex128_uint64_OBJECTS) $(convert_complex128_uint64_LDADD) $(LIBS)
+
+convert_complex64_complex128$(EXEEXT): $(convert_complex64_complex128_OBJECTS) $(convert_complex64_complex128_DEPENDENCIES) $(EXTRA_convert_complex64_complex128_DEPENDENCIES) 
+	@rm -f convert_complex64_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_complex64_complex128_OBJECTS) $(convert_complex64_complex128_LDADD) $(LIBS)
+
+convert_complex64_float64$(EXEEXT): $(convert_complex64_float64_OBJECTS) $(convert_complex64_float64_DEPENDENCIES) $(EXTRA_convert_complex64_float64_DEPENDENCIES) 
+	@rm -f convert_complex64_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_complex64_float64_OBJECTS) $(convert_complex64_float64_LDADD) $(LIBS)
+
+convert_complex64_int64$(EXEEXT): $(convert_complex64_int64_OBJECTS) $(convert_complex64_int64_DEPENDENCIES) $(EXTRA_convert_complex64_int64_DEPENDENCIES) 
+	@rm -f convert_complex64_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_complex64_int64_OBJECTS) $(convert_complex64_int64_LDADD) $(LIBS)
+
+convert_complex64_uint64$(EXEEXT): $(convert_complex64_uint64_OBJECTS) $(convert_complex64_uint64_DEPENDENCIES) $(EXTRA_convert_complex64_uint64_DEPENDENCIES) 
+	@rm -f convert_complex64_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_complex64_uint64_OBJECTS) $(convert_complex64_uint64_LDADD) $(LIBS)
+
+convert_float32_complex128$(EXEEXT): $(convert_float32_complex128_OBJECTS) $(convert_float32_complex128_DEPENDENCIES) $(EXTRA_convert_float32_complex128_DEPENDENCIES) 
+	@rm -f convert_float32_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_complex128_OBJECTS) $(convert_float32_complex128_LDADD) $(LIBS)
+
+convert_float32_complex64$(EXEEXT): $(convert_float32_complex64_OBJECTS) $(convert_float32_complex64_DEPENDENCIES) $(EXTRA_convert_float32_complex64_DEPENDENCIES) 
+	@rm -f convert_float32_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_complex64_OBJECTS) $(convert_float32_complex64_LDADD) $(LIBS)
+
+convert_float32_float64$(EXEEXT): $(convert_float32_float64_OBJECTS) $(convert_float32_float64_DEPENDENCIES) $(EXTRA_convert_float32_float64_DEPENDENCIES) 
+	@rm -f convert_float32_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_float64_OBJECTS) $(convert_float32_float64_LDADD) $(LIBS)
+
+convert_float32_int16$(EXEEXT): $(convert_float32_int16_OBJECTS) $(convert_float32_int16_DEPENDENCIES) $(EXTRA_convert_float32_int16_DEPENDENCIES) 
+	@rm -f convert_float32_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_int16_OBJECTS) $(convert_float32_int16_LDADD) $(LIBS)
+
+convert_float32_int32$(EXEEXT): $(convert_float32_int32_OBJECTS) $(convert_float32_int32_DEPENDENCIES) $(EXTRA_convert_float32_int32_DEPENDENCIES) 
+	@rm -f convert_float32_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_int32_OBJECTS) $(convert_float32_int32_LDADD) $(LIBS)
+
+convert_float32_int64$(EXEEXT): $(convert_float32_int64_OBJECTS) $(convert_float32_int64_DEPENDENCIES) $(EXTRA_convert_float32_int64_DEPENDENCIES) 
+	@rm -f convert_float32_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_int64_OBJECTS) $(convert_float32_int64_LDADD) $(LIBS)
+
+convert_float32_int8$(EXEEXT): $(convert_float32_int8_OBJECTS) $(convert_float32_int8_DEPENDENCIES) $(EXTRA_convert_float32_int8_DEPENDENCIES) 
+	@rm -f convert_float32_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_int8_OBJECTS) $(convert_float32_int8_LDADD) $(LIBS)
+
+convert_float32_uint16$(EXEEXT): $(convert_float32_uint16_OBJECTS) $(convert_float32_uint16_DEPENDENCIES) $(EXTRA_convert_float32_uint16_DEPENDENCIES) 
+	@rm -f convert_float32_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_uint16_OBJECTS) $(convert_float32_uint16_LDADD) $(LIBS)
+
+convert_float32_uint32$(EXEEXT): $(convert_float32_uint32_OBJECTS) $(convert_float32_uint32_DEPENDENCIES) $(EXTRA_convert_float32_uint32_DEPENDENCIES) 
+	@rm -f convert_float32_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_uint32_OBJECTS) $(convert_float32_uint32_LDADD) $(LIBS)
+
+convert_float32_uint64$(EXEEXT): $(convert_float32_uint64_OBJECTS) $(convert_float32_uint64_DEPENDENCIES) $(EXTRA_convert_float32_uint64_DEPENDENCIES) 
+	@rm -f convert_float32_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_uint64_OBJECTS) $(convert_float32_uint64_LDADD) $(LIBS)
+
+convert_float32_uint8$(EXEEXT): $(convert_float32_uint8_OBJECTS) $(convert_float32_uint8_DEPENDENCIES) $(EXTRA_convert_float32_uint8_DEPENDENCIES) 
+	@rm -f convert_float32_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float32_uint8_OBJECTS) $(convert_float32_uint8_LDADD) $(LIBS)
+
+convert_float64_complex128$(EXEEXT): $(convert_float64_complex128_OBJECTS) $(convert_float64_complex128_DEPENDENCIES) $(EXTRA_convert_float64_complex128_DEPENDENCIES) 
+	@rm -f convert_float64_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_complex128_OBJECTS) $(convert_float64_complex128_LDADD) $(LIBS)
+
+convert_float64_complex64$(EXEEXT): $(convert_float64_complex64_OBJECTS) $(convert_float64_complex64_DEPENDENCIES) $(EXTRA_convert_float64_complex64_DEPENDENCIES) 
+	@rm -f convert_float64_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_complex64_OBJECTS) $(convert_float64_complex64_LDADD) $(LIBS)
+
+convert_float64_float32$(EXEEXT): $(convert_float64_float32_OBJECTS) $(convert_float64_float32_DEPENDENCIES) $(EXTRA_convert_float64_float32_DEPENDENCIES) 
+	@rm -f convert_float64_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_float32_OBJECTS) $(convert_float64_float32_LDADD) $(LIBS)
+
+convert_float64_int16$(EXEEXT): $(convert_float64_int16_OBJECTS) $(convert_float64_int16_DEPENDENCIES) $(EXTRA_convert_float64_int16_DEPENDENCIES) 
+	@rm -f convert_float64_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_int16_OBJECTS) $(convert_float64_int16_LDADD) $(LIBS)
+
+convert_float64_int32$(EXEEXT): $(convert_float64_int32_OBJECTS) $(convert_float64_int32_DEPENDENCIES) $(EXTRA_convert_float64_int32_DEPENDENCIES) 
+	@rm -f convert_float64_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_int32_OBJECTS) $(convert_float64_int32_LDADD) $(LIBS)
+
+convert_float64_int64$(EXEEXT): $(convert_float64_int64_OBJECTS) $(convert_float64_int64_DEPENDENCIES) $(EXTRA_convert_float64_int64_DEPENDENCIES) 
+	@rm -f convert_float64_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_int64_OBJECTS) $(convert_float64_int64_LDADD) $(LIBS)
+
+convert_float64_int8$(EXEEXT): $(convert_float64_int8_OBJECTS) $(convert_float64_int8_DEPENDENCIES) $(EXTRA_convert_float64_int8_DEPENDENCIES) 
+	@rm -f convert_float64_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_int8_OBJECTS) $(convert_float64_int8_LDADD) $(LIBS)
+
+convert_float64_uint16$(EXEEXT): $(convert_float64_uint16_OBJECTS) $(convert_float64_uint16_DEPENDENCIES) $(EXTRA_convert_float64_uint16_DEPENDENCIES) 
+	@rm -f convert_float64_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_uint16_OBJECTS) $(convert_float64_uint16_LDADD) $(LIBS)
+
+convert_float64_uint32$(EXEEXT): $(convert_float64_uint32_OBJECTS) $(convert_float64_uint32_DEPENDENCIES) $(EXTRA_convert_float64_uint32_DEPENDENCIES) 
+	@rm -f convert_float64_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_uint32_OBJECTS) $(convert_float64_uint32_LDADD) $(LIBS)
+
+convert_float64_uint64$(EXEEXT): $(convert_float64_uint64_OBJECTS) $(convert_float64_uint64_DEPENDENCIES) $(EXTRA_convert_float64_uint64_DEPENDENCIES) 
+	@rm -f convert_float64_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_uint64_OBJECTS) $(convert_float64_uint64_LDADD) $(LIBS)
+
+convert_float64_uint8$(EXEEXT): $(convert_float64_uint8_OBJECTS) $(convert_float64_uint8_DEPENDENCIES) $(EXTRA_convert_float64_uint8_DEPENDENCIES) 
+	@rm -f convert_float64_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_float64_uint8_OBJECTS) $(convert_float64_uint8_LDADD) $(LIBS)
+
+convert_int16_complex128$(EXEEXT): $(convert_int16_complex128_OBJECTS) $(convert_int16_complex128_DEPENDENCIES) $(EXTRA_convert_int16_complex128_DEPENDENCIES) 
+	@rm -f convert_int16_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_complex128_OBJECTS) $(convert_int16_complex128_LDADD) $(LIBS)
+
+convert_int16_complex64$(EXEEXT): $(convert_int16_complex64_OBJECTS) $(convert_int16_complex64_DEPENDENCIES) $(EXTRA_convert_int16_complex64_DEPENDENCIES) 
+	@rm -f convert_int16_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_complex64_OBJECTS) $(convert_int16_complex64_LDADD) $(LIBS)
+
+convert_int16_float32$(EXEEXT): $(convert_int16_float32_OBJECTS) $(convert_int16_float32_DEPENDENCIES) $(EXTRA_convert_int16_float32_DEPENDENCIES) 
+	@rm -f convert_int16_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_float32_OBJECTS) $(convert_int16_float32_LDADD) $(LIBS)
+
+convert_int16_float64$(EXEEXT): $(convert_int16_float64_OBJECTS) $(convert_int16_float64_DEPENDENCIES) $(EXTRA_convert_int16_float64_DEPENDENCIES) 
+	@rm -f convert_int16_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_float64_OBJECTS) $(convert_int16_float64_LDADD) $(LIBS)
+
+convert_int16_int32$(EXEEXT): $(convert_int16_int32_OBJECTS) $(convert_int16_int32_DEPENDENCIES) $(EXTRA_convert_int16_int32_DEPENDENCIES) 
+	@rm -f convert_int16_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_int32_OBJECTS) $(convert_int16_int32_LDADD) $(LIBS)
+
+convert_int16_int64$(EXEEXT): $(convert_int16_int64_OBJECTS) $(convert_int16_int64_DEPENDENCIES) $(EXTRA_convert_int16_int64_DEPENDENCIES) 
+	@rm -f convert_int16_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_int64_OBJECTS) $(convert_int16_int64_LDADD) $(LIBS)
+
+convert_int16_int8$(EXEEXT): $(convert_int16_int8_OBJECTS) $(convert_int16_int8_DEPENDENCIES) $(EXTRA_convert_int16_int8_DEPENDENCIES) 
+	@rm -f convert_int16_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_int8_OBJECTS) $(convert_int16_int8_LDADD) $(LIBS)
+
+convert_int16_uint16$(EXEEXT): $(convert_int16_uint16_OBJECTS) $(convert_int16_uint16_DEPENDENCIES) $(EXTRA_convert_int16_uint16_DEPENDENCIES) 
+	@rm -f convert_int16_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_uint16_OBJECTS) $(convert_int16_uint16_LDADD) $(LIBS)
+
+convert_int16_uint32$(EXEEXT): $(convert_int16_uint32_OBJECTS) $(convert_int16_uint32_DEPENDENCIES) $(EXTRA_convert_int16_uint32_DEPENDENCIES) 
+	@rm -f convert_int16_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_uint32_OBJECTS) $(convert_int16_uint32_LDADD) $(LIBS)
+
+convert_int16_uint64$(EXEEXT): $(convert_int16_uint64_OBJECTS) $(convert_int16_uint64_DEPENDENCIES) $(EXTRA_convert_int16_uint64_DEPENDENCIES) 
+	@rm -f convert_int16_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_uint64_OBJECTS) $(convert_int16_uint64_LDADD) $(LIBS)
+
+convert_int16_uint8$(EXEEXT): $(convert_int16_uint8_OBJECTS) $(convert_int16_uint8_DEPENDENCIES) $(EXTRA_convert_int16_uint8_DEPENDENCIES) 
+	@rm -f convert_int16_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int16_uint8_OBJECTS) $(convert_int16_uint8_LDADD) $(LIBS)
+
+convert_int32_complex128$(EXEEXT): $(convert_int32_complex128_OBJECTS) $(convert_int32_complex128_DEPENDENCIES) $(EXTRA_convert_int32_complex128_DEPENDENCIES) 
+	@rm -f convert_int32_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_complex128_OBJECTS) $(convert_int32_complex128_LDADD) $(LIBS)
+
+convert_int32_complex64$(EXEEXT): $(convert_int32_complex64_OBJECTS) $(convert_int32_complex64_DEPENDENCIES) $(EXTRA_convert_int32_complex64_DEPENDENCIES) 
+	@rm -f convert_int32_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_complex64_OBJECTS) $(convert_int32_complex64_LDADD) $(LIBS)
+
+convert_int32_float32$(EXEEXT): $(convert_int32_float32_OBJECTS) $(convert_int32_float32_DEPENDENCIES) $(EXTRA_convert_int32_float32_DEPENDENCIES) 
+	@rm -f convert_int32_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_float32_OBJECTS) $(convert_int32_float32_LDADD) $(LIBS)
+
+convert_int32_float64$(EXEEXT): $(convert_int32_float64_OBJECTS) $(convert_int32_float64_DEPENDENCIES) $(EXTRA_convert_int32_float64_DEPENDENCIES) 
+	@rm -f convert_int32_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_float64_OBJECTS) $(convert_int32_float64_LDADD) $(LIBS)
+
+convert_int32_int16$(EXEEXT): $(convert_int32_int16_OBJECTS) $(convert_int32_int16_DEPENDENCIES) $(EXTRA_convert_int32_int16_DEPENDENCIES) 
+	@rm -f convert_int32_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_int16_OBJECTS) $(convert_int32_int16_LDADD) $(LIBS)
+
+convert_int32_int64$(EXEEXT): $(convert_int32_int64_OBJECTS) $(convert_int32_int64_DEPENDENCIES) $(EXTRA_convert_int32_int64_DEPENDENCIES) 
+	@rm -f convert_int32_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_int64_OBJECTS) $(convert_int32_int64_LDADD) $(LIBS)
+
+convert_int32_int8$(EXEEXT): $(convert_int32_int8_OBJECTS) $(convert_int32_int8_DEPENDENCIES) $(EXTRA_convert_int32_int8_DEPENDENCIES) 
+	@rm -f convert_int32_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_int8_OBJECTS) $(convert_int32_int8_LDADD) $(LIBS)
+
+convert_int32_uint16$(EXEEXT): $(convert_int32_uint16_OBJECTS) $(convert_int32_uint16_DEPENDENCIES) $(EXTRA_convert_int32_uint16_DEPENDENCIES) 
+	@rm -f convert_int32_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_uint16_OBJECTS) $(convert_int32_uint16_LDADD) $(LIBS)
+
+convert_int32_uint32$(EXEEXT): $(convert_int32_uint32_OBJECTS) $(convert_int32_uint32_DEPENDENCIES) $(EXTRA_convert_int32_uint32_DEPENDENCIES) 
+	@rm -f convert_int32_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_uint32_OBJECTS) $(convert_int32_uint32_LDADD) $(LIBS)
+
+convert_int32_uint64$(EXEEXT): $(convert_int32_uint64_OBJECTS) $(convert_int32_uint64_DEPENDENCIES) $(EXTRA_convert_int32_uint64_DEPENDENCIES) 
+	@rm -f convert_int32_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_uint64_OBJECTS) $(convert_int32_uint64_LDADD) $(LIBS)
+
+convert_int32_uint8$(EXEEXT): $(convert_int32_uint8_OBJECTS) $(convert_int32_uint8_DEPENDENCIES) $(EXTRA_convert_int32_uint8_DEPENDENCIES) 
+	@rm -f convert_int32_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int32_uint8_OBJECTS) $(convert_int32_uint8_LDADD) $(LIBS)
+
+convert_int64_complex128$(EXEEXT): $(convert_int64_complex128_OBJECTS) $(convert_int64_complex128_DEPENDENCIES) $(EXTRA_convert_int64_complex128_DEPENDENCIES) 
+	@rm -f convert_int64_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_complex128_OBJECTS) $(convert_int64_complex128_LDADD) $(LIBS)
+
+convert_int64_complex64$(EXEEXT): $(convert_int64_complex64_OBJECTS) $(convert_int64_complex64_DEPENDENCIES) $(EXTRA_convert_int64_complex64_DEPENDENCIES) 
+	@rm -f convert_int64_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_complex64_OBJECTS) $(convert_int64_complex64_LDADD) $(LIBS)
+
+convert_int64_float32$(EXEEXT): $(convert_int64_float32_OBJECTS) $(convert_int64_float32_DEPENDENCIES) $(EXTRA_convert_int64_float32_DEPENDENCIES) 
+	@rm -f convert_int64_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_float32_OBJECTS) $(convert_int64_float32_LDADD) $(LIBS)
+
+convert_int64_float64$(EXEEXT): $(convert_int64_float64_OBJECTS) $(convert_int64_float64_DEPENDENCIES) $(EXTRA_convert_int64_float64_DEPENDENCIES) 
+	@rm -f convert_int64_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_float64_OBJECTS) $(convert_int64_float64_LDADD) $(LIBS)
+
+convert_int64_int16$(EXEEXT): $(convert_int64_int16_OBJECTS) $(convert_int64_int16_DEPENDENCIES) $(EXTRA_convert_int64_int16_DEPENDENCIES) 
+	@rm -f convert_int64_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_int16_OBJECTS) $(convert_int64_int16_LDADD) $(LIBS)
+
+convert_int64_int32$(EXEEXT): $(convert_int64_int32_OBJECTS) $(convert_int64_int32_DEPENDENCIES) $(EXTRA_convert_int64_int32_DEPENDENCIES) 
+	@rm -f convert_int64_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_int32_OBJECTS) $(convert_int64_int32_LDADD) $(LIBS)
+
+convert_int64_int8$(EXEEXT): $(convert_int64_int8_OBJECTS) $(convert_int64_int8_DEPENDENCIES) $(EXTRA_convert_int64_int8_DEPENDENCIES) 
+	@rm -f convert_int64_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_int8_OBJECTS) $(convert_int64_int8_LDADD) $(LIBS)
+
+convert_int64_uint16$(EXEEXT): $(convert_int64_uint16_OBJECTS) $(convert_int64_uint16_DEPENDENCIES) $(EXTRA_convert_int64_uint16_DEPENDENCIES) 
+	@rm -f convert_int64_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_uint16_OBJECTS) $(convert_int64_uint16_LDADD) $(LIBS)
+
+convert_int64_uint32$(EXEEXT): $(convert_int64_uint32_OBJECTS) $(convert_int64_uint32_DEPENDENCIES) $(EXTRA_convert_int64_uint32_DEPENDENCIES) 
+	@rm -f convert_int64_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_uint32_OBJECTS) $(convert_int64_uint32_LDADD) $(LIBS)
+
+convert_int64_uint64$(EXEEXT): $(convert_int64_uint64_OBJECTS) $(convert_int64_uint64_DEPENDENCIES) $(EXTRA_convert_int64_uint64_DEPENDENCIES) 
+	@rm -f convert_int64_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_uint64_OBJECTS) $(convert_int64_uint64_LDADD) $(LIBS)
+
+convert_int64_uint8$(EXEEXT): $(convert_int64_uint8_OBJECTS) $(convert_int64_uint8_DEPENDENCIES) $(EXTRA_convert_int64_uint8_DEPENDENCIES) 
+	@rm -f convert_int64_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int64_uint8_OBJECTS) $(convert_int64_uint8_LDADD) $(LIBS)
+
+convert_int8_complex128$(EXEEXT): $(convert_int8_complex128_OBJECTS) $(convert_int8_complex128_DEPENDENCIES) $(EXTRA_convert_int8_complex128_DEPENDENCIES) 
+	@rm -f convert_int8_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_complex128_OBJECTS) $(convert_int8_complex128_LDADD) $(LIBS)
+
+convert_int8_complex64$(EXEEXT): $(convert_int8_complex64_OBJECTS) $(convert_int8_complex64_DEPENDENCIES) $(EXTRA_convert_int8_complex64_DEPENDENCIES) 
+	@rm -f convert_int8_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_complex64_OBJECTS) $(convert_int8_complex64_LDADD) $(LIBS)
+
+convert_int8_float32$(EXEEXT): $(convert_int8_float32_OBJECTS) $(convert_int8_float32_DEPENDENCIES) $(EXTRA_convert_int8_float32_DEPENDENCIES) 
+	@rm -f convert_int8_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_float32_OBJECTS) $(convert_int8_float32_LDADD) $(LIBS)
+
+convert_int8_float64$(EXEEXT): $(convert_int8_float64_OBJECTS) $(convert_int8_float64_DEPENDENCIES) $(EXTRA_convert_int8_float64_DEPENDENCIES) 
+	@rm -f convert_int8_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_float64_OBJECTS) $(convert_int8_float64_LDADD) $(LIBS)
+
+convert_int8_int16$(EXEEXT): $(convert_int8_int16_OBJECTS) $(convert_int8_int16_DEPENDENCIES) $(EXTRA_convert_int8_int16_DEPENDENCIES) 
+	@rm -f convert_int8_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_int16_OBJECTS) $(convert_int8_int16_LDADD) $(LIBS)
+
+convert_int8_int32$(EXEEXT): $(convert_int8_int32_OBJECTS) $(convert_int8_int32_DEPENDENCIES) $(EXTRA_convert_int8_int32_DEPENDENCIES) 
+	@rm -f convert_int8_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_int32_OBJECTS) $(convert_int8_int32_LDADD) $(LIBS)
+
+convert_int8_int64$(EXEEXT): $(convert_int8_int64_OBJECTS) $(convert_int8_int64_DEPENDENCIES) $(EXTRA_convert_int8_int64_DEPENDENCIES) 
+	@rm -f convert_int8_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_int64_OBJECTS) $(convert_int8_int64_LDADD) $(LIBS)
+
+convert_int8_uint16$(EXEEXT): $(convert_int8_uint16_OBJECTS) $(convert_int8_uint16_DEPENDENCIES) $(EXTRA_convert_int8_uint16_DEPENDENCIES) 
+	@rm -f convert_int8_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_uint16_OBJECTS) $(convert_int8_uint16_LDADD) $(LIBS)
+
+convert_int8_uint32$(EXEEXT): $(convert_int8_uint32_OBJECTS) $(convert_int8_uint32_DEPENDENCIES) $(EXTRA_convert_int8_uint32_DEPENDENCIES) 
+	@rm -f convert_int8_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_uint32_OBJECTS) $(convert_int8_uint32_LDADD) $(LIBS)
+
+convert_int8_uint64$(EXEEXT): $(convert_int8_uint64_OBJECTS) $(convert_int8_uint64_DEPENDENCIES) $(EXTRA_convert_int8_uint64_DEPENDENCIES) 
+	@rm -f convert_int8_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_uint64_OBJECTS) $(convert_int8_uint64_LDADD) $(LIBS)
+
+convert_int8_uint8$(EXEEXT): $(convert_int8_uint8_OBJECTS) $(convert_int8_uint8_DEPENDENCIES) $(EXTRA_convert_int8_uint8_DEPENDENCIES) 
+	@rm -f convert_int8_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_int8_uint8_OBJECTS) $(convert_int8_uint8_LDADD) $(LIBS)
+
+convert_uint16_complex128$(EXEEXT): $(convert_uint16_complex128_OBJECTS) $(convert_uint16_complex128_DEPENDENCIES) $(EXTRA_convert_uint16_complex128_DEPENDENCIES) 
+	@rm -f convert_uint16_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_complex128_OBJECTS) $(convert_uint16_complex128_LDADD) $(LIBS)
+
+convert_uint16_complex64$(EXEEXT): $(convert_uint16_complex64_OBJECTS) $(convert_uint16_complex64_DEPENDENCIES) $(EXTRA_convert_uint16_complex64_DEPENDENCIES) 
+	@rm -f convert_uint16_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_complex64_OBJECTS) $(convert_uint16_complex64_LDADD) $(LIBS)
+
+convert_uint16_float32$(EXEEXT): $(convert_uint16_float32_OBJECTS) $(convert_uint16_float32_DEPENDENCIES) $(EXTRA_convert_uint16_float32_DEPENDENCIES) 
+	@rm -f convert_uint16_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_float32_OBJECTS) $(convert_uint16_float32_LDADD) $(LIBS)
+
+convert_uint16_float64$(EXEEXT): $(convert_uint16_float64_OBJECTS) $(convert_uint16_float64_DEPENDENCIES) $(EXTRA_convert_uint16_float64_DEPENDENCIES) 
+	@rm -f convert_uint16_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_float64_OBJECTS) $(convert_uint16_float64_LDADD) $(LIBS)
+
+convert_uint16_int16$(EXEEXT): $(convert_uint16_int16_OBJECTS) $(convert_uint16_int16_DEPENDENCIES) $(EXTRA_convert_uint16_int16_DEPENDENCIES) 
+	@rm -f convert_uint16_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_int16_OBJECTS) $(convert_uint16_int16_LDADD) $(LIBS)
+
+convert_uint16_int32$(EXEEXT): $(convert_uint16_int32_OBJECTS) $(convert_uint16_int32_DEPENDENCIES) $(EXTRA_convert_uint16_int32_DEPENDENCIES) 
+	@rm -f convert_uint16_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_int32_OBJECTS) $(convert_uint16_int32_LDADD) $(LIBS)
+
+convert_uint16_int64$(EXEEXT): $(convert_uint16_int64_OBJECTS) $(convert_uint16_int64_DEPENDENCIES) $(EXTRA_convert_uint16_int64_DEPENDENCIES) 
+	@rm -f convert_uint16_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_int64_OBJECTS) $(convert_uint16_int64_LDADD) $(LIBS)
+
+convert_uint16_int8$(EXEEXT): $(convert_uint16_int8_OBJECTS) $(convert_uint16_int8_DEPENDENCIES) $(EXTRA_convert_uint16_int8_DEPENDENCIES) 
+	@rm -f convert_uint16_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_int8_OBJECTS) $(convert_uint16_int8_LDADD) $(LIBS)
+
+convert_uint16_uint32$(EXEEXT): $(convert_uint16_uint32_OBJECTS) $(convert_uint16_uint32_DEPENDENCIES) $(EXTRA_convert_uint16_uint32_DEPENDENCIES) 
+	@rm -f convert_uint16_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_uint32_OBJECTS) $(convert_uint16_uint32_LDADD) $(LIBS)
+
+convert_uint16_uint64$(EXEEXT): $(convert_uint16_uint64_OBJECTS) $(convert_uint16_uint64_DEPENDENCIES) $(EXTRA_convert_uint16_uint64_DEPENDENCIES) 
+	@rm -f convert_uint16_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_uint64_OBJECTS) $(convert_uint16_uint64_LDADD) $(LIBS)
+
+convert_uint16_uint8$(EXEEXT): $(convert_uint16_uint8_OBJECTS) $(convert_uint16_uint8_DEPENDENCIES) $(EXTRA_convert_uint16_uint8_DEPENDENCIES) 
+	@rm -f convert_uint16_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint16_uint8_OBJECTS) $(convert_uint16_uint8_LDADD) $(LIBS)
+
+convert_uint32_complex128$(EXEEXT): $(convert_uint32_complex128_OBJECTS) $(convert_uint32_complex128_DEPENDENCIES) $(EXTRA_convert_uint32_complex128_DEPENDENCIES) 
+	@rm -f convert_uint32_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_complex128_OBJECTS) $(convert_uint32_complex128_LDADD) $(LIBS)
+
+convert_uint32_complex64$(EXEEXT): $(convert_uint32_complex64_OBJECTS) $(convert_uint32_complex64_DEPENDENCIES) $(EXTRA_convert_uint32_complex64_DEPENDENCIES) 
+	@rm -f convert_uint32_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_complex64_OBJECTS) $(convert_uint32_complex64_LDADD) $(LIBS)
+
+convert_uint32_float32$(EXEEXT): $(convert_uint32_float32_OBJECTS) $(convert_uint32_float32_DEPENDENCIES) $(EXTRA_convert_uint32_float32_DEPENDENCIES) 
+	@rm -f convert_uint32_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_float32_OBJECTS) $(convert_uint32_float32_LDADD) $(LIBS)
+
+convert_uint32_float64$(EXEEXT): $(convert_uint32_float64_OBJECTS) $(convert_uint32_float64_DEPENDENCIES) $(EXTRA_convert_uint32_float64_DEPENDENCIES) 
+	@rm -f convert_uint32_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_float64_OBJECTS) $(convert_uint32_float64_LDADD) $(LIBS)
+
+convert_uint32_int16$(EXEEXT): $(convert_uint32_int16_OBJECTS) $(convert_uint32_int16_DEPENDENCIES) $(EXTRA_convert_uint32_int16_DEPENDENCIES) 
+	@rm -f convert_uint32_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_int16_OBJECTS) $(convert_uint32_int16_LDADD) $(LIBS)
+
+convert_uint32_int32$(EXEEXT): $(convert_uint32_int32_OBJECTS) $(convert_uint32_int32_DEPENDENCIES) $(EXTRA_convert_uint32_int32_DEPENDENCIES) 
+	@rm -f convert_uint32_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_int32_OBJECTS) $(convert_uint32_int32_LDADD) $(LIBS)
+
+convert_uint32_int64$(EXEEXT): $(convert_uint32_int64_OBJECTS) $(convert_uint32_int64_DEPENDENCIES) $(EXTRA_convert_uint32_int64_DEPENDENCIES) 
+	@rm -f convert_uint32_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_int64_OBJECTS) $(convert_uint32_int64_LDADD) $(LIBS)
+
+convert_uint32_int8$(EXEEXT): $(convert_uint32_int8_OBJECTS) $(convert_uint32_int8_DEPENDENCIES) $(EXTRA_convert_uint32_int8_DEPENDENCIES) 
+	@rm -f convert_uint32_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_int8_OBJECTS) $(convert_uint32_int8_LDADD) $(LIBS)
+
+convert_uint32_uint16$(EXEEXT): $(convert_uint32_uint16_OBJECTS) $(convert_uint32_uint16_DEPENDENCIES) $(EXTRA_convert_uint32_uint16_DEPENDENCIES) 
+	@rm -f convert_uint32_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_uint16_OBJECTS) $(convert_uint32_uint16_LDADD) $(LIBS)
+
+convert_uint32_uint64$(EXEEXT): $(convert_uint32_uint64_OBJECTS) $(convert_uint32_uint64_DEPENDENCIES) $(EXTRA_convert_uint32_uint64_DEPENDENCIES) 
+	@rm -f convert_uint32_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_uint64_OBJECTS) $(convert_uint32_uint64_LDADD) $(LIBS)
+
+convert_uint32_uint8$(EXEEXT): $(convert_uint32_uint8_OBJECTS) $(convert_uint32_uint8_DEPENDENCIES) $(EXTRA_convert_uint32_uint8_DEPENDENCIES) 
+	@rm -f convert_uint32_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint32_uint8_OBJECTS) $(convert_uint32_uint8_LDADD) $(LIBS)
+
+convert_uint64_complex128$(EXEEXT): $(convert_uint64_complex128_OBJECTS) $(convert_uint64_complex128_DEPENDENCIES) $(EXTRA_convert_uint64_complex128_DEPENDENCIES) 
+	@rm -f convert_uint64_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_complex128_OBJECTS) $(convert_uint64_complex128_LDADD) $(LIBS)
+
+convert_uint64_complex64$(EXEEXT): $(convert_uint64_complex64_OBJECTS) $(convert_uint64_complex64_DEPENDENCIES) $(EXTRA_convert_uint64_complex64_DEPENDENCIES) 
+	@rm -f convert_uint64_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_complex64_OBJECTS) $(convert_uint64_complex64_LDADD) $(LIBS)
+
+convert_uint64_float32$(EXEEXT): $(convert_uint64_float32_OBJECTS) $(convert_uint64_float32_DEPENDENCIES) $(EXTRA_convert_uint64_float32_DEPENDENCIES) 
+	@rm -f convert_uint64_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_float32_OBJECTS) $(convert_uint64_float32_LDADD) $(LIBS)
+
+convert_uint64_float64$(EXEEXT): $(convert_uint64_float64_OBJECTS) $(convert_uint64_float64_DEPENDENCIES) $(EXTRA_convert_uint64_float64_DEPENDENCIES) 
+	@rm -f convert_uint64_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_float64_OBJECTS) $(convert_uint64_float64_LDADD) $(LIBS)
+
+convert_uint64_int16$(EXEEXT): $(convert_uint64_int16_OBJECTS) $(convert_uint64_int16_DEPENDENCIES) $(EXTRA_convert_uint64_int16_DEPENDENCIES) 
+	@rm -f convert_uint64_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_int16_OBJECTS) $(convert_uint64_int16_LDADD) $(LIBS)
+
+convert_uint64_int32$(EXEEXT): $(convert_uint64_int32_OBJECTS) $(convert_uint64_int32_DEPENDENCIES) $(EXTRA_convert_uint64_int32_DEPENDENCIES) 
+	@rm -f convert_uint64_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_int32_OBJECTS) $(convert_uint64_int32_LDADD) $(LIBS)
+
+convert_uint64_int64$(EXEEXT): $(convert_uint64_int64_OBJECTS) $(convert_uint64_int64_DEPENDENCIES) $(EXTRA_convert_uint64_int64_DEPENDENCIES) 
+	@rm -f convert_uint64_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_int64_OBJECTS) $(convert_uint64_int64_LDADD) $(LIBS)
+
+convert_uint64_int8$(EXEEXT): $(convert_uint64_int8_OBJECTS) $(convert_uint64_int8_DEPENDENCIES) $(EXTRA_convert_uint64_int8_DEPENDENCIES) 
+	@rm -f convert_uint64_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_int8_OBJECTS) $(convert_uint64_int8_LDADD) $(LIBS)
+
+convert_uint64_uint16$(EXEEXT): $(convert_uint64_uint16_OBJECTS) $(convert_uint64_uint16_DEPENDENCIES) $(EXTRA_convert_uint64_uint16_DEPENDENCIES) 
+	@rm -f convert_uint64_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_uint16_OBJECTS) $(convert_uint64_uint16_LDADD) $(LIBS)
+
+convert_uint64_uint32$(EXEEXT): $(convert_uint64_uint32_OBJECTS) $(convert_uint64_uint32_DEPENDENCIES) $(EXTRA_convert_uint64_uint32_DEPENDENCIES) 
+	@rm -f convert_uint64_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_uint32_OBJECTS) $(convert_uint64_uint32_LDADD) $(LIBS)
+
+convert_uint64_uint8$(EXEEXT): $(convert_uint64_uint8_OBJECTS) $(convert_uint64_uint8_DEPENDENCIES) $(EXTRA_convert_uint64_uint8_DEPENDENCIES) 
+	@rm -f convert_uint64_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint64_uint8_OBJECTS) $(convert_uint64_uint8_LDADD) $(LIBS)
+
+convert_uint8_complex128$(EXEEXT): $(convert_uint8_complex128_OBJECTS) $(convert_uint8_complex128_DEPENDENCIES) $(EXTRA_convert_uint8_complex128_DEPENDENCIES) 
+	@rm -f convert_uint8_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_complex128_OBJECTS) $(convert_uint8_complex128_LDADD) $(LIBS)
+
+convert_uint8_complex64$(EXEEXT): $(convert_uint8_complex64_OBJECTS) $(convert_uint8_complex64_DEPENDENCIES) $(EXTRA_convert_uint8_complex64_DEPENDENCIES) 
+	@rm -f convert_uint8_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_complex64_OBJECTS) $(convert_uint8_complex64_LDADD) $(LIBS)
+
+convert_uint8_float32$(EXEEXT): $(convert_uint8_float32_OBJECTS) $(convert_uint8_float32_DEPENDENCIES) $(EXTRA_convert_uint8_float32_DEPENDENCIES) 
+	@rm -f convert_uint8_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_float32_OBJECTS) $(convert_uint8_float32_LDADD) $(LIBS)
+
+convert_uint8_float64$(EXEEXT): $(convert_uint8_float64_OBJECTS) $(convert_uint8_float64_DEPENDENCIES) $(EXTRA_convert_uint8_float64_DEPENDENCIES) 
+	@rm -f convert_uint8_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_float64_OBJECTS) $(convert_uint8_float64_LDADD) $(LIBS)
+
+convert_uint8_int16$(EXEEXT): $(convert_uint8_int16_OBJECTS) $(convert_uint8_int16_DEPENDENCIES) $(EXTRA_convert_uint8_int16_DEPENDENCIES) 
+	@rm -f convert_uint8_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_int16_OBJECTS) $(convert_uint8_int16_LDADD) $(LIBS)
+
+convert_uint8_int32$(EXEEXT): $(convert_uint8_int32_OBJECTS) $(convert_uint8_int32_DEPENDENCIES) $(EXTRA_convert_uint8_int32_DEPENDENCIES) 
+	@rm -f convert_uint8_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_int32_OBJECTS) $(convert_uint8_int32_LDADD) $(LIBS)
+
+convert_uint8_int64$(EXEEXT): $(convert_uint8_int64_OBJECTS) $(convert_uint8_int64_DEPENDENCIES) $(EXTRA_convert_uint8_int64_DEPENDENCIES) 
+	@rm -f convert_uint8_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_int64_OBJECTS) $(convert_uint8_int64_LDADD) $(LIBS)
+
+convert_uint8_int8$(EXEEXT): $(convert_uint8_int8_OBJECTS) $(convert_uint8_int8_DEPENDENCIES) $(EXTRA_convert_uint8_int8_DEPENDENCIES) 
+	@rm -f convert_uint8_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_int8_OBJECTS) $(convert_uint8_int8_LDADD) $(LIBS)
+
+convert_uint8_uint16$(EXEEXT): $(convert_uint8_uint16_OBJECTS) $(convert_uint8_uint16_DEPENDENCIES) $(EXTRA_convert_uint8_uint16_DEPENDENCIES) 
+	@rm -f convert_uint8_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_uint16_OBJECTS) $(convert_uint8_uint16_LDADD) $(LIBS)
+
+convert_uint8_uint32$(EXEEXT): $(convert_uint8_uint32_OBJECTS) $(convert_uint8_uint32_DEPENDENCIES) $(EXTRA_convert_uint8_uint32_DEPENDENCIES) 
+	@rm -f convert_uint8_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_uint32_OBJECTS) $(convert_uint8_uint32_LDADD) $(LIBS)
+
+convert_uint8_uint64$(EXEEXT): $(convert_uint8_uint64_OBJECTS) $(convert_uint8_uint64_DEPENDENCIES) $(EXTRA_convert_uint8_uint64_DEPENDENCIES) 
+	@rm -f convert_uint8_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(convert_uint8_uint64_OBJECTS) $(convert_uint8_uint64_LDADD) $(LIBS)
+
+creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES) $(EXTRA_creat_DEPENDENCIES) 
+	@rm -f creat$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS)
+
+creat_excl$(EXEEXT): $(creat_excl_OBJECTS) $(creat_excl_DEPENDENCIES) $(EXTRA_creat_excl_DEPENDENCIES) 
+	@rm -f creat_excl$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(creat_excl_OBJECTS) $(creat_excl_LDADD) $(LIBS)
+
+creat_rdonly$(EXEEXT): $(creat_rdonly_OBJECTS) $(creat_rdonly_DEPENDENCIES) $(EXTRA_creat_rdonly_DEPENDENCIES) 
+	@rm -f creat_rdonly$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(creat_rdonly_OBJECTS) $(creat_rdonly_LDADD) $(LIBS)
+
+cvlist$(EXEEXT): $(cvlist_OBJECTS) $(cvlist_DEPENDENCIES) $(EXTRA_cvlist_DEPENDENCIES) 
+	@rm -f cvlist$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_OBJECTS) $(cvlist_LDADD) $(LIBS)
+
+cvlist_array$(EXEEXT): $(cvlist_array_OBJECTS) $(cvlist_array_DEPENDENCIES) $(EXTRA_cvlist_array_DEPENDENCIES) 
+	@rm -f cvlist_array$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_array_OBJECTS) $(cvlist_array_LDADD) $(LIBS)
+
+cvlist_array_hidden$(EXEEXT): $(cvlist_array_hidden_OBJECTS) $(cvlist_array_hidden_DEPENDENCIES) $(EXTRA_cvlist_array_hidden_DEPENDENCIES) 
+	@rm -f cvlist_array_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_array_hidden_OBJECTS) $(cvlist_array_hidden_LDADD) $(LIBS)
+
+cvlist_array_meta$(EXEEXT): $(cvlist_array_meta_OBJECTS) $(cvlist_array_meta_DEPENDENCIES) $(EXTRA_cvlist_array_meta_DEPENDENCIES) 
+	@rm -f cvlist_array_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_array_meta_OBJECTS) $(cvlist_array_meta_LDADD) $(LIBS)
+
+cvlist_array_meta_hidden$(EXEEXT): $(cvlist_array_meta_hidden_OBJECTS) $(cvlist_array_meta_hidden_DEPENDENCIES) $(EXTRA_cvlist_array_meta_hidden_DEPENDENCIES) 
+	@rm -f cvlist_array_meta_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_array_meta_hidden_OBJECTS) $(cvlist_array_meta_hidden_LDADD) $(LIBS)
+
+cvlist_hidden$(EXEEXT): $(cvlist_hidden_OBJECTS) $(cvlist_hidden_DEPENDENCIES) $(EXTRA_cvlist_hidden_DEPENDENCIES) 
+	@rm -f cvlist_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_hidden_OBJECTS) $(cvlist_hidden_LDADD) $(LIBS)
+
+cvlist_invalid$(EXEEXT): $(cvlist_invalid_OBJECTS) $(cvlist_invalid_DEPENDENCIES) $(EXTRA_cvlist_invalid_DEPENDENCIES) 
+	@rm -f cvlist_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_invalid_OBJECTS) $(cvlist_invalid_LDADD) $(LIBS)
+
+cvlist_meta$(EXEEXT): $(cvlist_meta_OBJECTS) $(cvlist_meta_DEPENDENCIES) $(EXTRA_cvlist_meta_DEPENDENCIES) 
+	@rm -f cvlist_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_meta_OBJECTS) $(cvlist_meta_LDADD) $(LIBS)
+
+cvlist_meta_hidden$(EXEEXT): $(cvlist_meta_hidden_OBJECTS) $(cvlist_meta_hidden_DEPENDENCIES) $(EXTRA_cvlist_meta_hidden_DEPENDENCIES) 
+	@rm -f cvlist_meta_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_meta_hidden_OBJECTS) $(cvlist_meta_hidden_LDADD) $(LIBS)
+
+cvlist_meta_invalid$(EXEEXT): $(cvlist_meta_invalid_OBJECTS) $(cvlist_meta_invalid_DEPENDENCIES) $(EXTRA_cvlist_meta_invalid_DEPENDENCIES) 
+	@rm -f cvlist_meta_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cvlist_meta_invalid_OBJECTS) $(cvlist_meta_invalid_LDADD) $(LIBS)
+
+del$(EXEEXT): $(del_OBJECTS) $(del_DEPENDENCIES) $(EXTRA_del_DEPENDENCIES) 
+	@rm -f del$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_OBJECTS) $(del_LDADD) $(LIBS)
+
+del_carray$(EXEEXT): $(del_carray_OBJECTS) $(del_carray_DEPENDENCIES) $(EXTRA_del_carray_DEPENDENCIES) 
+	@rm -f del_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_carray_OBJECTS) $(del_carray_LDADD) $(LIBS)
+
+del_carray_deref$(EXEEXT): $(del_carray_deref_OBJECTS) $(del_carray_deref_DEPENDENCIES) $(EXTRA_del_carray_deref_DEPENDENCIES) 
+	@rm -f del_carray_deref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_carray_deref_OBJECTS) $(del_carray_deref_LDADD) $(LIBS)
+
+del_const$(EXEEXT): $(del_const_OBJECTS) $(del_const_DEPENDENCIES) $(EXTRA_del_const_DEPENDENCIES) 
+	@rm -f del_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_const_OBJECTS) $(del_const_LDADD) $(LIBS)
+
+del_const_deref$(EXEEXT): $(del_const_deref_OBJECTS) $(del_const_deref_DEPENDENCIES) $(EXTRA_del_const_deref_DEPENDENCIES) 
+	@rm -f del_const_deref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_const_deref_OBJECTS) $(del_const_deref_LDADD) $(LIBS)
+
+del_const_force$(EXEEXT): $(del_const_force_OBJECTS) $(del_const_force_DEPENDENCIES) $(EXTRA_del_const_force_DEPENDENCIES) 
+	@rm -f del_const_force$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_const_force_OBJECTS) $(del_const_force_LDADD) $(LIBS)
+
+del_data$(EXEEXT): $(del_data_OBJECTS) $(del_data_DEPENDENCIES) $(EXTRA_del_data_DEPENDENCIES) 
+	@rm -f del_data$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_data_OBJECTS) $(del_data_LDADD) $(LIBS)
+
+del_derived$(EXEEXT): $(del_derived_OBJECTS) $(del_derived_DEPENDENCIES) $(EXTRA_del_derived_DEPENDENCIES) 
+	@rm -f del_derived$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_derived_OBJECTS) $(del_derived_LDADD) $(LIBS)
+
+del_derived_after$(EXEEXT): $(del_derived_after_OBJECTS) $(del_derived_after_DEPENDENCIES) $(EXTRA_del_derived_after_DEPENDENCIES) 
+	@rm -f del_derived_after$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_derived_after_OBJECTS) $(del_derived_after_LDADD) $(LIBS)
+
+del_derived_force$(EXEEXT): $(del_derived_force_OBJECTS) $(del_derived_force_DEPENDENCIES) $(EXTRA_del_derived_force_DEPENDENCIES) 
+	@rm -f del_derived_force$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_derived_force_OBJECTS) $(del_derived_force_LDADD) $(LIBS)
+
+del_meta$(EXEEXT): $(del_meta_OBJECTS) $(del_meta_DEPENDENCIES) $(EXTRA_del_meta_DEPENDENCIES) 
+	@rm -f del_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_meta_OBJECTS) $(del_meta_LDADD) $(LIBS)
+
+del_meta_force$(EXEEXT): $(del_meta_force_OBJECTS) $(del_meta_force_DEPENDENCIES) $(EXTRA_del_meta_force_DEPENDENCIES) 
+	@rm -f del_meta_force$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(del_meta_force_OBJECTS) $(del_meta_force_LDADD) $(LIBS)
+
+desync$(EXEEXT): $(desync_OBJECTS) $(desync_DEPENDENCIES) $(EXTRA_desync_DEPENDENCIES) 
+	@rm -f desync$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(desync_OBJECTS) $(desync_LDADD) $(LIBS)
+
+desync_flush$(EXEEXT): $(desync_flush_OBJECTS) $(desync_flush_DEPENDENCIES) $(EXTRA_desync_flush_DEPENDENCIES) 
+	@rm -f desync_flush$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(desync_flush_OBJECTS) $(desync_flush_LDADD) $(LIBS)
+
+desync_reopen$(EXEEXT): $(desync_reopen_OBJECTS) $(desync_reopen_DEPENDENCIES) $(EXTRA_desync_reopen_DEPENDENCIES) 
+	@rm -f desync_reopen$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(desync_reopen_OBJECTS) $(desync_reopen_LDADD) $(LIBS)
+
+desync_reopen_inv$(EXEEXT): $(desync_reopen_inv_OBJECTS) $(desync_reopen_inv_DEPENDENCIES) $(EXTRA_desync_reopen_inv_DEPENDENCIES) 
+	@rm -f desync_reopen_inv$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(desync_reopen_inv_OBJECTS) $(desync_reopen_inv_LDADD) $(LIBS)
+
+dfes_bit$(EXEEXT): $(dfes_bit_OBJECTS) $(dfes_bit_DEPENDENCIES) $(EXTRA_dfes_bit_DEPENDENCIES) 
+	@rm -f dfes_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_bit_OBJECTS) $(dfes_bit_LDADD) $(LIBS)
+
+dfes_divide$(EXEEXT): $(dfes_divide_OBJECTS) $(dfes_divide_DEPENDENCIES) $(EXTRA_dfes_divide_DEPENDENCIES) 
+	@rm -f dfes_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_divide_OBJECTS) $(dfes_divide_LDADD) $(LIBS)
+
+dfes_lincom$(EXEEXT): $(dfes_lincom_OBJECTS) $(dfes_lincom_DEPENDENCIES) $(EXTRA_dfes_lincom_DEPENDENCIES) 
+	@rm -f dfes_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_lincom_OBJECTS) $(dfes_lincom_LDADD) $(LIBS)
+
+dfes_linterp$(EXEEXT): $(dfes_linterp_OBJECTS) $(dfes_linterp_DEPENDENCIES) $(EXTRA_dfes_linterp_DEPENDENCIES) 
+	@rm -f dfes_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_linterp_OBJECTS) $(dfes_linterp_LDADD) $(LIBS)
+
+dfes_multiply$(EXEEXT): $(dfes_multiply_OBJECTS) $(dfes_multiply_DEPENDENCIES) $(EXTRA_dfes_multiply_DEPENDENCIES) 
+	@rm -f dfes_multiply$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_multiply_OBJECTS) $(dfes_multiply_LDADD) $(LIBS)
+
+dfes_null$(EXEEXT): $(dfes_null_OBJECTS) $(dfes_null_DEPENDENCIES) $(EXTRA_dfes_null_DEPENDENCIES) 
+	@rm -f dfes_null$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_null_OBJECTS) $(dfes_null_LDADD) $(LIBS)
+
+dfes_phase$(EXEEXT): $(dfes_phase_OBJECTS) $(dfes_phase_DEPENDENCIES) $(EXTRA_dfes_phase_DEPENDENCIES) 
+	@rm -f dfes_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_phase_OBJECTS) $(dfes_phase_LDADD) $(LIBS)
+
+dfes_raw$(EXEEXT): $(dfes_raw_OBJECTS) $(dfes_raw_DEPENDENCIES) $(EXTRA_dfes_raw_DEPENDENCIES) 
+	@rm -f dfes_raw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_raw_OBJECTS) $(dfes_raw_LDADD) $(LIBS)
+
+dfes_recip$(EXEEXT): $(dfes_recip_OBJECTS) $(dfes_recip_DEPENDENCIES) $(EXTRA_dfes_recip_DEPENDENCIES) 
+	@rm -f dfes_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_recip_OBJECTS) $(dfes_recip_LDADD) $(LIBS)
+
+dfes_zero$(EXEEXT): $(dfes_zero_OBJECTS) $(dfes_zero_DEPENDENCIES) $(EXTRA_dfes_zero_DEPENDENCIES) 
+	@rm -f dfes_zero$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dfes_zero_OBJECTS) $(dfes_zero_LDADD) $(LIBS)
+
+elist_alias$(EXEEXT): $(elist_alias_OBJECTS) $(elist_alias_DEPENDENCIES) $(EXTRA_elist_alias_DEPENDENCIES) 
+	@rm -f elist_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(elist_alias_OBJECTS) $(elist_alias_LDADD) $(LIBS)
+
+elist_hidden$(EXEEXT): $(elist_hidden_OBJECTS) $(elist_hidden_DEPENDENCIES) $(EXTRA_elist_hidden_DEPENDENCIES) 
+	@rm -f elist_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(elist_hidden_OBJECTS) $(elist_hidden_LDADD) $(LIBS)
+
+elist_noalias$(EXEEXT): $(elist_noalias_OBJECTS) $(elist_noalias_DEPENDENCIES) $(EXTRA_elist_noalias_DEPENDENCIES) 
+	@rm -f elist_noalias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(elist_noalias_OBJECTS) $(elist_noalias_LDADD) $(LIBS)
+
+elist_scalar$(EXEEXT): $(elist_scalar_OBJECTS) $(elist_scalar_DEPENDENCIES) $(EXTRA_elist_scalar_DEPENDENCIES) 
+	@rm -f elist_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(elist_scalar_OBJECTS) $(elist_scalar_LDADD) $(LIBS)
+
+encode_alter$(EXEEXT): $(encode_alter_OBJECTS) $(encode_alter_DEPENDENCIES) $(EXTRA_encode_alter_DEPENDENCIES) 
+	@rm -f encode_alter$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(encode_alter_OBJECTS) $(encode_alter_LDADD) $(LIBS)
+
+encode_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)
+
+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_sie$(EXEEXT): $(endian_alter_sie_OBJECTS) $(endian_alter_sie_DEPENDENCIES) $(EXTRA_endian_alter_sie_DEPENDENCIES) 
+	@rm -f endian_alter_sie$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(endian_alter_sie_OBJECTS) $(endian_alter_sie_LDADD) $(LIBS)
+
+endian_get$(EXEEXT): $(endian_get_OBJECTS) $(endian_get_DEPENDENCIES) $(EXTRA_endian_get_DEPENDENCIES) 
+	@rm -f endian_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(endian_get_OBJECTS) $(endian_get_LDADD) $(LIBS)
+
+endian_move$(EXEEXT): $(endian_move_OBJECTS) $(endian_move_DEPENDENCIES) $(EXTRA_endian_move_DEPENDENCIES) 
+	@rm -f endian_move$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(endian_move_OBJECTS) $(endian_move_LDADD) $(LIBS)
+
+entry_bad_code$(EXEEXT): $(entry_bad_code_OBJECTS) $(entry_bad_code_DEPENDENCIES) $(EXTRA_entry_bad_code_DEPENDENCIES) 
+	@rm -f entry_bad_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_bad_code_OBJECTS) $(entry_bad_code_LDADD) $(LIBS)
+
+entry_bit$(EXEEXT): $(entry_bit_OBJECTS) $(entry_bit_DEPENDENCIES) $(EXTRA_entry_bit_DEPENDENCIES) 
+	@rm -f entry_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_bit_OBJECTS) $(entry_bit_LDADD) $(LIBS)
+
+entry_bit_scalar$(EXEEXT): $(entry_bit_scalar_OBJECTS) $(entry_bit_scalar_DEPENDENCIES) $(EXTRA_entry_bit_scalar_DEPENDENCIES) 
+	@rm -f entry_bit_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_bit_scalar_OBJECTS) $(entry_bit_scalar_LDADD) $(LIBS)
+
+entry_divide$(EXEEXT): $(entry_divide_OBJECTS) $(entry_divide_DEPENDENCIES) $(EXTRA_entry_divide_DEPENDENCIES) 
+	@rm -f entry_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_divide_OBJECTS) $(entry_divide_LDADD) $(LIBS)
+
+entry_invalid$(EXEEXT): $(entry_invalid_OBJECTS) $(entry_invalid_DEPENDENCIES) $(EXTRA_entry_invalid_DEPENDENCIES) 
+	@rm -f entry_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_invalid_OBJECTS) $(entry_invalid_LDADD) $(LIBS)
+
+entry_lincom$(EXEEXT): $(entry_lincom_OBJECTS) $(entry_lincom_DEPENDENCIES) $(EXTRA_entry_lincom_DEPENDENCIES) 
+	@rm -f entry_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_lincom_OBJECTS) $(entry_lincom_LDADD) $(LIBS)
+
+entry_lincom_scalar$(EXEEXT): $(entry_lincom_scalar_OBJECTS) $(entry_lincom_scalar_DEPENDENCIES) $(EXTRA_entry_lincom_scalar_DEPENDENCIES) 
+	@rm -f entry_lincom_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_lincom_scalar_OBJECTS) $(entry_lincom_scalar_LDADD) $(LIBS)
+
+entry_linterp$(EXEEXT): $(entry_linterp_OBJECTS) $(entry_linterp_DEPENDENCIES) $(EXTRA_entry_linterp_DEPENDENCIES) 
+	@rm -f entry_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_linterp_OBJECTS) $(entry_linterp_LDADD) $(LIBS)
+
+entry_mplex$(EXEEXT): $(entry_mplex_OBJECTS) $(entry_mplex_DEPENDENCIES) $(EXTRA_entry_mplex_DEPENDENCIES) 
+	@rm -f entry_mplex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_mplex_OBJECTS) $(entry_mplex_LDADD) $(LIBS)
+
+entry_mplex_scalar$(EXEEXT): $(entry_mplex_scalar_OBJECTS) $(entry_mplex_scalar_DEPENDENCIES) $(EXTRA_entry_mplex_scalar_DEPENDENCIES) 
+	@rm -f entry_mplex_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_mplex_scalar_OBJECTS) $(entry_mplex_scalar_LDADD) $(LIBS)
+
+entry_multiply$(EXEEXT): $(entry_multiply_OBJECTS) $(entry_multiply_DEPENDENCIES) $(EXTRA_entry_multiply_DEPENDENCIES) 
+	@rm -f entry_multiply$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_multiply_OBJECTS) $(entry_multiply_LDADD) $(LIBS)
+
+entry_phase$(EXEEXT): $(entry_phase_OBJECTS) $(entry_phase_DEPENDENCIES) $(EXTRA_entry_phase_DEPENDENCIES) 
+	@rm -f entry_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_phase_OBJECTS) $(entry_phase_LDADD) $(LIBS)
+
+entry_phase_scalar$(EXEEXT): $(entry_phase_scalar_OBJECTS) $(entry_phase_scalar_DEPENDENCIES) $(EXTRA_entry_phase_scalar_DEPENDENCIES) 
+	@rm -f entry_phase_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_phase_scalar_OBJECTS) $(entry_phase_scalar_LDADD) $(LIBS)
+
+entry_polynom$(EXEEXT): $(entry_polynom_OBJECTS) $(entry_polynom_DEPENDENCIES) $(EXTRA_entry_polynom_DEPENDENCIES) 
+	@rm -f entry_polynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_polynom_OBJECTS) $(entry_polynom_LDADD) $(LIBS)
+
+entry_polynom_scalar$(EXEEXT): $(entry_polynom_scalar_OBJECTS) $(entry_polynom_scalar_DEPENDENCIES) $(EXTRA_entry_polynom_scalar_DEPENDENCIES) 
+	@rm -f entry_polynom_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_polynom_scalar_OBJECTS) $(entry_polynom_scalar_LDADD) $(LIBS)
+
+entry_raw$(EXEEXT): $(entry_raw_OBJECTS) $(entry_raw_DEPENDENCIES) $(EXTRA_entry_raw_DEPENDENCIES) 
+	@rm -f entry_raw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_raw_OBJECTS) $(entry_raw_LDADD) $(LIBS)
+
+entry_raw_scalar$(EXEEXT): $(entry_raw_scalar_OBJECTS) $(entry_raw_scalar_DEPENDENCIES) $(EXTRA_entry_raw_scalar_DEPENDENCIES) 
+	@rm -f entry_raw_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_raw_scalar_OBJECTS) $(entry_raw_scalar_LDADD) $(LIBS)
+
+entry_raw_scalar_code$(EXEEXT): $(entry_raw_scalar_code_OBJECTS) $(entry_raw_scalar_code_DEPENDENCIES) $(EXTRA_entry_raw_scalar_code_DEPENDENCIES) 
+	@rm -f entry_raw_scalar_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_raw_scalar_code_OBJECTS) $(entry_raw_scalar_code_LDADD) $(LIBS)
+
+entry_raw_scalar_type$(EXEEXT): $(entry_raw_scalar_type_OBJECTS) $(entry_raw_scalar_type_DEPENDENCIES) $(EXTRA_entry_raw_scalar_type_DEPENDENCIES) 
+	@rm -f entry_raw_scalar_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_raw_scalar_type_OBJECTS) $(entry_raw_scalar_type_LDADD) $(LIBS)
+
+entry_recip$(EXEEXT): $(entry_recip_OBJECTS) $(entry_recip_DEPENDENCIES) $(EXTRA_entry_recip_DEPENDENCIES) 
+	@rm -f entry_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_recip_OBJECTS) $(entry_recip_LDADD) $(LIBS)
+
+entry_scalar_repr$(EXEEXT): $(entry_scalar_repr_OBJECTS) $(entry_scalar_repr_DEPENDENCIES) $(EXTRA_entry_scalar_repr_DEPENDENCIES) 
+	@rm -f entry_scalar_repr$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_scalar_repr_OBJECTS) $(entry_scalar_repr_LDADD) $(LIBS)
+
+entry_type$(EXEEXT): $(entry_type_OBJECTS) $(entry_type_DEPENDENCIES) $(EXTRA_entry_type_DEPENDENCIES) 
+	@rm -f entry_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_type_OBJECTS) $(entry_type_LDADD) $(LIBS)
+
+entry_type_alias$(EXEEXT): $(entry_type_alias_OBJECTS) $(entry_type_alias_DEPENDENCIES) $(EXTRA_entry_type_alias_DEPENDENCIES) 
+	@rm -f entry_type_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_type_alias_OBJECTS) $(entry_type_alias_LDADD) $(LIBS)
+
+entry_window$(EXEEXT): $(entry_window_OBJECTS) $(entry_window_DEPENDENCIES) $(EXTRA_entry_window_DEPENDENCIES) 
+	@rm -f entry_window$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_window_OBJECTS) $(entry_window_LDADD) $(LIBS)
+
+entry_window_scalar$(EXEEXT): $(entry_window_scalar_OBJECTS) $(entry_window_scalar_DEPENDENCIES) $(EXTRA_entry_window_scalar_DEPENDENCIES) 
+	@rm -f entry_window_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(entry_window_scalar_OBJECTS) $(entry_window_scalar_LDADD) $(LIBS)
+
+eof$(EXEEXT): $(eof_OBJECTS) $(eof_DEPENDENCIES) $(EXTRA_eof_DEPENDENCIES) 
+	@rm -f eof$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(eof_OBJECTS) $(eof_LDADD) $(LIBS)
+
+eof_index$(EXEEXT): $(eof_index_OBJECTS) $(eof_index_DEPENDENCIES) $(EXTRA_eof_index_DEPENDENCIES) 
+	@rm -f eof_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(eof_index_OBJECTS) $(eof_index_LDADD) $(LIBS)
+
+eof_lincom$(EXEEXT): $(eof_lincom_OBJECTS) $(eof_lincom_DEPENDENCIES) $(EXTRA_eof_lincom_DEPENDENCIES) 
+	@rm -f eof_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(eof_lincom_OBJECTS) $(eof_lincom_LDADD) $(LIBS)
+
+eof_phase$(EXEEXT): $(eof_phase_OBJECTS) $(eof_phase_DEPENDENCIES) $(EXTRA_eof_phase_DEPENDENCIES) 
+	@rm -f eof_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(eof_phase_OBJECTS) $(eof_phase_LDADD) $(LIBS)
+
+error$(EXEEXT): $(error_OBJECTS) $(error_DEPENDENCIES) $(EXTRA_error_DEPENDENCIES) 
+	@rm -f error$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(error_OBJECTS) $(error_LDADD) $(LIBS)
+
+error_error$(EXEEXT): $(error_error_OBJECTS) $(error_error_DEPENDENCIES) $(EXTRA_error_error_DEPENDENCIES) 
+	@rm -f error_error$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(error_error_OBJECTS) $(error_error_LDADD) $(LIBS)
+
+error_num$(EXEEXT): $(error_num_OBJECTS) $(error_num_DEPENDENCIES) $(EXTRA_error_num_DEPENDENCIES) 
+	@rm -f error_num$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(error_num_OBJECTS) $(error_num_LDADD) $(LIBS)
+
+error_short$(EXEEXT): $(error_short_OBJECTS) $(error_short_DEPENDENCIES) $(EXTRA_error_short_DEPENDENCIES) 
+	@rm -f error_short$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(error_short_OBJECTS) $(error_short_LDADD) $(LIBS)
+
+error_verbose$(EXEEXT): $(error_verbose_OBJECTS) $(error_verbose_DEPENDENCIES) $(EXTRA_error_verbose_DEPENDENCIES) 
+	@rm -f error_verbose$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(error_verbose_OBJECTS) $(error_verbose_LDADD) $(LIBS)
+
+error_verbose_prefix$(EXEEXT): $(error_verbose_prefix_OBJECTS) $(error_verbose_prefix_DEPENDENCIES) $(EXTRA_error_verbose_prefix_DEPENDENCIES) 
+	@rm -f error_verbose_prefix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(error_verbose_prefix_OBJECTS) $(error_verbose_prefix_LDADD) $(LIBS)
+
+file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) $(EXTRA_file_DEPENDENCIES) 
+	@rm -f file$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(file_OBJECTS) $(file_LDADD) $(LIBS)
+
+file_code$(EXEEXT): $(file_code_OBJECTS) $(file_code_DEPENDENCIES) $(EXTRA_file_code_DEPENDENCIES) 
+	@rm -f file_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(file_code_OBJECTS) $(file_code_LDADD) $(LIBS)
+
+file_type$(EXEEXT): $(file_type_OBJECTS) $(file_type_DEPENDENCIES) $(EXTRA_file_type_DEPENDENCIES) 
+	@rm -f file_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(file_type_OBJECTS) $(file_type_LDADD) $(LIBS)
+
+flist$(EXEEXT): $(flist_OBJECTS) $(flist_DEPENDENCIES) $(EXTRA_flist_DEPENDENCIES) 
+	@rm -f flist$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_OBJECTS) $(flist_LDADD) $(LIBS)
+
+flist_hidden$(EXEEXT): $(flist_hidden_OBJECTS) $(flist_hidden_DEPENDENCIES) $(EXTRA_flist_hidden_DEPENDENCIES) 
+	@rm -f flist_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_hidden_OBJECTS) $(flist_hidden_LDADD) $(LIBS)
+
+flist_invalid$(EXEEXT): $(flist_invalid_OBJECTS) $(flist_invalid_DEPENDENCIES) $(EXTRA_flist_invalid_DEPENDENCIES) 
+	@rm -f flist_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_invalid_OBJECTS) $(flist_invalid_LDADD) $(LIBS)
+
+flist_meta$(EXEEXT): $(flist_meta_OBJECTS) $(flist_meta_DEPENDENCIES) $(EXTRA_flist_meta_DEPENDENCIES) 
+	@rm -f flist_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_meta_OBJECTS) $(flist_meta_LDADD) $(LIBS)
+
+flist_meta_hidden$(EXEEXT): $(flist_meta_hidden_OBJECTS) $(flist_meta_hidden_DEPENDENCIES) $(EXTRA_flist_meta_hidden_DEPENDENCIES) 
+	@rm -f flist_meta_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_meta_hidden_OBJECTS) $(flist_meta_hidden_LDADD) $(LIBS)
+
+flist_meta_invalid$(EXEEXT): $(flist_meta_invalid_OBJECTS) $(flist_meta_invalid_DEPENDENCIES) $(EXTRA_flist_meta_invalid_DEPENDENCIES) 
+	@rm -f flist_meta_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_meta_invalid_OBJECTS) $(flist_meta_invalid_LDADD) $(LIBS)
+
+flist_type$(EXEEXT): $(flist_type_OBJECTS) $(flist_type_DEPENDENCIES) $(EXTRA_flist_type_DEPENDENCIES) 
+	@rm -f flist_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_type_OBJECTS) $(flist_type_LDADD) $(LIBS)
+
+flist_type_hidden$(EXEEXT): $(flist_type_hidden_OBJECTS) $(flist_type_hidden_DEPENDENCIES) $(EXTRA_flist_type_hidden_DEPENDENCIES) 
+	@rm -f flist_type_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_type_hidden_OBJECTS) $(flist_type_hidden_LDADD) $(LIBS)
+
+flist_type_invalid$(EXEEXT): $(flist_type_invalid_OBJECTS) $(flist_type_invalid_DEPENDENCIES) $(EXTRA_flist_type_invalid_DEPENDENCIES) 
+	@rm -f flist_type_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_type_invalid_OBJECTS) $(flist_type_invalid_LDADD) $(LIBS)
+
+flist_type_meta$(EXEEXT): $(flist_type_meta_OBJECTS) $(flist_type_meta_DEPENDENCIES) $(EXTRA_flist_type_meta_DEPENDENCIES) 
+	@rm -f flist_type_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_type_meta_OBJECTS) $(flist_type_meta_LDADD) $(LIBS)
+
+flist_type_meta_hidden$(EXEEXT): $(flist_type_meta_hidden_OBJECTS) $(flist_type_meta_hidden_DEPENDENCIES) $(EXTRA_flist_type_meta_hidden_DEPENDENCIES) 
+	@rm -f flist_type_meta_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_type_meta_hidden_OBJECTS) $(flist_type_meta_hidden_LDADD) $(LIBS)
+
+flist_type_meta_invalid$(EXEEXT): $(flist_type_meta_invalid_OBJECTS) $(flist_type_meta_invalid_DEPENDENCIES) $(EXTRA_flist_type_meta_invalid_DEPENDENCIES) 
+	@rm -f flist_type_meta_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flist_type_meta_invalid_OBJECTS) $(flist_type_meta_invalid_LDADD) $(LIBS)
+
+flush$(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_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_hex$(EXEEXT): $(flush_hex_OBJECTS) $(flush_hex_DEPENDENCIES) $(EXTRA_flush_hex_DEPENDENCIES) 
+	@rm -f flush_hex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_hex_OBJECTS) $(flush_hex_LDADD) $(LIBS)
+
+flush_invalid$(EXEEXT): $(flush_invalid_OBJECTS) $(flush_invalid_DEPENDENCIES) $(EXTRA_flush_invalid_DEPENDENCIES) 
+	@rm -f flush_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_invalid_OBJECTS) $(flush_invalid_LDADD) $(LIBS)
+
+flush_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_ref$(EXEEXT): $(flush_ref_OBJECTS) $(flush_ref_DEPENDENCIES) $(EXTRA_flush_ref_DEPENDENCIES) 
+	@rm -f flush_ref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_ref_OBJECTS) $(flush_ref_LDADD) $(LIBS)
+
+flush_spec$(EXEEXT): $(flush_spec_OBJECTS) $(flush_spec_DEPENDENCIES) $(EXTRA_flush_spec_DEPENDENCIES) 
+	@rm -f flush_spec$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(flush_spec_OBJECTS) $(flush_spec_LDADD) $(LIBS)
+
+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_get$(EXEEXT): $(foffs_get_OBJECTS) $(foffs_get_DEPENDENCIES) $(EXTRA_foffs_get_DEPENDENCIES) 
+	@rm -f foffs_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(foffs_get_OBJECTS) $(foffs_get_LDADD) $(LIBS)
+
+foffs_move$(EXEEXT): $(foffs_move_OBJECTS) $(foffs_move_DEPENDENCIES) $(EXTRA_foffs_move_DEPENDENCIES) 
+	@rm -f foffs_move$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(foffs_move_OBJECTS) $(foffs_move_LDADD) $(LIBS)
+
+fragment_affix$(EXEEXT): $(fragment_affix_OBJECTS) $(fragment_affix_DEPENDENCIES) $(EXTRA_fragment_affix_DEPENDENCIES) 
+	@rm -f fragment_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_affix_OBJECTS) $(fragment_affix_LDADD) $(LIBS)
+
+fragment_affix_alter$(EXEEXT): $(fragment_affix_alter_OBJECTS) $(fragment_affix_alter_DEPENDENCIES) $(EXTRA_fragment_affix_alter_DEPENDENCIES) 
+	@rm -f fragment_affix_alter$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_affix_alter_OBJECTS) $(fragment_affix_alter_LDADD) $(LIBS)
+
+fragment_affix_alter2$(EXEEXT): $(fragment_affix_alter2_OBJECTS) $(fragment_affix_alter2_DEPENDENCIES) $(EXTRA_fragment_affix_alter2_DEPENDENCIES) 
+	@rm -f fragment_affix_alter2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_affix_alter2_OBJECTS) $(fragment_affix_alter2_LDADD) $(LIBS)
+
+fragment_affix_dup$(EXEEXT): $(fragment_affix_dup_OBJECTS) $(fragment_affix_dup_DEPENDENCIES) $(EXTRA_fragment_affix_dup_DEPENDENCIES) 
+	@rm -f fragment_affix_dup$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_affix_dup_OBJECTS) $(fragment_affix_dup_LDADD) $(LIBS)
+
+fragment_index$(EXEEXT): $(fragment_index_OBJECTS) $(fragment_index_DEPENDENCIES) $(EXTRA_fragment_index_DEPENDENCIES) 
+	@rm -f fragment_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_index_OBJECTS) $(fragment_index_LDADD) $(LIBS)
+
+fragment_index_alias$(EXEEXT): $(fragment_index_alias_OBJECTS) $(fragment_index_alias_DEPENDENCIES) $(EXTRA_fragment_index_alias_DEPENDENCIES) 
+	@rm -f fragment_index_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_index_alias_OBJECTS) $(fragment_index_alias_LDADD) $(LIBS)
+
+fragment_name$(EXEEXT): $(fragment_name_OBJECTS) $(fragment_name_DEPENDENCIES) $(EXTRA_fragment_name_DEPENDENCIES) 
+	@rm -f fragment_name$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_name_OBJECTS) $(fragment_name_LDADD) $(LIBS)
+
+fragment_name_oor$(EXEEXT): $(fragment_name_oor_OBJECTS) $(fragment_name_oor_DEPENDENCIES) $(EXTRA_fragment_name_oor_DEPENDENCIES) 
+	@rm -f fragment_name_oor$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_name_oor_OBJECTS) $(fragment_name_oor_LDADD) $(LIBS)
+
+fragment_num$(EXEEXT): $(fragment_num_OBJECTS) $(fragment_num_DEPENDENCIES) $(EXTRA_fragment_num_DEPENDENCIES) 
+	@rm -f fragment_num$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_num_OBJECTS) $(fragment_num_LDADD) $(LIBS)
+
+fragment_parent$(EXEEXT): $(fragment_parent_OBJECTS) $(fragment_parent_DEPENDENCIES) $(EXTRA_fragment_parent_DEPENDENCIES) 
+	@rm -f fragment_parent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fragment_parent_OBJECTS) $(fragment_parent_LDADD) $(LIBS)
+
+get64$(EXEEXT): $(get64_OBJECTS) $(get64_DEPENDENCIES) $(EXTRA_get64_DEPENDENCIES) 
+	@rm -f get64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get64_OBJECTS) $(get64_LDADD) $(LIBS)
+
+get_affix$(EXEEXT): $(get_affix_OBJECTS) $(get_affix_DEPENDENCIES) $(EXTRA_get_affix_DEPENDENCIES) 
+	@rm -f get_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_affix_OBJECTS) $(get_affix_LDADD) $(LIBS)
+
+get_bad_code$(EXEEXT): $(get_bad_code_OBJECTS) $(get_bad_code_DEPENDENCIES) $(EXTRA_get_bad_code_DEPENDENCIES) 
+	@rm -f get_bad_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_bad_code_OBJECTS) $(get_bad_code_LDADD) $(LIBS)
+
+get_bit$(EXEEXT): $(get_bit_OBJECTS) $(get_bit_DEPENDENCIES) $(EXTRA_get_bit_DEPENDENCIES) 
+	@rm -f get_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_bit_OBJECTS) $(get_bit_LDADD) $(LIBS)
+
+get_carray$(EXEEXT): $(get_carray_OBJECTS) $(get_carray_DEPENDENCIES) $(EXTRA_get_carray_DEPENDENCIES) 
+	@rm -f get_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_carray_OBJECTS) $(get_carray_LDADD) $(LIBS)
+
+get_carray_c2r$(EXEEXT): $(get_carray_c2r_OBJECTS) $(get_carray_c2r_DEPENDENCIES) $(EXTRA_get_carray_c2r_DEPENDENCIES) 
+	@rm -f get_carray_c2r$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_carray_c2r_OBJECTS) $(get_carray_c2r_LDADD) $(LIBS)
+
+get_carray_len$(EXEEXT): $(get_carray_len_OBJECTS) $(get_carray_len_DEPENDENCIES) $(EXTRA_get_carray_len_DEPENDENCIES) 
+	@rm -f get_carray_len$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_carray_len_OBJECTS) $(get_carray_len_LDADD) $(LIBS)
+
+get_carray_slice$(EXEEXT): $(get_carray_slice_OBJECTS) $(get_carray_slice_DEPENDENCIES) $(EXTRA_get_carray_slice_DEPENDENCIES) 
+	@rm -f get_carray_slice$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_carray_slice_OBJECTS) $(get_carray_slice_LDADD) $(LIBS)
+
+get_char$(EXEEXT): $(get_char_OBJECTS) $(get_char_DEPENDENCIES) $(EXTRA_get_char_DEPENDENCIES) 
+	@rm -f get_char$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_char_OBJECTS) $(get_char_LDADD) $(LIBS)
+
+get_clincom$(EXEEXT): $(get_clincom_OBJECTS) $(get_clincom_DEPENDENCIES) $(EXTRA_get_clincom_DEPENDENCIES) 
+	@rm -f get_clincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_clincom_OBJECTS) $(get_clincom_LDADD) $(LIBS)
+
+get_complex128$(EXEEXT): $(get_complex128_OBJECTS) $(get_complex128_DEPENDENCIES) $(EXTRA_get_complex128_DEPENDENCIES) 
+	@rm -f get_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_complex128_OBJECTS) $(get_complex128_LDADD) $(LIBS)
+
+get_complex64$(EXEEXT): $(get_complex64_OBJECTS) $(get_complex64_DEPENDENCIES) $(EXTRA_get_complex64_DEPENDENCIES) 
+	@rm -f get_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_complex64_OBJECTS) $(get_complex64_LDADD) $(LIBS)
+
+get_const$(EXEEXT): $(get_const_OBJECTS) $(get_const_DEPENDENCIES) $(EXTRA_get_const_DEPENDENCIES) 
+	@rm -f get_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_const_OBJECTS) $(get_const_LDADD) $(LIBS)
+
+get_const_complex$(EXEEXT): $(get_const_complex_OBJECTS) $(get_const_complex_DEPENDENCIES) $(EXTRA_get_const_complex_DEPENDENCIES) 
+	@rm -f get_const_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_const_complex_OBJECTS) $(get_const_complex_LDADD) $(LIBS)
+
+get_const_repr$(EXEEXT): $(get_const_repr_OBJECTS) $(get_const_repr_DEPENDENCIES) $(EXTRA_get_const_repr_DEPENDENCIES) 
+	@rm -f get_const_repr$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_const_repr_OBJECTS) $(get_const_repr_LDADD) $(LIBS)
+
+get_cpolynom$(EXEEXT): $(get_cpolynom_OBJECTS) $(get_cpolynom_DEPENDENCIES) $(EXTRA_get_cpolynom_DEPENDENCIES) 
+	@rm -f get_cpolynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_cpolynom_OBJECTS) $(get_cpolynom_LDADD) $(LIBS)
+
+get_cpolynom1$(EXEEXT): $(get_cpolynom1_OBJECTS) $(get_cpolynom1_DEPENDENCIES) $(EXTRA_get_cpolynom1_DEPENDENCIES) 
+	@rm -f get_cpolynom1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_cpolynom1_OBJECTS) $(get_cpolynom1_LDADD) $(LIBS)
+
+get_cpolynom_int$(EXEEXT): $(get_cpolynom_int_OBJECTS) $(get_cpolynom_int_DEPENDENCIES) $(EXTRA_get_cpolynom_int_DEPENDENCIES) 
+	@rm -f get_cpolynom_int$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_cpolynom_int_OBJECTS) $(get_cpolynom_int_LDADD) $(LIBS)
+
+get_divide$(EXEEXT): $(get_divide_OBJECTS) $(get_divide_DEPENDENCIES) $(EXTRA_get_divide_DEPENDENCIES) 
+	@rm -f get_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_divide_OBJECTS) $(get_divide_LDADD) $(LIBS)
+
+get_divide_ccin$(EXEEXT): $(get_divide_ccin_OBJECTS) $(get_divide_ccin_DEPENDENCIES) $(EXTRA_get_divide_ccin_DEPENDENCIES) 
+	@rm -f get_divide_ccin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_divide_ccin_OBJECTS) $(get_divide_ccin_LDADD) $(LIBS)
+
+get_divide_crin$(EXEEXT): $(get_divide_crin_OBJECTS) $(get_divide_crin_DEPENDENCIES) $(EXTRA_get_divide_crin_DEPENDENCIES) 
+	@rm -f get_divide_crin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_divide_crin_OBJECTS) $(get_divide_crin_LDADD) $(LIBS)
+
+get_divide_crinr$(EXEEXT): $(get_divide_crinr_OBJECTS) $(get_divide_crinr_DEPENDENCIES) $(EXTRA_get_divide_crinr_DEPENDENCIES) 
+	@rm -f get_divide_crinr$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_divide_crinr_OBJECTS) $(get_divide_crinr_LDADD) $(LIBS)
+
+get_divide_rcin$(EXEEXT): $(get_divide_rcin_OBJECTS) $(get_divide_rcin_DEPENDENCIES) $(EXTRA_get_divide_rcin_DEPENDENCIES) 
+	@rm -f get_divide_rcin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_divide_rcin_OBJECTS) $(get_divide_rcin_LDADD) $(LIBS)
+
+get_divide_s$(EXEEXT): $(get_divide_s_OBJECTS) $(get_divide_s_DEPENDENCIES) $(EXTRA_get_divide_s_DEPENDENCIES) 
+	@rm -f get_divide_s$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_divide_s_OBJECTS) $(get_divide_s_LDADD) $(LIBS)
+
+get_endian16$(EXEEXT): $(get_endian16_OBJECTS) $(get_endian16_DEPENDENCIES) $(EXTRA_get_endian16_DEPENDENCIES) 
+	@rm -f get_endian16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian16_OBJECTS) $(get_endian16_LDADD) $(LIBS)
+
+get_endian32$(EXEEXT): $(get_endian32_OBJECTS) $(get_endian32_DEPENDENCIES) $(EXTRA_get_endian32_DEPENDENCIES) 
+	@rm -f get_endian32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian32_OBJECTS) $(get_endian32_LDADD) $(LIBS)
+
+get_endian64$(EXEEXT): $(get_endian64_OBJECTS) $(get_endian64_DEPENDENCIES) $(EXTRA_get_endian64_DEPENDENCIES) 
+	@rm -f get_endian64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian64_OBJECTS) $(get_endian64_LDADD) $(LIBS)
+
+get_endian8$(EXEEXT): $(get_endian8_OBJECTS) $(get_endian8_DEPENDENCIES) $(EXTRA_get_endian8_DEPENDENCIES) 
+	@rm -f get_endian8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian8_OBJECTS) $(get_endian8_LDADD) $(LIBS)
+
+get_endian_complex128_arm$(EXEEXT): $(get_endian_complex128_arm_OBJECTS) $(get_endian_complex128_arm_DEPENDENCIES) $(EXTRA_get_endian_complex128_arm_DEPENDENCIES) 
+	@rm -f get_endian_complex128_arm$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_complex128_arm_OBJECTS) $(get_endian_complex128_arm_LDADD) $(LIBS)
+
+get_endian_complex128_big$(EXEEXT): $(get_endian_complex128_big_OBJECTS) $(get_endian_complex128_big_DEPENDENCIES) $(EXTRA_get_endian_complex128_big_DEPENDENCIES) 
+	@rm -f get_endian_complex128_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_complex128_big_OBJECTS) $(get_endian_complex128_big_LDADD) $(LIBS)
+
+get_endian_complex128_little$(EXEEXT): $(get_endian_complex128_little_OBJECTS) $(get_endian_complex128_little_DEPENDENCIES) $(EXTRA_get_endian_complex128_little_DEPENDENCIES) 
+	@rm -f get_endian_complex128_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_complex128_little_OBJECTS) $(get_endian_complex128_little_LDADD) $(LIBS)
+
+get_endian_complex64_arm$(EXEEXT): $(get_endian_complex64_arm_OBJECTS) $(get_endian_complex64_arm_DEPENDENCIES) $(EXTRA_get_endian_complex64_arm_DEPENDENCIES) 
+	@rm -f get_endian_complex64_arm$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_complex64_arm_OBJECTS) $(get_endian_complex64_arm_LDADD) $(LIBS)
+
+get_endian_complex64_big$(EXEEXT): $(get_endian_complex64_big_OBJECTS) $(get_endian_complex64_big_DEPENDENCIES) $(EXTRA_get_endian_complex64_big_DEPENDENCIES) 
+	@rm -f get_endian_complex64_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_complex64_big_OBJECTS) $(get_endian_complex64_big_LDADD) $(LIBS)
+
+get_endian_complex64_little$(EXEEXT): $(get_endian_complex64_little_OBJECTS) $(get_endian_complex64_little_DEPENDENCIES) $(EXTRA_get_endian_complex64_little_DEPENDENCIES) 
+	@rm -f get_endian_complex64_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_complex64_little_OBJECTS) $(get_endian_complex64_little_LDADD) $(LIBS)
+
+get_endian_float32_arm$(EXEEXT): $(get_endian_float32_arm_OBJECTS) $(get_endian_float32_arm_DEPENDENCIES) $(EXTRA_get_endian_float32_arm_DEPENDENCIES) 
+	@rm -f get_endian_float32_arm$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_float32_arm_OBJECTS) $(get_endian_float32_arm_LDADD) $(LIBS)
+
+get_endian_float32_big$(EXEEXT): $(get_endian_float32_big_OBJECTS) $(get_endian_float32_big_DEPENDENCIES) $(EXTRA_get_endian_float32_big_DEPENDENCIES) 
+	@rm -f get_endian_float32_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_float32_big_OBJECTS) $(get_endian_float32_big_LDADD) $(LIBS)
+
+get_endian_float32_little$(EXEEXT): $(get_endian_float32_little_OBJECTS) $(get_endian_float32_little_DEPENDENCIES) $(EXTRA_get_endian_float32_little_DEPENDENCIES) 
+	@rm -f get_endian_float32_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_float32_little_OBJECTS) $(get_endian_float32_little_LDADD) $(LIBS)
+
+get_endian_float64_arm$(EXEEXT): $(get_endian_float64_arm_OBJECTS) $(get_endian_float64_arm_DEPENDENCIES) $(EXTRA_get_endian_float64_arm_DEPENDENCIES) 
+	@rm -f get_endian_float64_arm$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_float64_arm_OBJECTS) $(get_endian_float64_arm_LDADD) $(LIBS)
+
+get_endian_float64_big$(EXEEXT): $(get_endian_float64_big_OBJECTS) $(get_endian_float64_big_DEPENDENCIES) $(EXTRA_get_endian_float64_big_DEPENDENCIES) 
+	@rm -f get_endian_float64_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_float64_big_OBJECTS) $(get_endian_float64_big_LDADD) $(LIBS)
+
+get_endian_float64_little$(EXEEXT): $(get_endian_float64_little_OBJECTS) $(get_endian_float64_little_DEPENDENCIES) $(EXTRA_get_endian_float64_little_DEPENDENCIES) 
+	@rm -f get_endian_float64_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_endian_float64_little_OBJECTS) $(get_endian_float64_little_LDADD) $(LIBS)
+
+get_ff$(EXEEXT): $(get_ff_OBJECTS) $(get_ff_DEPENDENCIES) $(EXTRA_get_ff_DEPENDENCIES) 
+	@rm -f get_ff$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_ff_OBJECTS) $(get_ff_LDADD) $(LIBS)
+
+get_float32$(EXEEXT): $(get_float32_OBJECTS) $(get_float32_DEPENDENCIES) $(EXTRA_get_float32_DEPENDENCIES) 
+	@rm -f get_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_float32_OBJECTS) $(get_float32_LDADD) $(LIBS)
+
+get_float64$(EXEEXT): $(get_float64_OBJECTS) $(get_float64_DEPENDENCIES) $(EXTRA_get_float64_DEPENDENCIES) 
+	@rm -f get_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_float64_OBJECTS) $(get_float64_LDADD) $(LIBS)
+
+get_foffs$(EXEEXT): $(get_foffs_OBJECTS) $(get_foffs_DEPENDENCIES) $(EXTRA_get_foffs_DEPENDENCIES) 
+	@rm -f get_foffs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_foffs_OBJECTS) $(get_foffs_LDADD) $(LIBS)
+
+get_foffs2$(EXEEXT): $(get_foffs2_OBJECTS) $(get_foffs2_DEPENDENCIES) $(EXTRA_get_foffs2_DEPENDENCIES) 
+	@rm -f get_foffs2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_foffs2_OBJECTS) $(get_foffs2_LDADD) $(LIBS)
+
+get_fs$(EXEEXT): $(get_fs_OBJECTS) $(get_fs_DEPENDENCIES) $(EXTRA_get_fs_DEPENDENCIES) 
+	@rm -f get_fs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_fs_OBJECTS) $(get_fs_LDADD) $(LIBS)
+
+get_here$(EXEEXT): $(get_here_OBJECTS) $(get_here_DEPENDENCIES) $(EXTRA_get_here_DEPENDENCIES) 
+	@rm -f get_here$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_here_OBJECTS) $(get_here_LDADD) $(LIBS)
+
+get_here_foffs$(EXEEXT): $(get_here_foffs_OBJECTS) $(get_here_foffs_DEPENDENCIES) $(EXTRA_get_here_foffs_DEPENDENCIES) 
+	@rm -f get_here_foffs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_here_foffs_OBJECTS) $(get_here_foffs_LDADD) $(LIBS)
+
+get_heres$(EXEEXT): $(get_heres_OBJECTS) $(get_heres_DEPENDENCIES) $(EXTRA_get_heres_DEPENDENCIES) 
+	@rm -f get_heres$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_heres_OBJECTS) $(get_heres_LDADD) $(LIBS)
+
+get_int16$(EXEEXT): $(get_int16_OBJECTS) $(get_int16_DEPENDENCIES) $(EXTRA_get_int16_DEPENDENCIES) 
+	@rm -f get_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_int16_OBJECTS) $(get_int16_LDADD) $(LIBS)
+
+get_int32$(EXEEXT): $(get_int32_OBJECTS) $(get_int32_DEPENDENCIES) $(EXTRA_get_int32_DEPENDENCIES) 
+	@rm -f get_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_int32_OBJECTS) $(get_int32_LDADD) $(LIBS)
+
+get_int64$(EXEEXT): $(get_int64_OBJECTS) $(get_int64_DEPENDENCIES) $(EXTRA_get_int64_DEPENDENCIES) 
+	@rm -f get_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_int64_OBJECTS) $(get_int64_LDADD) $(LIBS)
+
+get_int8$(EXEEXT): $(get_int8_OBJECTS) $(get_int8_DEPENDENCIES) $(EXTRA_get_int8_DEPENDENCIES) 
+	@rm -f get_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_int8_OBJECTS) $(get_int8_LDADD) $(LIBS)
+
+get_invalid$(EXEEXT): $(get_invalid_OBJECTS) $(get_invalid_DEPENDENCIES) $(EXTRA_get_invalid_DEPENDENCIES) 
+	@rm -f get_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_invalid_OBJECTS) $(get_invalid_LDADD) $(LIBS)
+
+get_lincom1$(EXEEXT): $(get_lincom1_OBJECTS) $(get_lincom1_DEPENDENCIES) $(EXTRA_get_lincom1_DEPENDENCIES) 
+	@rm -f get_lincom1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom1_OBJECTS) $(get_lincom1_LDADD) $(LIBS)
+
+get_lincom2$(EXEEXT): $(get_lincom2_OBJECTS) $(get_lincom2_DEPENDENCIES) $(EXTRA_get_lincom2_DEPENDENCIES) 
+	@rm -f get_lincom2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom2_OBJECTS) $(get_lincom2_LDADD) $(LIBS)
+
+get_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_lincom_noin$(EXEEXT): $(get_lincom_noin_OBJECTS) $(get_lincom_noin_DEPENDENCIES) $(EXTRA_get_lincom_noin_DEPENDENCIES) 
+	@rm -f get_lincom_noin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom_noin_OBJECTS) $(get_lincom_noin_LDADD) $(LIBS)
+
+get_lincom_non$(EXEEXT): $(get_lincom_non_OBJECTS) $(get_lincom_non_DEPENDENCIES) $(EXTRA_get_lincom_non_DEPENDENCIES) 
+	@rm -f get_lincom_non$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom_non_OBJECTS) $(get_lincom_non_LDADD) $(LIBS)
+
+get_lincom_null$(EXEEXT): $(get_lincom_null_OBJECTS) $(get_lincom_null_DEPENDENCIES) $(EXTRA_get_lincom_null_DEPENDENCIES) 
+	@rm -f get_lincom_null$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom_null_OBJECTS) $(get_lincom_null_LDADD) $(LIBS)
+
+get_lincom_spf$(EXEEXT): $(get_lincom_spf_OBJECTS) $(get_lincom_spf_DEPENDENCIES) $(EXTRA_get_lincom_spf_DEPENDENCIES) 
+	@rm -f get_lincom_spf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_lincom_spf_OBJECTS) $(get_lincom_spf_LDADD) $(LIBS)
+
+get_linterp$(EXEEXT): $(get_linterp_OBJECTS) $(get_linterp_DEPENDENCIES) $(EXTRA_get_linterp_DEPENDENCIES) 
+	@rm -f get_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_linterp_OBJECTS) $(get_linterp_LDADD) $(LIBS)
+
+get_linterp_noin$(EXEEXT): $(get_linterp_noin_OBJECTS) $(get_linterp_noin_DEPENDENCIES) $(EXTRA_get_linterp_noin_DEPENDENCIES) 
+	@rm -f get_linterp_noin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_linterp_noin_OBJECTS) $(get_linterp_noin_LDADD) $(LIBS)
+
+get_linterp_notab$(EXEEXT): $(get_linterp_notab_OBJECTS) $(get_linterp_notab_DEPENDENCIES) $(EXTRA_get_linterp_notab_DEPENDENCIES) 
+	@rm -f get_linterp_notab$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_linterp_notab_OBJECTS) $(get_linterp_notab_LDADD) $(LIBS)
+
+get_linterp_sort$(EXEEXT): $(get_linterp_sort_OBJECTS) $(get_linterp_sort_DEPENDENCIES) $(EXTRA_get_linterp_sort_DEPENDENCIES) 
+	@rm -f get_linterp_sort$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_linterp_sort_OBJECTS) $(get_linterp_sort_LDADD) $(LIBS)
+
+get_mplex$(EXEEXT): $(get_mplex_OBJECTS) $(get_mplex_DEPENDENCIES) $(EXTRA_get_mplex_DEPENDENCIES) 
+	@rm -f get_mplex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_mplex_OBJECTS) $(get_mplex_LDADD) $(LIBS)
+
+get_mplex_bof$(EXEEXT): $(get_mplex_bof_OBJECTS) $(get_mplex_bof_DEPENDENCIES) $(EXTRA_get_mplex_bof_DEPENDENCIES) 
+	@rm -f get_mplex_bof$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_mplex_bof_OBJECTS) $(get_mplex_bof_LDADD) $(LIBS)
+
+get_mplex_lb$(EXEEXT): $(get_mplex_lb_OBJECTS) $(get_mplex_lb_DEPENDENCIES) $(EXTRA_get_mplex_lb_DEPENDENCIES) 
+	@rm -f get_mplex_lb$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_mplex_lb_OBJECTS) $(get_mplex_lb_LDADD) $(LIBS)
+
+get_mplex_lball$(EXEEXT): $(get_mplex_lball_OBJECTS) $(get_mplex_lball_DEPENDENCIES) $(EXTRA_get_mplex_lball_DEPENDENCIES) 
+	@rm -f get_mplex_lball$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_mplex_lball_OBJECTS) $(get_mplex_lball_LDADD) $(LIBS)
+
+get_mplex_nolb$(EXEEXT): $(get_mplex_nolb_OBJECTS) $(get_mplex_nolb_DEPENDENCIES) $(EXTRA_get_mplex_nolb_DEPENDENCIES) 
+	@rm -f get_mplex_nolb$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_mplex_nolb_OBJECTS) $(get_mplex_nolb_LDADD) $(LIBS)
+
+get_multiply$(EXEEXT): $(get_multiply_OBJECTS) $(get_multiply_DEPENDENCIES) $(EXTRA_get_multiply_DEPENDENCIES) 
+	@rm -f get_multiply$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_multiply_OBJECTS) $(get_multiply_LDADD) $(LIBS)
+
+get_multiply_ccin$(EXEEXT): $(get_multiply_ccin_OBJECTS) $(get_multiply_ccin_DEPENDENCIES) $(EXTRA_get_multiply_ccin_DEPENDENCIES) 
+	@rm -f get_multiply_ccin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_multiply_ccin_OBJECTS) $(get_multiply_ccin_LDADD) $(LIBS)
+
+get_multiply_crin$(EXEEXT): $(get_multiply_crin_OBJECTS) $(get_multiply_crin_DEPENDENCIES) $(EXTRA_get_multiply_crin_DEPENDENCIES) 
+	@rm -f get_multiply_crin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_multiply_crin_OBJECTS) $(get_multiply_crin_LDADD) $(LIBS)
+
+get_multiply_crinr$(EXEEXT): $(get_multiply_crinr_OBJECTS) $(get_multiply_crinr_DEPENDENCIES) $(EXTRA_get_multiply_crinr_DEPENDENCIES) 
+	@rm -f get_multiply_crinr$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_multiply_crinr_OBJECTS) $(get_multiply_crinr_LDADD) $(LIBS)
+
+get_multiply_noin$(EXEEXT): $(get_multiply_noin_OBJECTS) $(get_multiply_noin_DEPENDENCIES) $(EXTRA_get_multiply_noin_DEPENDENCIES) 
+	@rm -f get_multiply_noin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_multiply_noin_OBJECTS) $(get_multiply_noin_LDADD) $(LIBS)
+
+get_multiply_rcin$(EXEEXT): $(get_multiply_rcin_OBJECTS) $(get_multiply_rcin_DEPENDENCIES) $(EXTRA_get_multiply_rcin_DEPENDENCIES) 
+	@rm -f get_multiply_rcin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_multiply_rcin_OBJECTS) $(get_multiply_rcin_LDADD) $(LIBS)
+
+get_multiply_s$(EXEEXT): $(get_multiply_s_OBJECTS) $(get_multiply_s_DEPENDENCIES) $(EXTRA_get_multiply_s_DEPENDENCIES) 
+	@rm -f get_multiply_s$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_multiply_s_OBJECTS) $(get_multiply_s_LDADD) $(LIBS)
+
+get_nonexistent$(EXEEXT): $(get_nonexistent_OBJECTS) $(get_nonexistent_DEPENDENCIES) $(EXTRA_get_nonexistent_DEPENDENCIES) 
+	@rm -f get_nonexistent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_nonexistent_OBJECTS) $(get_nonexistent_LDADD) $(LIBS)
+
+get_null$(EXEEXT): $(get_null_OBJECTS) $(get_null_DEPENDENCIES) $(EXTRA_get_null_DEPENDENCIES) 
+	@rm -f get_null$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_null_OBJECTS) $(get_null_LDADD) $(LIBS)
+
+get_off64$(EXEEXT): $(get_off64_OBJECTS) $(get_off64_DEPENDENCIES) $(EXTRA_get_off64_DEPENDENCIES) 
+	@rm -f get_off64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_off64_OBJECTS) $(get_off64_LDADD) $(LIBS)
+
+get_phase$(EXEEXT): $(get_phase_OBJECTS) $(get_phase_DEPENDENCIES) $(EXTRA_get_phase_DEPENDENCIES) 
+	@rm -f get_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_phase_OBJECTS) $(get_phase_LDADD) $(LIBS)
+
+get_phase_affix$(EXEEXT): $(get_phase_affix_OBJECTS) $(get_phase_affix_DEPENDENCIES) $(EXTRA_get_phase_affix_DEPENDENCIES) 
+	@rm -f get_phase_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_phase_affix_OBJECTS) $(get_phase_affix_LDADD) $(LIBS)
+
+get_polynom$(EXEEXT): $(get_polynom_OBJECTS) $(get_polynom_DEPENDENCIES) $(EXTRA_get_polynom_DEPENDENCIES) 
+	@rm -f get_polynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_polynom_OBJECTS) $(get_polynom_LDADD) $(LIBS)
+
+get_polynom_cmpin$(EXEEXT): $(get_polynom_cmpin_OBJECTS) $(get_polynom_cmpin_DEPENDENCIES) $(EXTRA_get_polynom_cmpin_DEPENDENCIES) 
+	@rm -f get_polynom_cmpin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_polynom_cmpin_OBJECTS) $(get_polynom_cmpin_LDADD) $(LIBS)
+
+get_polynom_noin$(EXEEXT): $(get_polynom_noin_OBJECTS) $(get_polynom_noin_DEPENDENCIES) $(EXTRA_get_polynom_noin_DEPENDENCIES) 
+	@rm -f get_polynom_noin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_polynom_noin_OBJECTS) $(get_polynom_noin_LDADD) $(LIBS)
+
+get_recip$(EXEEXT): $(get_recip_OBJECTS) $(get_recip_DEPENDENCIES) $(EXTRA_get_recip_DEPENDENCIES) 
+	@rm -f get_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_recip_OBJECTS) $(get_recip_LDADD) $(LIBS)
+
+get_recip_const$(EXEEXT): $(get_recip_const_OBJECTS) $(get_recip_const_DEPENDENCIES) $(EXTRA_get_recip_const_DEPENDENCIES) 
+	@rm -f get_recip_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_recip_const_OBJECTS) $(get_recip_const_LDADD) $(LIBS)
+
+get_recurse$(EXEEXT): $(get_recurse_OBJECTS) $(get_recurse_DEPENDENCIES) $(EXTRA_get_recurse_DEPENDENCIES) 
+	@rm -f get_recurse$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_recurse_OBJECTS) $(get_recurse_LDADD) $(LIBS)
+
+get_rofs$(EXEEXT): $(get_rofs_OBJECTS) $(get_rofs_DEPENDENCIES) $(EXTRA_get_rofs_DEPENDENCIES) 
+	@rm -f get_rofs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_rofs_OBJECTS) $(get_rofs_LDADD) $(LIBS)
+
+get_sbit$(EXEEXT): $(get_sbit_OBJECTS) $(get_sbit_DEPENDENCIES) $(EXTRA_get_sbit_DEPENDENCIES) 
+	@rm -f get_sbit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_sbit_OBJECTS) $(get_sbit_LDADD) $(LIBS)
+
+get_sf$(EXEEXT): $(get_sf_OBJECTS) $(get_sf_DEPENDENCIES) $(EXTRA_get_sf_DEPENDENCIES) 
+	@rm -f get_sf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_sf_OBJECTS) $(get_sf_LDADD) $(LIBS)
+
+get_ss$(EXEEXT): $(get_ss_OBJECTS) $(get_ss_DEPENDENCIES) $(EXTRA_get_ss_DEPENDENCIES) 
+	@rm -f get_ss$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_ss_OBJECTS) $(get_ss_LDADD) $(LIBS)
+
+get_type$(EXEEXT): $(get_type_OBJECTS) $(get_type_DEPENDENCIES) $(EXTRA_get_type_DEPENDENCIES) 
+	@rm -f get_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_type_OBJECTS) $(get_type_LDADD) $(LIBS)
+
+get_uint16$(EXEEXT): $(get_uint16_OBJECTS) $(get_uint16_DEPENDENCIES) $(EXTRA_get_uint16_DEPENDENCIES) 
+	@rm -f get_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_uint16_OBJECTS) $(get_uint16_LDADD) $(LIBS)
+
+get_uint32$(EXEEXT): $(get_uint32_OBJECTS) $(get_uint32_DEPENDENCIES) $(EXTRA_get_uint32_DEPENDENCIES) 
+	@rm -f get_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_uint32_OBJECTS) $(get_uint32_LDADD) $(LIBS)
+
+get_uint64$(EXEEXT): $(get_uint64_OBJECTS) $(get_uint64_DEPENDENCIES) $(EXTRA_get_uint64_DEPENDENCIES) 
+	@rm -f get_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_uint64_OBJECTS) $(get_uint64_LDADD) $(LIBS)
+
+get_window$(EXEEXT): $(get_window_OBJECTS) $(get_window_DEPENDENCIES) $(EXTRA_get_window_DEPENDENCIES) 
+	@rm -f get_window$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_OBJECTS) $(get_window_LDADD) $(LIBS)
+
+get_window_clr$(EXEEXT): $(get_window_clr_OBJECTS) $(get_window_clr_DEPENDENCIES) $(EXTRA_get_window_clr_DEPENDENCIES) 
+	@rm -f get_window_clr$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_clr_OBJECTS) $(get_window_clr_LDADD) $(LIBS)
+
+get_window_ge$(EXEEXT): $(get_window_ge_OBJECTS) $(get_window_ge_DEPENDENCIES) $(EXTRA_get_window_ge_DEPENDENCIES) 
+	@rm -f get_window_ge$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_ge_OBJECTS) $(get_window_ge_LDADD) $(LIBS)
+
+get_window_gt$(EXEEXT): $(get_window_gt_OBJECTS) $(get_window_gt_DEPENDENCIES) $(EXTRA_get_window_gt_DEPENDENCIES) 
+	@rm -f get_window_gt$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_gt_OBJECTS) $(get_window_gt_LDADD) $(LIBS)
+
+get_window_le$(EXEEXT): $(get_window_le_OBJECTS) $(get_window_le_DEPENDENCIES) $(EXTRA_get_window_le_DEPENDENCIES) 
+	@rm -f get_window_le$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_le_OBJECTS) $(get_window_le_LDADD) $(LIBS)
+
+get_window_lt$(EXEEXT): $(get_window_lt_OBJECTS) $(get_window_lt_DEPENDENCIES) $(EXTRA_get_window_lt_DEPENDENCIES) 
+	@rm -f get_window_lt$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_lt_OBJECTS) $(get_window_lt_LDADD) $(LIBS)
+
+get_window_ne$(EXEEXT): $(get_window_ne_OBJECTS) $(get_window_ne_DEPENDENCIES) $(EXTRA_get_window_ne_DEPENDENCIES) 
+	@rm -f get_window_ne$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_ne_OBJECTS) $(get_window_ne_LDADD) $(LIBS)
+
+get_window_set$(EXEEXT): $(get_window_set_OBJECTS) $(get_window_set_DEPENDENCIES) $(EXTRA_get_window_set_DEPENDENCIES) 
+	@rm -f get_window_set$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_window_set_OBJECTS) $(get_window_set_LDADD) $(LIBS)
+
+get_zero$(EXEEXT): $(get_zero_OBJECTS) $(get_zero_DEPENDENCIES) $(EXTRA_get_zero_DEPENDENCIES) 
+	@rm -f get_zero$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(get_zero_OBJECTS) $(get_zero_LDADD) $(LIBS)
+
+global_flags$(EXEEXT): $(global_flags_OBJECTS) $(global_flags_DEPENDENCIES) $(EXTRA_global_flags_DEPENDENCIES) 
+	@rm -f global_flags$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(global_flags_OBJECTS) $(global_flags_LDADD) $(LIBS)
+
+global_name$(EXEEXT): $(global_name_OBJECTS) $(global_name_DEPENDENCIES) $(EXTRA_global_name_DEPENDENCIES) 
+	@rm -f global_name$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(global_name_OBJECTS) $(global_name_LDADD) $(LIBS)
+
+global_ref$(EXEEXT): $(global_ref_OBJECTS) $(global_ref_DEPENDENCIES) $(EXTRA_global_ref_DEPENDENCIES) 
+	@rm -f global_ref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(global_ref_OBJECTS) $(global_ref_LDADD) $(LIBS)
+
+global_ref_empty$(EXEEXT): $(global_ref_empty_OBJECTS) $(global_ref_empty_DEPENDENCIES) $(EXTRA_global_ref_empty_DEPENDENCIES) 
+	@rm -f global_ref_empty$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(global_ref_empty_OBJECTS) $(global_ref_empty_LDADD) $(LIBS)
+
+global_ref_set$(EXEEXT): $(global_ref_set_OBJECTS) $(global_ref_set_DEPENDENCIES) $(EXTRA_global_ref_set_DEPENDENCIES) 
+	@rm -f global_ref_set$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(global_ref_set_OBJECTS) $(global_ref_set_LDADD) $(LIBS)
+
+gzip_add$(EXEEXT): $(gzip_add_OBJECTS) $(gzip_add_DEPENDENCIES) $(EXTRA_gzip_add_DEPENDENCIES) 
+	@rm -f gzip_add$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_add_OBJECTS) $(gzip_add_LDADD) $(LIBS)
+
+gzip_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_get$(EXEEXT): $(gzip_get_get_OBJECTS) $(gzip_get_get_DEPENDENCIES) $(EXTRA_gzip_get_get_DEPENDENCIES) 
+	@rm -f gzip_get_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_get_get_OBJECTS) $(gzip_get_get_LDADD) $(LIBS)
+
+gzip_get_get2$(EXEEXT): $(gzip_get_get2_OBJECTS) $(gzip_get_get2_DEPENDENCIES) $(EXTRA_gzip_get_get2_DEPENDENCIES) 
+	@rm -f gzip_get_get2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_get_get2_OBJECTS) $(gzip_get_get2_LDADD) $(LIBS)
+
+gzip_get_put$(EXEEXT): $(gzip_get_put_OBJECTS) $(gzip_get_put_DEPENDENCIES) $(EXTRA_gzip_get_put_DEPENDENCIES) 
+	@rm -f gzip_get_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_get_put_OBJECTS) $(gzip_get_put_LDADD) $(LIBS)
+
+gzip_move_from$(EXEEXT): $(gzip_move_from_OBJECTS) $(gzip_move_from_DEPENDENCIES) $(EXTRA_gzip_move_from_DEPENDENCIES) 
+	@rm -f gzip_move_from$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_move_from_OBJECTS) $(gzip_move_from_LDADD) $(LIBS)
+
+gzip_move_to$(EXEEXT): $(gzip_move_to_OBJECTS) $(gzip_move_to_DEPENDENCIES) $(EXTRA_gzip_move_to_DEPENDENCIES) 
+	@rm -f gzip_move_to$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_move_to_OBJECTS) $(gzip_move_to_LDADD) $(LIBS)
+
+gzip_nframes$(EXEEXT): $(gzip_nframes_OBJECTS) $(gzip_nframes_DEPENDENCIES) $(EXTRA_gzip_nframes_DEPENDENCIES) 
+	@rm -f gzip_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_nframes_OBJECTS) $(gzip_nframes_LDADD) $(LIBS)
+
+gzip_put$(EXEEXT): $(gzip_put_OBJECTS) $(gzip_put_DEPENDENCIES) $(EXTRA_gzip_put_DEPENDENCIES) 
+	@rm -f gzip_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(gzip_put_OBJECTS) $(gzip_put_LDADD) $(LIBS)
+
+gzip_put_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)
+
+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)
+
+hide$(EXEEXT): $(hide_OBJECTS) $(hide_DEPENDENCIES) $(EXTRA_hide_DEPENDENCIES) 
+	@rm -f hide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hide_OBJECTS) $(hide_LDADD) $(LIBS)
+
+hide_hidden$(EXEEXT): $(hide_hidden_OBJECTS) $(hide_hidden_DEPENDENCIES) $(EXTRA_hide_hidden_DEPENDENCIES) 
+	@rm -f hide_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hide_hidden_OBJECTS) $(hide_hidden_LDADD) $(LIBS)
+
+hide_unhide$(EXEEXT): $(hide_unhide_OBJECTS) $(hide_unhide_DEPENDENCIES) $(EXTRA_hide_unhide_DEPENDENCIES) 
+	@rm -f hide_unhide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hide_unhide_OBJECTS) $(hide_unhide_LDADD) $(LIBS)
+
+include$(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)
+
+include_affix$(EXEEXT): $(include_affix_OBJECTS) $(include_affix_DEPENDENCIES) $(EXTRA_include_affix_DEPENDENCIES) 
+	@rm -f include_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_affix_OBJECTS) $(include_affix_LDADD) $(LIBS)
+
+include_auto$(EXEEXT): $(include_auto_OBJECTS) $(include_auto_DEPENDENCIES) $(EXTRA_include_auto_DEPENDENCIES) 
+	@rm -f include_auto$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_auto_OBJECTS) $(include_auto_LDADD) $(LIBS)
+
+include_cb$(EXEEXT): $(include_cb_OBJECTS) $(include_cb_DEPENDENCIES) $(EXTRA_include_cb_DEPENDENCIES) 
+	@rm -f include_cb$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_cb_OBJECTS) $(include_cb_LDADD) $(LIBS)
+
+include_creat$(EXEEXT): $(include_creat_OBJECTS) $(include_creat_DEPENDENCIES) $(EXTRA_include_creat_DEPENDENCIES) 
+	@rm -f include_creat$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_creat_OBJECTS) $(include_creat_LDADD) $(LIBS)
+
+include_ignore$(EXEEXT): $(include_ignore_OBJECTS) $(include_ignore_DEPENDENCIES) $(EXTRA_include_ignore_DEPENDENCIES) 
+	@rm -f include_ignore$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_ignore_OBJECTS) $(include_ignore_LDADD) $(LIBS)
+
+include_index$(EXEEXT): $(include_index_OBJECTS) $(include_index_DEPENDENCIES) $(EXTRA_include_index_DEPENDENCIES) 
+	@rm -f include_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_index_OBJECTS) $(include_index_LDADD) $(LIBS)
+
+include_invalid$(EXEEXT): $(include_invalid_OBJECTS) $(include_invalid_DEPENDENCIES) $(EXTRA_include_invalid_DEPENDENCIES) 
+	@rm -f include_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_invalid_OBJECTS) $(include_invalid_LDADD) $(LIBS)
+
+include_nonexistent$(EXEEXT): $(include_nonexistent_OBJECTS) $(include_nonexistent_DEPENDENCIES) $(EXTRA_include_nonexistent_DEPENDENCIES) 
+	@rm -f include_nonexistent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_nonexistent_OBJECTS) $(include_nonexistent_LDADD) $(LIBS)
+
+include_pc$(EXEEXT): $(include_pc_OBJECTS) $(include_pc_DEPENDENCIES) $(EXTRA_include_pc_DEPENDENCIES) 
+	@rm -f include_pc$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_pc_OBJECTS) $(include_pc_LDADD) $(LIBS)
+
+include_ref$(EXEEXT): $(include_ref_OBJECTS) $(include_ref_DEPENDENCIES) $(EXTRA_include_ref_DEPENDENCIES) 
+	@rm -f include_ref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_ref_OBJECTS) $(include_ref_LDADD) $(LIBS)
+
+include_sub$(EXEEXT): $(include_sub_OBJECTS) $(include_sub_DEPENDENCIES) $(EXTRA_include_sub_DEPENDENCIES) 
+	@rm -f include_sub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_sub_OBJECTS) $(include_sub_LDADD) $(LIBS)
+
+include_syntax$(EXEEXT): $(include_syntax_OBJECTS) $(include_syntax_DEPENDENCIES) $(EXTRA_include_syntax_DEPENDENCIES) 
+	@rm -f include_syntax$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(include_syntax_OBJECTS) $(include_syntax_LDADD) $(LIBS)
+
+index$(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_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)
+
+legacy_get$(EXEEXT): $(legacy_get_OBJECTS) $(legacy_get_DEPENDENCIES) $(EXTRA_legacy_get_DEPENDENCIES) 
+	@rm -f legacy_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_get_OBJECTS) $(legacy_get_LDADD) $(LIBS)
+
+legacy_get_put$(EXEEXT): $(legacy_get_put_OBJECTS) $(legacy_get_put_DEPENDENCIES) $(EXTRA_legacy_get_put_DEPENDENCIES) 
+	@rm -f legacy_get_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_get_put_OBJECTS) $(legacy_get_put_LDADD) $(LIBS)
+
+legacy_get_rofs$(EXEEXT): $(legacy_get_rofs_OBJECTS) $(legacy_get_rofs_DEPENDENCIES) $(EXTRA_legacy_get_rofs_DEPENDENCIES) 
+	@rm -f legacy_get_rofs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_get_rofs_OBJECTS) $(legacy_get_rofs_LDADD) $(LIBS)
+
+legacy_nframes$(EXEEXT): $(legacy_nframes_OBJECTS) $(legacy_nframes_DEPENDENCIES) $(EXTRA_legacy_nframes_DEPENDENCIES) 
+	@rm -f legacy_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_nframes_OBJECTS) $(legacy_nframes_LDADD) $(LIBS)
+
+legacy_nonexistent$(EXEEXT): $(legacy_nonexistent_OBJECTS) $(legacy_nonexistent_DEPENDENCIES) $(EXTRA_legacy_nonexistent_DEPENDENCIES) 
+	@rm -f legacy_nonexistent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_nonexistent_OBJECTS) $(legacy_nonexistent_LDADD) $(LIBS)
+
+legacy_put$(EXEEXT): $(legacy_put_OBJECTS) $(legacy_put_DEPENDENCIES) $(EXTRA_legacy_put_DEPENDENCIES) 
+	@rm -f legacy_put$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_put_OBJECTS) $(legacy_put_LDADD) $(LIBS)
+
+legacy_spf$(EXEEXT): $(legacy_spf_OBJECTS) $(legacy_spf_DEPENDENCIES) $(EXTRA_legacy_spf_DEPENDENCIES) 
+	@rm -f legacy_spf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(legacy_spf_OBJECTS) $(legacy_spf_LDADD) $(LIBS)
+
+lzma_get$(EXEEXT): $(lzma_get_OBJECTS) $(lzma_get_DEPENDENCIES) $(EXTRA_lzma_get_DEPENDENCIES) 
+	@rm -f lzma_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_get_OBJECTS) $(lzma_get_LDADD) $(LIBS)
+
+lzma_nframes$(EXEEXT): $(lzma_nframes_OBJECTS) $(lzma_nframes_DEPENDENCIES) $(EXTRA_lzma_nframes_DEPENDENCIES) 
+	@rm -f lzma_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lzma_nframes_OBJECTS) $(lzma_nframes_LDADD) $(LIBS)
+
+madd$(EXEEXT): $(madd_OBJECTS) $(madd_DEPENDENCIES) $(EXTRA_madd_DEPENDENCIES) 
+	@rm -f madd$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_OBJECTS) $(madd_LDADD) $(LIBS)
+
+madd_affix$(EXEEXT): $(madd_affix_OBJECTS) $(madd_affix_DEPENDENCIES) $(EXTRA_madd_affix_DEPENDENCIES) 
+	@rm -f madd_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_affix_OBJECTS) $(madd_affix_LDADD) $(LIBS)
+
+madd_alias$(EXEEXT): $(madd_alias_OBJECTS) $(madd_alias_DEPENDENCIES) $(EXTRA_madd_alias_DEPENDENCIES) 
+	@rm -f madd_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_alias_OBJECTS) $(madd_alias_LDADD) $(LIBS)
+
+madd_alias_affix$(EXEEXT): $(madd_alias_affix_OBJECTS) $(madd_alias_affix_DEPENDENCIES) $(EXTRA_madd_alias_affix_DEPENDENCIES) 
+	@rm -f madd_alias_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_alias_affix_OBJECTS) $(madd_alias_affix_LDADD) $(LIBS)
+
+madd_bit$(EXEEXT): $(madd_bit_OBJECTS) $(madd_bit_DEPENDENCIES) $(EXTRA_madd_bit_DEPENDENCIES) 
+	@rm -f madd_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_bit_OBJECTS) $(madd_bit_LDADD) $(LIBS)
+
+madd_bit_invalid$(EXEEXT): $(madd_bit_invalid_OBJECTS) $(madd_bit_invalid_DEPENDENCIES) $(EXTRA_madd_bit_invalid_DEPENDENCIES) 
+	@rm -f madd_bit_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_bit_invalid_OBJECTS) $(madd_bit_invalid_LDADD) $(LIBS)
+
+madd_carray$(EXEEXT): $(madd_carray_OBJECTS) $(madd_carray_DEPENDENCIES) $(EXTRA_madd_carray_DEPENDENCIES) 
+	@rm -f madd_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_carray_OBJECTS) $(madd_carray_LDADD) $(LIBS)
+
+madd_clincom$(EXEEXT): $(madd_clincom_OBJECTS) $(madd_clincom_DEPENDENCIES) $(EXTRA_madd_clincom_DEPENDENCIES) 
+	@rm -f madd_clincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_clincom_OBJECTS) $(madd_clincom_LDADD) $(LIBS)
+
+madd_const$(EXEEXT): $(madd_const_OBJECTS) $(madd_const_DEPENDENCIES) $(EXTRA_madd_const_DEPENDENCIES) 
+	@rm -f madd_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_const_OBJECTS) $(madd_const_LDADD) $(LIBS)
+
+madd_cpolynom$(EXEEXT): $(madd_cpolynom_OBJECTS) $(madd_cpolynom_DEPENDENCIES) $(EXTRA_madd_cpolynom_DEPENDENCIES) 
+	@rm -f madd_cpolynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_cpolynom_OBJECTS) $(madd_cpolynom_LDADD) $(LIBS)
+
+madd_crecip$(EXEEXT): $(madd_crecip_OBJECTS) $(madd_crecip_DEPENDENCIES) $(EXTRA_madd_crecip_DEPENDENCIES) 
+	@rm -f madd_crecip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_crecip_OBJECTS) $(madd_crecip_LDADD) $(LIBS)
+
+madd_crecip89$(EXEEXT): $(madd_crecip89_OBJECTS) $(madd_crecip89_DEPENDENCIES) $(EXTRA_madd_crecip89_DEPENDENCIES) 
+	@rm -f madd_crecip89$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_crecip89_OBJECTS) $(madd_crecip89_LDADD) $(LIBS)
+
+madd_divide$(EXEEXT): $(madd_divide_OBJECTS) $(madd_divide_DEPENDENCIES) $(EXTRA_madd_divide_DEPENDENCIES) 
+	@rm -f madd_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_divide_OBJECTS) $(madd_divide_LDADD) $(LIBS)
+
+madd_index$(EXEEXT): $(madd_index_OBJECTS) $(madd_index_DEPENDENCIES) $(EXTRA_madd_index_DEPENDENCIES) 
+	@rm -f madd_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_index_OBJECTS) $(madd_index_LDADD) $(LIBS)
+
+madd_lincom$(EXEEXT): $(madd_lincom_OBJECTS) $(madd_lincom_DEPENDENCIES) $(EXTRA_madd_lincom_DEPENDENCIES) 
+	@rm -f madd_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_lincom_OBJECTS) $(madd_lincom_LDADD) $(LIBS)
+
+madd_lincom_invalid$(EXEEXT): $(madd_lincom_invalid_OBJECTS) $(madd_lincom_invalid_DEPENDENCIES) $(EXTRA_madd_lincom_invalid_DEPENDENCIES) 
+	@rm -f madd_lincom_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_lincom_invalid_OBJECTS) $(madd_lincom_invalid_LDADD) $(LIBS)
+
+madd_linterp$(EXEEXT): $(madd_linterp_OBJECTS) $(madd_linterp_DEPENDENCIES) $(EXTRA_madd_linterp_DEPENDENCIES) 
+	@rm -f madd_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_linterp_OBJECTS) $(madd_linterp_LDADD) $(LIBS)
+
+madd_linterp_invalid$(EXEEXT): $(madd_linterp_invalid_OBJECTS) $(madd_linterp_invalid_DEPENDENCIES) $(EXTRA_madd_linterp_invalid_DEPENDENCIES) 
+	@rm -f madd_linterp_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_linterp_invalid_OBJECTS) $(madd_linterp_invalid_LDADD) $(LIBS)
+
+madd_mplex$(EXEEXT): $(madd_mplex_OBJECTS) $(madd_mplex_DEPENDENCIES) $(EXTRA_madd_mplex_DEPENDENCIES) 
+	@rm -f madd_mplex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_mplex_OBJECTS) $(madd_mplex_LDADD) $(LIBS)
+
+madd_multiply$(EXEEXT): $(madd_multiply_OBJECTS) $(madd_multiply_DEPENDENCIES) $(EXTRA_madd_multiply_DEPENDENCIES) 
+	@rm -f madd_multiply$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_multiply_OBJECTS) $(madd_multiply_LDADD) $(LIBS)
+
+madd_multiply_invalid$(EXEEXT): $(madd_multiply_invalid_OBJECTS) $(madd_multiply_invalid_DEPENDENCIES) $(EXTRA_madd_multiply_invalid_DEPENDENCIES) 
+	@rm -f madd_multiply_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_multiply_invalid_OBJECTS) $(madd_multiply_invalid_LDADD) $(LIBS)
+
+madd_phase$(EXEEXT): $(madd_phase_OBJECTS) $(madd_phase_DEPENDENCIES) $(EXTRA_madd_phase_DEPENDENCIES) 
+	@rm -f madd_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_phase_OBJECTS) $(madd_phase_LDADD) $(LIBS)
+
+madd_phase_invalid$(EXEEXT): $(madd_phase_invalid_OBJECTS) $(madd_phase_invalid_DEPENDENCIES) $(EXTRA_madd_phase_invalid_DEPENDENCIES) 
+	@rm -f madd_phase_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_phase_invalid_OBJECTS) $(madd_phase_invalid_LDADD) $(LIBS)
+
+madd_polynom$(EXEEXT): $(madd_polynom_OBJECTS) $(madd_polynom_DEPENDENCIES) $(EXTRA_madd_polynom_DEPENDENCIES) 
+	@rm -f madd_polynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_polynom_OBJECTS) $(madd_polynom_LDADD) $(LIBS)
+
+madd_recip$(EXEEXT): $(madd_recip_OBJECTS) $(madd_recip_DEPENDENCIES) $(EXTRA_madd_recip_DEPENDENCIES) 
+	@rm -f madd_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_recip_OBJECTS) $(madd_recip_LDADD) $(LIBS)
+
+madd_sbit$(EXEEXT): $(madd_sbit_OBJECTS) $(madd_sbit_DEPENDENCIES) $(EXTRA_madd_sbit_DEPENDENCIES) 
+	@rm -f madd_sbit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_sbit_OBJECTS) $(madd_sbit_LDADD) $(LIBS)
+
+madd_spec$(EXEEXT): $(madd_spec_OBJECTS) $(madd_spec_DEPENDENCIES) $(EXTRA_madd_spec_DEPENDENCIES) 
+	@rm -f madd_spec$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_spec_OBJECTS) $(madd_spec_LDADD) $(LIBS)
+
+madd_spec_directive$(EXEEXT): $(madd_spec_directive_OBJECTS) $(madd_spec_directive_DEPENDENCIES) $(EXTRA_madd_spec_directive_DEPENDENCIES) 
+	@rm -f madd_spec_directive$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_spec_directive_OBJECTS) $(madd_spec_directive_LDADD) $(LIBS)
+
+madd_spec_invalid$(EXEEXT): $(madd_spec_invalid_OBJECTS) $(madd_spec_invalid_DEPENDENCIES) $(EXTRA_madd_spec_invalid_DEPENDENCIES) 
+	@rm -f madd_spec_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_spec_invalid_OBJECTS) $(madd_spec_invalid_LDADD) $(LIBS)
+
+madd_spec_resolv$(EXEEXT): $(madd_spec_resolv_OBJECTS) $(madd_spec_resolv_DEPENDENCIES) $(EXTRA_madd_spec_resolv_DEPENDENCIES) 
+	@rm -f madd_spec_resolv$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_spec_resolv_OBJECTS) $(madd_spec_resolv_LDADD) $(LIBS)
+
+madd_string$(EXEEXT): $(madd_string_OBJECTS) $(madd_string_DEPENDENCIES) $(EXTRA_madd_string_DEPENDENCIES) 
+	@rm -f madd_string$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_string_OBJECTS) $(madd_string_LDADD) $(LIBS)
+
+madd_window$(EXEEXT): $(madd_window_OBJECTS) $(madd_window_DEPENDENCIES) $(EXTRA_madd_window_DEPENDENCIES) 
+	@rm -f madd_window$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(madd_window_OBJECTS) $(madd_window_LDADD) $(LIBS)
+
+move$(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)
+
+move_affix_dup$(EXEEXT): $(move_affix_dup_OBJECTS) $(move_affix_dup_DEPENDENCIES) $(EXTRA_move_affix_dup_DEPENDENCIES) 
+	@rm -f move_affix_dup$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_affix_dup_OBJECTS) $(move_affix_dup_LDADD) $(LIBS)
+
+move_alias$(EXEEXT): $(move_alias_OBJECTS) $(move_alias_DEPENDENCIES) $(EXTRA_move_alias_DEPENDENCIES) 
+	@rm -f move_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_alias_OBJECTS) $(move_alias_LDADD) $(LIBS)
+
+move_data_enc_ar$(EXEEXT): $(move_data_enc_ar_OBJECTS) $(move_data_enc_ar_DEPENDENCIES) $(EXTRA_move_data_enc_ar_DEPENDENCIES) 
+	@rm -f move_data_enc_ar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_data_enc_ar_OBJECTS) $(move_data_enc_ar_LDADD) $(LIBS)
+
+move_data_enc_ra$(EXEEXT): $(move_data_enc_ra_OBJECTS) $(move_data_enc_ra_DEPENDENCIES) $(EXTRA_move_data_enc_ra_DEPENDENCIES) 
+	@rm -f move_data_enc_ra$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_data_enc_ra_OBJECTS) $(move_data_enc_ra_LDADD) $(LIBS)
+
+move_data_endian$(EXEEXT): $(move_data_endian_OBJECTS) $(move_data_endian_DEPENDENCIES) $(EXTRA_move_data_endian_DEPENDENCIES) 
+	@rm -f move_data_endian$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_data_endian_OBJECTS) $(move_data_endian_LDADD) $(LIBS)
+
+move_data_foffs$(EXEEXT): $(move_data_foffs_OBJECTS) $(move_data_foffs_DEPENDENCIES) $(EXTRA_move_data_foffs_DEPENDENCIES) 
+	@rm -f move_data_foffs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_data_foffs_OBJECTS) $(move_data_foffs_LDADD) $(LIBS)
+
+move_data_nop$(EXEEXT): $(move_data_nop_OBJECTS) $(move_data_nop_DEPENDENCIES) $(EXTRA_move_data_nop_DEPENDENCIES) 
+	@rm -f move_data_nop$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_data_nop_OBJECTS) $(move_data_nop_LDADD) $(LIBS)
+
+move_index$(EXEEXT): $(move_index_OBJECTS) $(move_index_DEPENDENCIES) $(EXTRA_move_index_DEPENDENCIES) 
+	@rm -f move_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_index_OBJECTS) $(move_index_LDADD) $(LIBS)
+
+move_meta$(EXEEXT): $(move_meta_OBJECTS) $(move_meta_DEPENDENCIES) $(EXTRA_move_meta_DEPENDENCIES) 
+	@rm -f move_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_meta_OBJECTS) $(move_meta_LDADD) $(LIBS)
+
+move_protect$(EXEEXT): $(move_protect_OBJECTS) $(move_protect_DEPENDENCIES) $(EXTRA_move_protect_DEPENDENCIES) 
+	@rm -f move_protect$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_protect_OBJECTS) $(move_protect_LDADD) $(LIBS)
+
+move_subdir$(EXEEXT): $(move_subdir_OBJECTS) $(move_subdir_DEPENDENCIES) $(EXTRA_move_subdir_DEPENDENCIES) 
+	@rm -f move_subdir$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(move_subdir_OBJECTS) $(move_subdir_LDADD) $(LIBS)
+
+name$(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)
+
+name_affix_bad$(EXEEXT): $(name_affix_bad_OBJECTS) $(name_affix_bad_DEPENDENCIES) $(EXTRA_name_affix_bad_DEPENDENCIES) 
+	@rm -f name_affix_bad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_affix_bad_OBJECTS) $(name_affix_bad_LDADD) $(LIBS)
+
+name_alias$(EXEEXT): $(name_alias_OBJECTS) $(name_alias_DEPENDENCIES) $(EXTRA_name_alias_DEPENDENCIES) 
+	@rm -f name_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_alias_OBJECTS) $(name_alias_LDADD) $(LIBS)
+
+name_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_move$(EXEEXT): $(name_move_OBJECTS) $(name_move_DEPENDENCIES) $(EXTRA_name_move_DEPENDENCIES) 
+	@rm -f name_move$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_move_OBJECTS) $(name_move_LDADD) $(LIBS)
+
+name_move_alias$(EXEEXT): $(name_move_alias_OBJECTS) $(name_move_alias_DEPENDENCIES) $(EXTRA_name_move_alias_DEPENDENCIES) 
+	@rm -f name_move_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_move_alias_OBJECTS) $(name_move_alias_LDADD) $(LIBS)
+
+name_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_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_const$(EXEEXT): $(name_updb_const_OBJECTS) $(name_updb_const_DEPENDENCIES) $(EXTRA_name_updb_const_DEPENDENCIES) 
+	@rm -f name_updb_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_updb_const_OBJECTS) $(name_updb_const_LDADD) $(LIBS)
+
+name_updb_const_alias$(EXEEXT): $(name_updb_const_alias_OBJECTS) $(name_updb_const_alias_DEPENDENCIES) $(EXTRA_name_updb_const_alias_DEPENDENCIES) 
+	@rm -f name_updb_const_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(name_updb_const_alias_OBJECTS) $(name_updb_const_alias_LDADD) $(LIBS)
+
+nentries_alias$(EXEEXT): $(nentries_alias_OBJECTS) $(nentries_alias_DEPENDENCIES) $(EXTRA_nentries_alias_DEPENDENCIES) 
+	@rm -f nentries_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nentries_alias_OBJECTS) $(nentries_alias_LDADD) $(LIBS)
+
+nentries_hidden$(EXEEXT): $(nentries_hidden_OBJECTS) $(nentries_hidden_DEPENDENCIES) $(EXTRA_nentries_hidden_DEPENDENCIES) 
+	@rm -f nentries_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nentries_hidden_OBJECTS) $(nentries_hidden_LDADD) $(LIBS)
+
+nentries_noalias$(EXEEXT): $(nentries_noalias_OBJECTS) $(nentries_noalias_DEPENDENCIES) $(EXTRA_nentries_noalias_DEPENDENCIES) 
+	@rm -f nentries_noalias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nentries_noalias_OBJECTS) $(nentries_noalias_LDADD) $(LIBS)
+
+nentries_scalar$(EXEEXT): $(nentries_scalar_OBJECTS) $(nentries_scalar_DEPENDENCIES) $(EXTRA_nentries_scalar_DEPENDENCIES) 
+	@rm -f nentries_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nentries_scalar_OBJECTS) $(nentries_scalar_LDADD) $(LIBS)
+
+nfields$(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)
+
+nfields_invalid$(EXEEXT): $(nfields_invalid_OBJECTS) $(nfields_invalid_DEPENDENCIES) $(EXTRA_nfields_invalid_DEPENDENCIES) 
+	@rm -f nfields_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nfields_invalid_OBJECTS) $(nfields_invalid_LDADD) $(LIBS)
+
+nfields_type$(EXEEXT): $(nfields_type_OBJECTS) $(nfields_type_DEPENDENCIES) $(EXTRA_nfields_type_DEPENDENCIES) 
+	@rm -f nfields_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nfields_type_OBJECTS) $(nfields_type_LDADD) $(LIBS)
+
+nfields_type_hidden$(EXEEXT): $(nfields_type_hidden_OBJECTS) $(nfields_type_hidden_DEPENDENCIES) $(EXTRA_nfields_type_hidden_DEPENDENCIES) 
+	@rm -f nfields_type_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nfields_type_hidden_OBJECTS) $(nfields_type_hidden_LDADD) $(LIBS)
+
+nfields_type_invalid$(EXEEXT): $(nfields_type_invalid_OBJECTS) $(nfields_type_invalid_DEPENDENCIES) $(EXTRA_nfields_type_invalid_DEPENDENCIES) 
+	@rm -f nfields_type_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nfields_type_invalid_OBJECTS) $(nfields_type_invalid_LDADD) $(LIBS)
+
+nfields_vector$(EXEEXT): $(nfields_vector_OBJECTS) $(nfields_vector_DEPENDENCIES) $(EXTRA_nfields_vector_DEPENDENCIES) 
+	@rm -f nfields_vector$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nfields_vector_OBJECTS) $(nfields_vector_LDADD) $(LIBS)
+
+nfields_vector_hidden$(EXEEXT): $(nfields_vector_hidden_OBJECTS) $(nfields_vector_hidden_DEPENDENCIES) $(EXTRA_nfields_vector_hidden_DEPENDENCIES) 
+	@rm -f nfields_vector_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nfields_vector_hidden_OBJECTS) $(nfields_vector_hidden_LDADD) $(LIBS)
+
+nfields_vector_invalid$(EXEEXT): $(nfields_vector_invalid_OBJECTS) $(nfields_vector_invalid_DEPENDENCIES) $(EXTRA_nfields_vector_invalid_DEPENDENCIES) 
+	@rm -f nfields_vector_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nfields_vector_invalid_OBJECTS) $(nfields_vector_invalid_LDADD) $(LIBS)
+
+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)
+
+nframes_empty$(EXEEXT): $(nframes_empty_OBJECTS) $(nframes_empty_DEPENDENCIES) $(EXTRA_nframes_empty_DEPENDENCIES) 
+	@rm -f nframes_empty$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nframes_empty_OBJECTS) $(nframes_empty_LDADD) $(LIBS)
+
+nframes_invalid$(EXEEXT): $(nframes_invalid_OBJECTS) $(nframes_invalid_DEPENDENCIES) $(EXTRA_nframes_invalid_DEPENDENCIES) 
+	@rm -f nframes_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nframes_invalid_OBJECTS) $(nframes_invalid_LDADD) $(LIBS)
+
+nframes_off64$(EXEEXT): $(nframes_off64_OBJECTS) $(nframes_off64_DEPENDENCIES) $(EXTRA_nframes_off64_DEPENDENCIES) 
+	@rm -f nframes_off64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nframes_off64_OBJECTS) $(nframes_off64_LDADD) $(LIBS)
+
+nframes_spf$(EXEEXT): $(nframes_spf_OBJECTS) $(nframes_spf_DEPENDENCIES) $(EXTRA_nframes_spf_DEPENDENCIES) 
+	@rm -f nframes_spf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nframes_spf_OBJECTS) $(nframes_spf_LDADD) $(LIBS)
+
+nmeta$(EXEEXT): $(nmeta_OBJECTS) $(nmeta_DEPENDENCIES) $(EXTRA_nmeta_DEPENDENCIES) 
+	@rm -f nmeta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_OBJECTS) $(nmeta_LDADD) $(LIBS)
+
+nmeta_hidden$(EXEEXT): $(nmeta_hidden_OBJECTS) $(nmeta_hidden_DEPENDENCIES) $(EXTRA_nmeta_hidden_DEPENDENCIES) 
+	@rm -f nmeta_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_hidden_OBJECTS) $(nmeta_hidden_LDADD) $(LIBS)
+
+nmeta_invalid$(EXEEXT): $(nmeta_invalid_OBJECTS) $(nmeta_invalid_DEPENDENCIES) $(EXTRA_nmeta_invalid_DEPENDENCIES) 
+	@rm -f nmeta_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_invalid_OBJECTS) $(nmeta_invalid_LDADD) $(LIBS)
+
+nmeta_parent$(EXEEXT): $(nmeta_parent_OBJECTS) $(nmeta_parent_DEPENDENCIES) $(EXTRA_nmeta_parent_DEPENDENCIES) 
+	@rm -f nmeta_parent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_parent_OBJECTS) $(nmeta_parent_LDADD) $(LIBS)
+
+nmeta_type$(EXEEXT): $(nmeta_type_OBJECTS) $(nmeta_type_DEPENDENCIES) $(EXTRA_nmeta_type_DEPENDENCIES) 
+	@rm -f nmeta_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_type_OBJECTS) $(nmeta_type_LDADD) $(LIBS)
+
+nmeta_type_hidden$(EXEEXT): $(nmeta_type_hidden_OBJECTS) $(nmeta_type_hidden_DEPENDENCIES) $(EXTRA_nmeta_type_hidden_DEPENDENCIES) 
+	@rm -f nmeta_type_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_type_hidden_OBJECTS) $(nmeta_type_hidden_LDADD) $(LIBS)
+
+nmeta_type_invalid$(EXEEXT): $(nmeta_type_invalid_OBJECTS) $(nmeta_type_invalid_DEPENDENCIES) $(EXTRA_nmeta_type_invalid_DEPENDENCIES) 
+	@rm -f nmeta_type_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_type_invalid_OBJECTS) $(nmeta_type_invalid_LDADD) $(LIBS)
+
+nmeta_type_parent$(EXEEXT): $(nmeta_type_parent_OBJECTS) $(nmeta_type_parent_DEPENDENCIES) $(EXTRA_nmeta_type_parent_DEPENDENCIES) 
+	@rm -f nmeta_type_parent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_type_parent_OBJECTS) $(nmeta_type_parent_LDADD) $(LIBS)
+
+nmeta_vectors$(EXEEXT): $(nmeta_vectors_OBJECTS) $(nmeta_vectors_DEPENDENCIES) $(EXTRA_nmeta_vectors_DEPENDENCIES) 
+	@rm -f nmeta_vectors$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_vectors_OBJECTS) $(nmeta_vectors_LDADD) $(LIBS)
+
+nmeta_vectors_del$(EXEEXT): $(nmeta_vectors_del_OBJECTS) $(nmeta_vectors_del_DEPENDENCIES) $(EXTRA_nmeta_vectors_del_DEPENDENCIES) 
+	@rm -f nmeta_vectors_del$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_vectors_del_OBJECTS) $(nmeta_vectors_del_LDADD) $(LIBS)
+
+nmeta_vectors_hidden$(EXEEXT): $(nmeta_vectors_hidden_OBJECTS) $(nmeta_vectors_hidden_DEPENDENCIES) $(EXTRA_nmeta_vectors_hidden_DEPENDENCIES) 
+	@rm -f nmeta_vectors_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_vectors_hidden_OBJECTS) $(nmeta_vectors_hidden_LDADD) $(LIBS)
+
+nmeta_vectors_invalid$(EXEEXT): $(nmeta_vectors_invalid_OBJECTS) $(nmeta_vectors_invalid_DEPENDENCIES) $(EXTRA_nmeta_vectors_invalid_DEPENDENCIES) 
+	@rm -f nmeta_vectors_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_vectors_invalid_OBJECTS) $(nmeta_vectors_invalid_LDADD) $(LIBS)
+
+nmeta_vectors_parent$(EXEEXT): $(nmeta_vectors_parent_OBJECTS) $(nmeta_vectors_parent_DEPENDENCIES) $(EXTRA_nmeta_vectors_parent_DEPENDENCIES) 
+	@rm -f nmeta_vectors_parent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nmeta_vectors_parent_OBJECTS) $(nmeta_vectors_parent_LDADD) $(LIBS)
+
+open$(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)
+
+open_cb_abort$(EXEEXT): $(open_cb_abort_OBJECTS) $(open_cb_abort_DEPENDENCIES) $(EXTRA_open_cb_abort_DEPENDENCIES) 
+	@rm -f open_cb_abort$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_cb_abort_OBJECTS) $(open_cb_abort_LDADD) $(LIBS)
+
+open_cb_cont$(EXEEXT): $(open_cb_cont_OBJECTS) $(open_cb_cont_DEPENDENCIES) $(EXTRA_open_cb_cont_DEPENDENCIES) 
+	@rm -f open_cb_cont$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_cb_cont_OBJECTS) $(open_cb_cont_LDADD) $(LIBS)
+
+open_cb_ignore$(EXEEXT): $(open_cb_ignore_OBJECTS) $(open_cb_ignore_DEPENDENCIES) $(EXTRA_open_cb_ignore_DEPENDENCIES) 
+	@rm -f open_cb_ignore$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_cb_ignore_OBJECTS) $(open_cb_ignore_LDADD) $(LIBS)
+
+open_cb_invalid$(EXEEXT): $(open_cb_invalid_OBJECTS) $(open_cb_invalid_DEPENDENCIES) $(EXTRA_open_cb_invalid_DEPENDENCIES) 
+	@rm -f open_cb_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_cb_invalid_OBJECTS) $(open_cb_invalid_LDADD) $(LIBS)
+
+open_cb_rescan$(EXEEXT): $(open_cb_rescan_OBJECTS) $(open_cb_rescan_DEPENDENCIES) $(EXTRA_open_cb_rescan_DEPENDENCIES) 
+	@rm -f open_cb_rescan$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_cb_rescan_OBJECTS) $(open_cb_rescan_LDADD) $(LIBS)
+
+open_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_nonexistent$(EXEEXT): $(open_nonexistent_OBJECTS) $(open_nonexistent_DEPENDENCIES) $(EXTRA_open_nonexistent_DEPENDENCIES) 
+	@rm -f open_nonexistent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_nonexistent_OBJECTS) $(open_nonexistent_LDADD) $(LIBS)
+
+open_notdirfile$(EXEEXT): $(open_notdirfile_OBJECTS) $(open_notdirfile_DEPENDENCIES) $(EXTRA_open_notdirfile_DEPENDENCIES) 
+	@rm -f open_notdirfile$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_notdirfile_OBJECTS) $(open_notdirfile_LDADD) $(LIBS)
+
+open_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)
+
+open_sym_at$(EXEEXT): $(open_sym_at_OBJECTS) $(open_sym_at_DEPENDENCIES) $(EXTRA_open_sym_at_DEPENDENCIES) 
+	@rm -f open_sym_at$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_at_OBJECTS) $(open_sym_at_LDADD) $(LIBS)
+
+open_sym_c$(EXEEXT): $(open_sym_c_OBJECTS) $(open_sym_c_DEPENDENCIES) $(EXTRA_open_sym_c_DEPENDENCIES) 
+	@rm -f open_sym_c$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_c_OBJECTS) $(open_sym_c_LDADD) $(LIBS)
+
+open_sym_cl$(EXEEXT): $(open_sym_cl_OBJECTS) $(open_sym_cl_DEPENDENCIES) $(EXTRA_open_sym_cl_DEPENDENCIES) 
+	@rm -f open_sym_cl$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_cl_OBJECTS) $(open_sym_cl_LDADD) $(LIBS)
+
+open_sym_ct$(EXEEXT): $(open_sym_ct_OBJECTS) $(open_sym_ct_DEPENDENCIES) $(EXTRA_open_sym_ct_DEPENDENCIES) 
+	@rm -f open_sym_ct$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_ct_OBJECTS) $(open_sym_ct_LDADD) $(LIBS)
+
+open_sym_p$(EXEEXT): $(open_sym_p_OBJECTS) $(open_sym_p_DEPENDENCIES) $(EXTRA_open_sym_p_DEPENDENCIES) 
+	@rm -f open_sym_p$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_p_OBJECTS) $(open_sym_p_LDADD) $(LIBS)
+
+open_sym_pl$(EXEEXT): $(open_sym_pl_OBJECTS) $(open_sym_pl_DEPENDENCIES) $(EXTRA_open_sym_pl_DEPENDENCIES) 
+	@rm -f open_sym_pl$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_pl_OBJECTS) $(open_sym_pl_LDADD) $(LIBS)
+
+open_sym_pt$(EXEEXT): $(open_sym_pt_OBJECTS) $(open_sym_pt_DEPENDENCIES) $(EXTRA_open_sym_pt_DEPENDENCIES) 
+	@rm -f open_sym_pt$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(open_sym_pt_OBJECTS) $(open_sym_pt_LDADD) $(LIBS)
+
+parse_alias$(EXEEXT): $(parse_alias_OBJECTS) $(parse_alias_DEPENDENCIES) $(EXTRA_parse_alias_DEPENDENCIES) 
+	@rm -f parse_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_alias_OBJECTS) $(parse_alias_LDADD) $(LIBS)
+
+parse_alias_code$(EXEEXT): $(parse_alias_code_OBJECTS) $(parse_alias_code_DEPENDENCIES) $(EXTRA_parse_alias_code_DEPENDENCIES) 
+	@rm -f parse_alias_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_alias_code_OBJECTS) $(parse_alias_code_LDADD) $(LIBS)
+
+parse_alias_dup$(EXEEXT): $(parse_alias_dup_OBJECTS) $(parse_alias_dup_DEPENDENCIES) $(EXTRA_parse_alias_dup_DEPENDENCIES) 
+	@rm -f parse_alias_dup$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_alias_dup_OBJECTS) $(parse_alias_dup_LDADD) $(LIBS)
+
+parse_alias_meta$(EXEEXT): $(parse_alias_meta_OBJECTS) $(parse_alias_meta_DEPENDENCIES) $(EXTRA_parse_alias_meta_DEPENDENCIES) 
+	@rm -f parse_alias_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_alias_meta_OBJECTS) $(parse_alias_meta_LDADD) $(LIBS)
+
+parse_alias_missing$(EXEEXT): $(parse_alias_missing_OBJECTS) $(parse_alias_missing_DEPENDENCIES) $(EXTRA_parse_alias_missing_DEPENDENCIES) 
+	@rm -f parse_alias_missing$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_alias_missing_OBJECTS) $(parse_alias_missing_LDADD) $(LIBS)
+
+parse_badline$(EXEEXT): $(parse_badline_OBJECTS) $(parse_badline_DEPENDENCIES) $(EXTRA_parse_badline_DEPENDENCIES) 
+	@rm -f parse_badline$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_badline_OBJECTS) $(parse_badline_LDADD) $(LIBS)
+
+parse_bit$(EXEEXT): $(parse_bit_OBJECTS) $(parse_bit_DEPENDENCIES) $(EXTRA_parse_bit_DEPENDENCIES) 
+	@rm -f parse_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_bit_OBJECTS) $(parse_bit_LDADD) $(LIBS)
+
+parse_bit4$(EXEEXT): $(parse_bit4_OBJECTS) $(parse_bit4_DEPENDENCIES) $(EXTRA_parse_bit4_DEPENDENCIES) 
+	@rm -f parse_bit4$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_bit4_OBJECTS) $(parse_bit4_LDADD) $(LIBS)
+
+parse_bit_bitnum$(EXEEXT): $(parse_bit_bitnum_OBJECTS) $(parse_bit_bitnum_DEPENDENCIES) $(EXTRA_parse_bit_bitnum_DEPENDENCIES) 
+	@rm -f parse_bit_bitnum$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_bit_bitnum_OBJECTS) $(parse_bit_bitnum_LDADD) $(LIBS)
+
+parse_bit_bitsize$(EXEEXT): $(parse_bit_bitsize_OBJECTS) $(parse_bit_bitsize_DEPENDENCIES) $(EXTRA_parse_bit_bitsize_DEPENDENCIES) 
+	@rm -f parse_bit_bitsize$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_bit_bitsize_OBJECTS) $(parse_bit_bitsize_LDADD) $(LIBS)
+
+parse_bit_ncols$(EXEEXT): $(parse_bit_ncols_OBJECTS) $(parse_bit_ncols_DEPENDENCIES) $(EXTRA_parse_bit_ncols_DEPENDENCIES) 
+	@rm -f parse_bit_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_bit_ncols_OBJECTS) $(parse_bit_ncols_LDADD) $(LIBS)
+
+parse_bit_numbits$(EXEEXT): $(parse_bit_numbits_OBJECTS) $(parse_bit_numbits_DEPENDENCIES) $(EXTRA_parse_bit_numbits_DEPENDENCIES) 
+	@rm -f parse_bit_numbits$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_bit_numbits_OBJECTS) $(parse_bit_numbits_LDADD) $(LIBS)
+
+parse_bit_scalar$(EXEEXT): $(parse_bit_scalar_OBJECTS) $(parse_bit_scalar_DEPENDENCIES) $(EXTRA_parse_bit_scalar_DEPENDENCIES) 
+	@rm -f parse_bit_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_bit_scalar_OBJECTS) $(parse_bit_scalar_LDADD) $(LIBS)
+
+parse_carray$(EXEEXT): $(parse_carray_OBJECTS) $(parse_carray_DEPENDENCIES) $(EXTRA_parse_carray_DEPENDENCIES) 
+	@rm -f parse_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_carray_OBJECTS) $(parse_carray_LDADD) $(LIBS)
+
+parse_carray_long$(EXEEXT): $(parse_carray_long_OBJECTS) $(parse_carray_long_DEPENDENCIES) $(EXTRA_parse_carray_long_DEPENDENCIES) 
+	@rm -f parse_carray_long$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_carray_long_OBJECTS) $(parse_carray_long_LDADD) $(LIBS)
+
+parse_const$(EXEEXT): $(parse_const_OBJECTS) $(parse_const_DEPENDENCIES) $(EXTRA_parse_const_DEPENDENCIES) 
+	@rm -f parse_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_const_OBJECTS) $(parse_const_LDADD) $(LIBS)
+
+parse_const_complex$(EXEEXT): $(parse_const_complex_OBJECTS) $(parse_const_complex_DEPENDENCIES) $(EXTRA_parse_const_complex_DEPENDENCIES) 
+	@rm -f parse_const_complex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_const_complex_OBJECTS) $(parse_const_complex_LDADD) $(LIBS)
+
+parse_const_ncols$(EXEEXT): $(parse_const_ncols_OBJECTS) $(parse_const_ncols_DEPENDENCIES) $(EXTRA_parse_const_ncols_DEPENDENCIES) 
+	@rm -f parse_const_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_const_ncols_OBJECTS) $(parse_const_ncols_LDADD) $(LIBS)
+
+parse_divide$(EXEEXT): $(parse_divide_OBJECTS) $(parse_divide_DEPENDENCIES) $(EXTRA_parse_divide_DEPENDENCIES) 
+	@rm -f parse_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_divide_OBJECTS) $(parse_divide_LDADD) $(LIBS)
+
+parse_double$(EXEEXT): $(parse_double_OBJECTS) $(parse_double_DEPENDENCIES) $(EXTRA_parse_double_DEPENDENCIES) 
+	@rm -f parse_double$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_double_OBJECTS) $(parse_double_LDADD) $(LIBS)
+
+parse_duplicate$(EXEEXT): $(parse_duplicate_OBJECTS) $(parse_duplicate_DEPENDENCIES) $(EXTRA_parse_duplicate_DEPENDENCIES) 
+	@rm -f parse_duplicate$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_duplicate_OBJECTS) $(parse_duplicate_LDADD) $(LIBS)
+
+parse_duplicate_ignore$(EXEEXT): $(parse_duplicate_ignore_OBJECTS) $(parse_duplicate_ignore_DEPENDENCIES) $(EXTRA_parse_duplicate_ignore_DEPENDENCIES) 
+	@rm -f parse_duplicate_ignore$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_duplicate_ignore_OBJECTS) $(parse_duplicate_ignore_LDADD) $(LIBS)
+
+parse_endian_bad$(EXEEXT): $(parse_endian_bad_OBJECTS) $(parse_endian_bad_DEPENDENCIES) $(EXTRA_parse_endian_bad_DEPENDENCIES) 
+	@rm -f parse_endian_bad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_endian_bad_OBJECTS) $(parse_endian_bad_LDADD) $(LIBS)
+
+parse_endian_big$(EXEEXT): $(parse_endian_big_OBJECTS) $(parse_endian_big_DEPENDENCIES) $(EXTRA_parse_endian_big_DEPENDENCIES) 
+	@rm -f parse_endian_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_endian_big_OBJECTS) $(parse_endian_big_LDADD) $(LIBS)
+
+parse_endian_force$(EXEEXT): $(parse_endian_force_OBJECTS) $(parse_endian_force_DEPENDENCIES) $(EXTRA_parse_endian_force_DEPENDENCIES) 
+	@rm -f parse_endian_force$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_endian_force_OBJECTS) $(parse_endian_force_LDADD) $(LIBS)
+
+parse_endian_little$(EXEEXT): $(parse_endian_little_OBJECTS) $(parse_endian_little_DEPENDENCIES) $(EXTRA_parse_endian_little_DEPENDENCIES) 
+	@rm -f parse_endian_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_endian_little_OBJECTS) $(parse_endian_little_LDADD) $(LIBS)
+
+parse_endian_slash$(EXEEXT): $(parse_endian_slash_OBJECTS) $(parse_endian_slash_DEPENDENCIES) $(EXTRA_parse_endian_slash_DEPENDENCIES) 
+	@rm -f parse_endian_slash$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_endian_slash_OBJECTS) $(parse_endian_slash_LDADD) $(LIBS)
+
+parse_eol$(EXEEXT): $(parse_eol_OBJECTS) $(parse_eol_DEPENDENCIES) $(EXTRA_parse_eol_DEPENDENCIES) 
+	@rm -f parse_eol$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_eol_OBJECTS) $(parse_eol_LDADD) $(LIBS)
+
+parse_foffs$(EXEEXT): $(parse_foffs_OBJECTS) $(parse_foffs_DEPENDENCIES) $(EXTRA_parse_foffs_DEPENDENCIES) 
+	@rm -f parse_foffs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_foffs_OBJECTS) $(parse_foffs_LDADD) $(LIBS)
+
+parse_foffs_include$(EXEEXT): $(parse_foffs_include_OBJECTS) $(parse_foffs_include_DEPENDENCIES) $(EXTRA_parse_foffs_include_DEPENDENCIES) 
+	@rm -f parse_foffs_include$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_foffs_include_OBJECTS) $(parse_foffs_include_LDADD) $(LIBS)
+
+parse_foffs_slash$(EXEEXT): $(parse_foffs_slash_OBJECTS) $(parse_foffs_slash_DEPENDENCIES) $(EXTRA_parse_foffs_slash_DEPENDENCIES) 
+	@rm -f parse_foffs_slash$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_foffs_slash_OBJECTS) $(parse_foffs_slash_LDADD) $(LIBS)
+
+parse_hex$(EXEEXT): $(parse_hex_OBJECTS) $(parse_hex_DEPENDENCIES) $(EXTRA_parse_hex_DEPENDENCIES) 
+	@rm -f parse_hex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_hex_OBJECTS) $(parse_hex_LDADD) $(LIBS)
+
+parse_hidden$(EXEEXT): $(parse_hidden_OBJECTS) $(parse_hidden_DEPENDENCIES) $(EXTRA_parse_hidden_DEPENDENCIES) 
+	@rm -f parse_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_hidden_OBJECTS) $(parse_hidden_LDADD) $(LIBS)
+
+parse_hidden_field$(EXEEXT): $(parse_hidden_field_OBJECTS) $(parse_hidden_field_DEPENDENCIES) $(EXTRA_parse_hidden_field_DEPENDENCIES) 
+	@rm -f parse_hidden_field$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_hidden_field_OBJECTS) $(parse_hidden_field_LDADD) $(LIBS)
+
+parse_hidden_meta$(EXEEXT): $(parse_hidden_meta_OBJECTS) $(parse_hidden_meta_DEPENDENCIES) $(EXTRA_parse_hidden_meta_DEPENDENCIES) 
+	@rm -f parse_hidden_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_hidden_meta_OBJECTS) $(parse_hidden_meta_LDADD) $(LIBS)
+
+parse_include$(EXEEXT): $(parse_include_OBJECTS) $(parse_include_DEPENDENCIES) $(EXTRA_parse_include_DEPENDENCIES) 
+	@rm -f parse_include$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_OBJECTS) $(parse_include_LDADD) $(LIBS)
+
+parse_include_absolute$(EXEEXT): $(parse_include_absolute_OBJECTS) $(parse_include_absolute_DEPENDENCIES) $(EXTRA_parse_include_absolute_DEPENDENCIES) 
+	@rm -f parse_include_absolute$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_absolute_OBJECTS) $(parse_include_absolute_LDADD) $(LIBS)
+
+parse_include_absrel$(EXEEXT): $(parse_include_absrel_OBJECTS) $(parse_include_absrel_DEPENDENCIES) $(EXTRA_parse_include_absrel_DEPENDENCIES) 
+	@rm -f parse_include_absrel$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_absrel_OBJECTS) $(parse_include_absrel_LDADD) $(LIBS)
+
+parse_include_affix_ref$(EXEEXT): $(parse_include_affix_ref_OBJECTS) $(parse_include_affix_ref_DEPENDENCIES) $(EXTRA_parse_include_affix_ref_DEPENDENCIES) 
+	@rm -f parse_include_affix_ref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_affix_ref_OBJECTS) $(parse_include_affix_ref_LDADD) $(LIBS)
+
+parse_include_dir$(EXEEXT): $(parse_include_dir_OBJECTS) $(parse_include_dir_DEPENDENCIES) $(EXTRA_parse_include_dir_DEPENDENCIES) 
+	@rm -f parse_include_dir$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_dir_OBJECTS) $(parse_include_dir_LDADD) $(LIBS)
+
+parse_include_loop$(EXEEXT): $(parse_include_loop_OBJECTS) $(parse_include_loop_DEPENDENCIES) $(EXTRA_parse_include_loop_DEPENDENCIES) 
+	@rm -f parse_include_loop$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_loop_OBJECTS) $(parse_include_loop_LDADD) $(LIBS)
+
+parse_include_nonexistent$(EXEEXT): $(parse_include_nonexistent_OBJECTS) $(parse_include_nonexistent_DEPENDENCIES) $(EXTRA_parse_include_nonexistent_DEPENDENCIES) 
+	@rm -f parse_include_nonexistent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_nonexistent_OBJECTS) $(parse_include_nonexistent_LDADD) $(LIBS)
+
+parse_include_prefix$(EXEEXT): $(parse_include_prefix_OBJECTS) $(parse_include_prefix_DEPENDENCIES) $(EXTRA_parse_include_prefix_DEPENDENCIES) 
+	@rm -f parse_include_prefix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_prefix_OBJECTS) $(parse_include_prefix_LDADD) $(LIBS)
+
+parse_include_prefix_dup$(EXEEXT): $(parse_include_prefix_dup_OBJECTS) $(parse_include_prefix_dup_DEPENDENCIES) $(EXTRA_parse_include_prefix_dup_DEPENDENCIES) 
+	@rm -f parse_include_prefix_dup$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_prefix_dup_OBJECTS) $(parse_include_prefix_dup_LDADD) $(LIBS)
+
+parse_include_preprefix$(EXEEXT): $(parse_include_preprefix_OBJECTS) $(parse_include_preprefix_DEPENDENCIES) $(EXTRA_parse_include_preprefix_DEPENDENCIES) 
+	@rm -f parse_include_preprefix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_preprefix_OBJECTS) $(parse_include_preprefix_LDADD) $(LIBS)
+
+parse_include_ref$(EXEEXT): $(parse_include_ref_OBJECTS) $(parse_include_ref_DEPENDENCIES) $(EXTRA_parse_include_ref_DEPENDENCIES) 
+	@rm -f parse_include_ref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_ref_OBJECTS) $(parse_include_ref_LDADD) $(LIBS)
+
+parse_include_relabs$(EXEEXT): $(parse_include_relabs_OBJECTS) $(parse_include_relabs_DEPENDENCIES) $(EXTRA_parse_include_relabs_DEPENDENCIES) 
+	@rm -f parse_include_relabs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_relabs_OBJECTS) $(parse_include_relabs_LDADD) $(LIBS)
+
+parse_include_relrel$(EXEEXT): $(parse_include_relrel_OBJECTS) $(parse_include_relrel_DEPENDENCIES) $(EXTRA_parse_include_relrel_DEPENDENCIES) 
+	@rm -f parse_include_relrel$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_relrel_OBJECTS) $(parse_include_relrel_LDADD) $(LIBS)
+
+parse_include_slash$(EXEEXT): $(parse_include_slash_OBJECTS) $(parse_include_slash_DEPENDENCIES) $(EXTRA_parse_include_slash_DEPENDENCIES) 
+	@rm -f parse_include_slash$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_slash_OBJECTS) $(parse_include_slash_LDADD) $(LIBS)
+
+parse_include_suffix$(EXEEXT): $(parse_include_suffix_OBJECTS) $(parse_include_suffix_DEPENDENCIES) $(EXTRA_parse_include_suffix_DEPENDENCIES) 
+	@rm -f parse_include_suffix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_suffix_OBJECTS) $(parse_include_suffix_LDADD) $(LIBS)
+
+parse_include_sufsuffix$(EXEEXT): $(parse_include_sufsuffix_OBJECTS) $(parse_include_sufsuffix_DEPENDENCIES) $(EXTRA_parse_include_sufsuffix_DEPENDENCIES) 
+	@rm -f parse_include_sufsuffix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_include_sufsuffix_OBJECTS) $(parse_include_sufsuffix_LDADD) $(LIBS)
+
+parse_index$(EXEEXT): $(parse_index_OBJECTS) $(parse_index_DEPENDENCIES) $(EXTRA_parse_index_DEPENDENCIES) 
+	@rm -f parse_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_index_OBJECTS) $(parse_index_LDADD) $(LIBS)
+
+parse_lincom$(EXEEXT): $(parse_lincom_OBJECTS) $(parse_lincom_DEPENDENCIES) $(EXTRA_parse_lincom_DEPENDENCIES) 
+	@rm -f parse_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_lincom_OBJECTS) $(parse_lincom_LDADD) $(LIBS)
+
+parse_lincom_ncols1$(EXEEXT): $(parse_lincom_ncols1_OBJECTS) $(parse_lincom_ncols1_DEPENDENCIES) $(EXTRA_parse_lincom_ncols1_DEPENDENCIES) 
+	@rm -f parse_lincom_ncols1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_lincom_ncols1_OBJECTS) $(parse_lincom_ncols1_LDADD) $(LIBS)
+
+parse_lincom_ncols2$(EXEEXT): $(parse_lincom_ncols2_OBJECTS) $(parse_lincom_ncols2_DEPENDENCIES) $(EXTRA_parse_lincom_ncols2_DEPENDENCIES) 
+	@rm -f parse_lincom_ncols2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_lincom_ncols2_OBJECTS) $(parse_lincom_ncols2_LDADD) $(LIBS)
+
+parse_lincom_nfields$(EXEEXT): $(parse_lincom_nfields_OBJECTS) $(parse_lincom_nfields_DEPENDENCIES) $(EXTRA_parse_lincom_nfields_DEPENDENCIES) 
+	@rm -f parse_lincom_nfields$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_lincom_nfields_OBJECTS) $(parse_lincom_nfields_LDADD) $(LIBS)
+
+parse_lincom_nofields$(EXEEXT): $(parse_lincom_nofields_OBJECTS) $(parse_lincom_nofields_DEPENDENCIES) $(EXTRA_parse_lincom_nofields_DEPENDENCIES) 
+	@rm -f parse_lincom_nofields$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_lincom_nofields_OBJECTS) $(parse_lincom_nofields_LDADD) $(LIBS)
+
+parse_lincom_non$(EXEEXT): $(parse_lincom_non_OBJECTS) $(parse_lincom_non_DEPENDENCIES) $(EXTRA_parse_lincom_non_DEPENDENCIES) 
+	@rm -f parse_lincom_non$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_lincom_non_OBJECTS) $(parse_lincom_non_LDADD) $(LIBS)
+
+parse_lincom_non_ncols$(EXEEXT): $(parse_lincom_non_ncols_OBJECTS) $(parse_lincom_non_ncols_DEPENDENCIES) $(EXTRA_parse_lincom_non_ncols_DEPENDENCIES) 
+	@rm -f parse_lincom_non_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_lincom_non_ncols_OBJECTS) $(parse_lincom_non_ncols_LDADD) $(LIBS)
+
+parse_lincom_scalar$(EXEEXT): $(parse_lincom_scalar_OBJECTS) $(parse_lincom_scalar_DEPENDENCIES) $(EXTRA_parse_lincom_scalar_DEPENDENCIES) 
+	@rm -f parse_lincom_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_lincom_scalar_OBJECTS) $(parse_lincom_scalar_LDADD) $(LIBS)
+
+parse_linterp$(EXEEXT): $(parse_linterp_OBJECTS) $(parse_linterp_DEPENDENCIES) $(EXTRA_parse_linterp_DEPENDENCIES) 
+	@rm -f parse_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_linterp_OBJECTS) $(parse_linterp_LDADD) $(LIBS)
+
+parse_linterp_ncols$(EXEEXT): $(parse_linterp_ncols_OBJECTS) $(parse_linterp_ncols_DEPENDENCIES) $(EXTRA_parse_linterp_ncols_DEPENDENCIES) 
+	@rm -f parse_linterp_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_linterp_ncols_OBJECTS) $(parse_linterp_ncols_LDADD) $(LIBS)
+
+parse_malias$(EXEEXT): $(parse_malias_OBJECTS) $(parse_malias_DEPENDENCIES) $(EXTRA_parse_malias_DEPENDENCIES) 
+	@rm -f parse_malias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_malias_OBJECTS) $(parse_malias_LDADD) $(LIBS)
+
+parse_malias_dup$(EXEEXT): $(parse_malias_dup_OBJECTS) $(parse_malias_dup_DEPENDENCIES) $(EXTRA_parse_malias_dup_DEPENDENCIES) 
+	@rm -f parse_malias_dup$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_malias_dup_OBJECTS) $(parse_malias_dup_LDADD) $(LIBS)
+
+parse_malias_meta$(EXEEXT): $(parse_malias_meta_OBJECTS) $(parse_malias_meta_DEPENDENCIES) $(EXTRA_parse_malias_meta_DEPENDENCIES) 
+	@rm -f parse_malias_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_malias_meta_OBJECTS) $(parse_malias_meta_LDADD) $(LIBS)
+
+parse_meta$(EXEEXT): $(parse_meta_OBJECTS) $(parse_meta_DEPENDENCIES) $(EXTRA_parse_meta_DEPENDENCIES) 
+	@rm -f parse_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_OBJECTS) $(parse_meta_LDADD) $(LIBS)
+
+parse_meta_affix$(EXEEXT): $(parse_meta_affix_OBJECTS) $(parse_meta_affix_DEPENDENCIES) $(EXTRA_parse_meta_affix_DEPENDENCIES) 
+	@rm -f parse_meta_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_affix_OBJECTS) $(parse_meta_affix_LDADD) $(LIBS)
+
+parse_meta_alias$(EXEEXT): $(parse_meta_alias_OBJECTS) $(parse_meta_alias_DEPENDENCIES) $(EXTRA_parse_meta_alias_DEPENDENCIES) 
+	@rm -f parse_meta_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_alias_OBJECTS) $(parse_meta_alias_LDADD) $(LIBS)
+
+parse_meta_implicit$(EXEEXT): $(parse_meta_implicit_OBJECTS) $(parse_meta_implicit_DEPENDENCIES) $(EXTRA_parse_meta_implicit_DEPENDENCIES) 
+	@rm -f parse_meta_implicit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_implicit_OBJECTS) $(parse_meta_implicit_LDADD) $(LIBS)
+
+parse_meta_implicit2$(EXEEXT): $(parse_meta_implicit2_OBJECTS) $(parse_meta_implicit2_DEPENDENCIES) $(EXTRA_parse_meta_implicit2_DEPENDENCIES) 
+	@rm -f parse_meta_implicit2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_implicit2_OBJECTS) $(parse_meta_implicit2_LDADD) $(LIBS)
+
+parse_meta_implicit_affix$(EXEEXT): $(parse_meta_implicit_affix_OBJECTS) $(parse_meta_implicit_affix_DEPENDENCIES) $(EXTRA_parse_meta_implicit_affix_DEPENDENCIES) 
+	@rm -f parse_meta_implicit_affix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_implicit_affix_OBJECTS) $(parse_meta_implicit_affix_LDADD) $(LIBS)
+
+parse_meta_index$(EXEEXT): $(parse_meta_index_OBJECTS) $(parse_meta_index_DEPENDENCIES) $(EXTRA_parse_meta_index_DEPENDENCIES) 
+	@rm -f parse_meta_index$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_index_OBJECTS) $(parse_meta_index_LDADD) $(LIBS)
+
+parse_meta_index2$(EXEEXT): $(parse_meta_index2_OBJECTS) $(parse_meta_index2_DEPENDENCIES) $(EXTRA_parse_meta_index2_DEPENDENCIES) 
+	@rm -f parse_meta_index2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_index2_OBJECTS) $(parse_meta_index2_LDADD) $(LIBS)
+
+parse_meta_jump$(EXEEXT): $(parse_meta_jump_OBJECTS) $(parse_meta_jump_DEPENDENCIES) $(EXTRA_parse_meta_jump_DEPENDENCIES) 
+	@rm -f parse_meta_jump$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_jump_OBJECTS) $(parse_meta_jump_LDADD) $(LIBS)
+
+parse_meta_malias$(EXEEXT): $(parse_meta_malias_OBJECTS) $(parse_meta_malias_DEPENDENCIES) $(EXTRA_parse_meta_malias_DEPENDENCIES) 
+	@rm -f parse_meta_malias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_malias_OBJECTS) $(parse_meta_malias_LDADD) $(LIBS)
+
+parse_meta_meta$(EXEEXT): $(parse_meta_meta_OBJECTS) $(parse_meta_meta_DEPENDENCIES) $(EXTRA_parse_meta_meta_DEPENDENCIES) 
+	@rm -f parse_meta_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_meta_OBJECTS) $(parse_meta_meta_LDADD) $(LIBS)
+
+parse_meta_parent$(EXEEXT): $(parse_meta_parent_OBJECTS) $(parse_meta_parent_DEPENDENCIES) $(EXTRA_parse_meta_parent_DEPENDENCIES) 
+	@rm -f parse_meta_parent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_parent_OBJECTS) $(parse_meta_parent_LDADD) $(LIBS)
+
+parse_meta_raw$(EXEEXT): $(parse_meta_raw_OBJECTS) $(parse_meta_raw_DEPENDENCIES) $(EXTRA_parse_meta_raw_DEPENDENCIES) 
+	@rm -f parse_meta_raw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_meta_raw_OBJECTS) $(parse_meta_raw_LDADD) $(LIBS)
+
+parse_mplex$(EXEEXT): $(parse_mplex_OBJECTS) $(parse_mplex_DEPENDENCIES) $(EXTRA_parse_mplex_DEPENDENCIES) 
+	@rm -f parse_mplex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_mplex_OBJECTS) $(parse_mplex_LDADD) $(LIBS)
+
+parse_mplex_ncols$(EXEEXT): $(parse_mplex_ncols_OBJECTS) $(parse_mplex_ncols_DEPENDENCIES) $(EXTRA_parse_mplex_ncols_DEPENDENCIES) 
+	@rm -f parse_mplex_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_mplex_ncols_OBJECTS) $(parse_mplex_ncols_LDADD) $(LIBS)
+
+parse_mplex_nomax$(EXEEXT): $(parse_mplex_nomax_OBJECTS) $(parse_mplex_nomax_DEPENDENCIES) $(EXTRA_parse_mplex_nomax_DEPENDENCIES) 
+	@rm -f parse_mplex_nomax$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_mplex_nomax_OBJECTS) $(parse_mplex_nomax_LDADD) $(LIBS)
+
+parse_mplex_scalar$(EXEEXT): $(parse_mplex_scalar_OBJECTS) $(parse_mplex_scalar_DEPENDENCIES) $(EXTRA_parse_mplex_scalar_DEPENDENCIES) 
+	@rm -f parse_mplex_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_mplex_scalar_OBJECTS) $(parse_mplex_scalar_LDADD) $(LIBS)
+
+parse_multiply$(EXEEXT): $(parse_multiply_OBJECTS) $(parse_multiply_DEPENDENCIES) $(EXTRA_parse_multiply_DEPENDENCIES) 
+	@rm -f parse_multiply$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_multiply_OBJECTS) $(parse_multiply_LDADD) $(LIBS)
+
+parse_multiply_ncols$(EXEEXT): $(parse_multiply_ncols_OBJECTS) $(parse_multiply_ncols_DEPENDENCIES) $(EXTRA_parse_multiply_ncols_DEPENDENCIES) 
+	@rm -f parse_multiply_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_multiply_ncols_OBJECTS) $(parse_multiply_ncols_LDADD) $(LIBS)
+
+parse_name$(EXEEXT): $(parse_name_OBJECTS) $(parse_name_DEPENDENCIES) $(EXTRA_parse_name_DEPENDENCIES) 
+	@rm -f parse_name$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_name_OBJECTS) $(parse_name_LDADD) $(LIBS)
+
+parse_name_dot$(EXEEXT): $(parse_name_dot_OBJECTS) $(parse_name_dot_DEPENDENCIES) $(EXTRA_parse_name_dot_DEPENDENCIES) 
+	@rm -f parse_name_dot$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_name_dot_OBJECTS) $(parse_name_dot_LDADD) $(LIBS)
+
+parse_name_ext$(EXEEXT): $(parse_name_ext_OBJECTS) $(parse_name_ext_DEPENDENCIES) $(EXTRA_parse_name_ext_DEPENDENCIES) 
+	@rm -f parse_name_ext$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_name_ext_OBJECTS) $(parse_name_ext_LDADD) $(LIBS)
+
+parse_name_pedantic$(EXEEXT): $(parse_name_pedantic_OBJECTS) $(parse_name_pedantic_DEPENDENCIES) $(EXTRA_parse_name_pedantic_DEPENDENCIES) 
+	@rm -f parse_name_pedantic$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_name_pedantic_OBJECTS) $(parse_name_pedantic_LDADD) $(LIBS)
+
+parse_ncols$(EXEEXT): $(parse_ncols_OBJECTS) $(parse_ncols_DEPENDENCIES) $(EXTRA_parse_ncols_DEPENDENCIES) 
+	@rm -f parse_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_ncols_OBJECTS) $(parse_ncols_LDADD) $(LIBS)
+
+parse_phase$(EXEEXT): $(parse_phase_OBJECTS) $(parse_phase_DEPENDENCIES) $(EXTRA_parse_phase_DEPENDENCIES) 
+	@rm -f parse_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_phase_OBJECTS) $(parse_phase_LDADD) $(LIBS)
+
+parse_phase_ncols$(EXEEXT): $(parse_phase_ncols_OBJECTS) $(parse_phase_ncols_DEPENDENCIES) $(EXTRA_parse_phase_ncols_DEPENDENCIES) 
+	@rm -f parse_phase_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_phase_ncols_OBJECTS) $(parse_phase_ncols_LDADD) $(LIBS)
+
+parse_phase_scalar$(EXEEXT): $(parse_phase_scalar_OBJECTS) $(parse_phase_scalar_DEPENDENCIES) $(EXTRA_parse_phase_scalar_DEPENDENCIES) 
+	@rm -f parse_phase_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_phase_scalar_OBJECTS) $(parse_phase_scalar_LDADD) $(LIBS)
+
+parse_polynom$(EXEEXT): $(parse_polynom_OBJECTS) $(parse_polynom_DEPENDENCIES) $(EXTRA_parse_polynom_DEPENDENCIES) 
+	@rm -f parse_polynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_polynom_OBJECTS) $(parse_polynom_LDADD) $(LIBS)
+
+parse_polynom_ncols1$(EXEEXT): $(parse_polynom_ncols1_OBJECTS) $(parse_polynom_ncols1_DEPENDENCIES) $(EXTRA_parse_polynom_ncols1_DEPENDENCIES) 
+	@rm -f parse_polynom_ncols1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_polynom_ncols1_OBJECTS) $(parse_polynom_ncols1_LDADD) $(LIBS)
+
+parse_polynom_ncols2$(EXEEXT): $(parse_polynom_ncols2_OBJECTS) $(parse_polynom_ncols2_DEPENDENCIES) $(EXTRA_parse_polynom_ncols2_DEPENDENCIES) 
+	@rm -f parse_polynom_ncols2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_polynom_ncols2_OBJECTS) $(parse_polynom_ncols2_LDADD) $(LIBS)
+
+parse_polynom_scalar$(EXEEXT): $(parse_polynom_scalar_OBJECTS) $(parse_polynom_scalar_DEPENDENCIES) $(EXTRA_parse_polynom_scalar_DEPENDENCIES) 
+	@rm -f parse_polynom_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_polynom_scalar_OBJECTS) $(parse_polynom_scalar_LDADD) $(LIBS)
+
+parse_protect_all$(EXEEXT): $(parse_protect_all_OBJECTS) $(parse_protect_all_DEPENDENCIES) $(EXTRA_parse_protect_all_DEPENDENCIES) 
+	@rm -f parse_protect_all$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_protect_all_OBJECTS) $(parse_protect_all_LDADD) $(LIBS)
+
+parse_protect_bad$(EXEEXT): $(parse_protect_bad_OBJECTS) $(parse_protect_bad_DEPENDENCIES) $(EXTRA_parse_protect_bad_DEPENDENCIES) 
+	@rm -f parse_protect_bad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_protect_bad_OBJECTS) $(parse_protect_bad_LDADD) $(LIBS)
+
+parse_protect_data$(EXEEXT): $(parse_protect_data_OBJECTS) $(parse_protect_data_DEPENDENCIES) $(EXTRA_parse_protect_data_DEPENDENCIES) 
+	@rm -f parse_protect_data$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_protect_data_OBJECTS) $(parse_protect_data_LDADD) $(LIBS)
+
+parse_protect_format$(EXEEXT): $(parse_protect_format_OBJECTS) $(parse_protect_format_DEPENDENCIES) $(EXTRA_parse_protect_format_DEPENDENCIES) 
+	@rm -f parse_protect_format$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_protect_format_OBJECTS) $(parse_protect_format_LDADD) $(LIBS)
+
+parse_protect_none$(EXEEXT): $(parse_protect_none_OBJECTS) $(parse_protect_none_DEPENDENCIES) $(EXTRA_parse_protect_none_DEPENDENCIES) 
+	@rm -f parse_protect_none$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_protect_none_OBJECTS) $(parse_protect_none_LDADD) $(LIBS)
+
+parse_quote$(EXEEXT): $(parse_quote_OBJECTS) $(parse_quote_DEPENDENCIES) $(EXTRA_parse_quote_DEPENDENCIES) 
+	@rm -f parse_quote$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_quote_OBJECTS) $(parse_quote_LDADD) $(LIBS)
+
+parse_quote_mismatch$(EXEEXT): $(parse_quote_mismatch_OBJECTS) $(parse_quote_mismatch_DEPENDENCIES) $(EXTRA_parse_quote_mismatch_DEPENDENCIES) 
+	@rm -f parse_quote_mismatch$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_quote_mismatch_OBJECTS) $(parse_quote_mismatch_LDADD) $(LIBS)
+
+parse_raw$(EXEEXT): $(parse_raw_OBJECTS) $(parse_raw_DEPENDENCIES) $(EXTRA_parse_raw_DEPENDENCIES) 
+	@rm -f parse_raw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_raw_OBJECTS) $(parse_raw_LDADD) $(LIBS)
+
+parse_raw_char$(EXEEXT): $(parse_raw_char_OBJECTS) $(parse_raw_char_DEPENDENCIES) $(EXTRA_parse_raw_char_DEPENDENCIES) 
+	@rm -f parse_raw_char$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_raw_char_OBJECTS) $(parse_raw_char_LDADD) $(LIBS)
+
+parse_raw_ncols$(EXEEXT): $(parse_raw_ncols_OBJECTS) $(parse_raw_ncols_DEPENDENCIES) $(EXTRA_parse_raw_ncols_DEPENDENCIES) 
+	@rm -f parse_raw_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_raw_ncols_OBJECTS) $(parse_raw_ncols_LDADD) $(LIBS)
+
+parse_raw_scalar$(EXEEXT): $(parse_raw_scalar_OBJECTS) $(parse_raw_scalar_DEPENDENCIES) $(EXTRA_parse_raw_scalar_DEPENDENCIES) 
+	@rm -f parse_raw_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_raw_scalar_OBJECTS) $(parse_raw_scalar_LDADD) $(LIBS)
+
+parse_raw_spf$(EXEEXT): $(parse_raw_spf_OBJECTS) $(parse_raw_spf_DEPENDENCIES) $(EXTRA_parse_raw_spf_DEPENDENCIES) 
+	@rm -f parse_raw_spf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_raw_spf_OBJECTS) $(parse_raw_spf_LDADD) $(LIBS)
+
+parse_raw_type$(EXEEXT): $(parse_raw_type_OBJECTS) $(parse_raw_type_DEPENDENCIES) $(EXTRA_parse_raw_type_DEPENDENCIES) 
+	@rm -f parse_raw_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_raw_type_OBJECTS) $(parse_raw_type_LDADD) $(LIBS)
+
+parse_recip$(EXEEXT): $(parse_recip_OBJECTS) $(parse_recip_DEPENDENCIES) $(EXTRA_parse_recip_DEPENDENCIES) 
+	@rm -f parse_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_recip_OBJECTS) $(parse_recip_LDADD) $(LIBS)
+
+parse_ref$(EXEEXT): $(parse_ref_OBJECTS) $(parse_ref_DEPENDENCIES) $(EXTRA_parse_ref_DEPENDENCIES) 
+	@rm -f parse_ref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_ref_OBJECTS) $(parse_ref_LDADD) $(LIBS)
+
+parse_ref_nonexistent$(EXEEXT): $(parse_ref_nonexistent_OBJECTS) $(parse_ref_nonexistent_DEPENDENCIES) $(EXTRA_parse_ref_nonexistent_DEPENDENCIES) 
+	@rm -f parse_ref_nonexistent$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_ref_nonexistent_OBJECTS) $(parse_ref_nonexistent_LDADD) $(LIBS)
+
+parse_sbit$(EXEEXT): $(parse_sbit_OBJECTS) $(parse_sbit_DEPENDENCIES) $(EXTRA_parse_sbit_DEPENDENCIES) 
+	@rm -f parse_sbit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_sbit_OBJECTS) $(parse_sbit_LDADD) $(LIBS)
+
+parse_sort$(EXEEXT): $(parse_sort_OBJECTS) $(parse_sort_DEPENDENCIES) $(EXTRA_parse_sort_DEPENDENCIES) 
+	@rm -f parse_sort$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_sort_OBJECTS) $(parse_sort_LDADD) $(LIBS)
+
+parse_string$(EXEEXT): $(parse_string_OBJECTS) $(parse_string_DEPENDENCIES) $(EXTRA_parse_string_DEPENDENCIES) 
+	@rm -f parse_string$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_string_OBJECTS) $(parse_string_LDADD) $(LIBS)
+
+parse_string_ncols$(EXEEXT): $(parse_string_ncols_OBJECTS) $(parse_string_ncols_DEPENDENCIES) $(EXTRA_parse_string_ncols_DEPENDENCIES) 
+	@rm -f parse_string_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_string_ncols_OBJECTS) $(parse_string_ncols_LDADD) $(LIBS)
+
+parse_string_null$(EXEEXT): $(parse_string_null_OBJECTS) $(parse_string_null_DEPENDENCIES) $(EXTRA_parse_string_null_DEPENDENCIES) 
+	@rm -f parse_string_null$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_string_null_OBJECTS) $(parse_string_null_LDADD) $(LIBS)
+
+parse_utf8$(EXEEXT): $(parse_utf8_OBJECTS) $(parse_utf8_DEPENDENCIES) $(EXTRA_parse_utf8_DEPENDENCIES) 
+	@rm -f parse_utf8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_utf8_OBJECTS) $(parse_utf8_LDADD) $(LIBS)
+
+parse_utf8_invalid$(EXEEXT): $(parse_utf8_invalid_OBJECTS) $(parse_utf8_invalid_DEPENDENCIES) $(EXTRA_parse_utf8_invalid_DEPENDENCIES) 
+	@rm -f parse_utf8_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_utf8_invalid_OBJECTS) $(parse_utf8_invalid_LDADD) $(LIBS)
+
+parse_utf8_zero$(EXEEXT): $(parse_utf8_zero_OBJECTS) $(parse_utf8_zero_DEPENDENCIES) $(EXTRA_parse_utf8_zero_DEPENDENCIES) 
+	@rm -f parse_utf8_zero$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_utf8_zero_OBJECTS) $(parse_utf8_zero_LDADD) $(LIBS)
+
+parse_version$(EXEEXT): $(parse_version_OBJECTS) $(parse_version_DEPENDENCIES) $(EXTRA_parse_version_DEPENDENCIES) 
+	@rm -f parse_version$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_version_OBJECTS) $(parse_version_LDADD) $(LIBS)
+
+parse_version_89$(EXEEXT): $(parse_version_89_OBJECTS) $(parse_version_89_DEPENDENCIES) $(EXTRA_parse_version_89_DEPENDENCIES) 
+	@rm -f parse_version_89$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_version_89_OBJECTS) $(parse_version_89_LDADD) $(LIBS)
+
+parse_version_98$(EXEEXT): $(parse_version_98_OBJECTS) $(parse_version_98_DEPENDENCIES) $(EXTRA_parse_version_98_DEPENDENCIES) 
+	@rm -f parse_version_98$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_version_98_OBJECTS) $(parse_version_98_LDADD) $(LIBS)
+
+parse_version_include$(EXEEXT): $(parse_version_include_OBJECTS) $(parse_version_include_DEPENDENCIES) $(EXTRA_parse_version_include_DEPENDENCIES) 
+	@rm -f parse_version_include$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_version_include_OBJECTS) $(parse_version_include_LDADD) $(LIBS)
+
+parse_version_p8$(EXEEXT): $(parse_version_p8_OBJECTS) $(parse_version_p8_DEPENDENCIES) $(EXTRA_parse_version_p8_DEPENDENCIES) 
+	@rm -f parse_version_p8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_version_p8_OBJECTS) $(parse_version_p8_LDADD) $(LIBS)
+
+parse_version_p9$(EXEEXT): $(parse_version_p9_OBJECTS) $(parse_version_p9_DEPENDENCIES) $(EXTRA_parse_version_p9_DEPENDENCIES) 
+	@rm -f parse_version_p9$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_version_p9_OBJECTS) $(parse_version_p9_LDADD) $(LIBS)
+
+parse_version_permissive$(EXEEXT): $(parse_version_permissive_OBJECTS) $(parse_version_permissive_DEPENDENCIES) $(EXTRA_parse_version_permissive_DEPENDENCIES) 
+	@rm -f parse_version_permissive$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_version_permissive_OBJECTS) $(parse_version_permissive_LDADD) $(LIBS)
+
+parse_version_slash$(EXEEXT): $(parse_version_slash_OBJECTS) $(parse_version_slash_DEPENDENCIES) $(EXTRA_parse_version_slash_DEPENDENCIES) 
+	@rm -f parse_version_slash$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_version_slash_OBJECTS) $(parse_version_slash_LDADD) $(LIBS)
+
+parse_whitespace$(EXEEXT): $(parse_whitespace_OBJECTS) $(parse_whitespace_DEPENDENCIES) $(EXTRA_parse_whitespace_DEPENDENCIES) 
+	@rm -f parse_whitespace$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_whitespace_OBJECTS) $(parse_whitespace_LDADD) $(LIBS)
+
+parse_window$(EXEEXT): $(parse_window_OBJECTS) $(parse_window_DEPENDENCIES) $(EXTRA_parse_window_DEPENDENCIES) 
+	@rm -f parse_window$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_window_OBJECTS) $(parse_window_LDADD) $(LIBS)
+
+parse_window_ncols$(EXEEXT): $(parse_window_ncols_OBJECTS) $(parse_window_ncols_DEPENDENCIES) $(EXTRA_parse_window_ncols_DEPENDENCIES) 
+	@rm -f parse_window_ncols$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_window_ncols_OBJECTS) $(parse_window_ncols_LDADD) $(LIBS)
+
+parse_window_op$(EXEEXT): $(parse_window_op_OBJECTS) $(parse_window_op_DEPENDENCIES) $(EXTRA_parse_window_op_DEPENDENCIES) 
+	@rm -f parse_window_op$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_window_op_OBJECTS) $(parse_window_op_LDADD) $(LIBS)
+
+parse_window_scalar$(EXEEXT): $(parse_window_scalar_OBJECTS) $(parse_window_scalar_DEPENDENCIES) $(EXTRA_parse_window_scalar_DEPENDENCIES) 
+	@rm -f parse_window_scalar$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(parse_window_scalar_OBJECTS) $(parse_window_scalar_LDADD) $(LIBS)
+
+protect_alter$(EXEEXT): $(protect_alter_OBJECTS) $(protect_alter_DEPENDENCIES) $(EXTRA_protect_alter_DEPENDENCIES) 
+	@rm -f protect_alter$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(protect_alter_OBJECTS) $(protect_alter_LDADD) $(LIBS)
+
+protect_get$(EXEEXT): $(protect_get_OBJECTS) $(protect_get_DEPENDENCIES) $(EXTRA_protect_get_DEPENDENCIES) 
+	@rm -f protect_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(protect_get_OBJECTS) $(protect_get_LDADD) $(LIBS)
+
+put64$(EXEEXT): $(put64_OBJECTS) $(put64_DEPENDENCIES) $(EXTRA_put64_DEPENDENCIES) 
+	@rm -f put64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put64_OBJECTS) $(put64_LDADD) $(LIBS)
+
+put_bad_code$(EXEEXT): $(put_bad_code_OBJECTS) $(put_bad_code_DEPENDENCIES) $(EXTRA_put_bad_code_DEPENDENCIES) 
+	@rm -f put_bad_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_bad_code_OBJECTS) $(put_bad_code_LDADD) $(LIBS)
+
+put_bit$(EXEEXT): $(put_bit_OBJECTS) $(put_bit_DEPENDENCIES) $(EXTRA_put_bit_DEPENDENCIES) 
+	@rm -f put_bit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_bit_OBJECTS) $(put_bit_LDADD) $(LIBS)
+
+put_bof$(EXEEXT): $(put_bof_OBJECTS) $(put_bof_DEPENDENCIES) $(EXTRA_put_bof_DEPENDENCIES) 
+	@rm -f put_bof$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_bof_OBJECTS) $(put_bof_LDADD) $(LIBS)
+
+put_carray$(EXEEXT): $(put_carray_OBJECTS) $(put_carray_DEPENDENCIES) $(EXTRA_put_carray_DEPENDENCIES) 
+	@rm -f put_carray$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_carray_OBJECTS) $(put_carray_LDADD) $(LIBS)
+
+put_carray_slice$(EXEEXT): $(put_carray_slice_OBJECTS) $(put_carray_slice_DEPENDENCIES) $(EXTRA_put_carray_slice_DEPENDENCIES) 
+	@rm -f put_carray_slice$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_carray_slice_OBJECTS) $(put_carray_slice_LDADD) $(LIBS)
+
+put_char$(EXEEXT): $(put_char_OBJECTS) $(put_char_DEPENDENCIES) $(EXTRA_put_char_DEPENDENCIES) 
+	@rm -f put_char$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_char_OBJECTS) $(put_char_LDADD) $(LIBS)
+
+put_complex128$(EXEEXT): $(put_complex128_OBJECTS) $(put_complex128_DEPENDENCIES) $(EXTRA_put_complex128_DEPENDENCIES) 
+	@rm -f put_complex128$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_complex128_OBJECTS) $(put_complex128_LDADD) $(LIBS)
+
+put_complex64$(EXEEXT): $(put_complex64_OBJECTS) $(put_complex64_DEPENDENCIES) $(EXTRA_put_complex64_DEPENDENCIES) 
+	@rm -f put_complex64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_complex64_OBJECTS) $(put_complex64_LDADD) $(LIBS)
+
+put_const$(EXEEXT): $(put_const_OBJECTS) $(put_const_DEPENDENCIES) $(EXTRA_put_const_DEPENDENCIES) 
+	@rm -f put_const$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_const_OBJECTS) $(put_const_LDADD) $(LIBS)
+
+put_const_protect$(EXEEXT): $(put_const_protect_OBJECTS) $(put_const_protect_DEPENDENCIES) $(EXTRA_put_const_protect_DEPENDENCIES) 
+	@rm -f put_const_protect$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_const_protect_OBJECTS) $(put_const_protect_LDADD) $(LIBS)
+
+put_divide$(EXEEXT): $(put_divide_OBJECTS) $(put_divide_DEPENDENCIES) $(EXTRA_put_divide_DEPENDENCIES) 
+	@rm -f put_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_divide_OBJECTS) $(put_divide_LDADD) $(LIBS)
+
+put_endian16$(EXEEXT): $(put_endian16_OBJECTS) $(put_endian16_DEPENDENCIES) $(EXTRA_put_endian16_DEPENDENCIES) 
+	@rm -f put_endian16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian16_OBJECTS) $(put_endian16_LDADD) $(LIBS)
+
+put_endian32$(EXEEXT): $(put_endian32_OBJECTS) $(put_endian32_DEPENDENCIES) $(EXTRA_put_endian32_DEPENDENCIES) 
+	@rm -f put_endian32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian32_OBJECTS) $(put_endian32_LDADD) $(LIBS)
+
+put_endian64$(EXEEXT): $(put_endian64_OBJECTS) $(put_endian64_DEPENDENCIES) $(EXTRA_put_endian64_DEPENDENCIES) 
+	@rm -f put_endian64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian64_OBJECTS) $(put_endian64_LDADD) $(LIBS)
+
+put_endian8$(EXEEXT): $(put_endian8_OBJECTS) $(put_endian8_DEPENDENCIES) $(EXTRA_put_endian8_DEPENDENCIES) 
+	@rm -f put_endian8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian8_OBJECTS) $(put_endian8_LDADD) $(LIBS)
+
+put_endian_complex128_arm$(EXEEXT): $(put_endian_complex128_arm_OBJECTS) $(put_endian_complex128_arm_DEPENDENCIES) $(EXTRA_put_endian_complex128_arm_DEPENDENCIES) 
+	@rm -f put_endian_complex128_arm$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_complex128_arm_OBJECTS) $(put_endian_complex128_arm_LDADD) $(LIBS)
+
+put_endian_complex128_big$(EXEEXT): $(put_endian_complex128_big_OBJECTS) $(put_endian_complex128_big_DEPENDENCIES) $(EXTRA_put_endian_complex128_big_DEPENDENCIES) 
+	@rm -f put_endian_complex128_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_complex128_big_OBJECTS) $(put_endian_complex128_big_LDADD) $(LIBS)
+
+put_endian_complex128_little$(EXEEXT): $(put_endian_complex128_little_OBJECTS) $(put_endian_complex128_little_DEPENDENCIES) $(EXTRA_put_endian_complex128_little_DEPENDENCIES) 
+	@rm -f put_endian_complex128_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_complex128_little_OBJECTS) $(put_endian_complex128_little_LDADD) $(LIBS)
+
+put_endian_complex64_arm$(EXEEXT): $(put_endian_complex64_arm_OBJECTS) $(put_endian_complex64_arm_DEPENDENCIES) $(EXTRA_put_endian_complex64_arm_DEPENDENCIES) 
+	@rm -f put_endian_complex64_arm$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_complex64_arm_OBJECTS) $(put_endian_complex64_arm_LDADD) $(LIBS)
+
+put_endian_complex64_big$(EXEEXT): $(put_endian_complex64_big_OBJECTS) $(put_endian_complex64_big_DEPENDENCIES) $(EXTRA_put_endian_complex64_big_DEPENDENCIES) 
+	@rm -f put_endian_complex64_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_complex64_big_OBJECTS) $(put_endian_complex64_big_LDADD) $(LIBS)
+
+put_endian_complex64_little$(EXEEXT): $(put_endian_complex64_little_OBJECTS) $(put_endian_complex64_little_DEPENDENCIES) $(EXTRA_put_endian_complex64_little_DEPENDENCIES) 
+	@rm -f put_endian_complex64_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_complex64_little_OBJECTS) $(put_endian_complex64_little_LDADD) $(LIBS)
+
+put_endian_float32_arm$(EXEEXT): $(put_endian_float32_arm_OBJECTS) $(put_endian_float32_arm_DEPENDENCIES) $(EXTRA_put_endian_float32_arm_DEPENDENCIES) 
+	@rm -f put_endian_float32_arm$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_float32_arm_OBJECTS) $(put_endian_float32_arm_LDADD) $(LIBS)
+
+put_endian_float32_big$(EXEEXT): $(put_endian_float32_big_OBJECTS) $(put_endian_float32_big_DEPENDENCIES) $(EXTRA_put_endian_float32_big_DEPENDENCIES) 
+	@rm -f put_endian_float32_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_float32_big_OBJECTS) $(put_endian_float32_big_LDADD) $(LIBS)
+
+put_endian_float32_little$(EXEEXT): $(put_endian_float32_little_OBJECTS) $(put_endian_float32_little_DEPENDENCIES) $(EXTRA_put_endian_float32_little_DEPENDENCIES) 
+	@rm -f put_endian_float32_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_float32_little_OBJECTS) $(put_endian_float32_little_LDADD) $(LIBS)
+
+put_endian_float64_arm$(EXEEXT): $(put_endian_float64_arm_OBJECTS) $(put_endian_float64_arm_DEPENDENCIES) $(EXTRA_put_endian_float64_arm_DEPENDENCIES) 
+	@rm -f put_endian_float64_arm$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_float64_arm_OBJECTS) $(put_endian_float64_arm_LDADD) $(LIBS)
+
+put_endian_float64_big$(EXEEXT): $(put_endian_float64_big_OBJECTS) $(put_endian_float64_big_DEPENDENCIES) $(EXTRA_put_endian_float64_big_DEPENDENCIES) 
+	@rm -f put_endian_float64_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_float64_big_OBJECTS) $(put_endian_float64_big_LDADD) $(LIBS)
+
+put_endian_float64_little$(EXEEXT): $(put_endian_float64_little_OBJECTS) $(put_endian_float64_little_DEPENDENCIES) $(EXTRA_put_endian_float64_little_DEPENDENCIES) 
+	@rm -f put_endian_float64_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_endian_float64_little_OBJECTS) $(put_endian_float64_little_LDADD) $(LIBS)
+
+put_ff$(EXEEXT): $(put_ff_OBJECTS) $(put_ff_DEPENDENCIES) $(EXTRA_put_ff_DEPENDENCIES) 
+	@rm -f put_ff$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_ff_OBJECTS) $(put_ff_LDADD) $(LIBS)
+
+put_float32$(EXEEXT): $(put_float32_OBJECTS) $(put_float32_DEPENDENCIES) $(EXTRA_put_float32_DEPENDENCIES) 
+	@rm -f put_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_float32_OBJECTS) $(put_float32_LDADD) $(LIBS)
+
+put_float64$(EXEEXT): $(put_float64_OBJECTS) $(put_float64_DEPENDENCIES) $(EXTRA_put_float64_DEPENDENCIES) 
+	@rm -f put_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_float64_OBJECTS) $(put_float64_LDADD) $(LIBS)
+
+put_foffs$(EXEEXT): $(put_foffs_OBJECTS) $(put_foffs_DEPENDENCIES) $(EXTRA_put_foffs_DEPENDENCIES) 
+	@rm -f put_foffs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_foffs_OBJECTS) $(put_foffs_LDADD) $(LIBS)
+
+put_fs$(EXEEXT): $(put_fs_OBJECTS) $(put_fs_DEPENDENCIES) $(EXTRA_put_fs_DEPENDENCIES) 
+	@rm -f put_fs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_fs_OBJECTS) $(put_fs_LDADD) $(LIBS)
+
+put_here$(EXEEXT): $(put_here_OBJECTS) $(put_here_DEPENDENCIES) $(EXTRA_put_here_DEPENDENCIES) 
+	@rm -f put_here$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_here_OBJECTS) $(put_here_LDADD) $(LIBS)
+
+put_heres$(EXEEXT): $(put_heres_OBJECTS) $(put_heres_DEPENDENCIES) $(EXTRA_put_heres_DEPENDENCIES) 
+	@rm -f put_heres$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_heres_OBJECTS) $(put_heres_LDADD) $(LIBS)
+
+put_int16$(EXEEXT): $(put_int16_OBJECTS) $(put_int16_DEPENDENCIES) $(EXTRA_put_int16_DEPENDENCIES) 
+	@rm -f put_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_int16_OBJECTS) $(put_int16_LDADD) $(LIBS)
+
+put_int32$(EXEEXT): $(put_int32_OBJECTS) $(put_int32_DEPENDENCIES) $(EXTRA_put_int32_DEPENDENCIES) 
+	@rm -f put_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_int32_OBJECTS) $(put_int32_LDADD) $(LIBS)
+
+put_int64$(EXEEXT): $(put_int64_OBJECTS) $(put_int64_DEPENDENCIES) $(EXTRA_put_int64_DEPENDENCIES) 
+	@rm -f put_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_int64_OBJECTS) $(put_int64_LDADD) $(LIBS)
+
+put_int8$(EXEEXT): $(put_int8_OBJECTS) $(put_int8_DEPENDENCIES) $(EXTRA_put_int8_DEPENDENCIES) 
+	@rm -f put_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_int8_OBJECTS) $(put_int8_LDADD) $(LIBS)
+
+put_invalid$(EXEEXT): $(put_invalid_OBJECTS) $(put_invalid_DEPENDENCIES) $(EXTRA_put_invalid_DEPENDENCIES) 
+	@rm -f put_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_invalid_OBJECTS) $(put_invalid_LDADD) $(LIBS)
+
+put_lincom1$(EXEEXT): $(put_lincom1_OBJECTS) $(put_lincom1_DEPENDENCIES) $(EXTRA_put_lincom1_DEPENDENCIES) 
+	@rm -f put_lincom1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_lincom1_OBJECTS) $(put_lincom1_LDADD) $(LIBS)
+
+put_lincom2$(EXEEXT): $(put_lincom2_OBJECTS) $(put_lincom2_DEPENDENCIES) $(EXTRA_put_lincom2_DEPENDENCIES) 
+	@rm -f put_lincom2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_lincom2_OBJECTS) $(put_lincom2_LDADD) $(LIBS)
+
+put_lincom_noin$(EXEEXT): $(put_lincom_noin_OBJECTS) $(put_lincom_noin_DEPENDENCIES) $(EXTRA_put_lincom_noin_DEPENDENCIES) 
+	@rm -f put_lincom_noin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_lincom_noin_OBJECTS) $(put_lincom_noin_LDADD) $(LIBS)
+
+put_linterp$(EXEEXT): $(put_linterp_OBJECTS) $(put_linterp_DEPENDENCIES) $(EXTRA_put_linterp_DEPENDENCIES) 
+	@rm -f put_linterp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_linterp_OBJECTS) $(put_linterp_LDADD) $(LIBS)
+
+put_linterp_noin$(EXEEXT): $(put_linterp_noin_OBJECTS) $(put_linterp_noin_DEPENDENCIES) $(EXTRA_put_linterp_noin_DEPENDENCIES) 
+	@rm -f put_linterp_noin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_linterp_noin_OBJECTS) $(put_linterp_noin_LDADD) $(LIBS)
+
+put_linterp_nomono$(EXEEXT): $(put_linterp_nomono_OBJECTS) $(put_linterp_nomono_DEPENDENCIES) $(EXTRA_put_linterp_nomono_DEPENDENCIES) 
+	@rm -f put_linterp_nomono$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_linterp_nomono_OBJECTS) $(put_linterp_nomono_LDADD) $(LIBS)
+
+put_linterp_notab$(EXEEXT): $(put_linterp_notab_OBJECTS) $(put_linterp_notab_DEPENDENCIES) $(EXTRA_put_linterp_notab_DEPENDENCIES) 
+	@rm -f put_linterp_notab$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_linterp_notab_OBJECTS) $(put_linterp_notab_LDADD) $(LIBS)
+
+put_linterp_reverse$(EXEEXT): $(put_linterp_reverse_OBJECTS) $(put_linterp_reverse_DEPENDENCIES) $(EXTRA_put_linterp_reverse_DEPENDENCIES) 
+	@rm -f put_linterp_reverse$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_linterp_reverse_OBJECTS) $(put_linterp_reverse_LDADD) $(LIBS)
+
+put_mplex$(EXEEXT): $(put_mplex_OBJECTS) $(put_mplex_DEPENDENCIES) $(EXTRA_put_mplex_DEPENDENCIES) 
+	@rm -f put_mplex$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_mplex_OBJECTS) $(put_mplex_LDADD) $(LIBS)
+
+put_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_null$(EXEEXT): $(put_null_OBJECTS) $(put_null_DEPENDENCIES) $(EXTRA_put_null_DEPENDENCIES) 
+	@rm -f put_null$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_null_OBJECTS) $(put_null_LDADD) $(LIBS)
+
+put_off64$(EXEEXT): $(put_off64_OBJECTS) $(put_off64_DEPENDENCIES) $(EXTRA_put_off64_DEPENDENCIES) 
+	@rm -f put_off64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_off64_OBJECTS) $(put_off64_LDADD) $(LIBS)
+
+put_phase$(EXEEXT): $(put_phase_OBJECTS) $(put_phase_DEPENDENCIES) $(EXTRA_put_phase_DEPENDENCIES) 
+	@rm -f put_phase$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_phase_OBJECTS) $(put_phase_LDADD) $(LIBS)
+
+put_phase_noin$(EXEEXT): $(put_phase_noin_OBJECTS) $(put_phase_noin_DEPENDENCIES) $(EXTRA_put_phase_noin_DEPENDENCIES) 
+	@rm -f put_phase_noin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_phase_noin_OBJECTS) $(put_phase_noin_LDADD) $(LIBS)
+
+put_polynom1$(EXEEXT): $(put_polynom1_OBJECTS) $(put_polynom1_DEPENDENCIES) $(EXTRA_put_polynom1_DEPENDENCIES) 
+	@rm -f put_polynom1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_polynom1_OBJECTS) $(put_polynom1_LDADD) $(LIBS)
+
+put_polynom2$(EXEEXT): $(put_polynom2_OBJECTS) $(put_polynom2_DEPENDENCIES) $(EXTRA_put_polynom2_DEPENDENCIES) 
+	@rm -f put_polynom2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_polynom2_OBJECTS) $(put_polynom2_LDADD) $(LIBS)
+
+put_polynom_noin$(EXEEXT): $(put_polynom_noin_OBJECTS) $(put_polynom_noin_DEPENDENCIES) $(EXTRA_put_polynom_noin_DEPENDENCIES) 
+	@rm -f put_polynom_noin$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_polynom_noin_OBJECTS) $(put_polynom_noin_LDADD) $(LIBS)
+
+put_protect$(EXEEXT): $(put_protect_OBJECTS) $(put_protect_DEPENDENCIES) $(EXTRA_put_protect_DEPENDENCIES) 
+	@rm -f put_protect$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_protect_OBJECTS) $(put_protect_LDADD) $(LIBS)
+
+put_rdonly$(EXEEXT): $(put_rdonly_OBJECTS) $(put_rdonly_DEPENDENCIES) $(EXTRA_put_rdonly_DEPENDENCIES) 
+	@rm -f put_rdonly$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_rdonly_OBJECTS) $(put_rdonly_LDADD) $(LIBS)
+
+put_recip$(EXEEXT): $(put_recip_OBJECTS) $(put_recip_DEPENDENCIES) $(EXTRA_put_recip_DEPENDENCIES) 
+	@rm -f put_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_recip_OBJECTS) $(put_recip_LDADD) $(LIBS)
+
+put_recurse$(EXEEXT): $(put_recurse_OBJECTS) $(put_recurse_DEPENDENCIES) $(EXTRA_put_recurse_DEPENDENCIES) 
+	@rm -f put_recurse$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_recurse_OBJECTS) $(put_recurse_LDADD) $(LIBS)
+
+put_repr$(EXEEXT): $(put_repr_OBJECTS) $(put_repr_DEPENDENCIES) $(EXTRA_put_repr_DEPENDENCIES) 
+	@rm -f put_repr$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_repr_OBJECTS) $(put_repr_LDADD) $(LIBS)
+
+put_rofs$(EXEEXT): $(put_rofs_OBJECTS) $(put_rofs_DEPENDENCIES) $(EXTRA_put_rofs_DEPENDENCIES) 
+	@rm -f put_rofs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_rofs_OBJECTS) $(put_rofs_LDADD) $(LIBS)
+
+put_sbit$(EXEEXT): $(put_sbit_OBJECTS) $(put_sbit_DEPENDENCIES) $(EXTRA_put_sbit_DEPENDENCIES) 
+	@rm -f put_sbit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_sbit_OBJECTS) $(put_sbit_LDADD) $(LIBS)
+
+put_sf$(EXEEXT): $(put_sf_OBJECTS) $(put_sf_DEPENDENCIES) $(EXTRA_put_sf_DEPENDENCIES) 
+	@rm -f put_sf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_sf_OBJECTS) $(put_sf_LDADD) $(LIBS)
+
+put_ss$(EXEEXT): $(put_ss_OBJECTS) $(put_ss_DEPENDENCIES) $(EXTRA_put_ss_DEPENDENCIES) 
+	@rm -f put_ss$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_ss_OBJECTS) $(put_ss_LDADD) $(LIBS)
+
+put_string$(EXEEXT): $(put_string_OBJECTS) $(put_string_DEPENDENCIES) $(EXTRA_put_string_DEPENDENCIES) 
+	@rm -f put_string$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_string_OBJECTS) $(put_string_LDADD) $(LIBS)
+
+put_string_protect$(EXEEXT): $(put_string_protect_OBJECTS) $(put_string_protect_DEPENDENCIES) $(EXTRA_put_string_protect_DEPENDENCIES) 
+	@rm -f put_string_protect$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_string_protect_OBJECTS) $(put_string_protect_LDADD) $(LIBS)
+
+put_type$(EXEEXT): $(put_type_OBJECTS) $(put_type_DEPENDENCIES) $(EXTRA_put_type_DEPENDENCIES) 
+	@rm -f put_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_type_OBJECTS) $(put_type_LDADD) $(LIBS)
+
+put_uint16$(EXEEXT): $(put_uint16_OBJECTS) $(put_uint16_DEPENDENCIES) $(EXTRA_put_uint16_DEPENDENCIES) 
+	@rm -f put_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_uint16_OBJECTS) $(put_uint16_LDADD) $(LIBS)
+
+put_uint32$(EXEEXT): $(put_uint32_OBJECTS) $(put_uint32_DEPENDENCIES) $(EXTRA_put_uint32_DEPENDENCIES) 
+	@rm -f put_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_uint32_OBJECTS) $(put_uint32_LDADD) $(LIBS)
+
+put_uint64$(EXEEXT): $(put_uint64_OBJECTS) $(put_uint64_DEPENDENCIES) $(EXTRA_put_uint64_DEPENDENCIES) 
+	@rm -f put_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_uint64_OBJECTS) $(put_uint64_LDADD) $(LIBS)
+
+put_window$(EXEEXT): $(put_window_OBJECTS) $(put_window_DEPENDENCIES) $(EXTRA_put_window_DEPENDENCIES) 
+	@rm -f put_window$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_window_OBJECTS) $(put_window_LDADD) $(LIBS)
+
+put_zero$(EXEEXT): $(put_zero_OBJECTS) $(put_zero_DEPENDENCIES) $(EXTRA_put_zero_DEPENDENCIES) 
+	@rm -f put_zero$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(put_zero_OBJECTS) $(put_zero_LDADD) $(LIBS)
+
+ref$(EXEEXT): $(ref_OBJECTS) $(ref_DEPENDENCIES) $(EXTRA_ref_DEPENDENCIES) 
+	@rm -f ref$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ref_OBJECTS) $(ref_LDADD) $(LIBS)
+
+ref_none$(EXEEXT): $(ref_none_OBJECTS) $(ref_none_DEPENDENCIES) $(EXTRA_ref_none_DEPENDENCIES) 
+	@rm -f ref_none$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ref_none_OBJECTS) $(ref_none_LDADD) $(LIBS)
+
+ref_two$(EXEEXT): $(ref_two_OBJECTS) $(ref_two_DEPENDENCIES) $(EXTRA_ref_two_DEPENDENCIES) 
+	@rm -f ref_two$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(ref_two_OBJECTS) $(ref_two_LDADD) $(LIBS)
+
+repr_a$(EXEEXT): $(repr_a_OBJECTS) $(repr_a_DEPENDENCIES) $(EXTRA_repr_a_DEPENDENCIES) 
+	@rm -f repr_a$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_a_OBJECTS) $(repr_a_LDADD) $(LIBS)
+
+repr_float32$(EXEEXT): $(repr_float32_OBJECTS) $(repr_float32_DEPENDENCIES) $(EXTRA_repr_float32_DEPENDENCIES) 
+	@rm -f repr_float32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_float32_OBJECTS) $(repr_float32_LDADD) $(LIBS)
+
+repr_float64$(EXEEXT): $(repr_float64_OBJECTS) $(repr_float64_DEPENDENCIES) $(EXTRA_repr_float64_DEPENDENCIES) 
+	@rm -f repr_float64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_float64_OBJECTS) $(repr_float64_LDADD) $(LIBS)
+
+repr_i$(EXEEXT): $(repr_i_OBJECTS) $(repr_i_DEPENDENCIES) $(EXTRA_repr_i_DEPENDENCIES) 
+	@rm -f repr_i$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_i_OBJECTS) $(repr_i_LDADD) $(LIBS)
+
+repr_int16$(EXEEXT): $(repr_int16_OBJECTS) $(repr_int16_DEPENDENCIES) $(EXTRA_repr_int16_DEPENDENCIES) 
+	@rm -f repr_int16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_int16_OBJECTS) $(repr_int16_LDADD) $(LIBS)
+
+repr_int32$(EXEEXT): $(repr_int32_OBJECTS) $(repr_int32_DEPENDENCIES) $(EXTRA_repr_int32_DEPENDENCIES) 
+	@rm -f repr_int32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_int32_OBJECTS) $(repr_int32_LDADD) $(LIBS)
+
+repr_int64$(EXEEXT): $(repr_int64_OBJECTS) $(repr_int64_DEPENDENCIES) $(EXTRA_repr_int64_DEPENDENCIES) 
+	@rm -f repr_int64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_int64_OBJECTS) $(repr_int64_LDADD) $(LIBS)
+
+repr_int8$(EXEEXT): $(repr_int8_OBJECTS) $(repr_int8_DEPENDENCIES) $(EXTRA_repr_int8_DEPENDENCIES) 
+	@rm -f repr_int8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_int8_OBJECTS) $(repr_int8_LDADD) $(LIBS)
+
+repr_m$(EXEEXT): $(repr_m_OBJECTS) $(repr_m_DEPENDENCIES) $(EXTRA_repr_m_DEPENDENCIES) 
+	@rm -f repr_m$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_m_OBJECTS) $(repr_m_LDADD) $(LIBS)
+
+repr_r$(EXEEXT): $(repr_r_OBJECTS) $(repr_r_DEPENDENCIES) $(EXTRA_repr_r_DEPENDENCIES) 
+	@rm -f repr_r$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_r_OBJECTS) $(repr_r_LDADD) $(LIBS)
+
+repr_real_a$(EXEEXT): $(repr_real_a_OBJECTS) $(repr_real_a_DEPENDENCIES) $(EXTRA_repr_real_a_DEPENDENCIES) 
+	@rm -f repr_real_a$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_real_a_OBJECTS) $(repr_real_a_LDADD) $(LIBS)
+
+repr_real_i$(EXEEXT): $(repr_real_i_OBJECTS) $(repr_real_i_DEPENDENCIES) $(EXTRA_repr_real_i_DEPENDENCIES) 
+	@rm -f repr_real_i$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_real_i_OBJECTS) $(repr_real_i_LDADD) $(LIBS)
+
+repr_real_m$(EXEEXT): $(repr_real_m_OBJECTS) $(repr_real_m_DEPENDENCIES) $(EXTRA_repr_real_m_DEPENDENCIES) 
+	@rm -f repr_real_m$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_real_m_OBJECTS) $(repr_real_m_LDADD) $(LIBS)
+
+repr_real_r$(EXEEXT): $(repr_real_r_OBJECTS) $(repr_real_r_DEPENDENCIES) $(EXTRA_repr_real_r_DEPENDENCIES) 
+	@rm -f repr_real_r$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_real_r_OBJECTS) $(repr_real_r_LDADD) $(LIBS)
+
+repr_uint16$(EXEEXT): $(repr_uint16_OBJECTS) $(repr_uint16_DEPENDENCIES) $(EXTRA_repr_uint16_DEPENDENCIES) 
+	@rm -f repr_uint16$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_uint16_OBJECTS) $(repr_uint16_LDADD) $(LIBS)
+
+repr_uint32$(EXEEXT): $(repr_uint32_OBJECTS) $(repr_uint32_DEPENDENCIES) $(EXTRA_repr_uint32_DEPENDENCIES) 
+	@rm -f repr_uint32$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_uint32_OBJECTS) $(repr_uint32_LDADD) $(LIBS)
+
+repr_uint64$(EXEEXT): $(repr_uint64_OBJECTS) $(repr_uint64_DEPENDENCIES) $(EXTRA_repr_uint64_DEPENDENCIES) 
+	@rm -f repr_uint64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_uint64_OBJECTS) $(repr_uint64_LDADD) $(LIBS)
+
+repr_uint8$(EXEEXT): $(repr_uint8_OBJECTS) $(repr_uint8_DEPENDENCIES) $(EXTRA_repr_uint8_DEPENDENCIES) 
+	@rm -f repr_uint8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(repr_uint8_OBJECTS) $(repr_uint8_LDADD) $(LIBS)
+
+seek64$(EXEEXT): $(seek64_OBJECTS) $(seek64_DEPENDENCIES) $(EXTRA_seek64_DEPENDENCIES) 
+	@rm -f seek64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek64_OBJECTS) $(seek64_LDADD) $(LIBS)
+
+seek_cur$(EXEEXT): $(seek_cur_OBJECTS) $(seek_cur_DEPENDENCIES) $(EXTRA_seek_cur_DEPENDENCIES) 
+	@rm -f seek_cur$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_cur_OBJECTS) $(seek_cur_LDADD) $(LIBS)
+
+seek_end$(EXEEXT): $(seek_end_OBJECTS) $(seek_end_DEPENDENCIES) $(EXTRA_seek_end_DEPENDENCIES) 
+	@rm -f seek_end$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_end_OBJECTS) $(seek_end_LDADD) $(LIBS)
+
+seek_foffs$(EXEEXT): $(seek_foffs_OBJECTS) $(seek_foffs_DEPENDENCIES) $(EXTRA_seek_foffs_DEPENDENCIES) 
+	@rm -f seek_foffs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_foffs_OBJECTS) $(seek_foffs_LDADD) $(LIBS)
+
+seek_foffs2$(EXEEXT): $(seek_foffs2_OBJECTS) $(seek_foffs2_DEPENDENCIES) $(EXTRA_seek_foffs2_DEPENDENCIES) 
+	@rm -f seek_foffs2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(seek_foffs2_OBJECTS) $(seek_foffs2_LDADD) $(LIBS)
+
+seek_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_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)
+
+sie_get_big$(EXEEXT): $(sie_get_big_OBJECTS) $(sie_get_big_DEPENDENCIES) $(EXTRA_sie_get_big_DEPENDENCIES) 
+	@rm -f sie_get_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_get_big_OBJECTS) $(sie_get_big_LDADD) $(LIBS)
+
+sie_get_little$(EXEEXT): $(sie_get_little_OBJECTS) $(sie_get_little_DEPENDENCIES) $(EXTRA_sie_get_little_DEPENDENCIES) 
+	@rm -f sie_get_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_get_little_OBJECTS) $(sie_get_little_LDADD) $(LIBS)
+
+sie_move_from$(EXEEXT): $(sie_move_from_OBJECTS) $(sie_move_from_DEPENDENCIES) $(EXTRA_sie_move_from_DEPENDENCIES) 
+	@rm -f sie_move_from$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_move_from_OBJECTS) $(sie_move_from_LDADD) $(LIBS)
+
+sie_move_to$(EXEEXT): $(sie_move_to_OBJECTS) $(sie_move_to_DEPENDENCIES) $(EXTRA_sie_move_to_DEPENDENCIES) 
+	@rm -f sie_move_to$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_move_to_OBJECTS) $(sie_move_to_LDADD) $(LIBS)
+
+sie_nframes_big$(EXEEXT): $(sie_nframes_big_OBJECTS) $(sie_nframes_big_DEPENDENCIES) $(EXTRA_sie_nframes_big_DEPENDENCIES) 
+	@rm -f sie_nframes_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_nframes_big_OBJECTS) $(sie_nframes_big_LDADD) $(LIBS)
+
+sie_nframes_little$(EXEEXT): $(sie_nframes_little_OBJECTS) $(sie_nframes_little_DEPENDENCIES) $(EXTRA_sie_nframes_little_DEPENDENCIES) 
+	@rm -f sie_nframes_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_nframes_little_OBJECTS) $(sie_nframes_little_LDADD) $(LIBS)
+
+sie_put_append$(EXEEXT): $(sie_put_append_OBJECTS) $(sie_put_append_DEPENDENCIES) $(EXTRA_sie_put_append_DEPENDENCIES) 
+	@rm -f sie_put_append$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_append_OBJECTS) $(sie_put_append_LDADD) $(LIBS)
+
+sie_put_append2$(EXEEXT): $(sie_put_append2_OBJECTS) $(sie_put_append2_DEPENDENCIES) $(EXTRA_sie_put_append2_DEPENDENCIES) 
+	@rm -f sie_put_append2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_append2_OBJECTS) $(sie_put_append2_LDADD) $(LIBS)
+
+sie_put_back$(EXEEXT): $(sie_put_back_OBJECTS) $(sie_put_back_DEPENDENCIES) $(EXTRA_sie_put_back_DEPENDENCIES) 
+	@rm -f sie_put_back$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_back_OBJECTS) $(sie_put_back_LDADD) $(LIBS)
+
+sie_put_big$(EXEEXT): $(sie_put_big_OBJECTS) $(sie_put_big_DEPENDENCIES) $(EXTRA_sie_put_big_DEPENDENCIES) 
+	@rm -f sie_put_big$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_big_OBJECTS) $(sie_put_big_LDADD) $(LIBS)
+
+sie_put_little$(EXEEXT): $(sie_put_little_OBJECTS) $(sie_put_little_DEPENDENCIES) $(EXTRA_sie_put_little_DEPENDENCIES) 
+	@rm -f sie_put_little$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_little_OBJECTS) $(sie_put_little_LDADD) $(LIBS)
+
+sie_put_many$(EXEEXT): $(sie_put_many_OBJECTS) $(sie_put_many_DEPENDENCIES) $(EXTRA_sie_put_many_DEPENDENCIES) 
+	@rm -f sie_put_many$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_many_OBJECTS) $(sie_put_many_LDADD) $(LIBS)
+
+sie_put_newo$(EXEEXT): $(sie_put_newo_OBJECTS) $(sie_put_newo_DEPENDENCIES) $(EXTRA_sie_put_newo_DEPENDENCIES) 
+	@rm -f sie_put_newo$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_newo_OBJECTS) $(sie_put_newo_LDADD) $(LIBS)
+
+sie_put_newo0$(EXEEXT): $(sie_put_newo0_OBJECTS) $(sie_put_newo0_DEPENDENCIES) $(EXTRA_sie_put_newo0_DEPENDENCIES) 
+	@rm -f sie_put_newo0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_newo0_OBJECTS) $(sie_put_newo0_LDADD) $(LIBS)
+
+sie_put_pad$(EXEEXT): $(sie_put_pad_OBJECTS) $(sie_put_pad_DEPENDENCIES) $(EXTRA_sie_put_pad_DEPENDENCIES) 
+	@rm -f sie_put_pad$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_pad_OBJECTS) $(sie_put_pad_LDADD) $(LIBS)
+
+sie_put_pad0$(EXEEXT): $(sie_put_pad0_OBJECTS) $(sie_put_pad0_DEPENDENCIES) $(EXTRA_sie_put_pad0_DEPENDENCIES) 
+	@rm -f sie_put_pad0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_pad0_OBJECTS) $(sie_put_pad0_LDADD) $(LIBS)
+
+sie_put_trunc$(EXEEXT): $(sie_put_trunc_OBJECTS) $(sie_put_trunc_DEPENDENCIES) $(EXTRA_sie_put_trunc_DEPENDENCIES) 
+	@rm -f sie_put_trunc$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_trunc_OBJECTS) $(sie_put_trunc_LDADD) $(LIBS)
+
+sie_put_trunc2$(EXEEXT): $(sie_put_trunc2_OBJECTS) $(sie_put_trunc2_DEPENDENCIES) $(EXTRA_sie_put_trunc2_DEPENDENCIES) 
+	@rm -f sie_put_trunc2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_trunc2_OBJECTS) $(sie_put_trunc2_LDADD) $(LIBS)
+
+sie_put_trunc_nf$(EXEEXT): $(sie_put_trunc_nf_OBJECTS) $(sie_put_trunc_nf_DEPENDENCIES) $(EXTRA_sie_put_trunc_nf_DEPENDENCIES) 
+	@rm -f sie_put_trunc_nf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_put_trunc_nf_OBJECTS) $(sie_put_trunc_nf_LDADD) $(LIBS)
+
+sie_sync$(EXEEXT): $(sie_sync_OBJECTS) $(sie_sync_DEPENDENCIES) $(EXTRA_sie_sync_DEPENDENCIES) 
+	@rm -f sie_sync$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sie_sync_OBJECTS) $(sie_sync_LDADD) $(LIBS)
+
+slim_get$(EXEEXT): $(slim_get_OBJECTS) $(slim_get_DEPENDENCIES) $(EXTRA_slim_get_DEPENDENCIES) 
+	@rm -f slim_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(slim_get_OBJECTS) $(slim_get_LDADD) $(LIBS)
+
+slim_nframes$(EXEEXT): $(slim_nframes_OBJECTS) $(slim_nframes_DEPENDENCIES) $(EXTRA_slim_nframes_DEPENDENCIES) 
+	@rm -f slim_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(slim_nframes_OBJECTS) $(slim_nframes_LDADD) $(LIBS)
+
+spf$(EXEEXT): $(spf_OBJECTS) $(spf_DEPENDENCIES) $(EXTRA_spf_DEPENDENCIES) 
+	@rm -f spf$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_OBJECTS) $(spf_LDADD) $(LIBS)
+
+spf_alias$(EXEEXT): $(spf_alias_OBJECTS) $(spf_alias_DEPENDENCIES) $(EXTRA_spf_alias_DEPENDENCIES) 
+	@rm -f spf_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_alias_OBJECTS) $(spf_alias_LDADD) $(LIBS)
+
+spf_alias_meta$(EXEEXT): $(spf_alias_meta_OBJECTS) $(spf_alias_meta_DEPENDENCIES) $(EXTRA_spf_alias_meta_DEPENDENCIES) 
+	@rm -f spf_alias_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_alias_meta_OBJECTS) $(spf_alias_meta_LDADD) $(LIBS)
+
+spf_alias_missing$(EXEEXT): $(spf_alias_missing_OBJECTS) $(spf_alias_missing_DEPENDENCIES) $(EXTRA_spf_alias_missing_DEPENDENCIES) 
+	@rm -f spf_alias_missing$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_alias_missing_OBJECTS) $(spf_alias_missing_LDADD) $(LIBS)
+
+spf_divide$(EXEEXT): $(spf_divide_OBJECTS) $(spf_divide_DEPENDENCIES) $(EXTRA_spf_divide_DEPENDENCIES) 
+	@rm -f spf_divide$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_divide_OBJECTS) $(spf_divide_LDADD) $(LIBS)
+
+spf_lincom$(EXEEXT): $(spf_lincom_OBJECTS) $(spf_lincom_DEPENDENCIES) $(EXTRA_spf_lincom_DEPENDENCIES) 
+	@rm -f spf_lincom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_lincom_OBJECTS) $(spf_lincom_LDADD) $(LIBS)
+
+spf_multiply$(EXEEXT): $(spf_multiply_OBJECTS) $(spf_multiply_DEPENDENCIES) $(EXTRA_spf_multiply_DEPENDENCIES) 
+	@rm -f spf_multiply$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_multiply_OBJECTS) $(spf_multiply_LDADD) $(LIBS)
+
+spf_polynom$(EXEEXT): $(spf_polynom_OBJECTS) $(spf_polynom_DEPENDENCIES) $(EXTRA_spf_polynom_DEPENDENCIES) 
+	@rm -f spf_polynom$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_polynom_OBJECTS) $(spf_polynom_LDADD) $(LIBS)
+
+spf_recip$(EXEEXT): $(spf_recip_OBJECTS) $(spf_recip_DEPENDENCIES) $(EXTRA_spf_recip_DEPENDENCIES) 
+	@rm -f spf_recip$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_recip_OBJECTS) $(spf_recip_LDADD) $(LIBS)
+
+spf_recurse$(EXEEXT): $(spf_recurse_OBJECTS) $(spf_recurse_DEPENDENCIES) $(EXTRA_spf_recurse_DEPENDENCIES) 
+	@rm -f spf_recurse$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(spf_recurse_OBJECTS) $(spf_recurse_LDADD) $(LIBS)
+
+svlist$(EXEEXT): $(svlist_OBJECTS) $(svlist_DEPENDENCIES) $(EXTRA_svlist_DEPENDENCIES) 
+	@rm -f svlist$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist_OBJECTS) $(svlist_LDADD) $(LIBS)
+
+svlist_hidden$(EXEEXT): $(svlist_hidden_OBJECTS) $(svlist_hidden_DEPENDENCIES) $(EXTRA_svlist_hidden_DEPENDENCIES) 
+	@rm -f svlist_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist_hidden_OBJECTS) $(svlist_hidden_LDADD) $(LIBS)
+
+svlist_invalid$(EXEEXT): $(svlist_invalid_OBJECTS) $(svlist_invalid_DEPENDENCIES) $(EXTRA_svlist_invalid_DEPENDENCIES) 
+	@rm -f svlist_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist_invalid_OBJECTS) $(svlist_invalid_LDADD) $(LIBS)
+
+svlist_meta$(EXEEXT): $(svlist_meta_OBJECTS) $(svlist_meta_DEPENDENCIES) $(EXTRA_svlist_meta_DEPENDENCIES) 
+	@rm -f svlist_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist_meta_OBJECTS) $(svlist_meta_LDADD) $(LIBS)
+
+svlist_meta_hidden$(EXEEXT): $(svlist_meta_hidden_OBJECTS) $(svlist_meta_hidden_DEPENDENCIES) $(EXTRA_svlist_meta_hidden_DEPENDENCIES) 
+	@rm -f svlist_meta_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist_meta_hidden_OBJECTS) $(svlist_meta_hidden_LDADD) $(LIBS)
+
+svlist_meta_invalid$(EXEEXT): $(svlist_meta_invalid_OBJECTS) $(svlist_meta_invalid_DEPENDENCIES) $(EXTRA_svlist_meta_invalid_DEPENDENCIES) 
+	@rm -f svlist_meta_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(svlist_meta_invalid_OBJECTS) $(svlist_meta_invalid_LDADD) $(LIBS)
+
+table$(EXEEXT): $(table_OBJECTS) $(table_DEPENDENCIES) $(EXTRA_table_DEPENDENCIES) 
+	@rm -f table$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(table_OBJECTS) $(table_LDADD) $(LIBS)
+
+table_code$(EXEEXT): $(table_code_OBJECTS) $(table_code_DEPENDENCIES) $(EXTRA_table_code_DEPENDENCIES) 
+	@rm -f table_code$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(table_code_OBJECTS) $(table_code_LDADD) $(LIBS)
+
+table_type$(EXEEXT): $(table_type_OBJECTS) $(table_type_DEPENDENCIES) $(EXTRA_table_type_DEPENDENCIES) 
+	@rm -f table_type$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(table_type_OBJECTS) $(table_type_LDADD) $(LIBS)
+
+tell$(EXEEXT): $(tell_OBJECTS) $(tell_DEPENDENCIES) $(EXTRA_tell_DEPENDENCIES) 
+	@rm -f tell$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tell_OBJECTS) $(tell_LDADD) $(LIBS)
+
+tell64$(EXEEXT): $(tell64_OBJECTS) $(tell64_DEPENDENCIES) $(EXTRA_tell64_DEPENDENCIES) 
+	@rm -f tell64$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tell64_OBJECTS) $(tell64_LDADD) $(LIBS)
+
+tell_multidiv$(EXEEXT): $(tell_multidiv_OBJECTS) $(tell_multidiv_DEPENDENCIES) $(EXTRA_tell_multidiv_DEPENDENCIES) 
+	@rm -f tell_multidiv$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tell_multidiv_OBJECTS) $(tell_multidiv_LDADD) $(LIBS)
+
+tok_arg$(EXEEXT): $(tok_arg_OBJECTS) $(tok_arg_DEPENDENCIES) $(EXTRA_tok_arg_DEPENDENCIES) 
+	@rm -f tok_arg$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tok_arg_OBJECTS) $(tok_arg_LDADD) $(LIBS)
+
+tok_escape$(EXEEXT): $(tok_escape_OBJECTS) $(tok_escape_DEPENDENCIES) $(EXTRA_tok_escape_DEPENDENCIES) 
+	@rm -f tok_escape$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tok_escape_OBJECTS) $(tok_escape_LDADD) $(LIBS)
+
+tok_quote$(EXEEXT): $(tok_quote_OBJECTS) $(tok_quote_DEPENDENCIES) $(EXTRA_tok_quote_DEPENDENCIES) 
+	@rm -f tok_quote$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(tok_quote_OBJECTS) $(tok_quote_LDADD) $(LIBS)
+
+trunc$(EXEEXT): $(trunc_OBJECTS) $(trunc_DEPENDENCIES) $(EXTRA_trunc_DEPENDENCIES) 
+	@rm -f trunc$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(trunc_OBJECTS) $(trunc_LDADD) $(LIBS)
+
+trunc_dir$(EXEEXT): $(trunc_dir_OBJECTS) $(trunc_dir_DEPENDENCIES) $(EXTRA_trunc_dir_DEPENDENCIES) 
+	@rm -f trunc_dir$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(trunc_dir_OBJECTS) $(trunc_dir_LDADD) $(LIBS)
+
+trunc_rdonly$(EXEEXT): $(trunc_rdonly_OBJECTS) $(trunc_rdonly_DEPENDENCIES) $(EXTRA_trunc_rdonly_DEPENDENCIES) 
+	@rm -f trunc_rdonly$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(trunc_rdonly_OBJECTS) $(trunc_rdonly_LDADD) $(LIBS)
+
+trunc_rofs$(EXEEXT): $(trunc_rofs_OBJECTS) $(trunc_rofs_DEPENDENCIES) $(EXTRA_trunc_rofs_DEPENDENCIES) 
+	@rm -f trunc_rofs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(trunc_rofs_OBJECTS) $(trunc_rofs_LDADD) $(LIBS)
+
+trunc_truncsub$(EXEEXT): $(trunc_truncsub_OBJECTS) $(trunc_truncsub_DEPENDENCIES) $(EXTRA_trunc_truncsub_DEPENDENCIES) 
+	@rm -f trunc_truncsub$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(trunc_truncsub_OBJECTS) $(trunc_truncsub_LDADD) $(LIBS)
+
+unclude$(EXEEXT): $(unclude_OBJECTS) $(unclude_DEPENDENCIES) $(EXTRA_unclude_DEPENDENCIES) 
+	@rm -f unclude$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(unclude_OBJECTS) $(unclude_LDADD) $(LIBS)
+
+unclude_del$(EXEEXT): $(unclude_del_OBJECTS) $(unclude_del_DEPENDENCIES) $(EXTRA_unclude_del_DEPENDENCIES) 
+	@rm -f unclude_del$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(unclude_del_OBJECTS) $(unclude_del_LDADD) $(LIBS)
+
+unclude_move$(EXEEXT): $(unclude_move_OBJECTS) $(unclude_move_DEPENDENCIES) $(EXTRA_unclude_move_DEPENDENCIES) 
+	@rm -f unclude_move$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(unclude_move_OBJECTS) $(unclude_move_LDADD) $(LIBS)
+
+version_0$(EXEEXT): $(version_0_OBJECTS) $(version_0_DEPENDENCIES) $(EXTRA_version_0_DEPENDENCIES) 
+	@rm -f version_0$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_0_OBJECTS) $(version_0_LDADD) $(LIBS)
+
+version_0_write$(EXEEXT): $(version_0_write_OBJECTS) $(version_0_write_DEPENDENCIES) $(EXTRA_version_0_write_DEPENDENCIES) 
+	@rm -f version_0_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_0_write_OBJECTS) $(version_0_write_LDADD) $(LIBS)
+
+version_1$(EXEEXT): $(version_1_OBJECTS) $(version_1_DEPENDENCIES) $(EXTRA_version_1_DEPENDENCIES) 
+	@rm -f version_1$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_1_OBJECTS) $(version_1_LDADD) $(LIBS)
+
+version_1_write$(EXEEXT): $(version_1_write_OBJECTS) $(version_1_write_DEPENDENCIES) $(EXTRA_version_1_write_DEPENDENCIES) 
+	@rm -f version_1_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_1_write_OBJECTS) $(version_1_write_LDADD) $(LIBS)
+
+version_2$(EXEEXT): $(version_2_OBJECTS) $(version_2_DEPENDENCIES) $(EXTRA_version_2_DEPENDENCIES) 
+	@rm -f version_2$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_2_OBJECTS) $(version_2_LDADD) $(LIBS)
+
+version_2_write$(EXEEXT): $(version_2_write_OBJECTS) $(version_2_write_DEPENDENCIES) $(EXTRA_version_2_write_DEPENDENCIES) 
+	@rm -f version_2_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_2_write_OBJECTS) $(version_2_write_LDADD) $(LIBS)
+
+version_3$(EXEEXT): $(version_3_OBJECTS) $(version_3_DEPENDENCIES) $(EXTRA_version_3_DEPENDENCIES) 
+	@rm -f version_3$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_3_OBJECTS) $(version_3_LDADD) $(LIBS)
+
+version_3_write$(EXEEXT): $(version_3_write_OBJECTS) $(version_3_write_DEPENDENCIES) $(EXTRA_version_3_write_DEPENDENCIES) 
+	@rm -f version_3_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_3_write_OBJECTS) $(version_3_write_LDADD) $(LIBS)
+
+version_4$(EXEEXT): $(version_4_OBJECTS) $(version_4_DEPENDENCIES) $(EXTRA_version_4_DEPENDENCIES) 
+	@rm -f version_4$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_4_OBJECTS) $(version_4_LDADD) $(LIBS)
+
+version_4_write$(EXEEXT): $(version_4_write_OBJECTS) $(version_4_write_DEPENDENCIES) $(EXTRA_version_4_write_DEPENDENCIES) 
+	@rm -f version_4_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_4_write_OBJECTS) $(version_4_write_LDADD) $(LIBS)
+
+version_5$(EXEEXT): $(version_5_OBJECTS) $(version_5_DEPENDENCIES) $(EXTRA_version_5_DEPENDENCIES) 
+	@rm -f version_5$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_5_OBJECTS) $(version_5_LDADD) $(LIBS)
+
+version_5_strict$(EXEEXT): $(version_5_strict_OBJECTS) $(version_5_strict_DEPENDENCIES) $(EXTRA_version_5_strict_DEPENDENCIES) 
+	@rm -f version_5_strict$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_5_strict_OBJECTS) $(version_5_strict_LDADD) $(LIBS)
+
+version_5_write$(EXEEXT): $(version_5_write_OBJECTS) $(version_5_write_DEPENDENCIES) $(EXTRA_version_5_write_DEPENDENCIES) 
+	@rm -f version_5_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_5_write_OBJECTS) $(version_5_write_LDADD) $(LIBS)
+
+version_6$(EXEEXT): $(version_6_OBJECTS) $(version_6_DEPENDENCIES) $(EXTRA_version_6_DEPENDENCIES) 
+	@rm -f version_6$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_6_OBJECTS) $(version_6_LDADD) $(LIBS)
+
+version_6_strict$(EXEEXT): $(version_6_strict_OBJECTS) $(version_6_strict_DEPENDENCIES) $(EXTRA_version_6_strict_DEPENDENCIES) 
+	@rm -f version_6_strict$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_6_strict_OBJECTS) $(version_6_strict_LDADD) $(LIBS)
+
+version_6_write$(EXEEXT): $(version_6_write_OBJECTS) $(version_6_write_DEPENDENCIES) $(EXTRA_version_6_write_DEPENDENCIES) 
+	@rm -f version_6_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_6_write_OBJECTS) $(version_6_write_LDADD) $(LIBS)
+
+version_7$(EXEEXT): $(version_7_OBJECTS) $(version_7_DEPENDENCIES) $(EXTRA_version_7_DEPENDENCIES) 
+	@rm -f version_7$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_7_OBJECTS) $(version_7_LDADD) $(LIBS)
+
+version_7_strict$(EXEEXT): $(version_7_strict_OBJECTS) $(version_7_strict_DEPENDENCIES) $(EXTRA_version_7_strict_DEPENDENCIES) 
+	@rm -f version_7_strict$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_7_strict_OBJECTS) $(version_7_strict_LDADD) $(LIBS)
+
+version_7_write$(EXEEXT): $(version_7_write_OBJECTS) $(version_7_write_DEPENDENCIES) $(EXTRA_version_7_write_DEPENDENCIES) 
+	@rm -f version_7_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_7_write_OBJECTS) $(version_7_write_LDADD) $(LIBS)
+
+version_8$(EXEEXT): $(version_8_OBJECTS) $(version_8_DEPENDENCIES) $(EXTRA_version_8_DEPENDENCIES) 
+	@rm -f version_8$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_8_OBJECTS) $(version_8_LDADD) $(LIBS)
+
+version_8_strict$(EXEEXT): $(version_8_strict_OBJECTS) $(version_8_strict_DEPENDENCIES) $(EXTRA_version_8_strict_DEPENDENCIES) 
+	@rm -f version_8_strict$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_8_strict_OBJECTS) $(version_8_strict_LDADD) $(LIBS)
+
+version_8_write$(EXEEXT): $(version_8_write_OBJECTS) $(version_8_write_DEPENDENCIES) $(EXTRA_version_8_write_DEPENDENCIES) 
+	@rm -f version_8_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_8_write_OBJECTS) $(version_8_write_LDADD) $(LIBS)
+
+version_9$(EXEEXT): $(version_9_OBJECTS) $(version_9_DEPENDENCIES) $(EXTRA_version_9_DEPENDENCIES) 
+	@rm -f version_9$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_9_OBJECTS) $(version_9_LDADD) $(LIBS)
+
+version_9_strict$(EXEEXT): $(version_9_strict_OBJECTS) $(version_9_strict_DEPENDENCIES) $(EXTRA_version_9_strict_DEPENDENCIES) 
+	@rm -f version_9_strict$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_9_strict_OBJECTS) $(version_9_strict_LDADD) $(LIBS)
+
+version_9_write$(EXEEXT): $(version_9_write_OBJECTS) $(version_9_write_DEPENDENCIES) $(EXTRA_version_9_write_DEPENDENCIES) 
+	@rm -f version_9_write$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(version_9_write_OBJECTS) $(version_9_write_LDADD) $(LIBS)
+
+vlist$(EXEEXT): $(vlist_OBJECTS) $(vlist_DEPENDENCIES) $(EXTRA_vlist_DEPENDENCIES) 
+	@rm -f vlist$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(vlist_OBJECTS) $(vlist_LDADD) $(LIBS)
+
+vlist_alias$(EXEEXT): $(vlist_alias_OBJECTS) $(vlist_alias_DEPENDENCIES) $(EXTRA_vlist_alias_DEPENDENCIES) 
+	@rm -f vlist_alias$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(vlist_alias_OBJECTS) $(vlist_alias_LDADD) $(LIBS)
+
+vlist_hidden$(EXEEXT): $(vlist_hidden_OBJECTS) $(vlist_hidden_DEPENDENCIES) $(EXTRA_vlist_hidden_DEPENDENCIES) 
+	@rm -f vlist_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(vlist_hidden_OBJECTS) $(vlist_hidden_LDADD) $(LIBS)
+
+vlist_invalid$(EXEEXT): $(vlist_invalid_OBJECTS) $(vlist_invalid_DEPENDENCIES) $(EXTRA_vlist_invalid_DEPENDENCIES) 
+	@rm -f vlist_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(vlist_invalid_OBJECTS) $(vlist_invalid_LDADD) $(LIBS)
+
+vlist_meta$(EXEEXT): $(vlist_meta_OBJECTS) $(vlist_meta_DEPENDENCIES) $(EXTRA_vlist_meta_DEPENDENCIES) 
+	@rm -f vlist_meta$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(vlist_meta_OBJECTS) $(vlist_meta_LDADD) $(LIBS)
+
+vlist_meta_hidden$(EXEEXT): $(vlist_meta_hidden_OBJECTS) $(vlist_meta_hidden_DEPENDENCIES) $(EXTRA_vlist_meta_hidden_DEPENDENCIES) 
+	@rm -f vlist_meta_hidden$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(vlist_meta_hidden_OBJECTS) $(vlist_meta_hidden_LDADD) $(LIBS)
+
+vlist_meta_invalid$(EXEEXT): $(vlist_meta_invalid_OBJECTS) $(vlist_meta_invalid_DEPENDENCIES) $(EXTRA_vlist_meta_invalid_DEPENDENCIES) 
+	@rm -f vlist_meta_invalid$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(vlist_meta_invalid_OBJECTS) $(vlist_meta_invalid_LDADD) $(LIBS)
+
+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)
+
+zzip_get$(EXEEXT): $(zzip_get_OBJECTS) $(zzip_get_DEPENDENCIES) $(EXTRA_zzip_get_DEPENDENCIES) 
+	@rm -f zzip_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzip_get_OBJECTS) $(zzip_get_LDADD) $(LIBS)
+
+zzip_get_get$(EXEEXT): $(zzip_get_get_OBJECTS) $(zzip_get_get_DEPENDENCIES) $(EXTRA_zzip_get_get_DEPENDENCIES) 
+	@rm -f zzip_get_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzip_get_get_OBJECTS) $(zzip_get_get_LDADD) $(LIBS)
+
+zzip_nframes$(EXEEXT): $(zzip_nframes_OBJECTS) $(zzip_nframes_DEPENDENCIES) $(EXTRA_zzip_nframes_DEPENDENCIES) 
+	@rm -f zzip_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzip_nframes_OBJECTS) $(zzip_nframes_LDADD) $(LIBS)
+
+zzslim_get$(EXEEXT): $(zzslim_get_OBJECTS) $(zzslim_get_DEPENDENCIES) $(EXTRA_zzslim_get_DEPENDENCIES) 
+	@rm -f zzslim_get$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzslim_get_OBJECTS) $(zzslim_get_LDADD) $(LIBS)
+
+zzslim_nframes$(EXEEXT): $(zzslim_nframes_OBJECTS) $(zzslim_nframes_DEPENDENCIES) $(EXTRA_zzslim_nframes_DEPENDENCIES) 
+	@rm -f zzslim_nframes$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(zzslim_nframes_OBJECTS) $(zzslim_nframes_LDADD) $(LIBS)
+
+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_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_alias_affix.Po at am__quote@
+ at 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_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_bitnum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_bitsize.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_numbits.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_bit_scalars.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_clincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_crecip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_crecip89.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_dangle_dup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_divide_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_duplicate.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_format.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_lincom_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_lincom_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_lincom_nfields.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_linterp_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_meta_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_mplex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_mplex_scalars.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_multiply_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_phase_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_polynom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_spf_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_raw_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_resolv.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_scalar_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_scalar_carray_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_sort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec_directive.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_spec_resolv.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_string_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_window.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/add_window_op.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_list.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_list_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_list_missing.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_num.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_num_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_num_missing.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_target.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_target_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alias_target_missing.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_bit_bitnum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_bit_numbits.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_carray_len.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_carray_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_const_c2r.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip89.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_crecip_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_affix.Po at am__quote@
+ at 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_recode.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar2a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar2n.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_entry_scalar4.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_23.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_input.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_offset.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_lincom_slope.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_linterp_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_mplex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_mspec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_mspec_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_polynom_coeff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_polynom_input.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_polynom_ord.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_raw_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_raw_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_recip_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_scalar_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_spec_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/alter_window.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_add.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ascii_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bof_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_move_from.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bzip_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_discard.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/close_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex128_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex64_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex64_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex64_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_complex64_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float32_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_float64_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int16_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int32_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int64_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_int8_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint16_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint32_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint64_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/convert_uint8_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat_excl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/creat_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_array_meta_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_meta_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cvlist_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_carray_deref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const_deref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_const_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_data.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_derived.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_derived_after.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_derived_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/del_meta_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync_flush.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync_reopen.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/desync_reopen_inv.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dfes_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/elist_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/elist_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/elist_noalias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/elist_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/encode_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_alter_sie.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/endian_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_bad_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_bit_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_lincom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_mplex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_mplex_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_phase_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_polynom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_raw_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_raw_scalar_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_raw_scalar_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_scalar_repr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_type_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_window.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/entry_window_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/eof_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_error.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_num.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_short.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_verbose.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error_verbose_prefix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_meta_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flist_type_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_all.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_bad_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_hex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flush_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/foffs_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_affix_alter.Po at am__quote@
+ at 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_dup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_index_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_name.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_name_oor.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_num.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragment_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_bad_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_carray_c2r.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_carray_len.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_carray_slice.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_char.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_clincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_const_complex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_const_repr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_cpolynom1.Po at am__quote@
+ at 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_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide_ccin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide_crin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide_crinr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide_rcin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_divide_s.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex128_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex128_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex128_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex64_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex64_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_complex64_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float32_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float32_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float32_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float64_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float64_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_endian_float64_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_ff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_foffs2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_fs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_here.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_here_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_heres.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_non.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_lincom_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_notab.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_linterp_sort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex.Po at am__quote@
+ at 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_lb.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_mplex_lball.Po at am__quote@
+ at 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_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_ccin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_crin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_crinr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_multiply_rcin.Po at am__quote@
+ at 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_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_off64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_phase_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_polynom_cmpin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_polynom_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_recip_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_recurse.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_rofs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_sf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_ss.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window.Po at am__quote@
+ at 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_ge.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_gt.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_le.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_window_lt.Po at am__quote@
+ at 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_set.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/get_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_flags.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_name.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref_empty.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/global_ref_set.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_add.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get_get2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_get_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_move_from.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_move_to.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzip_put_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/header_complex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hide_hidden.Po at am__quote@
+ at 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@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_accmode.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_auto.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_cb.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_creat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_ignore.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_pc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_sub.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/include_syntax.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_domain.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/index_range.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_get_rofs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_put.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/legacy_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lzma_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_alias_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_bit_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_clincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_cpolynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_crecip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_crecip89.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_lincom_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_linterp_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_mplex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_multiply_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_phase_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_spec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_spec_directive.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_spec_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_spec_resolv.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/madd_window.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_affix.Po at am__quote@
+ at 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_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_enc_ar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_enc_ra.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_endian.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_data_nop.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/move_subdir.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_affix_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_dup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_move_alias.Po at am__quote@
+ at 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_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/name_updb_const.Po at am__quote@
+ at 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)/nentries_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nentries_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nentries_noalias.Po at am__quote@
+ at 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@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_type_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_type_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_vector.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nfields_vector_hidden.Po at am__quote@
+ at 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@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_empty.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_off64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nframes_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_type_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_type_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_type_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_del.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nmeta_vectors_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_abs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_abort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_cont.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_ignore.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_cb_rescan.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_eaccess.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_notdirfile.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_rofs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_al.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_at.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_c.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_cl.Po at am__quote@
+ at 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_p.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_pl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/open_sym_pt.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_alias_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_alias_dup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_alias_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_alias_missing.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_badline.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit4.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_bitnum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_bitsize.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_numbits.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_bit_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_carray_long.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_const_complex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_const_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_double.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_duplicate.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_duplicate_ignore.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_force.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_endian_slash.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_eol.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_foffs_include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_foffs_slash.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_hex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_hidden_field.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_hidden_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_absolute.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_absrel.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_affix_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_dir.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_loop.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_prefix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_prefix_dup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_preprefix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_relabs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_relrel.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_slash.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_suffix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_include_sufsuffix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_ncols1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_ncols2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_nfields.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_nofields.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_non.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_non_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_lincom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_linterp_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_malias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_malias_dup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_malias_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_affix.Po at am__quote@
+ at 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_implicit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_implicit2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_implicit_affix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_index.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_index2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_jump.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_malias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_parent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_meta_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_mplex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_mplex_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_mplex_nomax.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_mplex_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_multiply_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name_dot.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name_ext.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_name_pedantic.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_phase_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_polynom_ncols1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_polynom_ncols2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_polynom_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_all.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_bad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_data.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_format.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_protect_none.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_quote.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_quote_mismatch.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_char.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_raw_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_ref_nonexistent.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_sort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_string_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_string_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_utf8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_utf8_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_utf8_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_89.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_98.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_include.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_p8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_p9.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_permissive.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_version_slash.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_whitespace.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_window.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_window_ncols.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_window_op.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse_window_scalar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect_alter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/protect_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bad_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_bof.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_carray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_carray_slice.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_char.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_complex128.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_complex64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_const.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_const_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex128_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex128_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex128_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex64_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex64_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_complex64_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float32_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float32_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float32_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float64_arm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float64_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_endian_float64_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_ff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_fs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_here.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_heres.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_lincom1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_lincom2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_lincom_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_nomono.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_notab.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_linterp_reverse.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_mplex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_null.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_off64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_phase.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_phase_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_polynom1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_polynom2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_polynom_noin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_recurse.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_repr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_rofs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_sbit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_sf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_ss.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_string.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_string_protect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_window.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/put_zero.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ref_none.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ref_two.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_float32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_float64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_i.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_int16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_int32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_int8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_m.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_r.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_real_a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_real_i.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_real_m.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_real_r.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_uint16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_uint32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_uint64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/repr_uint8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_cur.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_end.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_foffs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_foffs2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_neg.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/seek_set.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_get_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_get_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_move_from.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_move_to.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_nframes_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_nframes_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_append.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_append2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_back.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_big.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_many.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_newo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_newo0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_pad.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_pad0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_trunc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sie_put_trunc2.Po at am__quote@
+ at 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_sync.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/slim_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/slim_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_alias_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_alias_missing.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_divide.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_lincom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_multiply.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_polynom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_recip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spf_recurse.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svlist_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table_code.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table_type.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tell.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tell64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tell_multidiv.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tok_arg.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tok_escape.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tok_quote.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trunc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trunc_dir.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trunc_rdonly.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trunc_rofs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trunc_truncsub.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude_del.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/unclude_move.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_0.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_0_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_1_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_2_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_3_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_4.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_4_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_5.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_5_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_5_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_6.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_6_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_6_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_7.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_7_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_7_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_8_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_8_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_9.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_9_strict.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version_9_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_alias.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_meta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_meta_hidden.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_meta_invalid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xz_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xz_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_data.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_get_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzip_nframes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzslim_get.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zzslim_nframes.Po 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
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \
+	check-local clean clean-checkPROGRAMS clean-generic \
+	clean-libtool clean-local cscopelist-am ctags ctags-am \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am
+
+
+# fast tests
+.PHONY: fastcheck
+fastcheck:
+	touch $(TESTS)
+	${MAKE} check
+
+# valgrind
+valgrind.log: $(TESTS)
+	rm -f $@; \
+		for x in $^; do ( \
+		echo $$x:; \
+		sed -e 's/exec "/exec valgrind --leak-check=full --track-origins=yes --track-fds=yes --suppressions=valgrind.suppressions "/' $$x | sh; \
+		echo $$x = $$? ); done &> $@;
+
+# clean up after the tests
+check-local: check-TESTS
+	$(MAKE) getdata-clean-dir
+
+getdata-clean-dir:
+	rm -rf dirfile
+
+clean-local:
+	$(MAKE) getdata-clean-dir
+	rm -rf *~
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/add.c b/test/add.c
new file mode 100644
index 0000000..c90b82b
--- /dev/null
+++ b/test/add.c
@@ -0,0 +1,75 @@
+/* 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_affix.c b/test/add_affix.c
new file mode 100644
index 0000000..d15b05a
--- /dev/null
+++ b/test/add_affix.c
@@ -0,0 +1,105 @@
+/* Copyright (C) 2011-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data = "AconstZ CONST UINT8 3\n/INCLUDE format1 A Z\n";
+  int n, fd, e1, e2, e3, e4, e5, r = 0;
+  DIRFILE *D;
+  gd_entry_t E, e;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  close(open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+
+  memset(&E, 0, sizeof(E));
+  E.field = "Adata1Z";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 1;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+  E.scalar[0] = NULL;
+
+  gd_add(D, &E);
+  e1 = gd_error(D);
+
+  memset(&E, 0, sizeof(E));
+  E.field = "Adata2Z";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 1;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+  E.scalar[0] = "const";
+
+  gd_add(D, &E);
+  e2 = gd_error(D);
+
+  memset(&E, 0, sizeof(E));
+  E.field = "Adata3Z";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 1;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+  E.scalar[0] = "AconstZ";
+
+  gd_add(D, &E);
+  e3 = gd_error(D);
+
+  /* check */
+  gd_entry(D, "Adata1Z", &e);
+  e4 = gd_error(D);
+  n = gd_spf(D, "Adata3Z");
+  e5 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_BAD_CODE);
+  CHECKI(e3, GD_E_OK);
+  CHECKI(e4, GD_E_OK);
+  CHECKI(e5, GD_E_OK);
+  CHECKI(n, 3);
+  CHECKI(e.field_type, GD_RAW_ENTRY);
+  CHECKI(e.fragment_index, 1);
+  CHECKI(e.EN(raw,spf), 2);
+  CHECKI(e.EN(raw,data_type), GD_UINT8);
+  CHECKP(e.scalar[0]);
+  gd_free_entry_strings(&e);
+
+  return r;
+}
diff --git a/test/add_alias.c b/test/add_alias.c
new file mode 100644
index 0000000..43a3599
--- /dev/null
+++ b/test/add_alias.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *target;
+  int error, i, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_raw(D, "data", GD_UINT8, 1, 0);
+  gd_add_alias(D, "alias", "data", 0);
+  error = gd_error(D);
+
+  /* check */
+  target = gd_alias_target(D, "alias");
+  CHECKS(target, "data");
+  i = gd_fragment_index(D, "alias");
+  n = gd_naliases(D, "alias");
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(i, 0);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/add_alias_affix.c b/test/add_alias_affix.c
new file mode 100644
index 0000000..e412207
--- /dev/null
+++ b/test/add_alias_affix.c
@@ -0,0 +1,66 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *target;
+  int e1, e2, e3, i, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+
+  gd_include_affix(D, "format1", 0, "A", "Z", GD_CREAT);
+  gd_add_raw(D, "AdataZ", GD_UINT8, 1, 1);
+  gd_add_alias(D, "alias", "AdataZ", 1);
+  e1 = gd_error(D);
+  gd_add_alias(D, "AaliasZ", "data", 1);
+  e2 = gd_error(D);
+  gd_add_alias(D, "AaliasZ", "AdataZ", 1);
+  e3 = gd_error(D);
+
+  /* check */
+  target = gd_alias_target(D, "AaliasZ");
+  CHECKS(target, "AdataZ");
+  i = gd_fragment_index(D, "AaliasZ");
+  n = gd_naliases(D, "AaliasZ");
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_BAD_CODE);
+  CHECKI(e2, GD_E_BAD_CODE);
+  CHECKI(e3, GD_E_OK);
+  CHECKI(i, 1);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/add_alias_meta.c b/test/add_alias_meta.c
new file mode 100644
index 0000000..86af86d
--- /dev/null
+++ b/test/add_alias_meta.c
@@ -0,0 +1,57 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *target;
+  int error, i, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_raw(D, "data", GD_UINT8, 1, 0);
+  gd_add_alias(D, "data/alias", "data", 0);
+  error = gd_error(D);
+
+  /* check */
+  target = gd_alias_target(D, "data/alias");
+  CHECKS(target, "data");
+  i = gd_fragment_index(D, "data/alias");
+  n = gd_naliases(D, "data/alias");
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(i, 0);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/add_bit.c b/test/add_bit.c
new file mode 100644
index 0000000..5b32c2a
--- /dev/null
+++ b/test/add_bit.c
@@ -0,0 +1,67 @@
+/* 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 BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_bit(D, "new", "input", 1, 1, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_BIT_ENTRY);
+    CHECKS(e.in_fields[0], "input");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(bit,bitnum), 1);
+    CHECKI(e.EN(bit,numbits), 1);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_bit_bitnum.c b/test/add_bit_bitnum.c
new file mode 100644
index 0000000..fc47c8c
--- /dev/null
+++ b/test/add_bit_bitnum.c
@@ -0,0 +1,56 @@
+/* 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 BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+
+  gd_add_bit(D, "new", "input", -1, 1, 0);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 1);
+  CHECKI(error, GD_E_BAD_ENTRY);
+
+  return r;
+}
diff --git a/test/add_bit_bitsize.c b/test/add_bit_bitsize.c
new file mode 100644
index 0000000..c861d30
--- /dev/null
+++ b/test/add_bit_bitsize.c
@@ -0,0 +1,56 @@
+/* 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 BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+
+  gd_add_bit(D, "new", "input", 1, 99, 0);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 1);
+  CHECKI(error, GD_E_BAD_ENTRY);
+
+  return r;
+}
diff --git a/test/add_bit_invalid.c b/test/add_bit_invalid.c
new file mode 100644
index 0000000..c62fa04
--- /dev/null
+++ b/test/add_bit_invalid.c
@@ -0,0 +1,46 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+
+  gd_add_bit(D, "new", "input", 1, 1, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error,GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/add_bit_numbits.c b/test/add_bit_numbits.c
new file mode 100644
index 0000000..533a047
--- /dev/null
+++ b/test/add_bit_numbits.c
@@ -0,0 +1,56 @@
+/* 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 BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+
+  gd_add_bit(D, "new", "input", 1, 0, 0);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 1);
+  CHECKI(error, GD_E_BAD_ENTRY);
+
+  return r;
+}
diff --git a/test/add_bit_scalars.c b/test/add_bit_scalars.c
new file mode 100644
index 0000000..0d5ed21
--- /dev/null
+++ b/test/add_bit_scalars.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General 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 e1, e2, e3, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  memset(&E, 0, sizeof(E));
+  E.field = "bit1";
+  E.field_type = GD_BIT_ENTRY;
+  E.in_fields[0] = "INDEX";
+  E.EN(bit,bitnum) = -1;
+  E.EN(bit,numbits) = 1;
+  E.scalar[0] = "const";
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add(D, &E);
+  e1 = gd_error(D);
+
+  E.field = "bit2";
+  E.EN(bit,bitnum) = 1;
+  E.EN(bit,numbits) = 0;
+  E.scalar[0] = NULL;
+  E.scalar[1] = "const";
+  gd_add(D, &E);
+  e2 = gd_error(D);
+
+  E.field = "bit3";
+  E.EN(bit,bitnum) = 61;
+  E.EN(bit,numbits) = 5;
+  E.scalar[0] = "const";
+  E.scalar[1] = "const";
+  gd_add(D, &E);
+  e3 = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(e3, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_carray.c b/test/add_carray.c
new file mode 100644
index 0000000..27d5a3b
--- /dev/null
+++ b/test/add_carray.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  uint8_t val[] = {3, 4, 5, 6, 7};
+  uint8_t data[5];
+  int n, error;
+  int r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_carray(D, "data", GD_UINT8, 5, GD_UINT8, &val, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_CARRAY_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+  n = (int)gd_carray_len(D, "data");
+  CHECKI(n, 5);
+  gd_get_carray(D, "data", GD_UINT8, &data);
+  for (n = 0; n < 5; ++n)
+    CHECKIi(n, data[n], 3 + n);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_clincom.c b/test/add_clincom.c
new file mode 100644
index 0000000..76258a0
--- /dev/null
+++ b/test/add_clincom.c
@@ -0,0 +1,88 @@
+/* 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
+ */
+/* Add a complex LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  DIRFILE *D;
+  const char *in_fields[2] = {"in1", "in2"};
+#ifdef GD_NO_C99_API
+  const double m[4] = {1, 3.3, 0.3, 18.3};
+  const double b[4] = {2, 3.8, 2.1, 9.8};
+#else
+  const double complex m[2] = {1 + _Complex_I * 3.3, 0.3 + _Complex_I * 18.3};
+  const double complex b[2] = {2 + _Complex_I * 3.8, 2.1 + _Complex_I * 9.8};
+#endif
+  int error, r = 0;
+  gd_entry_t e;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_clincom(D, "new", 2, in_fields, m, b, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_LINCOM_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(lincom,n_fields),2);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKS(e.in_fields[1], "in2");
+#ifdef GD_NO_C99_API
+    CHECKC(e.EN(lincom,cm)[0], m);
+    CHECKC(e.EN(lincom,cm)[1], m + 2);
+    CHECKC(e.EN(lincom,cb)[0], b);
+    CHECKC(e.EN(lincom,cb)[1], b + 2);
+#else
+    CHECKC(e.EN(lincom,cm)[0], m[0]);
+    CHECKC(e.EN(lincom,cm)[1], m[1]);
+    CHECKC(e.EN(lincom,cb)[0], b[0]);
+    CHECKC(e.EN(lincom,cb)[1], b[1]);
+#endif
+    CHECKI(e.comp_scal,1);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_code.c b/test/add_code.c
new file mode 100644
index 0000000..49042d1
--- /dev/null
+++ b/test/add_code.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  E.field =  "ne/w";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 0;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 1);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/add_const.c b/test/add_const.c
new file mode 100644
index 0000000..dac48c8
--- /dev/null
+++ b/test/add_const.c
@@ -0,0 +1,67 @@
+/* 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 CONST field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  uint8_t val = 3;
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_const(D, "data", GD_UINT8, GD_UINT8, &val, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_get_constant(D, "data", GD_UINT8, &val);
+    CHECKI(val, 3);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_cpolynom.c b/test/add_cpolynom.c
new file mode 100644
index 0000000..4a99f53
--- /dev/null
+++ b/test/add_cpolynom.c
@@ -0,0 +1,80 @@
+/* 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
+ */
+/* Add a complex POLYNOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int r = 0;
+  int error, j;
+  gd_entry_t e;
+  DIRFILE *D;
+#ifdef GD_NO_C99_API
+  const double a[8] = {1, 29.03, 0.3, 12.34, 0.5, 99.55, 1.8, 45.32};
+#else
+  const double complex a[4] = {1 + _Complex_I * 29.03, 0.3 + _Complex_I * 12.34,
+    0.5 + _Complex_I * 99.55, 1.8 + _Complex_I * 45.32};
+#endif
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_cpolynom(D, "new", 3, "in", a, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_POLYNOM_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(polynom,poly_ord), 3);
+    CHECKI(e.comp_scal, 1);
+    for (j = 0; j < 4; ++j) {
+#ifdef GD_NO_C99_API
+      CHECKCi(j,e.EN(polynom,ca)[j], a + 2 * j);
+#else
+      CHECKCi(j,e.EN(polynom,ca)[j], a[j]);
+#endif
+    }
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_crecip.c b/test/add_crecip.c
new file mode 100644
index 0000000..c66d7fb
--- /dev/null
+++ b/test/add_crecip.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  int error, r = 0;
+#ifdef GD_NO_C99_API
+  const double cdividend[2] = {33.3, 44.4};
+#else
+  const double complex cdividend = 33.3 + _Complex_I * 44.4;
+#endif
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_crecip(D, "new", "in", cdividend, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RECIP_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.comp_scal, 1);
+    CHECKC(e.EN(recip,cdividend), cdividend);
+    CHECKI(e.fragment_index, 0);
+
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_crecip89.c b/test/add_crecip89.c
new file mode 100644
index 0000000..909b086
--- /dev/null
+++ b/test/add_crecip89.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#define GD_C89_API
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  double dividend[2] = {33.3, 44.4}; 
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_crecip(D, "new", "in", dividend, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RECIP_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.comp_scal, 1);
+    CHECKF(e.EN(recip,cdividend)[0], dividend[0]);
+    CHECKF(e.EN(recip,cdividend)[1], dividend[1]);
+    CHECKI(e.fragment_index, 0);
+
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_dangle_dup.c b/test/add_dangle_dup.c
new file mode 100644
index 0000000..0a55c1a
--- /dev/null
+++ b/test/add_dangle_dup.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int e1, e2, e3, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_add_alias(D, "name", "target", 0);
+  e1 = gd_error(D);
+  CHECKI(e1, GD_E_OK);
+
+  gd_add_raw(D, "name", GD_UINT8, 1, 0);
+  e2 = gd_error(D);
+  CHECKI(e2, GD_E_DUPLICATE);
+
+  gd_add_alias(D, "name", "target", 0);
+  e3 = gd_error(D);
+  CHECKI(e3, GD_E_DUPLICATE);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/add_divide.c b/test/add_divide.c
new file mode 100644
index 0000000..43e6941
--- /dev/null
+++ b/test/add_divide.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_divide(D, "new", "in1", "in2", 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_DIVIDE_ENTRY);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKS(e.in_fields[1], "in2");
+    CHECKI(e.fragment_index, 0);
+
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_divide_invalid.c b/test/add_divide_invalid.c
new file mode 100644
index 0000000..c53bd8d
--- /dev/null
+++ b/test/add_divide_invalid.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add_multiply(D, "new", "in1", "in2", 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/add_duplicate.c b/test/add_duplicate.c
new file mode 100644
index 0000000..4d378ce
--- /dev/null
+++ b/test/add_duplicate.c
@@ -0,0 +1,70 @@
+/* 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 <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 r = 0;
+  int fd, error, n;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  E.field =  "data";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 0;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,2);
+  CHECKI(error, GD_E_DUPLICATE);
+
+  return r;
+}
diff --git a/test/add_format.c b/test/add_format.c
new file mode 100644
index 0000000..6a99e90
--- /dev/null
+++ b/test/add_format.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  E.field =  "new";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 21;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,1);
+  CHECKI(error, GD_E_BAD_INDEX);
+
+  return r;
+}
diff --git a/test/add_invalid.c b/test/add_invalid.c
new file mode 100644
index 0000000..59e70f8
--- /dev/null
+++ b/test/add_invalid.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  gd_entry_t E;
+  E.field =  "data";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 0;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add(D, &E);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/add_lincom.c b/test/add_lincom.c
new file mode 100644
index 0000000..11f960f
--- /dev/null
+++ b/test/add_lincom.c
@@ -0,0 +1,76 @@
+/* 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 LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+  const char *in_fields[2] = {"in1", "in2"};
+  const double m[2] = {1, 0.3};
+  const double b[2] = {5, 0.9};
+  gd_entry_t e;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_lincom(D, "new", 2, in_fields, m, b, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_LINCOM_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(lincom,n_fields), 2);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKS(e.in_fields[1], "in2");
+    CHECKF(e.EN(lincom,m)[0], m[0]);
+    CHECKF(e.EN(lincom,m)[1], m[1]);
+    CHECKF(e.EN(lincom,b)[0], b[0]);
+    CHECKF(e.EN(lincom,b)[1], b[1]);
+    CHECKI(e.comp_scal, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  
+  return r;
+}
diff --git a/test/add_lincom_affix.c b/test/add_lincom_affix.c
new file mode 100644
index 0000000..a87bd97
--- /dev/null
+++ b/test/add_lincom_affix.c
@@ -0,0 +1,86 @@
+/* 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
+ */
+/* Add a LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  int e1, e2, e3, r = 0;
+  DIRFILE *D;
+  const char *in_fields[2] = {"in1", "in2"};
+  const char *Ain_fieldsZ[2] = {"Ain1Z", "Ain2Z"};
+  const double m[2] = {1, 0.3};
+  const double b[2] = {5, 0.9};
+  gd_entry_t e;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_include_affix(D, "format1", 0, "A", "Z", GD_CREAT);
+
+  gd_add_lincom(D, "new", 2, Ain_fieldsZ, m, b, 1);
+  e1 = gd_error(D);
+  gd_add_lincom(D, "AnewZ", 2, in_fields, m, b, 1);
+  e2 = gd_error(D);
+  gd_add_lincom(D, "AnewZ", 2, Ain_fieldsZ, m, b, 1);
+  e3 = gd_error(D);
+
+  /* check */
+  gd_entry(D, "AnewZ", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_LINCOM_ENTRY);
+    CHECKI(e.fragment_index, 1);
+    CHECKI(e.EN(lincom,n_fields), 2);
+    CHECKS(e.in_fields[0], "Ain1Z");
+    CHECKS(e.in_fields[1], "Ain2Z");
+    CHECKF(e.EN(lincom,m)[0], m[0]);
+    CHECKF(e.EN(lincom,m)[1], m[1]);
+    CHECKF(e.EN(lincom,b)[0], b[0]);
+    CHECKF(e.EN(lincom,b)[1], b[1]);
+    CHECKI(e.comp_scal, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_BAD_CODE);
+  CHECKI(e2, GD_E_BAD_CODE);
+  CHECKI(e3, GD_E_OK);
+  
+  return r;
+}
diff --git a/test/add_lincom_invalid.c b/test/add_lincom_invalid.c
new file mode 100644
index 0000000..8980ffd
--- /dev/null
+++ b/test/add_lincom_invalid.c
@@ -0,0 +1,48 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char *in_fields[2] = {"in1", "in2"};
+  const double m[2] = {1, 0.3};
+  const double b[2] = {0, 0.9};
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add_lincom(D, "new", 2, in_fields, m, b, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/add_lincom_nfields.c b/test/add_lincom_nfields.c
new file mode 100644
index 0000000..cfe60ce
--- /dev/null
+++ b/test/add_lincom_nfields.c
@@ -0,0 +1,58 @@
+/* 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 LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  DIRFILE *D;
+  const char *in_fields[2] = {"in1", "in2"};
+  const double m[2] = {1, 0.3};
+  const double b[2] = {0, 0.9};
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_add_lincom(D, "new", 0, in_fields, m, b, 0);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 1);
+  CHECKI(error, GD_E_BAD_ENTRY);
+
+  return r;
+}
diff --git a/test/add_linterp.c b/test/add_linterp.c
new file mode 100644
index 0000000..514fcd3
--- /dev/null
+++ b/test/add_linterp.c
@@ -0,0 +1,65 @@
+/* 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 LINTERP field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_linterp(D, "new", "in", "table", 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_LINTERP_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKS(e.EN(linterp,table), "table");
+    CHECKI(e.fragment_index, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_linterp_invalid.c b/test/add_linterp_invalid.c
new file mode 100644
index 0000000..11d1250
--- /dev/null
+++ b/test/add_linterp_invalid.c
@@ -0,0 +1,44 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add_linterp(D, "new", "in", "table", 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/add_meta.c b/test/add_meta.c
new file mode 100644
index 0000000..07c4c41
--- /dev/null
+++ b/test/add_meta.c
@@ -0,0 +1,76 @@
+/* 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 e1, e2, r = 0;
+  DIRFILE *D;
+  gd_entry_t E, e;
+
+  rmdirfile();
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_CONST_ENTRY;
+  E.fragment_index = 0;
+  E.EN(scalar,const_type) = GD_UINT8;
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add(D, &E);
+  e1 = gd_error(D);
+  E.field = "data/data";
+  gd_add(D, &E);
+  e2 = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data/data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_meta_alias.c b/test/add_meta_alias.c
new file mode 100644
index 0000000..96ab508
--- /dev/null
+++ b/test/add_meta_alias.c
@@ -0,0 +1,79 @@
+/* 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 e1, e2, e3, r = 0;
+  DIRFILE *D;
+  gd_entry_t E, e;
+
+  rmdirfile();
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_CONST_ENTRY;
+  E.fragment_index = 0;
+  E.EN(scalar,const_type) = GD_UINT8;
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add(D, &E);
+  e1 = gd_error(D);
+  gd_add_alias(D, "alias", "data", 0);
+  e2 = gd_error(D);
+  E.field = "alias/data";
+  gd_add(D, &E);
+  e3 = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data/data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(e3, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_mplex.c b/test/add_mplex.c
new file mode 100644
index 0000000..68b116d
--- /dev/null
+++ b/test/add_mplex.c
@@ -0,0 +1,58 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_mplex(D, "new", "in", "count", 3, 4, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_MPLEX_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKS(e.in_fields[1], "count");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(mplex,count_val), 3);
+    CHECKF(e.EN(mplex,period), 4);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_mplex_scalars.c b/test/add_mplex_scalars.c
new file mode 100644
index 0000000..4136fc2
--- /dev/null
+++ b/test/add_mplex_scalars.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
+ */
+/* 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;
+
+  rmdirfile();
+  memset(&E, 0, sizeof(E));
+  E.field = "mplex1";
+  E.field_type = GD_MPLEX_ENTRY;
+  E.in_fields[0] = "INDEX";
+  E.in_fields[1] = "INDEX";
+  E.EN(mplex,count_val) = 0;
+  E.EN(mplex,period) = -1;
+  E.scalar[1] = "const";
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_multiply.c b/test/add_multiply.c
new file mode 100644
index 0000000..cc65a99
--- /dev/null
+++ b/test/add_multiply.c
@@ -0,0 +1,65 @@
+/* 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 MULTIPLY field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_multiply(D, "new", "in1", "in2", 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_MULTIPLY_ENTRY);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKS(e.in_fields[1], "in2");
+    CHECKI(e.fragment_index, 0);
+
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_multiply_invalid.c b/test/add_multiply_invalid.c
new file mode 100644
index 0000000..55a43ca
--- /dev/null
+++ b/test/add_multiply_invalid.c
@@ -0,0 +1,44 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add_multiply(D, "new", "in1", "in2", 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/add_phase.c b/test/add_phase.c
new file mode 100644
index 0000000..c801031
--- /dev/null
+++ b/test/add_phase.c
@@ -0,0 +1,65 @@
+/* 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 PHASE field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_PHASE_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(phase,shift), 3);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_phase_invalid.c b/test/add_phase_invalid.c
new file mode 100644
index 0000000..269e6ad
--- /dev/null
+++ b/test/add_phase_invalid.c
@@ -0,0 +1,44 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add_phase(D, "new", "in", 3, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/add_polynom.c b/test/add_polynom.c
new file mode 100644
index 0000000..9bb7437
--- /dev/null
+++ b/test/add_polynom.c
@@ -0,0 +1,70 @@
+/* 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
+ */
+/* Add a POLYNOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int r = 0;
+  int j, error;
+  gd_entry_t e;
+  DIRFILE *D;
+  const double a[4] = {1, 0.3, 0.5, 1.8};
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_polynom(D, "new", 3, "in", a, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_POLYNOM_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(polynom,poly_ord), 3);
+    CHECKI(e.comp_scal, 0);
+    for (j = 0; j < 4; ++j)
+      CHECKFi(j,e.EN(polynom,a)[j], a[j]);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+  
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_polynom_scalar.c b/test/add_polynom_scalar.c
new file mode 100644
index 0000000..8d446cf
--- /dev/null
+++ b/test/add_polynom_scalar.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";
+  int error, r = 0;
+  DIRFILE *D;
+
+  gd_entry_t E, e;
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_POLYNOM_ENTRY;
+  E.fragment_index = 0;
+  E.EN(polynom,poly_ord) = 3;
+  E.comp_scal = 0;
+  E.in_fields[0] = "INDEX";
+  E.scalar[0] = "A";
+  E.scalar[1] = "B";
+  E.scalar[2] = "C";
+  E.scalar[3] = "D";
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_spec(D, "A CONST INT64 1", 0);
+  gd_add_spec(D, "B CONST INT64 2", 0);
+  gd_add_spec(D, "C CONST INT64 3", 0);
+  gd_add_spec(D, "D CONST INT64 4", 0);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_POLYNOM_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(polynom,poly_ord), 3);
+    CHECKF(e.EN(polynom,a)[0], 1);
+    CHECKF(e.EN(polynom,a)[1], 2);
+    CHECKF(e.EN(polynom,a)[2], 3);
+    CHECKF(e.EN(polynom,a)[3], 4);
+    CHECKS(e.scalar[0], "A");
+    CHECKS(e.scalar[1], "B");
+    CHECKS(e.scalar[2], "C");
+    CHECKS(e.scalar[3], "D");
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_protect.c b/test/add_protect.c
new file mode 100644
index 0000000..2fcd142
--- /dev/null
+++ b/test/add_protect.c
@@ -0,0 +1,69 @@
+/* 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 <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\nPROTECT all\n";
+  int fd, error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  E.field =  "data2";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 0;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 2);
+  CHECKI(error, GD_E_PROTECTED);
+
+  return r;
+}
diff --git a/test/add_raw.c b/test/add_raw.c
new file mode 100644
index 0000000..f2efa8c
--- /dev/null
+++ b/test/add_raw.c
@@ -0,0 +1,69 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  gd_entry_t e;
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_raw(D, "data", GD_UINT8, 2, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  if (unlink(data)) {
+    perror("unlink");
+    r = 1;
+  }
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_raw_include.c b/test/add_raw_include.c
new file mode 100644
index 0000000..d7fc411
--- /dev/null
+++ b/test/add_raw_include.c
@@ -0,0 +1,71 @@
+/* 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
+ */
+/* Add a RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  gd_entry_t e;
+  int frag, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_UNENCODED | GD_VERBOSE);
+  frag = gd_include(D, "format1", 0, GD_CREAT);
+
+  gd_add_raw(D, "data", GD_UINT8, 2, frag);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 1);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  if (unlink(data))
+    r = 1;
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_raw_invalid.c b/test/add_raw_invalid.c
new file mode 100644
index 0000000..cfb66d6
--- /dev/null
+++ b/test/add_raw_invalid.c
@@ -0,0 +1,44 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add_raw(D, "data", GD_UINT8, 2, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/add_raw_spf.c b/test/add_raw_spf.c
new file mode 100644
index 0000000..420c64b
--- /dev/null
+++ b/test/add_raw_spf.c
@@ -0,0 +1,55 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_add_raw(D, "new", GD_UINT8, 0, 0);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,1);
+  CHECKI(error, GD_E_BAD_ENTRY);
+
+  return r;
+}
diff --git a/test/add_raw_spf_scalar.c b/test/add_raw_spf_scalar.c
new file mode 100644
index 0000000..2b990b3
--- /dev/null
+++ b/test/add_raw_spf_scalar.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
+ */
+/* 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.fragment_index = 0;
+  E.EN(raw,spf) = 0;
+  E.EN(raw,data_type) = GD_UINT8;
+  E.scalar[0] = "const";
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_spec(D, "const CONST UINT8 2", 0);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    CHECKS(e.scalar[0], "const");
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_raw_type.c b/test/add_raw_type.c
new file mode 100644
index 0000000..d28b5c5
--- /dev/null
+++ b/test/add_raw_type.c
@@ -0,0 +1,55 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_add_raw(D, "new", (gd_type_t)'c', 2, 0);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 1);
+  CHECKI(error, GD_E_BAD_TYPE);
+  
+  return r;
+}
diff --git a/test/add_rdonly.c b/test/add_rdonly.c
new file mode 100644
index 0000000..09232db
--- /dev/null
+++ b/test/add_rdonly.c
@@ -0,0 +1,69 @@
+/* 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 to a read-only dirfile*/
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, error, n, r = 0;
+  DIRFILE *D;
+
+  gd_entry_t E;
+  E.field =  "new";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 0;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 2);
+  CHECKI(error, GD_E_ACCMODE);
+
+  return r;
+}
diff --git a/test/add_recip.c b/test/add_recip.c
new file mode 100644
index 0000000..e73b3b1
--- /dev/null
+++ b/test/add_recip.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_recip(D, "new", "in", 33.3, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RECIP_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.comp_scal, 0);
+    CHECKF(e.EN(recip,dividend), 33.3);
+    CHECKI(e.fragment_index, 0);
+
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_resolv.c b/test/add_resolv.c
new file mode 100644
index 0000000..8bd2fa4
--- /dev/null
+++ b/test/add_resolv.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, i, n, r = 0;
+  DIRFILE *D;
+  const char *target;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_alias(D, "alias", "data", 0);
+  gd_add_raw(D, "data", GD_UINT8, 1, 0);
+  error = gd_error(D);
+
+  /* check */
+  target = gd_alias_target(D, "alias");
+  CHECKS(target, "data");
+  i = gd_fragment_index(D, "alias");
+  n = gd_naliases(D, "alias");
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(i, 0);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/add_sbit.c b/test/add_sbit.c
new file mode 100644
index 0000000..da51dad
--- /dev/null
+++ b/test/add_sbit.c
@@ -0,0 +1,66 @@
+/* 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
+ */
+/* Add a SBIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_sbit(D, "new", "input", 1, 1, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_SBIT_ENTRY);
+    CHECKS(e.in_fields[0], "input");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(bit,bitnum), 1);
+    CHECKI(e.EN(bit,numbits), 1);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  
+  return r;
+}
diff --git a/test/add_scalar.c b/test/add_scalar.c
new file mode 100644
index 0000000..bd79f6e
--- /dev/null
+++ b/test/add_scalar.c
@@ -0,0 +1,71 @@
+/* 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)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+
+  gd_entry_t E, e;
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_LINCOM_ENTRY;
+  E.fragment_index = 0;
+  E.EN(lincom,n_fields) = 1;
+  E.comp_scal = 0;
+  E.in_fields[0] = "INDEX";
+  E.EN(lincom,m)[0] = 1.;
+  E.scalar[0] = NULL;
+  E.scalar[0 + GD_MAX_LINCOM] = "c";
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_spec(D, "c CONST INT64 4", 0);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_LINCOM_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(lincom,n_fields), 1);
+    CHECKF(e.EN(lincom,m)[0], 1);
+    CHECKF(e.EN(lincom,b)[0], 4);
+    CHECKP(e.scalar[0]);
+    CHECKS(e.scalar[0 + GD_MAX_LINCOM], "c");
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_scalar_carray.c b/test/add_scalar_carray.c
new file mode 100644
index 0000000..7bd34ee
--- /dev/null
+++ b/test/add_scalar_carray.c
@@ -0,0 +1,73 @@
+/* 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)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+
+  gd_entry_t E, e;
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_LINCOM_ENTRY;
+  E.fragment_index = 0;
+  E.EN(lincom,n_fields) = 1;
+  E.comp_scal = 0;
+  E.in_fields[0] = "INDEX";
+  E.EN(lincom,m)[0] = 1.;
+  E.scalar[0] = NULL;
+  E.scalar[0 + GD_MAX_LINCOM] = "c";
+  E.scalar_ind[0 + GD_MAX_LINCOM] = 3;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_spec(D, "c CARRAY INT64 1 2 3 4", 0);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_LINCOM_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(lincom,n_fields), 1);
+    CHECKF(e.EN(lincom,m)[0], 1);
+    CHECKF(e.EN(lincom,b)[0], 4);
+    CHECKP(e.scalar[0]);
+    CHECKS(e.scalar[0 + GD_MAX_LINCOM], "c");
+    CHECKI(e.scalar_ind[0 + GD_MAX_LINCOM], 3);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_scalar_carray_bad.c b/test/add_scalar_carray_bad.c
new file mode 100644
index 0000000..c410e42
--- /dev/null
+++ b/test/add_scalar_carray_bad.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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+
+  gd_entry_t E, e;
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_LINCOM_ENTRY;
+  E.fragment_index = 0;
+  E.EN(lincom,n_fields) = 1;
+  E.comp_scal = 0;
+  E.in_fields[0] = "INDEX";
+  E.EN(lincom,m)[0] = 1.;
+  E.scalar[0] = NULL;
+  E.scalar[0 + GD_MAX_LINCOM] = "c";
+  E.scalar_ind[0 + GD_MAX_LINCOM] = -1;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_spec(D, "c CARRAY INT64 1 2 3 4", 0);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_LINCOM_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(lincom,n_fields), 1);
+    CHECKF(e.EN(lincom,m)[0], 1);
+    CHECKF(e.EN(lincom,b)[0], 1);
+    CHECKP(e.scalar[0]);
+    CHECKS(e.scalar[0 + GD_MAX_LINCOM], "c");
+    CHECKI(e.scalar_ind[0 + GD_MAX_LINCOM], 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_sort.c b/test/add_sort.c
new file mode 100644
index 0000000..cb8c1d8
--- /dev/null
+++ b/test/add_sort.c
@@ -0,0 +1,102 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int r = 0;
+
+void CheckSPF(DIRFILE *D, const char *f, unsigned int v)
+{
+  gd_entry_t e;
+
+  gd_entry(D, f, &e);
+
+  if (gd_error(D)) {
+    r = 1;
+    return;
+  }
+
+  CHECKS(e.field, f);
+  CHECKI(e.EN(raw,spf), v);
+  gd_free_entry_strings(&e);
+}
+
+int main (void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *a = "dirfile/a";
+  const char *b = "dirfile/b";
+  const char *c = "dirfile/c";
+  const char *d = "dirfile/d";
+  const char *e = "dirfile/e";
+  const char *f = "dirfile/f";
+  const char *g = "dirfile/g";
+  const char *h = "dirfile/h";
+  const char *i = "dirfile/i";
+  const char *j = "dirfile/j";
+  const char *k = "dirfile/k";
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE);
+  gd_add_raw(D, "d", GD_FLOAT64, 1, 0);
+  gd_add_raw(D, "b", GD_FLOAT64, 2, 0);
+  gd_add_raw(D, "h", GD_FLOAT64, 3, 0);
+  gd_add_raw(D, "e", GD_FLOAT64, 4, 0);
+  gd_add_raw(D, "g", GD_FLOAT64, 5, 0);
+  gd_add_raw(D, "c", GD_FLOAT64, 6, 0);
+  gd_add_raw(D, "k", GD_FLOAT64, 7, 0);
+  gd_add_raw(D, "a", GD_FLOAT64, 8, 0);
+  gd_add_raw(D, "f", GD_FLOAT64, 9, 0);
+  gd_add_raw(D, "i", GD_FLOAT64, 10, 0);
+  gd_add_raw(D, "j", GD_FLOAT64, 11, 0);
+
+  /* The idea here is that a field look-up will fail unless the library has
+   * added the field in the correct location */
+  CheckSPF(D, "a", 8);
+  CheckSPF(D, "b", 2);
+  CheckSPF(D, "c", 6);
+  CheckSPF(D, "d", 1);
+  CheckSPF(D, "e", 4);
+  CheckSPF(D, "f", 9);
+  CheckSPF(D, "g", 5);
+  CheckSPF(D, "h", 3);
+  CheckSPF(D, "i", 10);
+  CheckSPF(D, "j", 11);
+  CheckSPF(D, "k", 7);
+  gd_close(D);
+
+  unlink(k);
+  unlink(j);
+  unlink(i);
+  unlink(h);
+  unlink(g);
+  unlink(f);
+  unlink(e);
+  unlink(d);
+  unlink(c);
+  unlink(b);
+  unlink(a);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/add_spec.c b/test/add_spec.c
new file mode 100644
index 0000000..30cef8d
--- /dev/null
+++ b/test/add_spec.c
@@ -0,0 +1,68 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_spec(D, "data RAW UINT8 2", 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  if (unlink(data))
+    r = 1;
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_spec_directive.c b/test/add_spec_directive.c
new file mode 100644
index 0000000..c775c13
--- /dev/null
+++ b/test/add_spec_directive.c
@@ -0,0 +1,59 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/INCLUDE";
+  int error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_dirfile_standards(D, 7);
+  gd_add_spec(D, "INCLUDE RAW UINT8 2", 0);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  if (!unlink(data))
+    r = 1;
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 1);
+  CHECKI(error, GD_E_FORMAT);
+
+  return r;
+}
diff --git a/test/add_spec_invalid.c b/test/add_spec_invalid.c
new file mode 100644
index 0000000..755c948
--- /dev/null
+++ b/test/add_spec_invalid.c
@@ -0,0 +1,45 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_add_spec(D, "data RAW UINT8 2", 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/add_spec_meta.c b/test/add_spec_meta.c
new file mode 100644
index 0000000..24e8340
--- /dev/null
+++ b/test/add_spec_meta.c
@@ -0,0 +1,70 @@
+/* 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
+ */
+/* add a barth-style meta field with add_spec */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  gd_entry_t e;
+  unsigned char val;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_spec(D, "INDEX/meta CONST UINT8 2", 0);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  CHECKI(n, 1);
+
+  gd_entry(D, "INDEX/meta", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_get_constant(D, "INDEX/meta", GD_UINT8, &val);
+    CHECKI(val, 2);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/add_spec_resolv.c b/test/add_spec_resolv.c
new file mode 100644
index 0000000..c028be9
--- /dev/null
+++ b/test/add_spec_resolv.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, i, n, r = 0;
+  DIRFILE *D;
+  const char *target;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_alias(D, "alias", "data", 0);
+  gd_add_spec(D, "data RAW UINT8 1", 0);
+  error = gd_error(D);
+
+  /* check */
+  target = gd_alias_target(D, "alias");
+  CHECKS(target, "data");
+  i = gd_fragment_index(D, "alias");
+  n = gd_naliases(D, "alias");
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(i, 0);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/add_string.c b/test/add_string.c
new file mode 100644
index 0000000..b372406
--- /dev/null
+++ b/test/add_string.c
@@ -0,0 +1,67 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  char val[1000];
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_string(D, "data", "A string.", 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_STRING_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    gd_get_string(D, "data", 1000, val);
+    CHECKS(val, "A string.");
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_string_affix.c b/test/add_string_affix.c
new file mode 100644
index 0000000..02ead8e
--- /dev/null
+++ b/test/add_string_affix.c
@@ -0,0 +1,62 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  int fd, e1, e2, r = 0;
+  char val[1000];
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  close(open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  gd_add_string(D, "AdataZ", "A string.", 1);
+  e1 = gd_error(D);
+
+  /* check */
+  gd_get_string(D, "AdataZ", 1000, val);
+  e2 = gd_error(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKS(val, "A string.");
+
+  return r;
+}
diff --git a/test/add_type.c b/test/add_type.c
new file mode 100644
index 0000000..05135d7
--- /dev/null
+++ b/test/add_type.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, r = 0;
+  DIRFILE *D;
+
+  gd_entry_t E;
+  E.field =  "new";
+  E.field_type = GD_NO_ENTRY;
+  E.fragment_index = 0;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_add(D, &E);
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,1);
+  CHECKI(error, GD_E_BAD_ENTRY);
+  return r;
+}
diff --git a/test/add_window.c b/test/add_window.c
new file mode 100644
index 0000000..8f0c871
--- /dev/null
+++ b/test/add_window.c
@@ -0,0 +1,60 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  gd_triplet_t threshold;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  threshold.r = 3.4;
+  gd_add_window(D, "new", "in", "check", GD_WINDOP_GE, threshold, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_WINDOW_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKS(e.in_fields[1], "check");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(window,windop), GD_WINDOP_GE);
+    CHECKF(e.EN(window,threshold.r), 3.4);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/add_window_op.c b/test/add_window_op.c
new file mode 100644
index 0000000..515c244
--- /dev/null
+++ b/test/add_window_op.c
@@ -0,0 +1,54 @@
+/* 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 WINDOW 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";
+  int error, r = 0;
+  gd_triplet_t threshold;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  threshold.r = 3.4;
+  gd_add_window(D, "new", "in", "check", (gd_windop_t)-1, threshold, 0);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_ENTRY);
+
+  return r;
+}
diff --git a/test/alias_list.c b/test/alias_list.c
new file mode 100644
index 0000000..c7c3d62
--- /dev/null
+++ b/test/alias_list.c
@@ -0,0 +1,71 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "/ALIAS e f\n"
+    "/ALIAS a b\n"
+    "/ALIAS b d\n"
+    "/ALIAS c d\n"
+    "/ALIAS d f\n"
+    "f CONST UINT8 1\n";
+  int fd, e, i = 0, r = 0;
+  int x[256];
+  DIRFILE *D;
+  const char **al;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  memset(x, 0, 256 * sizeof(int));
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  al = gd_aliases(D, "f");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_OK);
+  CHECKPN(al);
+
+  if (!r)
+    for (i = 0; al[i]; ++i) {
+      CHECKUi(i, al[i][1], 0);
+      x[(int)(al[i][0])]++;
+    }
+
+  CHECKI(i, 6);
+  for (i = 0; i < 256; ++i)
+    CHECKIi(i, x[i], (i >= 'a' && i <= 'f') ? 1 : 0);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alias_list_alias.c b/test/alias_list_alias.c
new file mode 100644
index 0000000..55991e7
--- /dev/null
+++ b/test/alias_list_alias.c
@@ -0,0 +1,71 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "/ALIAS e f\n"
+    "/ALIAS a b\n"
+    "/ALIAS b d\n"
+    "/ALIAS c d\n"
+    "/ALIAS d f\n"
+    "f CONST UINT8 1\n";
+  int fd, e, i = 0, r = 0;
+  int x[256];
+  DIRFILE *D;
+  const char **al;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  memset(x, 0, 256 * sizeof(int));
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  al = gd_aliases(D, "a");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_OK);
+  CHECKPN(al);
+
+  if (!r)
+    for (i = 0; al[i]; ++i) {
+      CHECKUi(i, al[i][1], 0);
+      x[(int)(al[i][0])]++;
+    }
+
+  CHECKI(i, 6);
+  for (i = 0; i < 256; ++i)
+    CHECKIi(i, x[i], (i >= 'a' && i <= 'f') ? 1 : 0);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alias_list_missing.c b/test/alias_list_missing.c
new file mode 100644
index 0000000..4473365
--- /dev/null
+++ b/test/alias_list_missing.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "/ALIAS e f\n"
+    "/ALIAS a b\n"
+    "/ALIAS b d\n"
+    "/ALIAS c d\n"
+    "/ALIAS d f\n";
+  int fd, e, r = 0;
+  DIRFILE *D;
+  const char **al;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+
+  al = gd_aliases(D, "a");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_BAD_CODE);
+  CHECKP(al);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alias_num.c b/test/alias_num.c
new file mode 100644
index 0000000..24a9d01
--- /dev/null
+++ b/test/alias_num.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "/ALIAS e f\n"
+    "/ALIAS a b\n"
+    "/ALIAS b d\n"
+    "/ALIAS c d\n"
+    "/ALIAS d f\n"
+    "f CONST UINT8 1\n";
+  int fd, e, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_naliases(D, "f");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_OK);
+  CHECKI(n, 6);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alias_num_alias.c b/test/alias_num_alias.c
new file mode 100644
index 0000000..6bc4d55
--- /dev/null
+++ b/test/alias_num_alias.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "/ALIAS e f\n"
+    "/ALIAS a b\n"
+    "/ALIAS b d\n"
+    "/ALIAS c d\n"
+    "/ALIAS d f\n"
+    "f CONST UINT8 1\n";
+  int fd, e, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_naliases(D, "a");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_OK);
+  CHECKI(n, 6);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alias_num_missing.c b/test/alias_num_missing.c
new file mode 100644
index 0000000..a81f00e
--- /dev/null
+++ b/test/alias_num_missing.c
@@ -0,0 +1,56 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "/ALIAS e f\n"
+    "/ALIAS a b\n"
+    "/ALIAS b d\n"
+    "/ALIAS c d\n"
+    "/ALIAS d f\n";
+  int fd, e, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+
+  n = gd_naliases(D, "a");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_BAD_CODE);
+  CHECKI(n, -1);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alias_target.c b/test/alias_target.c
new file mode 100644
index 0000000..cb9ca02
--- /dev/null
+++ b/test/alias_target.c
@@ -0,0 +1,52 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/ALIAS alias target\ntarget CONST UINT8 1\n";
+  int fd, e, r = 0;
+  DIRFILE *D;
+  const char *t;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  t = gd_alias_target(D, "alias");
+  CHECKS(t, "target");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_OK);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alias_target_alias.c b/test/alias_target_alias.c
new file mode 100644
index 0000000..fc147bc
--- /dev/null
+++ b/test/alias_target_alias.c
@@ -0,0 +1,52 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/ALIAS alias target\n/ALIAS target next\n";
+  int fd, e, r = 0;
+  DIRFILE *D;
+  const char *t;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  t = gd_alias_target(D, "alias");
+  CHECKS(t, "target");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_OK);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alias_target_missing.c b/test/alias_target_missing.c
new file mode 100644
index 0000000..0a56170
--- /dev/null
+++ b/test/alias_target_missing.c
@@ -0,0 +1,52 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/ALIAS alias target\n";
+  int fd, e, r = 0;
+  DIRFILE *D;
+  const char *t;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  t = gd_alias_target(D, "alias");
+  CHECKS(t, "target");
+  e = gd_error(D);
+
+  CHECKI(e, GD_E_OK);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/alter_bit_bitnum.c b/test/alter_bit_bitnum.c
new file mode 100644
index 0000000..a6f457d
--- /dev/null
+++ b/test/alter_bit_bitnum.c
@@ -0,0 +1,77 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nbit BIT data 1 1\n";
+  unsigned char data_data[256];
+  unsigned char c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_bit(D, "bit", NULL, 2, 0);
+  error = gd_error(D);
+  n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i],((i & 4) != 0));
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_bit_numbits.c b/test/alter_bit_numbits.c
new file mode 100644
index 0000000..6ac9778
--- /dev/null
+++ b/test/alter_bit_numbits.c
@@ -0,0 +1,77 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nbit BIT data 1 1\n";
+  unsigned char data_data[256];
+  unsigned char c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_bit(D, "bit", NULL, -1, 2);
+  error = gd_error(D);
+  n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i / 2);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n, 8);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_carray_len.c b/test/alter_carray_len.c
new file mode 100644
index 0000000..8b1861b
--- /dev/null
+++ b/test/alter_carray_len.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "carray CARRAY FLOAT32 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n";
+  int fd, i, ret, error, n, r = 0;
+  size_t z;
+  DIRFILE *D;
+  double d[5];
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_carray(D, "carray", GD_NULL, 5);
+  error = gd_error(D);
+  z = gd_carray_len(D, "carray");
+  n = gd_get_carray(D, "carray", GD_FLOAT64, &d);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKU(z, 5);
+  for (i = 0; i < 5; ++i)
+    CHECKFi(i, d[i], 8.3 - i * 1.1);
+
+  return r;
+}
diff --git a/test/alter_carray_type.c b/test/alter_carray_type.c
new file mode 100644
index 0000000..914ba2d
--- /dev/null
+++ b/test/alter_carray_type.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "carray CARRAY FLOAT32 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n";
+  int fd, i, ret, error, n, r = 0;
+  size_t z;
+  DIRFILE *D;
+  double d[7];
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_carray(D, "carray", GD_UINT8, 0);
+  error = gd_error(D);
+  z = gd_carray_len(D, "carray");
+  n = gd_get_carray(D, "carray", GD_FLOAT64, &d);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKU(z, 7);
+  for (i = 0; i < 7; ++i)
+    CHECKFi(i, d[i], ((i > 3) ? 7. : 8.) - i);
+
+  return r;
+}
diff --git a/test/alter_const.c b/test/alter_const.c
new file mode 100644
index 0000000..58a52db
--- /dev/null
+++ b/test/alter_const.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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST FLOAT32 8.3\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  double d;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_const(D, "const", GD_UINT8);
+  error = gd_error(D);
+  n = gd_get_constant(D, "const", GD_FLOAT64, &d);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKF(d, 8.);
+
+  return r;
+}
diff --git a/test/alter_const_c2r.c b/test/alter_const_c2r.c
new file mode 100644
index 0000000..dda81ab
--- /dev/null
+++ b/test/alter_const_c2r.c
@@ -0,0 +1,65 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST COMPLEX128 8.3;9.4\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  double d;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_const(D, "const", GD_FLOAT64);
+  error = gd_error(D);
+  n = gd_get_constant(D, "const", GD_FLOAT64, &d);
+
+  gd_close(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
new file mode 100644
index 0000000..b3c2bd5
--- /dev/null
+++ b/test/alter_cpolynom.c
@@ -0,0 +1,94 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n"
+    "polynom POLYNOM data 1 2 1\n";
+  int32_t data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+  const double a[] = {2, 1, 1, 2, 1, 3};
+#else
+  double complex c[8];
+  const double complex a[] = {2 + _Complex_I * 1,
+    1 + _Complex_I * 2, 1 + _Complex_I * 3};
+#endif
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_cpolynom(D, "polynom", 0, NULL, a);
+  error = gd_error(D);
+  n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_COMPLEX128, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i) {
+    int x = i + 40;
+#ifdef GD_NO_C99_API
+    const double v[2] = {2 + x + x * x, 1 + 2 * x + 3 * x * x};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    const double complex v = (2 + _Complex_I * 1) + (1 + _Complex_I * 2) * x
+      + (1 + _Complex_I * 3) * x * x;
+    CHECKCi(i,c[i], v);
+#endif
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_crecip.c b/test/alter_crecip.c
new file mode 100644
index 0000000..e5490db
--- /dev/null
+++ b/test/alter_crecip.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "div RECIP data 230.\n";
+  int32_t data_data[256];
+  double c[8];
+#ifdef GD_NO_C99_API
+  double v[2] = {1093, 3290};
+#else
+  double complex v = 1093 + _Complex_I * 3290;
+#endif
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_crecip(D, "div", "phase", v);
+  error = gd_error(D);
+  n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], creal(v) / (i + 41.));
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_crecip89.c b/test/alter_crecip89.c
new file mode 100644
index 0000000..f10cf07
--- /dev/null
+++ b/test/alter_crecip89.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#define GD_C89_API
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "div RECIP data 230.\n";
+  int32_t data_data[256];
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  double div[2] = {1093., 3290.};
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_crecip(D, "div", "phase", div);
+  error = gd_error(D);
+  n = gd_entry(D, "div", &E);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,0);
+  CHECKI(ret,0);
+  CHECKF(E.EN(recip,cdividend)[0], div[0]);
+  CHECKF(E.EN(recip,cdividend)[1], div[1]);
+  CHECKS(E.in_fields[0], "phase");
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_crecip_zero.c b/test/alter_crecip_zero.c
new file mode 100644
index 0000000..1360596
--- /dev/null
+++ b/test/alter_crecip_zero.c
@@ -0,0 +1,78 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "div RECIP data 230.\n";
+  int32_t data_data[256];
+  double c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_crecip(D, "div", "phase", 0);
+  error = gd_error(D);
+  n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 230. / (i + 41.));
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_divide.c b/test/alter_divide.c
new file mode 100644
index 0000000..fcbffac
--- /dev/null
+++ b/test/alter_divide.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "div DIVIDE data data\n";
+  int32_t data_data[256];
+  double c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_divide(D, "div", NULL, "phase");
+  error = gd_error(D);
+  n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], (i + 40.) / (i + 41.));
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_entry.c b/test/alter_entry.c
new file mode 100644
index 0000000..ca27e51
--- /dev/null
+++ b/test/alter_entry.c
@@ -0,0 +1,78 @@
+/* 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 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 *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, error, r = 0;
+  off_t n;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "data", &E);
+  E.EN(raw,data_type) = GD_UINT16;
+  E.EN(raw,spf) = 11;
+  ret = gd_alter_entry(D, "data", &E, 0);
+  error = gd_error(D);
+  n = gd_nframes(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 11);
+  CHECKI(ret, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_affix.c b/test/alter_entry_affix.c
new file mode 100644
index 0000000..d9d312b
--- /dev/null
+++ b/test/alter_entry_affix.c
@@ -0,0 +1,75 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data = "/INCLUDE format1 A\n";
+  const char *format1_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, error, r = 0;
+  off_t n;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "Adata", &E);
+  E.EN(raw,data_type) = GD_UINT16;
+  E.EN(raw,spf) = 11;
+  ret = gd_alter_entry(D, "Adata", &E, 0);
+  error = gd_error(D);
+  n = gd_nframes(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 11);
+  CHECKI(ret, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_hidden.c b/test/alter_entry_hidden.c
new file mode 100644
index 0000000..9712f80
--- /dev/null
+++ b/test/alter_entry_hidden.c
@@ -0,0 +1,69 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, error, r = 0;
+  off_t n;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "data", &E);
+  E.hidden = 1;
+  ret = gd_alter_entry(D, "data", &E, 0);
+  error = gd_error(D);
+  n = gd_nfields(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 2);
+  CHECKI(ret, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_recode.c b/test/alter_entry_recode.c
new file mode 100644
index 0000000..fcb7da2
--- /dev/null
+++ b/test/alter_entry_recode.c
@@ -0,0 +1,94 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  uint16_t d;
+  int fd, i, ret, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "data", &E);
+  E.EN(raw,data_type) = GD_UINT16;
+  E.EN(raw,spf) = 11;
+  ret = gd_alter_entry(D, "data", &E, 1);
+  error = gd_error(D);
+  n = gd_nframes(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKXi(i, d, i * 8 / 11);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 32);
+  CHECKI(ret, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_scalar2a.c b/test/alter_entry_scalar2a.c
new file mode 100644
index 0000000..92dad32
--- /dev/null
+++ b/test/alter_entry_scalar2a.c
@@ -0,0 +1,72 @@
+/* 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
+ */
+/* 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 = "data BIT in c1 3\nc1 CONST INT64 3\n"
+    "c2 CONST INT64 11\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "data", &E);
+  free(E.scalar[0]);
+  E.scalar[0] = "c2";
+  ret = gd_alter_entry(D, "data", &E, 0);
+  error = gd_error(D);
+
+  E.scalar[0] = NULL;
+  gd_free_entry_strings(&E);
+  n = gd_entry(D, "data", &E);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKI(E.EN(bit,bitnum), 11);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_scalar2n.c b/test/alter_entry_scalar2n.c
new file mode 100644
index 0000000..674c087
--- /dev/null
+++ b/test/alter_entry_scalar2n.c
@@ -0,0 +1,80 @@
+/* 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
+ */
+/* 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 *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nconst CONST INT64 11\n";
+  unsigned char data_data[256];
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "data", &E);
+  E.scalar[0] = "const";
+  ret = gd_alter_entry(D, "data", &E, 0);
+  error = gd_error(D);
+
+  E.scalar[0] = NULL;
+  gd_free_entry_strings(&E);
+  n = gd_entry(D, "data", &E);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKI(E.EN(raw,spf), 11);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_scalar3.c b/test/alter_entry_scalar3.c
new file mode 100644
index 0000000..12b1362
--- /dev/null
+++ b/test/alter_entry_scalar3.c
@@ -0,0 +1,71 @@
+/* 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
+ */
+/* 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 = "data BIT in c1 3\nc1 CONST INT64 3\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "data", &E);
+  free(E.scalar[0]);
+  E.scalar[0] = NULL;
+  ret = gd_alter_entry(D, "data", &E, 0);
+  error = gd_error(D);
+
+  gd_free_entry_strings(&E);
+  n = gd_entry(D, "data", &E);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,0);
+  CHECKI(ret,0);
+  CHECKI(E.EN(bit,bitnum), 3);
+  CHECKP(E.scalar[0]);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_entry_scalar4.c b/test/alter_entry_scalar4.c
new file mode 100644
index 0000000..b85542c
--- /dev/null
+++ b/test/alter_entry_scalar4.c
@@ -0,0 +1,72 @@
+/* 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
+ */
+/* 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 = "data BIT in 3 c1\nc1 CONST INT64 3\n";
+  int fd, ret, error, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "data", &E);
+  free(E.scalar[1]);
+  E.scalar[1] = NULL;
+  E.EN(bit,numbits) = 11;
+  ret = gd_alter_entry(D, "data", &E, 0);
+  error = gd_error(D);
+
+  gd_free_entry_strings(&E);
+  n = gd_entry(D, "data", &E);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKI(E.EN(bit,numbits), 11);
+  CHECKP(E.scalar[1]);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_lincom_23.c b/test/alter_lincom_23.c
new file mode 100644
index 0000000..7e270c8
--- /dev/null
+++ b/test/alter_lincom_23.c
@@ -0,0 +1,81 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "lincom LINCOM 2 data 1 0 data 1 0\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+  const char *in_fields[3] = {"data", "phase", "data"};
+  const double m[3] = {1, 2, 3};
+  const double b[3] = {3, 0, 1};
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_lincom(D, "lincom", 3, in_fields, m, b);
+  error = gd_error(D);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], (40 + i) * 6 + 6);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_lincom_32.c b/test/alter_lincom_32.c
new file mode 100644
index 0000000..7e4ba2a
--- /dev/null
+++ b/test/alter_lincom_32.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "lincom LINCOM 3 data 1 3 phase 2 0 data 3 1\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+  const char *in_fields[2] = {"data", "phase"};
+  const double m[2] = {2, 4};
+  const double b[2] = {0, 2};
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_lincom(D, "lincom", 2, in_fields, m, b);
+  error = gd_error(D);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], (40 + i) * 6 + 6);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_lincom_affix.c b/test/alter_lincom_affix.c
new file mode 100644
index 0000000..4b32a8f
--- /dev/null
+++ b/test/alter_lincom_affix.c
@@ -0,0 +1,89 @@
+/* Copyright (C) 2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <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 *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data = "INCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "lincom LINCOM 2 data 1 0 data 1 0\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, e1, e2, n, r = 0;
+  DIRFILE *D;
+  const char *in_fields[3] = {"data", "phase", NULL};
+  const char *Ain_fieldsZ[3] = {"AdataZ", "AphaseZ", NULL};
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_alter_lincom(D, "AlincomZ", 0, in_fields, NULL, NULL);
+  e1 = gd_error(D);
+  gd_alter_lincom(D, "AlincomZ", 0, Ain_fieldsZ, NULL, NULL);
+  e2 = gd_error(D);
+  n = gd_getdata(D, "AlincomZ", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_discard(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i * 2 + 81);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_BAD_CODE);
+  CHECKI(e2, 0);
+  CHECKI(n, 8);
+
+  return r;
+}
diff --git a/test/alter_lincom_input.c b/test/alter_lincom_input.c
new file mode 100644
index 0000000..d117db9
--- /dev/null
+++ b/test/alter_lincom_input.c
@@ -0,0 +1,79 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "lincom LINCOM 2 data 1 0 data 1 0\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+  const char *in_fields[3] = {"data", "phase", NULL};
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_lincom(D, "lincom", 0, in_fields, NULL, NULL);
+  error = gd_error(D);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i * 2 + 81);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_lincom_offset.c b/test/alter_lincom_offset.c
new file mode 100644
index 0000000..87878b1
--- /dev/null
+++ b/test/alter_lincom_offset.c
@@ -0,0 +1,80 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "lincom LINCOM 2 data 1 0 data 1 0\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+  const char *in_fields[3] = {"data", "phase", NULL};
+  double b[3] = {2, 3, 0};
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_lincom(D, "lincom", 0, in_fields, NULL, b);
+  error = gd_error(D);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i * 2 + 86);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_lincom_slope.c b/test/alter_lincom_slope.c
new file mode 100644
index 0000000..a72de69
--- /dev/null
+++ b/test/alter_lincom_slope.c
@@ -0,0 +1,80 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "lincom LINCOM 2 data 1 0 data 1 0\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+  const char *in_fields[3] = {"data", "phase", NULL};
+  double m[3] = {2, 3, 0};
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_lincom(D, "lincom", 0, in_fields, m, NULL);
+  error = gd_error(D);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i * 5 + 203);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_linterp.c b/test/alter_linterp.c
new file mode 100644
index 0000000..bed7d48
--- /dev/null
+++ b/test/alter_linterp.c
@@ -0,0 +1,99 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *table = "dirfile/table";
+  const char *table1 = "dirfile/table1";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nlut LINTERP data table\n";
+  const char *tabledata = "0 0\n1000 5000\n";
+  const char *table1data = "0 0\n1000 10000\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  gd_entry_t e;
+  int fd, i, ret, error, error2, n, unlink_table, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, tabledata, strlen(tabledata));
+  close(fd);
+
+  fd = open(table1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, table1data, strlen(table1data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_linterp(D, "lut", NULL, "table1", 0);
+  error = gd_error(D);
+  gd_entry(D, "lut", &e);
+  error2 = gd_error(D);
+  n = gd_getdata(D, "lut", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink_table = unlink(table);
+  unlink(table1);
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], (i + 40) * 10);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(ret, 0);
+  CHECKI(unlink_table, 0);
+  CHECKI(error2, 0);
+  CHECKS(e.in_fields[0], "data");
+  CHECKS(e.EN(linterp,table), "table1");
+  gd_free_entry_strings(&e);
+
+  return r;
+}
diff --git a/test/alter_linterp_move.c b/test/alter_linterp_move.c
new file mode 100644
index 0000000..83d40f5
--- /dev/null
+++ b/test/alter_linterp_move.c
@@ -0,0 +1,92 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *table = "dirfile/table";
+  const char *table1 = "dirfile/table1";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nlut LINTERP data table\n";
+  const char *tabledata = "0 0\n1000 5000\n";
+  const char *table1data = "0 0\n1000 10000\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, unlink_table, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, tabledata, strlen(tabledata));
+  close(fd);
+
+  fd = open(table1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, table1data, strlen(table1data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_linterp(D, "lut", NULL, "table1", 1);
+  error = gd_error(D);
+  n = gd_getdata(D, "lut", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], (i + 40) * 5);
+
+  unlink(data);
+  unlink_table = unlink(table);
+  unlink(table1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+  CHECKI(unlink_table,-1);
+
+  return r;
+}
diff --git a/test/alter_mplex.c b/test/alter_mplex.c
new file mode 100644
index 0000000..a7e7860
--- /dev/null
+++ b/test/alter_mplex.c
@@ -0,0 +1,79 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n"
+    "mplex MPLEX data count 1 3\n";
+  unsigned char data_data[256];
+  unsigned char c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] %= 3;
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_mplex(D, "mplex", NULL, NULL, 2, -1);
+  error = gd_error(D);
+  n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 38 + 3 * ((i + 2) / 3));
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_mspec.c b/test/alter_mspec.c
new file mode 100644
index 0000000..c131ff6
--- /dev/null
+++ b/test/alter_mspec.c
@@ -0,0 +1,77 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nMETA data phase PHASE data 1\n";
+  unsigned char data_data[256];
+  unsigned char c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_malter_spec(D, "phase PHASE data 2", "data", 0);
+  error = gd_error(D);
+  n = gd_getdata(D, "data/phase", 5, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i + 42);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_mspec_affix.c b/test/alter_mspec_affix.c
new file mode 100644
index 0000000..3945c21
--- /dev/null
+++ b/test/alter_mspec_affix.c
@@ -0,0 +1,73 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 8\nMETA data phase PHASE data 1\n";
+  unsigned char data_data[256];
+  unsigned char c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_malter_spec(D, "phase PHASE data 2", "AdataZ", 0);
+  error = gd_error(D);
+  n = gd_getdata(D, "AdataZ/phase", 5, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i + 42);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_multiply.c b/test/alter_multiply.c
new file mode 100644
index 0000000..9854434
--- /dev/null
+++ b/test/alter_multiply.c
@@ -0,0 +1,78 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "mult MULTIPLY data data\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_multiply(D, "mult", NULL, "phase");
+  error = gd_error(D);
+  n = gd_getdata(D, "mult", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], (i + 40) * (i + 41));
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_phase.c b/test/alter_phase.c
new file mode 100644
index 0000000..82e873c
--- /dev/null
+++ b/test/alter_phase.c
@@ -0,0 +1,77 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nphase PHASE data 1\n";
+  unsigned char data_data[256];
+  unsigned char c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_phase(D, "phase", NULL, 2);
+  error = gd_error(D);
+  n = gd_getdata(D, "phase", 5, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i + 42);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_polynom_coeff.c b/test/alter_polynom_coeff.c
new file mode 100644
index 0000000..0c44125
--- /dev/null
+++ b/test/alter_polynom_coeff.c
@@ -0,0 +1,91 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n"
+    "polynom POLYNOM data 1 2 1\n";
+  int32_t data_data[256];
+  const double a[] = {2, 1, 3};
+  int fd, i, ret, error, n, error2, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_polynom(D, "polynom", 0, NULL, a);
+  error = gd_error(D);
+
+  CHECKI(error,0);
+
+  n = gd_entry(D, "polynom", &E);
+  error2 = gd_error(D);
+
+  gd_close(D);
+
+  CHECKS(E.field, "polynom");
+  CHECKI(E.field_type, GD_POLYNOM_ENTRY);
+  CHECKI(E.EN(polynom,poly_ord), 2);
+  CHECKI(E.comp_scal, 0);
+  CHECKS(E.in_fields[0], "data"); 
+
+  for (i = 0; i < 3; ++i) 
+    CHECKFi(i,E.EN(polynom,a)[i], a[i]);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error2,0);
+  CHECKI(n,0);
+  CHECKI(ret,0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_polynom_input.c b/test/alter_polynom_input.c
new file mode 100644
index 0000000..3278372
--- /dev/null
+++ b/test/alter_polynom_input.c
@@ -0,0 +1,80 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "polynom POLYNOM data 1 2 1\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_polynom(D, "polynom", 0, "phase", NULL);
+  error = gd_error(D);
+  n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i) {
+    const int x = i + 41;
+    CHECKIi(i,c[i], x * x + 2 * x + 1);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_polynom_ord.c b/test/alter_polynom_ord.c
new file mode 100644
index 0000000..e7628b0
--- /dev/null
+++ b/test/alter_polynom_ord.c
@@ -0,0 +1,80 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n"
+    "polynom POLYNOM data 1 2 1\n";
+  int32_t data_data[256];
+  int32_t c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_polynom(D, "polynom", 1, NULL, NULL);
+  error = gd_error(D);
+  n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_INT32, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i) {
+    int x = i + 40;
+    CHECKIi(i,c[i], 2 * x + 1);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_raw_spf.c b/test/alter_raw_spf.c
new file mode 100644
index 0000000..afa51ce
--- /dev/null
+++ b/test/alter_raw_spf.c
@@ -0,0 +1,89 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  uint8_t d;
+  int fd, i, ret, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_raw(D, "data", GD_NULL, 11, 1);
+  error = gd_error(D);
+  n = gd_nframes(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint8_t))) {
+      CHECKX(d, i * 8 / 11);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 32);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_raw_type.c b/test/alter_raw_type.c
new file mode 100644
index 0000000..193a73f
--- /dev/null
+++ b/test/alter_raw_type.c
@@ -0,0 +1,89 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  uint16_t d;
+  int fd, i, ret, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_raw(D, "data", GD_UINT16, 0, 1);
+  error = gd_error(D);
+  n = gd_nframes(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKX(d, i);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 32);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_recip.c b/test/alter_recip.c
new file mode 100644
index 0000000..113cfb1
--- /dev/null
+++ b/test/alter_recip.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "div RECIP data 230.\n";
+  int32_t data_data[256];
+  double c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_recip(D, "div", "phase", 1093.);
+  error = gd_error(D);
+  n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 1093. / (i + 41.));
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_recip_zero.c b/test/alter_recip_zero.c
new file mode 100644
index 0000000..159bd31
--- /dev/null
+++ b/test/alter_recip_zero.c
@@ -0,0 +1,78 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
+    "div RECIP data 230.\n";
+  int32_t data_data[256];
+  double c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int32_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_recip(D, "div", "phase", 0.);
+  error = gd_error(D);
+  n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 230. / (i + 41.));
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_scalar_affix.c b/test/alter_scalar_affix.c
new file mode 100644
index 0000000..eb92011
--- /dev/null
+++ b/test/alter_scalar_affix.c
@@ -0,0 +1,91 @@
+/* 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>
+#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 *data = "dirfile/data";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 8\nconst CONST INT64 11\n";
+  unsigned char data_data[256];
+  int fd, e1, e2, n, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_entry(D, "AdataZ", &E);
+  E.scalar[0] = "const";
+  gd_alter_entry(D, "AdataZ", &E, 0);
+  e1 = gd_error(D);
+
+  E.scalar[0] = "AconstZ";
+  gd_alter_entry(D, "AdataZ", &E, 0);
+  e2 = gd_error(D);
+
+  E.scalar[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  n = gd_entry(D, "AdataZ", &E);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_BAD_CODE);
+  CHECKI(e2, 0);
+  CHECKI(n, 0);
+  CHECKI(E.EN(raw,spf), 11);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/alter_spec.c b/test/alter_spec.c
new file mode 100644
index 0000000..c0c979b
--- /dev/null
+++ b/test/alter_spec.c
@@ -0,0 +1,89 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  uint8_t d;
+  int fd, i, ret, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_spec(D, "data RAW UINT8 11", 1);
+  error = gd_error(D);
+  n = gd_nframes(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint8_t))) {
+      CHECKX(d, i * 8 / 11);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,32);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_spec_affix.c b/test/alter_spec_affix.c
new file mode 100644
index 0000000..aba034c
--- /dev/null
+++ b/test/alter_spec_affix.c
@@ -0,0 +1,70 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 1\n";
+  unsigned char data_data[256];
+  int fd, ret, error, r = 0;
+  off64_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_spec(D, "AdataZ RAW UINT16 4\n", 0);
+  error = gd_error(D);
+  n = gd_nframes(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,256 / 2 / 4);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/alter_spec_meta.c b/test/alter_spec_meta.c
new file mode 100644
index 0000000..1a3f32d
--- /dev/null
+++ b/test/alter_spec_meta.c
@@ -0,0 +1,77 @@
+/* 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
+ */
+/* Test field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nMETA data phase PHASE data 1\n";
+  unsigned char data_data[256];
+  unsigned char c[8];
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_spec(D, "data/phase PHASE data 2", 0);
+  error = gd_error(D);
+  n = gd_getdata(D, "data/phase", 5, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], i + 42);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/alter_window.c b/test/alter_window.c
new file mode 100644
index 0000000..adc3c8c
--- /dev/null
+++ b/test/alter_window.c
@@ -0,0 +1,79 @@
+/* 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 field modifying */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nwindow WINDOW data data LT 44\n";
+  unsigned char data_data[256];
+  unsigned char c[8];
+  gd_triplet_t threshold;
+  int fd, i, ret, error, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  threshold.r = 43;
+  ret = gd_alter_window(D, "window", NULL, NULL, GD_WINDOP_GT, threshold);
+  error = gd_error(D);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], (i > 3) ? i + 40 : 0);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  CHECKI(ret,0);
+
+  return r;
+}
diff --git a/test/ascii_add.c b/test/ascii_add.c
new file mode 100644
index 0000000..0a756f3
--- /dev/null
+++ b/test/ascii_add.c
@@ -0,0 +1,69 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.txt";
+  gd_entry_t e;
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_TEXT_ENCODED);
+  gd_add_raw(D, "data", GD_UINT8, 2, 0);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  if (unlink(data)) {
+    perror("unlink");
+    r = 1;
+  }
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/ascii_get.c b/test/ascii_get.c
new file mode 100644
index 0000000..c96738d
--- /dev/null
+++ b/test/ascii_get.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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 UINT8 8\n";
+  unsigned char c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE* stream;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  stream = fopen(data, "w");
+  for (i = 0; i < 256; ++i)
+    fprintf(stream, "%i\n", i);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/ascii_get_get.c b/test/ascii_get_get.c
new file mode 100644
index 0000000..dded3ec
--- /dev/null
+++ b/test/ascii_get_get.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8], d[8];
+  int fd, i, n, error, n2, error2, r = 0;
+  DIRFILE *D;
+  FILE* stream;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  stream = fopen(data, "w");
+  for (i = 0; i < 256; ++i)
+    fprintf(stream, "%i\n", i);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
+  error2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(error2, 0);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKIi(i,c[i], 40 + i);
+    CHECKIi(i+8,d[i], 40 + i);
+  }
+
+  return r;
+}
diff --git a/test/ascii_nframes.c b/test/ascii_nframes.c
new file mode 100644
index 0000000..a3a8b08
--- /dev/null
+++ b/test/ascii_nframes.c
@@ -0,0 +1,67 @@
+/* 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 <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 1\n";
+  int i, r = 0;
+  FILE* stream;
+  size_t n, m;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  stream = fopen(data, "w");
+  for (i = 0; i < 256; ++i)
+    fprintf(stream, "%i\n", i);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_nframes(D);
+  m = gd_nframes(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 256);
+  CHECKI(m, 256);
+
+  return r;
+}
diff --git a/test/ascii_put.c b/test/ascii_put.c
new file mode 100644
index 0000000..4bdc6c2
--- /dev/null
+++ b/test/ascii_put.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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, error;
+  int fd, i, r = 0;
+  struct stat buf;
+  FILE* stream;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_TEXT_ENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  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);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  return r;
+}
diff --git a/test/bof.c b/test/bof.c
new file mode 100644
index 0000000..9a47fec
--- /dev/null
+++ b/test/bof.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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, "data");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 70);
+
+  return r;
+}
diff --git a/test/bof_lincom.c b/test/bof_lincom.c
new file mode 100644
index 0000000..4019260
--- /dev/null
+++ b/test/bof_lincom.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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 2\n"
+    "/FRAMEOFFSET 35\n"
+    "lincom LINCOM 2 data2 1. 0. data 1. 0.\n"
+    "lincom2 LINCOM 2 data 1. 0. data2 1. 0.\n"
+    "INCLUDE format1\n";
+  const char *format1_data = "data2 RAW UINT8 3\nFRAMEOFFSET 33\n";
+  int fd, error1, error2, error3, error4, r = 0;
+  off_t bof_data, bof_data2, bof_lincom, bof_lincom2;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  bof_data = gd_bof(D, "data");
+  error1 = gd_error(D);
+  bof_data2 = gd_bof(D, "data2");
+  error2 = gd_error(D);
+  bof_lincom = gd_bof(D, "lincom");
+  error3 = gd_error(D);
+  bof_lincom2 = gd_bof(D, "lincom2");
+  error4 = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(bof_data, 70);
+  CHECKI(error2, 0);
+  CHECKI(bof_data2, 99);
+  CHECKI(error3, 0);
+  CHECKI(bof_lincom, 105);
+  CHECKI(error4, 0);
+  CHECKI(bof_lincom2, 70);
+
+  return r;
+}
diff --git a/test/bof_phase.c b/test/bof_phase.c
new file mode 100644
index 0000000..ba6075b
--- /dev/null
+++ b/test/bof_phase.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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"
+    "lincom LINCOM 2 phase2 1. 0. phase 1. 0.\n"
+    "lincom2 LINCOM 2 phase 1. 0. phase2 1. 0.\n"
+    "INCLUDE format1\n";
+  const char *format1_data = "data2 RAW UINT8 3\n"
+    "FRAMEOFFSET 43\n"
+    "phase2 PHASE data2 -7\n";
+  int fd, error1, error2, error3, error4, r = 0;
+  off_t bof_phase, bof_phase2, bof_lincom, bof_lincom2;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  bof_phase = gd_bof(D, "phase");
+  error1 = gd_error(D);
+  bof_phase2 = gd_bof(D, "phase2");
+  error2 = gd_error(D);
+  bof_lincom = gd_bof(D, "lincom");
+  error3 = gd_error(D);
+  bof_lincom2 = gd_bof(D, "lincom2");
+  error4 = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(bof_phase, 172);
+  CHECKI(error2, 0);
+  CHECKI(bof_phase2, 136);
+  CHECKI(error3, 0);
+  CHECKI(bof_lincom, 136);
+  CHECKI(error4, 0);
+  CHECKI(bof_lincom2, 226);
+
+  return r;
+}
diff --git a/test/bzip_get.c b/test/bzip_get.c
new file mode 100644
index 0000000..cda0558
--- /dev/null
+++ b/test/bzip_get.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *bzip2data = "dirfile/data.bz2";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, i, 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", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(bzip2data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_BZIP2
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n,0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/bzip_get_get.c b/test/bzip_get_get.c
new file mode 100644
index 0000000..a5b311f
--- /dev/null
+++ b/test/bzip_get_get.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+#if !defined USE_BZIP2 || !defined TEST_BZIP2
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *gzipdata = "dirfile/data.bz2";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, 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", 5, 0, 1, 0, GD_UINT16, c1);
+  error1 = gd_error(D);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
+  error2 = gd_error(D);
+  gd_close(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKI(n1, 8);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKIi(i,c1[i], 40 + i);
+    CHECKIi(i,c2[i], 40 + i);
+  }
+
+  return r;
+#endif
+}
diff --git a/test/bzip_move_from.c b/test/bzip_move_from.c
new file mode 100644
index 0000000..e073f93
--- /dev/null
+++ b/test/bzip_move_from.c
@@ -0,0 +1,126 @@
+/* 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>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *bz2data = "dirfile/data.bz2";
+  const char *format_data =
+    "/INCLUDE format1\ndata RAW UINT16 11\nENCODING bzip2\n";
+  const char *format1_data = "ENCODING none\n";
+  uint16_t data_data[128];
+  int fd, ret, error, ge_ret, unlink_data, unlink_bz2data, r = 0, i = 0;
+  char command[4096];
+  gd_entry_t E;
+  DIRFILE *D;
+  uint16_t d;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = fd * 0x201;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE | GD_UNENCODED);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+#endif
+  ret = gd_move(D, "data", 1, 1);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+#ifdef USE_BZIP2
+  fd = open(data, O_RDONLY | O_BINARY);
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKI(d, i * 0x201);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+#endif
+
+  unlink(format1);
+  unlink(format);
+  unlink_data = unlink(data);
+  unlink_bz2data = unlink(bz2data);
+  rmdir(filedir);
+
+#ifdef USE_BZIP2
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_bz2data, -1);
+#else
+  CHECKI(ret, -1);
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 0);
+  CHECKI(unlink_data, -1);
+  CHECKI(unlink_bz2data, 0);
+#endif
+  gd_free_entry_strings(&E);
+
+  return r;
+#endif
+}
diff --git a/test/bzip_nframes.c b/test/bzip_nframes.c
new file mode 100644
index 0000000..a45688c
--- /dev/null
+++ b/test/bzip_nframes.c
@@ -0,0 +1,92 @@
+/* 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 <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_BZIP2
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *gzipdata = "dirfile/data.bz2";
+  const char *format_data = "data RAW UINT16 1\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int i, error, r = 0;
+  size_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (uint16_t)i;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256 * sizeof(uint16_t));
+  close(i);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data);
+  if (gd_system(command)) {
+    perror(BZIP2);
+    r = 1;
+  }
+
+#ifdef USE_BZIP2
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_BZIP2
+  CHECKI(error, 0);
+  CHECKI(n, 256);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/close.c b/test/close.c
new file mode 100644
index 0000000..3560d56
--- /dev/null
+++ b/test/close.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Closing a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <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_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/close_bad.c b/test/close_bad.c
new file mode 100644
index 0000000..f0a9ede
--- /dev/null
+++ b/test/close_bad.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Closing an invalid dirfile should succeed cleanly */
+#include "test.h"
+
+int main(void)
+{
+  DIRFILE *D = gd_open("a non_existant dirfile", 0);
+  int r = 0;
+
+  int ret = gd_close(D);
+
+  CHECKI(ret, 0);
+  return r;
+}
diff --git a/test/close_discard.c b/test/close_discard.c
new file mode 100644
index 0000000..0deaf91
--- /dev/null
+++ b/test/close_discard.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Closing a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int ret, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  gd_add_spec(D, "data RAW UINT8 1", 0);
+  ret = gd_discard(D);
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_nfields(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(n, 1);
+
+  return r;
+}
diff --git a/test/close_null.c b/test/close_null.c
new file mode 100644
index 0000000..9ef6835
--- /dev/null
+++ b/test/close_null.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Passing NULL to dirfile_close should succeed cleanly */
+#include "test.h"
+
+int main(void)
+{
+  int r = 0;
+  int ret = gd_close(NULL);
+
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/convert_complex128_complex64.c b/test/convert_complex128_complex64.c
new file mode 100644
index 0000000..2ad1ad1
--- /dev/null
+++ b/test/convert_complex128_complex64.c
@@ -0,0 +1,92 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[512];
+  float c[16];
+#else
+  double complex  data_data[256];
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[2 * fd] = data_data[2 * fd + 1] =  fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 40 + i};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], (40 + i) * (1 + _Complex_I));
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_complex128_float64.c b/test/convert_complex128_float64.c
new file mode 100644
index 0000000..8fed12e
--- /dev/null
+++ b/test/convert_complex128_float64.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data CONST FLOAT64 0\n";
+  double c = 0;
+#ifdef GD_NO_C99_API
+  double d[] = {8, 0};
+#else
+  double complex d = 8;
+#endif
+  int fd, n1, n2, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+#ifdef GD_NO_C99_API
+  n1 = gd_put_constant(D, "data", GD_COMPLEX128, d);
+#else
+  n1 = gd_put_constant(D, "data", GD_COMPLEX128, &d);
+#endif
+  n2 = gd_get_constant(D, "data", GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n1, 0);
+  CHECKI(n2, 0);
+  CHECKF(c, 8.);
+
+  return r;
+}
diff --git a/test/convert_complex128_int64.c b/test/convert_complex128_int64.c
new file mode 100644
index 0000000..5593cb0
--- /dev/null
+++ b/test/convert_complex128_int64.c
@@ -0,0 +1,73 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data CONST INT64 0\n";
+  int64_t c = 0;
+#ifdef GD_NO_C99_API
+  double d[] = {8, 0};
+#else
+  double complex d = 8;
+#endif
+  int fd, n1, n2, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+#ifdef GD_NO_C99_API
+  n1 = gd_put_constant(D, "data", GD_COMPLEX128, d);
+#else
+  n1 = gd_put_constant(D, "data", GD_COMPLEX128, &d);
+#endif
+  n2 = gd_get_constant(D, "data", GD_INT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n1, 0);
+  CHECKI(n2, 0);
+  CHECKI(c, 8);
+
+  return r;
+}
diff --git a/test/convert_complex128_uint64.c b/test/convert_complex128_uint64.c
new file mode 100644
index 0000000..c28e6fe
--- /dev/null
+++ b/test/convert_complex128_uint64.c
@@ -0,0 +1,73 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data CONST UINT64 0\n";
+  uint64_t c = 0;
+#ifdef GD_NO_C99_API
+  double d[] = {8, 0};
+#else
+  double complex d = 8;
+#endif
+  int fd, n1, n2, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+#ifdef GD_NO_C99_API
+  n1 = gd_put_constant(D, "data", GD_COMPLEX128, d);
+#else
+  n1 = gd_put_constant(D, "data", GD_COMPLEX128, &d);
+#endif
+  n2 = gd_get_constant(D, "data", GD_UINT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n1, 0);
+  CHECKI(n2, 0);
+  CHECKU(c, 8);
+
+  return r;
+}
diff --git a/test/convert_complex64_complex128.c b/test/convert_complex64_complex128.c
new file mode 100644
index 0000000..1992383
--- /dev/null
+++ b/test/convert_complex64_complex128.c
@@ -0,0 +1,91 @@
+/* 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
+ */
+/* Attempt to read COMPLEX64 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 8\n";
+#ifdef GD_NO_C99_API
+  float data_data[512];
+  double c[16];
+#else
+  float complex  data_data[256];
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[2 * fd] = data_data[2 * fd + 1] = (float)fd;
+#else
+    data_data[fd] = (float complex)fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 40 + i};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], (40 + i) * (1 + _Complex_I));
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_complex64_float64.c b/test/convert_complex64_float64.c
new file mode 100644
index 0000000..a084481
--- /dev/null
+++ b/test/convert_complex64_float64.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Attempt to read COMPLEX64 as FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data CONST FLOAT64 0\n";
+  double c = 0;
+#ifdef GD_NO_C99_API
+  float d[] = {8, 0};
+#else
+  float complex d = 8;
+#endif
+  int fd, n1, n2, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+#ifdef GD_NO_C99_API
+  n1 = gd_put_constant(D, "data", GD_COMPLEX64, d);
+#else
+  n1 = gd_put_constant(D, "data", GD_COMPLEX64, &d);
+#endif
+  n2 = gd_get_constant(D, "data", GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n1, 0);
+  CHECKI(n2, 0);
+  CHECKF(c, 8.);
+
+  return r;
+}
diff --git a/test/convert_complex64_int64.c b/test/convert_complex64_int64.c
new file mode 100644
index 0000000..ba087cd
--- /dev/null
+++ b/test/convert_complex64_int64.c
@@ -0,0 +1,73 @@
+/* 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
+ */
+/* Attempt to read COMPLEX64 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data CONST INT64 0\n";
+  int64_t c = 0;
+#ifdef GD_NO_C99_API
+  float d[] = {8, 0};
+#else
+  float complex d = 8;
+#endif
+  int fd, n1, n2, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+#ifdef GD_NO_C99_API
+  n1 = gd_put_constant(D, "data", GD_COMPLEX64, d);
+#else
+  n1 = gd_put_constant(D, "data", GD_COMPLEX64, &d);
+#endif
+  n2 = gd_get_constant(D, "data", GD_INT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n1, 0);
+  CHECKI(n2, 0);
+  CHECKI(c, 8);
+
+  return r;
+}
diff --git a/test/convert_complex64_uint64.c b/test/convert_complex64_uint64.c
new file mode 100644
index 0000000..e749544
--- /dev/null
+++ b/test/convert_complex64_uint64.c
@@ -0,0 +1,73 @@
+/* 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
+ */
+/* Attempt to read COMPLEX64 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data CONST UINT64 0\n";
+  uint64_t c = 0;
+#ifdef GD_NO_C99_API
+  float d[] = {8, 0};
+#else
+  float complex d = 8;
+#endif
+  int fd, error, n1, n2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+#ifdef GD_NO_C99_API
+  n1 = gd_put_constant(D, "data", GD_COMPLEX64, d);
+#else
+  n1 = gd_put_constant(D, "data", GD_COMPLEX64, &d);
+#endif
+  n2 = gd_get_constant(D, "data", GD_UINT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n1, 0);
+  CHECKI(n2, 0);
+  CHECKU(c, 8);
+
+  return r;
+}
diff --git a/test/convert_float32_complex128.c b/test/convert_float32_complex128.c
new file mode 100644
index 0000000..b515d78
--- /dev/null
+++ b/test/convert_float32_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read FLOAT32 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_float32_complex64.c b/test/convert_float32_complex64.c
new file mode 100644
index 0000000..43bd1ee
--- /dev/null
+++ b/test/convert_float32_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read FLOAT32 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float data_data[256];
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_float32_float64.c b/test/convert_float32_float64.c
new file mode 100644
index 0000000..6d40682
--- /dev/null
+++ b/test/convert_float32_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  double c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40. + i);
+
+  return r;
+}
diff --git a/test/convert_float32_int16.c b/test/convert_float32_int16.c
new file mode 100644
index 0000000..49296b8
--- /dev/null
+++ b/test/convert_float32_int16.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  int16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float32_int32.c b/test/convert_float32_int32.c
new file mode 100644
index 0000000..1416b2c
--- /dev/null
+++ b/test/convert_float32_int32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  int32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float32_int64.c b/test/convert_float32_int64.c
new file mode 100644
index 0000000..fe1af6b
--- /dev/null
+++ b/test/convert_float32_int64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  int64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float32_int8.c b/test/convert_float32_int8.c
new file mode 100644
index 0000000..030cec1
--- /dev/null
+++ b/test/convert_float32_int8.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float32_uint16.c b/test/convert_float32_uint16.c
new file mode 100644
index 0000000..7d1cd74
--- /dev/null
+++ b/test/convert_float32_uint16.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  uint16_t c[8], i;
+  int fd, error, n, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float32_uint32.c b/test/convert_float32_uint32.c
new file mode 100644
index 0000000..71244b8
--- /dev/null
+++ b/test/convert_float32_uint32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  uint32_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float32_uint64.c b/test/convert_float32_uint64.c
new file mode 100644
index 0000000..6bbc08a
--- /dev/null
+++ b/test/convert_float32_uint64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  uint64_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float32_uint8.c b/test/convert_float32_uint8.c
new file mode 100644
index 0000000..6652fde
--- /dev/null
+++ b/test/convert_float32_uint8.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float  data_data[256];
+  uint8_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (float)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float64_complex128.c b/test/convert_float64_complex128.c
new file mode 100644
index 0000000..5576028
--- /dev/null
+++ b/test/convert_float64_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read FLOAT64 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_float64_complex64.c b/test/convert_float64_complex64.c
new file mode 100644
index 0000000..99d5ef5
--- /dev/null
+++ b/test/convert_float64_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read FLOAT64 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double data_data[256];
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_float64_float32.c b/test/convert_float64_float32.c
new file mode 100644
index 0000000..6986a01
--- /dev/null
+++ b/test/convert_float64_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double  data_data[256];
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40. + i);
+
+  return r;
+}
diff --git a/test/convert_float64_int16.c b/test/convert_float64_int16.c
new file mode 100644
index 0000000..5e7bcdf
--- /dev/null
+++ b/test/convert_float64_int16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double  data_data[256];
+  int16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float64_int32.c b/test/convert_float64_int32.c
new file mode 100644
index 0000000..909dd40
--- /dev/null
+++ b/test/convert_float64_int32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double  data_data[256];
+  int32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float64_int64.c b/test/convert_float64_int64.c
new file mode 100644
index 0000000..59a84c8
--- /dev/null
+++ b/test/convert_float64_int64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double  data_data[256];
+  uint64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float64_int8.c b/test/convert_float64_int8.c
new file mode 100644
index 0000000..7657f06
--- /dev/null
+++ b/test/convert_float64_int8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double data_data[256];
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float64_uint16.c b/test/convert_float64_uint16.c
new file mode 100644
index 0000000..beaf983
--- /dev/null
+++ b/test/convert_float64_uint16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double data_data[256];
+  uint16_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float64_uint32.c b/test/convert_float64_uint32.c
new file mode 100644
index 0000000..9df3d8d
--- /dev/null
+++ b/test/convert_float64_uint32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double  data_data[256];
+  uint32_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float64_uint64.c b/test/convert_float64_uint64.c
new file mode 100644
index 0000000..173ffc5
--- /dev/null
+++ b/test/convert_float64_uint64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double  data_data[256];
+  uint64_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_float64_uint8.c b/test/convert_float64_uint8.c
new file mode 100644
index 0000000..7785fc8
--- /dev/null
+++ b/test/convert_float64_uint8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double data_data[256];
+  uint8_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int16_complex128.c b/test/convert_int16_complex128.c
new file mode 100644
index 0000000..d9562b2
--- /dev/null
+++ b/test/convert_int16_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read INT16 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t  data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_int16_complex64.c b/test/convert_int16_complex64.c
new file mode 100644
index 0000000..f00a3ce
--- /dev/null
+++ b/test/convert_int16_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read INT16 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t data_data[256];
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_int16_float32.c b/test/convert_int16_float32.c
new file mode 100644
index 0000000..70c3124
--- /dev/null
+++ b/test/convert_int16_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t  data_data[256];
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40. + i);
+
+  return r;
+}
diff --git a/test/convert_int16_float64.c b/test/convert_int16_float64.c
new file mode 100644
index 0000000..fb32a2c
--- /dev/null
+++ b/test/convert_int16_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t data_data[256];
+  double c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40. + i);
+
+  return r;
+}
diff --git a/test/convert_int16_int32.c b/test/convert_int16_int32.c
new file mode 100644
index 0000000..81fdb76
--- /dev/null
+++ b/test/convert_int16_int32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t data_data[256];
+  int32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int16_int64.c b/test/convert_int16_int64.c
new file mode 100644
index 0000000..41a5ced
--- /dev/null
+++ b/test/convert_int16_int64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t  data_data[256];
+  int64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int16_int8.c b/test/convert_int16_int8.c
new file mode 100644
index 0000000..574ccb7
--- /dev/null
+++ b/test/convert_int16_int8.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t  data_data[256];
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int16_uint16.c b/test/convert_int16_uint16.c
new file mode 100644
index 0000000..d3cc2f5
--- /dev/null
+++ b/test/convert_int16_uint16.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t  data_data[256];
+  uint16_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int16_uint32.c b/test/convert_int16_uint32.c
new file mode 100644
index 0000000..678e647
--- /dev/null
+++ b/test/convert_int16_uint32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t  data_data[256];
+  uint32_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int16_uint64.c b/test/convert_int16_uint64.c
new file mode 100644
index 0000000..76f4233
--- /dev/null
+++ b/test/convert_int16_uint64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t  data_data[256];
+  uint64_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int16_uint8.c b/test/convert_int16_uint8.c
new file mode 100644
index 0000000..31a65f9
--- /dev/null
+++ b/test/convert_int16_uint8.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t  data_data[256];
+  uint8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int32_complex128.c b/test/convert_int32_complex128.c
new file mode 100644
index 0000000..2c221e5
--- /dev/null
+++ b/test/convert_int32_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read INT32 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_int32_complex64.c b/test/convert_int32_complex64.c
new file mode 100644
index 0000000..44e9ee0
--- /dev/null
+++ b/test/convert_int32_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read INT32 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t  data_data[256];
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_int32_float32.c b/test/convert_int32_float32.c
new file mode 100644
index 0000000..fb891cb
--- /dev/null
+++ b/test/convert_int32_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t  data_data[256];
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40. + i);
+
+  return r;
+}
diff --git a/test/convert_int32_float64.c b/test/convert_int32_float64.c
new file mode 100644
index 0000000..1df0ede
--- /dev/null
+++ b/test/convert_int32_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t  data_data[256];
+  double c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40. + i);
+
+  return r;
+}
diff --git a/test/convert_int32_int16.c b/test/convert_int32_int16.c
new file mode 100644
index 0000000..b63131a
--- /dev/null
+++ b/test/convert_int32_int16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t  data_data[256];
+  int16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int32_int64.c b/test/convert_int32_int64.c
new file mode 100644
index 0000000..57d36dd
--- /dev/null
+++ b/test/convert_int32_int64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t  data_data[256];
+  int64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int32_int8.c b/test/convert_int32_int8.c
new file mode 100644
index 0000000..1610c25
--- /dev/null
+++ b/test/convert_int32_int8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t  data_data[256];
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int32_uint16.c b/test/convert_int32_uint16.c
new file mode 100644
index 0000000..9790ff1
--- /dev/null
+++ b/test/convert_int32_uint16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t data_data[256];
+  uint16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int32_uint32.c b/test/convert_int32_uint32.c
new file mode 100644
index 0000000..433da6a
--- /dev/null
+++ b/test/convert_int32_uint32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t data_data[256];
+  uint32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_int32_uint64.c b/test/convert_int32_uint64.c
new file mode 100644
index 0000000..dc53606
--- /dev/null
+++ b/test/convert_int32_uint64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t data_data[256];
+  uint64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_int32_uint8.c b/test/convert_int32_uint8.c
new file mode 100644
index 0000000..345eae3
--- /dev/null
+++ b/test/convert_int32_uint8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t data_data[256];
+  uint8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int64_complex128.c b/test/convert_int64_complex128.c
new file mode 100644
index 0000000..9408b4f
--- /dev/null
+++ b/test/convert_int64_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read INT64 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_int64_complex64.c b/test/convert_int64_complex64.c
new file mode 100644
index 0000000..0828bcb
--- /dev/null
+++ b/test/convert_int64_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read INT64 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t data_data[256];
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_int64_float32.c b/test/convert_int64_float32.c
new file mode 100644
index 0000000..05729cb
--- /dev/null
+++ b/test/convert_int64_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t  data_data[256];
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40. + i);
+
+  return r;
+}
diff --git a/test/convert_int64_float64.c b/test/convert_int64_float64.c
new file mode 100644
index 0000000..99ac47f
--- /dev/null
+++ b/test/convert_int64_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t  data_data[256];
+  double c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40. + i);
+
+  return r;
+}
diff --git a/test/convert_int64_int16.c b/test/convert_int64_int16.c
new file mode 100644
index 0000000..1b02322
--- /dev/null
+++ b/test/convert_int64_int16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t  data_data[256];
+  int16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int64_int32.c b/test/convert_int64_int32.c
new file mode 100644
index 0000000..09a0616
--- /dev/null
+++ b/test/convert_int64_int32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t  data_data[256];
+  int32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int64_int8.c b/test/convert_int64_int8.c
new file mode 100644
index 0000000..863917d
--- /dev/null
+++ b/test/convert_int64_int8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t  data_data[256];
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int64_uint16.c b/test/convert_int64_uint16.c
new file mode 100644
index 0000000..d94af54
--- /dev/null
+++ b/test/convert_int64_uint16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t data_data[256];
+  uint16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int64_uint32.c b/test/convert_int64_uint32.c
new file mode 100644
index 0000000..a0bef2b
--- /dev/null
+++ b/test/convert_int64_uint32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t data_data[256];
+  uint32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_int64_uint64.c b/test/convert_int64_uint64.c
new file mode 100644
index 0000000..8f38764
--- /dev/null
+++ b/test/convert_int64_uint64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t data_data[256];
+  uint64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_int64_uint8.c b/test/convert_int64_uint8.c
new file mode 100644
index 0000000..246ae3c
--- /dev/null
+++ b/test/convert_int64_uint8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t data_data[256];
+  uint8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int8_complex128.c b/test/convert_int8_complex128.c
new file mode 100644
index 0000000..041d0af
--- /dev/null
+++ b/test/convert_int8_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read INT8 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_int8_complex64.c b/test/convert_int8_complex64.c
new file mode 100644
index 0000000..a77049b
--- /dev/null
+++ b/test/convert_int8_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read INT8 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_int8_float32.c b/test/convert_int8_float32.c
new file mode 100644
index 0000000..fa1b7f6
--- /dev/null
+++ b/test/convert_int8_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  float c[8];
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int8_float64.c b/test/convert_int8_float64.c
new file mode 100644
index 0000000..b11420e
--- /dev/null
+++ b/test/convert_int8_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  double c[8];
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int8_int16.c b/test/convert_int8_int16.c
new file mode 100644
index 0000000..8c0bc6e
--- /dev/null
+++ b/test/convert_int8_int16.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  int16_t c[8];
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int8_int32.c b/test/convert_int8_int32.c
new file mode 100644
index 0000000..34993b8
--- /dev/null
+++ b/test/convert_int8_int32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  int32_t c[8];
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int8_int64.c b/test/convert_int8_int64.c
new file mode 100644
index 0000000..19112cc
--- /dev/null
+++ b/test/convert_int8_int64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  int64_t c[8];
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int8_uint16.c b/test/convert_int8_uint16.c
new file mode 100644
index 0000000..6c6b93a
--- /dev/null
+++ b/test/convert_int8_uint16.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  uint16_t c[8];
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int8_uint32.c b/test/convert_int8_uint32.c
new file mode 100644
index 0000000..22efe90
--- /dev/null
+++ b/test/convert_int8_uint32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  uint32_t c[8];
+  int8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_int8_uint64.c b/test/convert_int8_uint64.c
new file mode 100644
index 0000000..26445c7
--- /dev/null
+++ b/test/convert_int8_uint64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  uint64_t c[8], i;
+  int8_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_int8_uint8.c b/test/convert_int8_uint8.c
new file mode 100644
index 0000000..326d546
--- /dev/null
+++ b/test/convert_int8_uint8.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  uint8_t c[8], i;
+  int8_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (int8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint16_complex128.c b/test/convert_uint16_complex128.c
new file mode 100644
index 0000000..178ec27
--- /dev/null
+++ b/test/convert_uint16_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read UINT16 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_uint16_complex64.c b/test/convert_uint16_complex64.c
new file mode 100644
index 0000000..c3dcedc
--- /dev/null
+++ b/test/convert_uint16_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read UINT16 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_uint16_float32.c b/test/convert_uint16_float32.c
new file mode 100644
index 0000000..ee3cee9
--- /dev/null
+++ b/test/convert_uint16_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint16_float64.c b/test/convert_uint16_float64.c
new file mode 100644
index 0000000..0731c7d
--- /dev/null
+++ b/test/convert_uint16_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  double c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint16_int16.c b/test/convert_uint16_int16.c
new file mode 100644
index 0000000..e28eb72
--- /dev/null
+++ b/test/convert_uint16_int16.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  int16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint16_int32.c b/test/convert_uint16_int32.c
new file mode 100644
index 0000000..147ccc5
--- /dev/null
+++ b/test/convert_uint16_int32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  int32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint16_int64.c b/test/convert_uint16_int64.c
new file mode 100644
index 0000000..4811ce0
--- /dev/null
+++ b/test/convert_uint16_int64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  int64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint16_int8.c b/test/convert_uint16_int8.c
new file mode 100644
index 0000000..f2376ba
--- /dev/null
+++ b/test/convert_uint16_int8.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint16_uint32.c b/test/convert_uint16_uint32.c
new file mode 100644
index 0000000..aca283c
--- /dev/null
+++ b/test/convert_uint16_uint32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  uint32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_uint16_uint64.c b/test/convert_uint16_uint64.c
new file mode 100644
index 0000000..0b2c6d2
--- /dev/null
+++ b/test/convert_uint16_uint64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  uint64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_uint16_uint8.c b/test/convert_uint16_uint8.c
new file mode 100644
index 0000000..294ba5c
--- /dev/null
+++ b/test/convert_uint16_uint8.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t  data_data[256];
+  uint8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint32_complex128.c b/test/convert_uint32_complex128.c
new file mode 100644
index 0000000..8861fdf
--- /dev/null
+++ b/test/convert_uint32_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read UINT32 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_uint32_complex64.c b/test/convert_uint32_complex64.c
new file mode 100644
index 0000000..6749c2a
--- /dev/null
+++ b/test/convert_uint32_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read UINT32 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_uint32_float32.c b/test/convert_uint32_float32.c
new file mode 100644
index 0000000..a6ee729
--- /dev/null
+++ b/test/convert_uint32_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint32_float64.c b/test/convert_uint32_float64.c
new file mode 100644
index 0000000..056d90e
--- /dev/null
+++ b/test/convert_uint32_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  double c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint32_int16.c b/test/convert_uint32_int16.c
new file mode 100644
index 0000000..b0f288a
--- /dev/null
+++ b/test/convert_uint32_int16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  int16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint32_int32.c b/test/convert_uint32_int32.c
new file mode 100644
index 0000000..b0762f2
--- /dev/null
+++ b/test/convert_uint32_int32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  int32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint32_int64.c b/test/convert_uint32_int64.c
new file mode 100644
index 0000000..165540f
--- /dev/null
+++ b/test/convert_uint32_int64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  int64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint32_int8.c b/test/convert_uint32_int8.c
new file mode 100644
index 0000000..072d48e
--- /dev/null
+++ b/test/convert_uint32_int8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint32_uint16.c b/test/convert_uint32_uint16.c
new file mode 100644
index 0000000..7b746f6
--- /dev/null
+++ b/test/convert_uint32_uint16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  uint16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint32_uint64.c b/test/convert_uint32_uint64.c
new file mode 100644
index 0000000..073836e
--- /dev/null
+++ b/test/convert_uint32_uint64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  uint64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_uint32_uint8.c b/test/convert_uint32_uint8.c
new file mode 100644
index 0000000..b1d8112
--- /dev/null
+++ b/test/convert_uint32_uint8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t  data_data[256];
+  uint8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint64_complex128.c b/test/convert_uint64_complex128.c
new file mode 100644
index 0000000..8c3deb0
--- /dev/null
+++ b/test/convert_uint64_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read UINT64 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_uint64_complex64.c b/test/convert_uint64_complex64.c
new file mode 100644
index 0000000..dc4e06a
--- /dev/null
+++ b/test/convert_uint64_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read UINT64 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_uint64_float32.c b/test/convert_uint64_float32.c
new file mode 100644
index 0000000..83a60a4
--- /dev/null
+++ b/test/convert_uint64_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint64_float64.c b/test/convert_uint64_float64.c
new file mode 100644
index 0000000..6c7480e
--- /dev/null
+++ b/test/convert_uint64_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  double c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint64_int16.c b/test/convert_uint64_int16.c
new file mode 100644
index 0000000..a18a32a
--- /dev/null
+++ b/test/convert_uint64_int16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  int16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint64_int32.c b/test/convert_uint64_int32.c
new file mode 100644
index 0000000..cf3c960
--- /dev/null
+++ b/test/convert_uint64_int32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  int32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint64_int64.c b/test/convert_uint64_int64.c
new file mode 100644
index 0000000..696f92e
--- /dev/null
+++ b/test/convert_uint64_int64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  int64_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint64_int8.c b/test/convert_uint64_int8.c
new file mode 100644
index 0000000..9f1039c
--- /dev/null
+++ b/test/convert_uint64_int8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint64_uint16.c b/test/convert_uint64_uint16.c
new file mode 100644
index 0000000..fd70f38
--- /dev/null
+++ b/test/convert_uint64_uint16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  uint16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_uint64_uint32.c b/test/convert_uint64_uint32.c
new file mode 100644
index 0000000..d01edf8
--- /dev/null
+++ b/test/convert_uint64_uint32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  uint32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_uint64_uint8.c b/test/convert_uint64_uint8.c
new file mode 100644
index 0000000..2d2aa9d
--- /dev/null
+++ b/test/convert_uint64_uint8.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t  data_data[256];
+  uint8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint8_complex128.c b/test/convert_uint8_complex128.c
new file mode 100644
index 0000000..f4f9d32
--- /dev/null
+++ b/test/convert_uint8_complex128.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read UINT8 as COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+#ifdef GD_NO_C99_API
+  double c[16];
+#else
+  double complex c[8];
+#endif
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    double v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_uint8_complex64.c b/test/convert_uint8_complex64.c
new file mode 100644
index 0000000..b4fb472
--- /dev/null
+++ b/test/convert_uint8_complex64.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read UINT8 as COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+#ifdef GD_NO_C99_API
+  float c[16];
+#else
+  float complex c[8];
+#endif
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    float v[] = {40 + i, 0};
+    CHECKCi(i,c + 2 * i, v);
+#else
+    CHECKCi(i,c[i], 40 + i);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/convert_uint8_float32.c b/test/convert_uint8_float32.c
new file mode 100644
index 0000000..8775b6b
--- /dev/null
+++ b/test/convert_uint8_float32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  float c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint8_float64.c b/test/convert_uint8_float64.c
new file mode 100644
index 0000000..ace524b
--- /dev/null
+++ b/test/convert_uint8_float64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  double c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint8_int16.c b/test/convert_uint8_int16.c
new file mode 100644
index 0000000..2fa87b1
--- /dev/null
+++ b/test/convert_uint8_int16.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as INT16 */
+#include "test.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  int16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint8_int32.c b/test/convert_uint8_int32.c
new file mode 100644
index 0000000..4299405
--- /dev/null
+++ b/test/convert_uint8_int32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as INT32 */
+#include "test.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  int32_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint8_int64.c b/test/convert_uint8_int64.c
new file mode 100644
index 0000000..4c4ead4
--- /dev/null
+++ b/test/convert_uint8_int64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as INT64 */
+#include "test.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  int64_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint8_int8.c b/test/convert_uint8_int8.c
new file mode 100644
index 0000000..7ea9bb6
--- /dev/null
+++ b/test/convert_uint8_int8.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  int8_t c[8];
+  uint8_t data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint8_uint16.c b/test/convert_uint8_uint16.c
new file mode 100644
index 0000000..ce05591
--- /dev/null
+++ b/test/convert_uint8_uint16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/convert_uint8_uint32.c b/test/convert_uint8_uint32.c
new file mode 100644
index 0000000..9a470a5
--- /dev/null
+++ b/test/convert_uint8_uint32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint32_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/convert_uint8_uint64.c b/test/convert_uint8_uint64.c
new file mode 100644
index 0000000..6c94a81
--- /dev/null
+++ b/test/convert_uint8_uint64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint64_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + (unsigned)i);
+
+  return r;
+}
diff --git a/test/creat.c b/test/creat.c
new file mode 100644
index 0000000..95d142b
--- /dev/null
+++ b/test/creat.c
@@ -0,0 +1,51 @@
+/* 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
+ */
+/* Creating a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, 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);
+
+  unlink_ret = unlink(format);
+  rmdir_ret = rmdir(filedir);
+
+  CHECKI(unlink_ret, 0);
+  CHECKI(rmdir_ret, 0);
+  CHECKI(error, GD_E_OK);
+  
+  return r;
+}
diff --git a/test/creat_excl.c b/test/creat_excl.c
new file mode 100644
index 0000000..6f854e9
--- /dev/null
+++ b/test/creat_excl.c
@@ -0,0 +1,51 @@
+/* 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
+ */
+/* Exclusively creating an existing dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_EXISTS);
+
+  return r;
+}
diff --git a/test/creat_rdonly.c b/test/creat_rdonly.c
new file mode 100644
index 0000000..33e2683
--- /dev/null
+++ b/test/creat_rdonly.c
@@ -0,0 +1,51 @@
+/* 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
+ */
+/* Creating a read-only dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, unlink_ret, rmdir_ret, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY | GD_CREAT);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink_ret = unlink(format);
+  rmdir_ret = rmdir(filedir);
+
+  CHECKI(unlink_ret, -1);
+  CHECKI(rmdir_ret, -1);
+  CHECKI(error, GD_E_ACCMODE);
+
+  return r;
+}
diff --git a/test/cvlist.c b/test/cvlist.c
new file mode 100644
index 0000000..23b3331
--- /dev/null
+++ b/test/cvlist.c
@@ -0,0 +1,69 @@
+/* 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 list of constant values should succeed cleanly */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 CONST UINT8 1\n"
+    "data2 CONST UINT8 2\n"
+    "data3 CONST UINT8 3\n"
+    "data4 RAW UINT8 1\n";
+  int fd, error, r = 0;
+  const uint8_t *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (const uint8_t *)gd_constants(D, GD_UINT8);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 3; ++fd)
+      CHECKUi(fd,field_list[fd], fd + 1);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_array.c b/test/cvlist_array.c
new file mode 100644
index 0000000..5080a1c
--- /dev/null
+++ b/test/cvlist_array.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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"
+    "data3 CARRAY UINT8 3 6 9 12 15 18 21\n"
+    "data4 RAW UINT8 1\n";
+  int fd, error, r = 0;
+  size_t i;
+  struct uint8_carrays {
+    size_t n;
+    uint8_t *d;
+  } *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (struct uint8_carrays*)gd_carrays(D, GD_UINT8);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 3; ++fd) {
+      CHECKUi(fd,field_list[fd].n, (size_t)(5 + fd));
+      for (i = 0; i < field_list[fd].n; ++i)
+        CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1));
+    }
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_array_hidden.c b/test/cvlist_array_hidden.c
new file mode 100644
index 0000000..6db4de0
--- /dev/null
+++ b/test/cvlist_array_hidden.c
@@ -0,0 +1,67 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 CARRAY UINT8 1 2 3 4 5\n"
+    "data2 CARRAY UINT8 2 4 6 8 10 12\n"
+    "/HIDDEN data2\n"
+    "data3 CARRAY UINT8 3 6 9 12 15 18 21\n"
+    "data4 RAW UINT8 1\n";
+  int fd, error, r = 0;
+  size_t i;
+  struct uint8_carrays {
+    size_t n;
+    uint8_t *d;
+  } *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (struct uint8_carrays*)gd_carrays(D, GD_UINT8);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 2; ++fd) {
+      CHECKUi(fd,field_list[fd].n, (size_t)(5 + 2 * fd));
+      for (i = 0; i < field_list[fd].n; ++i)
+        CHECKUi(fd * 1000 + i,field_list[fd].d[i], (2 * fd + 1) * (i + 1));
+    }
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_array_meta.c b/test/cvlist_array_meta.c
new file mode 100644
index 0000000..7b8e378
--- /dev/null
+++ b/test/cvlist_array_meta.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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"
+    "parent/data3 CARRAY UINT8 3 6 9 12 15 18 21\n"
+    "META parent data4 LINTERP UINT8 1\n";
+  int fd, r = 0;
+  size_t i, error;
+  struct uint8_carrays {
+    size_t n;
+    uint8_t *d;
+  } *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (struct uint8_carrays *)gd_mcarrays(D, "parent", GD_UINT8);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 3; ++fd) {
+      CHECKUi(fd,field_list[fd].n, (size_t)(5 + fd));
+      for (i = 0; i < field_list[fd].n; ++i)
+        CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1));
+    }
+
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_array_meta_hidden.c b/test/cvlist_array_meta_hidden.c
new file mode 100644
index 0000000..6b19dd6
--- /dev/null
+++ b/test/cvlist_array_meta_hidden.c
@@ -0,0 +1,68 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent CARRAY UINT8 1\n"
+    "parent/data1 CARRAY UINT8 1 2 3 4 5\n"
+    "parent/data2 CARRAY UINT8 2 4 6 8 10 12\n"
+    "/HIDDEN parent/data2\n"
+    "parent/data3 CARRAY UINT8 3 6 9 12 15 18 21\n"
+    "META parent data4 LINTERP UINT8 1\n";
+  int fd, r = 0;
+  size_t i, error;
+  struct uint8_carrays {
+    size_t n;
+    uint8_t *d;
+  } *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (struct uint8_carrays *)gd_mcarrays(D, "parent", GD_UINT8);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 2; ++fd) {
+      CHECKUi(fd,field_list[fd].n, (size_t)(5 + 2 * fd));
+      for (i = 0; i < field_list[fd].n; ++i)
+        CHECKUi(fd * 1000 + i,field_list[fd].d[i], (2 * fd + 1) * (i + 1));
+    }
+
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_hidden.c b/test/cvlist_hidden.c
new file mode 100644
index 0000000..7ce56fd
--- /dev/null
+++ b/test/cvlist_hidden.c
@@ -0,0 +1,60 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 CONST UINT8 1\n"
+    "data2 CONST UINT8 2\n"
+    "/HIDDEN data2\n"
+    "data3 CONST UINT8 3\n"
+    "data4 RAW UINT8 1\n";
+  int fd, error, r = 0;
+  const uint8_t *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (const uint8_t *)gd_constants(D, GD_UINT8);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 2; ++fd)
+      CHECKUi(fd,field_list[fd], 2 * fd + 1);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_invalid.c b/test/cvlist_invalid.c
new file mode 100644
index 0000000..e5026e2
--- /dev/null
+++ b/test/cvlist_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const void *fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_constants(D, GD_UINT8);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/cvlist_meta.c b/test/cvlist_meta.c
new file mode 100644
index 0000000..7a89cdd
--- /dev/null
+++ b/test/cvlist_meta.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 data1 CONST UINT8 1\n"
+    "META parent data2 CONST UINT8 2\n"
+    "META parent data3 CONST UINT8 3\n"
+    "META parent data4 LINTERP UINT8 1\n";
+  int fd, error, r = 0;
+  uint8_t *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (uint8_t *)gd_mconstants(D, "parent", GD_UINT8);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 3; ++fd)
+      CHECKUi(fd,field_list[fd], fd + 1);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_meta_hidden.c b/test/cvlist_meta_hidden.c
new file mode 100644
index 0000000..e322008
--- /dev/null
+++ b/test/cvlist_meta_hidden.c
@@ -0,0 +1,60 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent CONST UINT8 1\n"
+    "META parent data1 CONST UINT8 1\n"
+    "META parent data2 CONST UINT8 2\n"
+    "/HIDDEN parent/data2\n"
+    "META parent data3 CONST UINT8 3\n"
+    "META parent data4 LINTERP UINT8 1\n";
+  int fd, error, r = 0;
+  uint8_t *field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = (uint8_t *)gd_mconstants(D, "parent", GD_UINT8);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  if (!r)
+    for (fd = 0; fd < 2; ++fd)
+      CHECKUi(fd,field_list[fd], 2 * fd + 1);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/cvlist_meta_invalid.c b/test/cvlist_meta_invalid.c
new file mode 100644
index 0000000..aa01526
--- /dev/null
+++ b/test/cvlist_meta_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const void *fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_mconstants(D, "parent", GD_UINT8);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/del.c b/test/del.c
new file mode 100644
index 0000000..4ce4d09
--- /dev/null
+++ b/test/del.c
@@ -0,0 +1,76 @@
+/* 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_carray.c b/test/del_carray.c
new file mode 100644
index 0000000..67cc416
--- /dev/null
+++ b/test/del_carray.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* 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 *format_data = "data CARRAY UINT8 1 2 3 4\n"
+    "raw RAW UINT8 data<2>\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_DELETE);
+  CHECKI(ret, -1);
+
+  return r;
+}
diff --git a/test/del_carray_deref.c b/test/del_carray_deref.c
new file mode 100644
index 0000000..43d6923
--- /dev/null
+++ b/test/del_carray_deref.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* 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 *format_data = "data CARRAY UINT8 13 14 15 16 17\n"
+    "raw RAW UINT8 data<2>\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", GD_DEL_DEREF);
+  error = gd_error(D);
+  spf = gd_spf(D, "raw");
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKU(spf, 15);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/del_const.c b/test/del_const.c
new file mode 100644
index 0000000..f2bf6fa
--- /dev/null
+++ b/test/del_const.c
@@ -0,0 +1,60 @@
+/* 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 *format_data = "data CONST UINT8 1\n"
+    "raw RAW UINT8 data\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_DELETE);
+  CHECKI(ret, -1);
+
+  return r;
+}
diff --git a/test/del_const_deref.c b/test/del_const_deref.c
new file mode 100644
index 0000000..d23b611
--- /dev/null
+++ b/test/del_const_deref.c
@@ -0,0 +1,63 @@
+/* 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 *format_data = "data CONST UINT8 13\n"
+    "raw RAW UINT8 data\n";
+  int fd, ret, 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_RDWR);
+  ret = gd_delete(D, "data", GD_DEL_DEREF);
+  error = gd_error(D);
+  spf = gd_spf(D, "raw");
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKU(spf, 13);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/del_const_force.c b/test/del_const_force.c
new file mode 100644
index 0000000..f1802d7
--- /dev/null
+++ b/test/del_const_force.c
@@ -0,0 +1,65 @@
+/* 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 *format_data = "data CONST UINT8 13\n"
+    "raw RAW UINT8 data\n";
+  int fd, ret, error1, error2, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", GD_DEL_FORCE);
+  error1 = gd_error(D);
+  spf = gd_spf(D, "raw");
+  error2 = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, GD_E_OK);
+  CHECKI(error2, GD_E_BAD_SCALAR);
+  CHECKU(spf, 0);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/del_data.c b/test/del_data.c
new file mode 100644
index 0000000..8163983
--- /dev/null
+++ b/test/del_data.c
@@ -0,0 +1,74 @@
+/* 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 data_data[256];
+  int fd, ret, error1, n, error2, unlink_data, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", GD_DEL_DATA);
+  error1 = gd_error(D);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, data_data);
+  error2 = gd_error(D);
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, -1);
+  CHECKI(error1, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKI(ret, 0);
+  CHECKI(error2, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/del_derived.c b/test/del_derived.c
new file mode 100644
index 0000000..baeba99
--- /dev/null
+++ b/test/del_derived.c
@@ -0,0 +1,59 @@
+/* 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 *format_data = "data RAW UINT8 8\nlincom LINCOM 1 data 1 0\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_DELETE);
+  CHECKI(ret, -1);
+
+  return r;
+}
diff --git a/test/del_derived_after.c b/test/del_derived_after.c
new file mode 100644
index 0000000..a77bad4
--- /dev/null
+++ b/test/del_derived_after.c
@@ -0,0 +1,59 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\nlincom LINCOM 1 data 1 0\n";
+  int fd, ret, v, e1, e2, r = 0;
+  size_t n;
+  double c;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  /* in order to initialise the lincom's entry cache */
+  v = gd_validate(D, "lincom");
+  ret = gd_delete(D, "data", GD_DEL_FORCE);
+  e1 = gd_error(D);
+  n = gd_getdata(D, "lincom", 0, 0, 0, 1, GD_FLOAT64, &c);
+  e2 = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_BAD_CODE);
+  CHECKI(ret, 0);
+  CHECKI(n, 0);
+  CHECKI(v, 0);
+
+  return r;
+}
diff --git a/test/del_derived_force.c b/test/del_derived_force.c
new file mode 100644
index 0000000..8110de7
--- /dev/null
+++ b/test/del_derived_force.c
@@ -0,0 +1,59 @@
+/* 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 *format_data = "data RAW UINT8 8\nlincom LINCOM 1 data 1 0\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", GD_DEL_FORCE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/del_meta.c b/test/del_meta.c
new file mode 100644
index 0000000..13c5f7a
--- /dev/null
+++ b/test/del_meta.c
@@ -0,0 +1,65 @@
+/* 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 *format_data = "data RAW UINT8 8\n"
+    "META data e CONST UINT8 1\n"
+    "META data q CONST UINT8 2\n"
+    "META data a CONST UINT8 3\n"
+    "META data b CONST UINT8 4\n"
+    "META data z CONST UINT8 5\n"
+    "META data l CONST UINT8 6\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_DELETE);
+  CHECKI(ret, -1);
+
+  return r;
+}
diff --git a/test/del_meta_force.c b/test/del_meta_force.c
new file mode 100644
index 0000000..04afc3f
--- /dev/null
+++ b/test/del_meta_force.c
@@ -0,0 +1,68 @@
+/* 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 *format_data = "data RAW UINT8 8\n"
+    "META data e STRING 1\n"
+    "META data q STRING 2\n"
+    "META data a STRING 3\n"
+    "META data b STRING 4\n"
+    "META data z STRING 5\n"
+    "META data l STRING 6\n"
+    "s STRING e\n";
+  int fd, ret, error, nf, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_delete(D, "data", GD_DEL_META);
+  error = gd_error(D);
+  nf = gd_nfields(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(nf, 2);
+  CHECKI(ret, 0);
+
+  return r;
+}
diff --git a/test/desync.c b/test/desync.c
new file mode 100644
index 0000000..704457c
--- /dev/null
+++ b/test/desync.c
@@ -0,0 +1,67 @@
+/* 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)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int e1, e2, e3, n1, n2, fd, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  e1 = gd_error(D);
+  n1 = gd_desync(D, 0);
+  e2 = gd_error(D);
+  
+  /* ensure mtime ticks over */
+  sleep(1);
+
+  /* modify the format file */
+  fd = open(format, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+  write(fd, "#\n", 2);
+  close(fd);
+
+  n2 = gd_desync(D, 0);
+  e3 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(e3, 0);
+  CHECKI(n1, 0);
+  CHECKI(n2, 1);
+  return r;
+}
diff --git a/test/desync_flush.c b/test/desync_flush.c
new file mode 100644
index 0000000..37e5b78
--- /dev/null
+++ b/test/desync_flush.c
@@ -0,0 +1,60 @@
+/* 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)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int e1, e2, n1, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e1 = gd_error(D);
+
+  /* ensure mtime ticks over */
+  sleep(1);
+
+  gd_rewrite_fragment(D, 0);
+
+  n1 = gd_desync(D, 0);
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(n1, 0);
+  return r;
+}
diff --git a/test/desync_reopen.c b/test/desync_reopen.c
new file mode 100644
index 0000000..476ee65
--- /dev/null
+++ b/test/desync_reopen.c
@@ -0,0 +1,68 @@
+/* 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)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 1\n";
+  int e1, e2, e3, n1, n2, fd, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  e1 = gd_error(D);
+  
+  /* ensure mtime ticks over */
+  sleep(1);
+
+  /* modify the format file */
+  fd = open(format, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  n1 = gd_desync(D, GD_DESYNC_REOPEN);
+  e2 = gd_error(D);
+  n2 = gd_validate(D, "data");
+  e3 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(e3, 0);
+  CHECKI(n1, 1);
+  CHECKI(n2, 0);
+  return r;
+}
diff --git a/test/desync_reopen_inv.c b/test/desync_reopen_inv.c
new file mode 100644
index 0000000..2dca079
--- /dev/null
+++ b/test/desync_reopen_inv.c
@@ -0,0 +1,68 @@
+/* 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)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "bad format\n";
+  int e1, e2, e3, n1, n2, fd, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY);
+  e1 = gd_error(D);
+  
+  /* ensure mtime ticks over */
+  sleep(1);
+
+  /* modify the format file */
+  fd = open(format, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  n1 = gd_desync(D, GD_DESYNC_REOPEN);
+  e2 = gd_error(D);
+  n2 = gd_validate(D, "data");
+  e3 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_FORMAT);
+  CHECKI(e3, GD_E_BAD_DIRFILE);
+  CHECKI(n1, -1);
+  CHECKI(n2, -1);
+  return r;
+}
diff --git a/test/dfes_bit.c b/test/dfes_bit.c
new file mode 100644
index 0000000..d0bfee2
--- /dev/null
+++ b/test/dfes_bit.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to free the strings from a BIT entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data BIT in 3 2\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  gd_entry(D, "data", &E);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/dfes_divide.c b/test/dfes_divide.c
new file mode 100644
index 0000000..556b920
--- /dev/null
+++ b/test/dfes_divide.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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 DIVIDE e b\n";
+  int fd;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  gd_entry(D, "data", &E);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return 0;
+}
diff --git a/test/dfes_lincom.c b/test/dfes_lincom.c
new file mode 100644
index 0000000..b9ba0ac
--- /dev/null
+++ b/test/dfes_lincom.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to free the strings from a LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data LINCOM 2 in1 2 1 in2 2 1\n";
+  int fd;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  gd_entry(D, "data", &E);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return 0;
+}
diff --git a/test/dfes_linterp.c b/test/dfes_linterp.c
new file mode 100644
index 0000000..4d251e4
--- /dev/null
+++ b/test/dfes_linterp.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to free the strings from a LINTERP entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data LINTERP in table\n";
+  int fd;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  gd_entry(D, "data", &E);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return 0;
+}
diff --git a/test/dfes_multiply.c b/test/dfes_multiply.c
new file mode 100644
index 0000000..f1db758
--- /dev/null
+++ b/test/dfes_multiply.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to free the strings from a MULTIPLY entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data MULTIPLY e b\n";
+  int fd;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  gd_entry(D, "data", &E);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return 0;
+}
diff --git a/test/dfes_null.c b/test/dfes_null.c
new file mode 100644
index 0000000..f4e0e7e
--- /dev/null
+++ b/test/dfes_null.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to free the strings from NULL */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  gd_free_entry_strings(NULL);
+
+  return 0;
+}
diff --git a/test/dfes_phase.c b/test/dfes_phase.c
new file mode 100644
index 0000000..d89e4d5
--- /dev/null
+++ b/test/dfes_phase.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to free the strings from a PHASE entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data PHASE in 8\n";
+  int fd;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  gd_entry(D, "data", &E);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return 0;
+}
diff --git a/test/dfes_raw.c b/test/dfes_raw.c
new file mode 100644
index 0000000..921e4dd
--- /dev/null
+++ b/test/dfes_raw.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to free the strings from a RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  gd_entry(D, "data", &E);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return 0;
+}
diff --git a/test/dfes_recip.c b/test/dfes_recip.c
new file mode 100644
index 0000000..da4d388
--- /dev/null
+++ b/test/dfes_recip.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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 RECIP b e\ne CONST UINT8 3";
+  int fd;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  gd_entry(D, "data", &E);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return 0;
+}
diff --git a/test/dfes_zero.c b/test/dfes_zero.c
new file mode 100644
index 0000000..b71701f
--- /dev/null
+++ b/test/dfes_zero.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to free the strings from a zeroed entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  gd_entry_t E;
+  memset(&E, 0, sizeof(E));
+  gd_free_entry_strings(&E);
+
+  return 0;
+}
diff --git a/test/elist_alias.c b/test/elist_alias.c
new file mode 100644
index 0000000..4a2974b
--- /dev/null
+++ b/test/elist_alias.c
@@ -0,0 +1,78 @@
+/* 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 <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"
+    "/ALIAS data2 data1\n"
+    "/ALIAS data3 data4\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_entry_list(D, NULL, GD_ALIAS_ENTRIES, 0);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; ; ++i) {
+    if (field_list[i] == NULL)
+      break;
+
+    if (strcmp(field_list[i], "data3") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data2") == 0)
+      continue;
+
+    fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+    r = 1;
+  }
+
+  CHECKI(i, 2);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/elist_hidden.c b/test/elist_hidden.c
new file mode 100644
index 0000000..373e7b0
--- /dev/null
+++ b/test/elist_hidden.c
@@ -0,0 +1,75 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 RAW UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    "/HIDDEN data2\n"
+    "data3 RAW UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **entry_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  entry_list = gd_entry_list(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_HIDDEN);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKPN(entry_list);
+
+  for (i = 0; ; ++i) {
+    if (entry_list[i] == NULL)
+      break;
+
+    if (strcmp(entry_list[i], "data1") == 0)
+      continue;
+    else if (strcmp(entry_list[i], "data2") == 0)
+      continue;
+    else if (strcmp(entry_list[i], "data3") == 0)
+      continue;
+    else if (strcmp(entry_list[i], "INDEX") == 0)
+      continue;
+
+    fprintf(stderr, "entry_list[%i] = \"%s\"\n", i, entry_list[i]);
+    r = 1;
+  }
+
+  CHECKI(i, 4);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/elist_noalias.c b/test/elist_noalias.c
new file mode 100644
index 0000000..a938dca
--- /dev/null
+++ b/test/elist_noalias.c
@@ -0,0 +1,75 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 RAW UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    "data3 RAW UINT8 1\n"
+    "/ALIAS data4 data32\n";
+  int fd, i, error, r = 0;
+  const char **entry_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  entry_list = gd_entry_list(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_NOALIAS);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKPN(entry_list);
+
+  for (i = 0; ; ++i) {
+    if (entry_list[i] == NULL)
+      break;
+
+    if (strcmp(entry_list[i], "data1") == 0)
+      continue;
+    else if (strcmp(entry_list[i], "data2") == 0)
+      continue;
+    else if (strcmp(entry_list[i], "data3") == 0)
+      continue;
+    else if (strcmp(entry_list[i], "INDEX") == 0)
+      continue;
+
+    fprintf(stderr, "entry_list[%i] = \"%s\"\n", i, entry_list[i]);
+    r = 1;
+  }
+
+  CHECKI(i, 4);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/elist_scalar.c b/test/elist_scalar.c
new file mode 100644
index 0000000..d7d3819
--- /dev/null
+++ b/test/elist_scalar.c
@@ -0,0 +1,70 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 CONST UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    "data3 STRING UINT8\n";
+  int fd, i, error, r = 0;
+  const char **entry_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  entry_list = gd_entry_list(D, NULL, GD_SCALAR_ENTRIES, 0);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKPN(entry_list);
+
+  for (i = 0; ; ++i) {
+    if (entry_list[i] == NULL)
+      break;
+
+    if (strcmp(entry_list[i], "data1") == 0)
+      continue;
+    else if (strcmp(entry_list[i], "data3") == 0)
+      continue;
+
+    fprintf(stderr, "entry_list[%i] = \"%s\"\n", i, entry_list[i]);
+    r = 1;
+  }
+
+  CHECKI(i, 2);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/encode_alter.c b/test/encode_alter.c
new file mode 100644
index 0000000..9a40e5d
--- /dev/null
+++ b/test/encode_alter.c
@@ -0,0 +1,84 @@
+/* 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 encoding */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *txtdata = "dirfile/data.txt";
+  const char *format_data = "data RAW UINT16 8\nENCODING none\n";
+  const char *txt_data =
+    "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n";
+  uint16_t data_data[128];
+  uint16_t c[8];
+  int fd, ret, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = 0x201 * fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(txtdata, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, txt_data, strlen(txt_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 0);
+  error = gd_error(D);
+  n = gd_nframes(D);
+
+  gd_close(D);
+
+  unlink(txtdata);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/encode_get.c b/test/encode_get.c
new file mode 100644
index 0000000..a12443f
--- /dev/null
+++ b/test/encode_get.c
@@ -0,0 +1,71 @@
+/* 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 <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\nFRAMEOFFSET 13\n";
+  unsigned char data_data[256];
+  int fd, error, r = 0;
+  unsigned long n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_encoding(D, 0);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKX(n, GD_UNENCODED);
+
+  return r;
+}
diff --git a/test/encode_move.c b/test/encode_move.c
new file mode 100644
index 0000000..8bdbf2a
--- /dev/null
+++ b/test/encode_move.c
@@ -0,0 +1,82 @@
+/* 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/endian_alter.c b/test/endian_alter.c
new file mode 100644
index 0000000..3206814
--- /dev/null
+++ b/test/endian_alter.c
@@ -0,0 +1,97 @@
+/* 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 *format_data = "data RAW UINT16 8\nENDIAN little\n";
+  uint16_t data_data[128];
+  uint16_t c[8], d;
+  int fd, ret, error, n, i = 0, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = 0x201 * fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_endianness(D, GD_BIG_ENDIAN, 0, 0);
+  error = gd_error(D);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKX(d, i * 0x201);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef WORDS_BIGENDIAN
+# define FACTOR 0x201
+#else
+# define FACTOR 0x102
+#endif
+
+  for (i = 0; i < 8; ++i)
+    CHECKXi(i,c[i], (40 + i) * FACTOR);
+
+  CHECKI(error,0);
+  CHECKI(ret, 0);
+  CHECKI(n, 8);
+
+  return r;
+}
diff --git a/test/endian_alter_sie.c b/test/endian_alter_sie.c
new file mode 100644
index 0000000..5040b6f
--- /dev/null
+++ b/test/endian_alter_sie.c
@@ -0,0 +1,97 @@
+/* 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.sie";
+  const char *format_data = "data RAW UINT8 8\nENDIAN little\nENCODING sie\n";
+  const uint8_t data_in[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  const uint8_t data_out[] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32
+  };
+  uint8_t c[8], d[3 * 9];
+  int fd, ret, error, n, i = 0, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_in, 3 * 9);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_endianness(D, GD_BIG_ENDIAN, 0, 1);
+  error = gd_error(D);
+  n = gd_getdata(D, "data", 3, 0, 1, 0, GD_UINT8, c);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+
+  if (fd >= 0) {
+    read(fd, d, 3 * 9);
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < 8; ++i)
+    CHECKXi(i,c[i], 0x22);
+
+  for (i = 0; i < 3 * 9; ++i)
+    CHECKXi(i,d[i], data_out[i]);
+
+  CHECKI(error,0);
+  CHECKI(ret, 0);
+  CHECKI(n, 8);
+
+  return r;
+}
diff --git a/test/endian_get.c b/test/endian_get.c
new file mode 100644
index 0000000..43e7854
--- /dev/null
+++ b/test/endian_get.c
@@ -0,0 +1,88 @@
+/* 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 <stdio.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 *format3 = "dirfile/format3";
+  const char *format_data = "ENDIAN little\nINCLUDE format1\n";
+  const char *format_data1 = "ENDIAN big\nINCLUDE format2\n";
+  const char *format_data2 = "ENDIAN big arm\nINCLUDE format3\n";
+  const char *format_data3 = "ENDIAN little arm\n";
+  int fd, error, r = 0;
+  unsigned long n, m, l, k;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data1, strlen(format_data1));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data2, strlen(format_data2));
+  close(fd);
+
+  fd = open(format3, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data3, strlen(format_data3));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_endianness(D, 0);
+  m = gd_endianness(D, 1);
+  l = gd_endianness(D, 2);
+  k = gd_endianness(D, 3);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  unlink(format1);
+  unlink(format2);
+  unlink(format3);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKX(n, GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
+  CHECKX(m, GD_BIG_ENDIAN | GD_NOT_ARM_ENDIAN);
+  CHECKX(l, GD_BIG_ENDIAN | GD_ARM_ENDIAN);
+  CHECKX(k, GD_LITTLE_ENDIAN | GD_ARM_ENDIAN);
+
+  return r;
+}
diff --git a/test/endian_move.c b/test/endian_move.c
new file mode 100644
index 0000000..8d35880
--- /dev/null
+++ b/test/endian_move.c
@@ -0,0 +1,97 @@
+/* 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 *format_data = "data RAW UINT16 8\nENDIAN little\n";
+  uint16_t data_data[128];
+  uint16_t c[8], d;
+  int fd, ret, error, n, i = 0, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = 0x201 * fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_endianness(D, GD_BIG_ENDIAN, 0, 1);
+  error = gd_error(D);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKX(d, i * 0x102);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef WORDS_BIGENDIAN
+# define FACTOR 0x102
+#else
+# define FACTOR 0x201
+#endif
+
+  for (i = 0; i < 8; ++i)
+    CHECKXi(i,c[i], (40 + i) * FACTOR);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKI(n, 8);
+
+  return r;
+}
diff --git a/test/entry_bad_code.c b/test/entry_bad_code.c
new file mode 100644
index 0000000..02f44bb
--- /dev/null
+++ b/test/entry_bad_code.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+
+  n = gd_entry(D, "not a field", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_CODE);
+  CHECKI(n, -1);
+
+  return r;
+}
diff --git a/test/entry_bit.c b/test/entry_bit.c
new file mode 100644
index 0000000..2db4e5e
--- /dev/null
+++ b/test/entry_bit.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read BIT entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data BIT in1 3 4\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKI(E.field_type, GD_BIT_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKI(E.EN(bit,bitnum), 3);
+  CHECKI(E.EN(bit,numbits), 4);
+  CHECKP(E.scalar[0]);
+  CHECKP(E.scalar[1]);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_bit_scalar.c b/test/entry_bit_scalar.c
new file mode 100644
index 0000000..d4dac46
--- /dev/null
+++ b/test/entry_bit_scalar.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read BIT entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "bitnum CONST UINT8 3\n"
+    "numbits CONST UINT8 4\n"
+    "data BIT in1 bitnum numbits\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKI(E.field_type, GD_BIT_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKI(E.EN(bit,bitnum), 3);
+  CHECKI(E.EN(bit,numbits), 4);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_divide.c b/test/entry_divide.c
new file mode 100644
index 0000000..1e83ff9
--- /dev/null
+++ b/test/entry_divide.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read DIVIDE entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data DIVIDE in1 in2\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_DIVIDE_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.in_fields[1], "in2");
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_invalid.c b/test/entry_invalid.c
new file mode 100644
index 0000000..6c217be
--- /dev/null
+++ b/test/entry_invalid.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read entry from an invalid DIRFILE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  DIRFILE *D = gd_open("not a dirfile", GD_RDONLY);
+  gd_entry_t E;
+  int error, r = 0;
+
+  int n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  CHECKI(n, -1);
+
+  return r;
+}
diff --git a/test/entry_lincom.c b/test/entry_lincom.c
new file mode 100644
index 0000000..1ec1c99
--- /dev/null
+++ b/test/entry_lincom.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data LINCOM 3 in1 1 2 in2 3 4 in3 5 6\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKI(E.field_type, GD_LINCOM_ENTRY);
+  CHECKI(E.comp_scal, 0);
+  CHECKI(E.EN(lincom,n_fields), 3);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.in_fields[1], "in2");
+  CHECKS(E.in_fields[2], "in3");
+  CHECKF(E.EN(lincom,m)[0], 1.);
+  CHECKF(E.EN(lincom,b)[0], 2.);
+  CHECKF(E.EN(lincom,m)[1], 3.);
+  CHECKF(E.EN(lincom,b)[1], 4.);
+  CHECKF(E.EN(lincom,m)[2], 5.);
+  CHECKF(E.EN(lincom,b)[2], 6.);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_lincom_scalar.c b/test/entry_lincom_scalar.c
new file mode 100644
index 0000000..d441a27
--- /dev/null
+++ b/test/entry_lincom_scalar.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "m1 CONST FLOAT64 1\n"
+    "b1 CONST FLOAT64 2\n"
+    "m2 CONST FLOAT64 3\n"
+    "b2 CONST FLOAT64 4\n"
+    "m3 CONST FLOAT64 5\n"
+    "b3 CONST FLOAT64 6\n"
+    "data LINCOM 3 in1 m1 b1 in2 m2 b2 in3 m3 b3\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKI(E.field_type, GD_LINCOM_ENTRY);
+  CHECKI(E.EN(lincom,n_fields), 3);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.in_fields[1], "in2");
+  CHECKS(E.in_fields[2], "in3");
+  CHECKS(E.scalar[0], "m1");
+  CHECKS(E.scalar[1], "m2");
+  CHECKS(E.scalar[2], "m3");
+  CHECKS(E.scalar[3], "b1");
+  CHECKS(E.scalar[4], "b2");
+  CHECKS(E.scalar[5], "b3");
+  CHECKF(E.EN(lincom,m)[0], 1.);
+  CHECKF(E.EN(lincom,b)[0], 2.);
+  CHECKF(E.EN(lincom,m)[1], 3.);
+  CHECKF(E.EN(lincom,b)[1], 4.);
+  CHECKF(E.EN(lincom,m)[2], 5.);
+  CHECKF(E.EN(lincom,b)[2], 6.);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_linterp.c b/test/entry_linterp.c
new file mode 100644
index 0000000..98838f6
--- /dev/null
+++ b/test/entry_linterp.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read LINTERP entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data LINTERP in1 ../tablefile\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKI(E.field_type, GD_LINTERP_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.EN(linterp,table), "../tablefile");
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_mplex.c b/test/entry_mplex.c
new file mode 100644
index 0000000..b7a4c1b
--- /dev/null
+++ b/test/entry_mplex.c
@@ -0,0 +1,59 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data MPLEX in1 in2 1 2\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_MPLEX_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.in_fields[1], "in2");
+  CHECKI(E.EN(mplex,count_val), 1);
+  CHECKI(E.EN(mplex,period), 2);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_mplex_scalar.c b/test/entry_mplex_scalar.c
new file mode 100644
index 0000000..7836d37
--- /dev/null
+++ b/test/entry_mplex_scalar.c
@@ -0,0 +1,66 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "a CONST UINT16 1\n"
+    "b CARRAY UINT16 2 3 4 5\n"
+    "data MPLEX in1 in2 a b<3>\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_MPLEX_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.in_fields[1], "in2");
+  CHECKS(E.scalar[0], "a");
+  CHECKS(E.scalar[1], "b");
+  CHECKI(E.scalar_ind[0], -1);
+  CHECKI(E.scalar_ind[1], 3);
+  CHECKI(E.EN(mplex,count_val), 1);
+  CHECKI(E.EN(mplex,period), 5);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_multiply.c b/test/entry_multiply.c
new file mode 100644
index 0000000..4972f5c
--- /dev/null
+++ b/test/entry_multiply.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read MULTIPLY entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data MULTIPLY in1 in2\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_MULTIPLY_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.in_fields[1], "in2");
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_phase.c b/test/entry_phase.c
new file mode 100644
index 0000000..1270435
--- /dev/null
+++ b/test/entry_phase.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read PHASE entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data PHASE in1 3\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_PHASE_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKI(E.EN(phase,shift), 3);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_phase_scalar.c b/test/entry_phase_scalar.c
new file mode 100644
index 0000000..b829142
--- /dev/null
+++ b/test/entry_phase_scalar.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read PHASE entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "shift CONST UINT8 3\ndata PHASE in1 shift\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKI(E.field_type, GD_PHASE_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.scalar[0], "shift");
+  CHECKI(E.EN(phase,shift), 3);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_polynom.c b/test/entry_polynom.c
new file mode 100644
index 0000000..8693bcf
--- /dev/null
+++ b/test/entry_polynom.c
@@ -0,0 +1,69 @@
+/* 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
+ */
+/* Try to read POLYNOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data POLYNOM in 1 2 3 4 5\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_POLYNOM_ENTRY);
+  CHECKI(E.comp_scal, 0);
+  CHECKI(E.EN(polynom,poly_ord), 4);
+  CHECKS(E.in_fields[0], "in");
+  for (fd = 0; fd < 4; ++fd)
+    CHECKFi(fd,E.EN(polynom,a)[fd], fd + 1.);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_polynom_scalar.c b/test/entry_polynom_scalar.c
new file mode 100644
index 0000000..6cc3e45
--- /dev/null
+++ b/test/entry_polynom_scalar.c
@@ -0,0 +1,81 @@
+/* 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
+ */
+/* Try to read LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "a0 CONST FLOAT64 1\n"
+    "a1 CONST FLOAT64 2\n"
+    "a2 CONST FLOAT64 3\n"
+    "a3 CONST FLOAT64 4\n"
+    "a4 CONST FLOAT64 5\n"
+    "data POLYNOM in a0 a1 a2 a3 a4\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_POLYNOM_ENTRY);
+  CHECKI(E.comp_scal, 0);
+  CHECKI(E.EN(polynom,poly_ord), 4);
+  CHECKS(E.in_fields[0], "in");
+  CHECKS(E.scalar[0], "a0");
+  CHECKS(E.scalar[1], "a1");
+  CHECKS(E.scalar[2], "a2");
+  CHECKS(E.scalar[3], "a3");
+  CHECKS(E.scalar[4], "a4");
+  for (fd = 0; fd < 4; ++fd)
+    CHECKFi(fd,E.EN(polynom,a)[fd], fd + 1.);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_raw.c b/test/entry_raw.c
new file mode 100644
index 0000000..c09a41e
--- /dev/null
+++ b/test/entry_raw.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKI(E.field_type, GD_RAW_ENTRY);
+  CHECKU(E.EN(raw,spf), 8);
+  CHECKX(E.EN(raw,data_type), GD_UINT8);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_raw_scalar.c b/test/entry_raw_scalar.c
new file mode 100644
index 0000000..07ddcb3
--- /dev/null
+++ b/test/entry_raw_scalar.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST UINT32 8\ndata RAW UINT8 const\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_RAW_ENTRY);
+  CHECKS(E.scalar[0], "const");
+  CHECKU(E.EN(raw,spf), 8);
+  CHECKX(E.EN(raw,data_type), GD_UINT8);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_raw_scalar_code.c b/test/entry_raw_scalar_code.c
new file mode 100644
index 0000000..4a8624a
--- /dev/null
+++ b/test/entry_raw_scalar_code.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 const\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_SCALAR);
+  CHECKI(n, -1);
+
+  return r;
+}
diff --git a/test/entry_raw_scalar_type.c b/test/entry_raw_scalar_type.c
new file mode 100644
index 0000000..cea8cab
--- /dev/null
+++ b/test/entry_raw_scalar_type.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read RAW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const RAW UINT32 8\ndata RAW UINT8 const\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_SCALAR);
+  CHECKI(n, -1);
+
+  return r;
+}
diff --git a/test/entry_recip.c b/test/entry_recip.c
new file mode 100644
index 0000000..a03c16b
--- /dev/null
+++ b/test/entry_recip.c
@@ -0,0 +1,67 @@
+/* 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
+ */
+/* Try to read POLYNOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RECIP in 2\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_RECIP_ENTRY);
+  CHECKI(E.comp_scal, 0);
+  CHECKI(E.EN(recip,dividend), 2);
+  CHECKS(E.in_fields[0], "in");
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_scalar_repr.c b/test/entry_scalar_repr.c
new file mode 100644
index 0000000..7a34695
--- /dev/null
+++ b/test/entry_scalar_repr.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Try to read LINCOM entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "m1 CONST COMPLEX128 1.1;3.2\n"
+    "b1 CONST COMPLEX64 2.2;9.3\n"
+    "data LINCOM 1 in1 m1.r b1.i\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_LINCOM_ENTRY);
+  CHECKI(E.EN(lincom,n_fields), 1);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.scalar[0], "m1.r");
+  CHECKS(E.scalar[GD_MAX_LINCOM], "b1.i");
+  CHECKF(E.EN(lincom,m)[0], 1.1);
+  CHECKF(E.EN(lincom,b)[0], 9.3);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_type.c b/test/entry_type.c
new file mode 100644
index 0000000..869784b
--- /dev/null
+++ b/test/entry_type.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read entry type */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, error, r = 0;
+  gd_entype_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry_type(D, "data");
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, GD_RAW_ENTRY);
+
+  return r;
+}
diff --git a/test/entry_type_alias.c b/test/entry_type_alias.c
new file mode 100644
index 0000000..c8d362a
--- /dev/null
+++ b/test/entry_type_alias.c
@@ -0,0 +1,54 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 8\n"
+    "/ALIAS alias data\n";
+  int fd, error, r = 0;
+  gd_entype_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry_type(D, "alias");
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, GD_RAW_ENTRY);
+
+  return r;
+}
diff --git a/test/entry_window.c b/test/entry_window.c
new file mode 100644
index 0000000..5d9b041
--- /dev/null
+++ b/test/entry_window.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read WINDOW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data WINDOW in1 in2 NE 0\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKX(E.field_type, GD_WINDOW_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.in_fields[1], "in2");
+  CHECKI(E.EN(window,windop), GD_WINDOP_NE);
+  CHECKI(E.EN(window,threshold.i), 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/entry_window_scalar.c b/test/entry_window_scalar.c
new file mode 100644
index 0000000..a259c85
--- /dev/null
+++ b/test/entry_window_scalar.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read WINDOW entry */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST UINT8 3\ndata WINDOW in1 in2 GE const\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_entry(D, "data", &E);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 0);
+  CHECKS(E.field, "data");
+  CHECKI(E.field_type, GD_WINDOW_ENTRY);
+  CHECKS(E.in_fields[0], "in1");
+  CHECKS(E.in_fields[1], "in2");
+  CHECKS(E.scalar[0], "const");
+  CHECKI(E.EN(window,windop), GD_WINDOP_GE);
+  CHECKF(E.EN(window,threshold.r), 3);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/eof.c b/test/eof.c
new file mode 100644
index 0000000..fa1ec40
--- /dev/null
+++ b/test/eof.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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;
+  off_t n;
+  const size_t len = strlen(data);
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_eof(D, "data");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI((int)n, (int)len / 2);
+
+  return r;
+}
diff --git a/test/eof_index.c b/test/eof_index.c
new file mode 100644
index 0000000..fb34479
--- /dev/null
+++ b/test/eof_index.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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"
+    "mult1 MULTIPLY data INDEX\n"
+    "mult2 MULTIPLY INDEX INDEX\n"
+    "mult3 MULTIPLY INDEX data\n";
+  int fd, error0, error1, error2, error3, r = 0;
+  const size_t len = strlen(data);
+  off_t eof_INDEX, eof_mult1, eof_mult2, eof_mult3;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  eof_INDEX = gd_eof(D, "INDEX");
+  error0 = gd_error(D);
+  eof_mult1 = gd_eof(D, "mult1");
+  error1 = gd_error(D);
+  eof_mult2 = gd_eof(D, "mult2");
+  error2 = gd_error(D);
+  eof_mult3 = gd_eof(D, "mult3");
+  error3 = gd_error(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error0, GD_E_BAD_FIELD_TYPE);
+  CHECKI(eof_INDEX, -1);
+  CHECKI(error1, GD_E_OK);
+  CHECKI(eof_mult1, (int)len / 2);
+  CHECKI(error2, GD_E_BAD_FIELD_TYPE);
+  CHECKI(eof_mult2, -1);
+  CHECKI(error3, GD_E_OK);
+  CHECKI(eof_mult3, (int)len / 2);
+
+  return r;
+}
diff --git a/test/eof_lincom.c b/test/eof_lincom.c
new file mode 100644
index 0000000..1f18e23
--- /dev/null
+++ b/test/eof_lincom.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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 *data2 = "dirfile/data2";
+  const char *format_data =
+    "data RAW UINT16 1\n"
+    "data2 RAW UINT8 1\n"
+    "lincom LINCOM 2 data2 1. 0. data 1. 0.\n"
+    "lincom2 LINCOM 2 data 1. 0. data2 1. 0.\n";
+  int fd, error, error2, r = 0;
+  const size_t len = strlen(data);
+  off_t n, m;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_eof(D, "lincom");
+  error = gd_error(D);
+  m = gd_eof(D, "lincom");
+  error2 = gd_error(D);
+  gd_close(D);
+
+  unlink(data2);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, (int)len / 2);
+  CHECKI(error2, 0);
+  CHECKI(m, (int)len / 2);
+
+  return r;
+}
diff --git a/test/eof_phase.c b/test/eof_phase.c
new file mode 100644
index 0000000..64a2e8f
--- /dev/null
+++ b/test/eof_phase.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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 3";
+  int fd, error, r = 0;
+  off_t n;
+  const size_t len = strlen(data);
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_eof(D, "phase");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, (int)len / 2 - 3);
+
+  return r;
+}
diff --git a/test/error.c b/test/error.c
new file mode 100644
index 0000000..c3705de
--- /dev/null
+++ b/test/error.c
@@ -0,0 +1,54 @@
+/* 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 obtain an error string */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  char string[1000] = "";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY);
+  gd_error_string(D, string, 1000);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKS(string, "Success");
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/error_error.c b/test/error_error.c
new file mode 100644
index 0000000..3dd8e81
--- /dev/null
+++ b/test/error_error.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Opening a non-existent dirfile should fail cleanly */
+#include "test.h"
+
+#include <string.h>
+
+int main(void)
+{
+  char string[1000];
+  int error, r = 0;
+  DIRFILE *D = gd_open("a non_existant dirfile", 0);
+
+  gd_error_string(D, string, 1000);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_OPEN);
+  CHECKSp(string, "Dirfile does not exist");
+
+  return r;
+}
diff --git a/test/error_num.c b/test/error_num.c
new file mode 100644
index 0000000..62c9d59
--- /dev/null
+++ b/test/error_num.c
@@ -0,0 +1,54 @@
+/* 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 "test.h"
+
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int ne1, ne2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY);
+  gd_validate(D, "1");
+  gd_validate(D, "2");
+  gd_validate(D, "3");
+  ne1 = gd_error_count(D);
+  ne2 = gd_error_count(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ne1, 3);
+  CHECKI(ne2, 0);
+
+  return r;
+}
diff --git a/test/error_short.c b/test/error_short.c
new file mode 100644
index 0000000..723af57
--- /dev/null
+++ b/test/error_short.c
@@ -0,0 +1,52 @@
+/* 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
+ */
+/* a short error string should still be NULL-terminated */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  char string[1000] = "abc";
+  int r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY);
+  gd_error_string(D, string, 2);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(string[1], 0);
+  
+  return r;
+}
diff --git a/test/error_verbose.c b/test/error_verbose.c
new file mode 100644
index 0000000..b7dac3b
--- /dev/null
+++ b/test/error_verbose.c
@@ -0,0 +1,79 @@
+/* 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>
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+#if !defined HAVE_MKFIFO || !defined HAVE_WORKING_FORK || defined __CYGWIN__
+  return 77; /* skip */
+#else
+  const char *fifo = "./dirfile";
+  int error, r = 0, status;
+  FILE *stream;
+  pid_t pid;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkfifo(fifo, 0666);
+
+  /* read our standard error */
+  if ((pid = fork()) == 0) {
+    char string[1024];
+    stream = fopen(fifo, "r");
+
+    fgets(string, 1024, stream);
+    CHECKBOS(string, "libgetdata: Not a dirfile:");
+    return r;
+  }
+
+  /* retarget stderr */
+  freopen(fifo, "w", stderr);
+
+  D = gd_open("", GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  fputs("\n", stderr);
+  fflush(stderr);
+
+  /* restore stderr */
+  freopen("/dev/stderr", "w", stderr);
+
+  unlink(fifo);
+
+  CHECKI(error, GD_E_OPEN);
+
+  wait(&status);
+  if (status)
+    r = 1;
+
+  return r;
+#endif
+}
diff --git a/test/error_verbose_prefix.c b/test/error_verbose_prefix.c
new file mode 100644
index 0000000..dab8d87
--- /dev/null
+++ b/test/error_verbose_prefix.c
@@ -0,0 +1,90 @@
+/* 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>
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+#if !defined HAVE_MKFIFO || !defined HAVE_WORKING_FORK || defined __CYGWIN__
+  return 77; /* skip */
+#else
+  const char *filedir = "dirfile";
+  const char *fifo = "dirfile/fifo";
+  const char *format = "dirfile/format";
+  int e1, e2, r = 0, status;
+  FILE *stream;
+  pid_t pid;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+  mkfifo(fifo, 0666);
+
+  /* read our standard error */
+  if ((pid = fork()) == 0) {
+    char string[1024];
+    stream = fopen(fifo, "r");
+
+    fgets(string, 1024, stream);
+    CHECKS(string, "getdata-test: libgetdata: Field not found: data\n");
+    return r;
+  }
+
+  /* retarget stderr */
+  freopen(fifo, "w", stderr);
+
+  D = gd_open(filedir, GD_RDONLY);
+  e1 = gd_error(D);
+  gd_flags(D, GD_VERBOSE, 0);
+  gd_verbose_prefix(D, "getdata-test: ");
+  gd_validate(D, "data");
+  e2 = gd_error(D);
+  gd_close(D);
+
+  fputs("\n", stderr);
+  fflush(stderr);
+
+  /* restore stderr */
+  freopen("/dev/stderr", "w", stderr);
+
+  unlink(fifo);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, GD_E_BAD_CODE);
+
+  wait(&status);
+  if (status)
+    r = 1;
+
+  return r;
+#endif
+}
diff --git a/test/file.c b/test/file.c
new file mode 100644
index 0000000..06befa2
--- /dev/null
+++ b/test/file.c
@@ -0,0 +1,78 @@
+/* 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 get RAW filename */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, error, r = 0;
+  char *path;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  path = gd_raw_filename(D, "data");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  /* This only checks whether the end of the returned path is what we expect.
+   * This should work, since we can guarantee that both "dirfile" and "data"
+   * aren't symlinks. */
+#if GD_DIRSEP == '/'
+  CHECKEOS(path,"dirfile/data");
+#else
+  CHECKEOS(path,"dirfile\\data");
+#endif
+  free(path);
+
+  return r;
+}
diff --git a/test/file_code.c b/test/file_code.c
new file mode 100644
index 0000000..1347258
--- /dev/null
+++ b/test/file_code.c
@@ -0,0 +1,70 @@
+/* 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 get RAW filename */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, error, r = 0;
+  const char *path;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  path = gd_raw_filename(D, "bata");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_CODE);
+  CHECKP(path);
+
+  return r;
+}
diff --git a/test/file_type.c b/test/file_type.c
new file mode 100644
index 0000000..4f87f1d
--- /dev/null
+++ b/test/file_type.c
@@ -0,0 +1,70 @@
+/* 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 get RAW filename */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data CONST UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, error, r = 0;
+  const char *path;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  path = gd_raw_filename(D, "data");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_FIELD_TYPE);
+  CHECKP(path);
+
+  return r;
+}
diff --git a/test/flist.c b/test/flist.c
new file mode 100644
index 0000000..d16106c
--- /dev/null
+++ b/test/flist.c
@@ -0,0 +1,83 @@
+/* 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 <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, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_field_list(D);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; ; ++i) {
+    if (field_list[i] == NULL)
+      break;
+
+    if (strcmp(field_list[i], "data1") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data2") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data3") == 0)
+      continue;
+    else if (strcmp(field_list[i], "INDEX") == 0)
+      continue;
+
+    fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+    r = 1;
+  }
+
+  CHECKI(i, 4);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_hidden.c b/test/flist_hidden.c
new file mode 100644
index 0000000..110aa51
--- /dev/null
+++ b/test/flist_hidden.c
@@ -0,0 +1,73 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 RAW UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    "/HIDDEN data2\n"
+    "data3 RAW UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_field_list(D);
+
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; ; ++i) {
+    if (field_list[i] == NULL)
+      break;
+
+    if (strcmp(field_list[i], "data1") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data3") == 0)
+      continue;
+    else if (strcmp(field_list[i], "INDEX") == 0)
+      continue;
+
+    fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+    r = 1;
+  }
+
+  CHECKI(i, 3);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_invalid.c b/test/flist_invalid.c
new file mode 100644
index 0000000..87a205c
--- /dev/null
+++ b/test/flist_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char **fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_field_list(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/flist_meta.c b/test/flist_meta.c
new file mode 100644
index 0000000..3103791
--- /dev/null
+++ b/test/flist_meta.c
@@ -0,0 +1,79 @@
+/* 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 <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, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_mfield_list(D, "parent");
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i] != NULL; ++i) {
+    CHECKIi(i,strlen(field_list[i]), 5);
+    CHECKIi(i,field_list[i][0], 'd');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 't');
+    CHECKIi(i,field_list[i][3], 'a');
+
+    if (field_list[i][4] < '1' || field_list[i][4] > '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i, 3);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_meta_hidden.c b/test/flist_meta_hidden.c
new file mode 100644
index 0000000..cad3250
--- /dev/null
+++ b/test/flist_meta_hidden.c
@@ -0,0 +1,71 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent RAW UINT8 1\n"
+    "META parent data1 LINTERP UINT8 1\n"
+    "META parent data2 LINTERP UINT8 1\n"
+    "/HIDDEN parent/data2\n"
+    "META parent data3 LINTERP UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_mfield_list(D, "parent");
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i] != NULL; ++i) {
+    CHECKIi(i,strlen(field_list[i]), 5);
+    CHECKIi(i,field_list[i][0], 'd');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 't');
+    CHECKIi(i,field_list[i][3], 'a');
+
+    if (field_list[i][4] != '1' && field_list[i][4] != '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i, 2);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_meta_invalid.c b/test/flist_meta_invalid.c
new file mode 100644
index 0000000..02a83f4
--- /dev/null
+++ b/test/flist_meta_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char **fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_mfield_list(D, "parent");
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/flist_type.c b/test/flist_type.c
new file mode 100644
index 0000000..65ceacc
--- /dev/null
+++ b/test/flist_type.c
@@ -0,0 +1,83 @@
+/* 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 <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 UINT8 1\n"
+    "data2 STRING UINT8 1\n"
+    "data3 STRING UINT8 1\n"
+    "data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_field_list_by_type(D, GD_STRING_ENTRY);
+
+  error = gd_error(D);
+  CHECKI(error, GD_E_OK);
+  CHECKPN(field_list);
+
+  if (field_list == NULL)
+    r = 1;
+
+  for (i = 0; field_list[i]; ++i) {
+    CHECKIi(i,strlen(field_list[i]), 5);
+
+    CHECKIi(i,field_list[i][0], 'd');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 't');
+    CHECKIi(i,field_list[i][3], 'a');
+
+    if (field_list[i][4] < '1' || field_list[i][4] > '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i, 3);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_type_hidden.c b/test/flist_type_hidden.c
new file mode 100644
index 0000000..2835c10
--- /dev/null
+++ b/test/flist_type_hidden.c
@@ -0,0 +1,75 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 STRING UINT8 1\n"
+    "data2 STRING UINT8 1\n"
+    "/HIDDEN data2\n"
+    "data3 STRING UINT8 1\n"
+    "data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_field_list_by_type(D, GD_STRING_ENTRY);
+
+  error = gd_error(D);
+  CHECKI(error, GD_E_OK);
+  CHECKPN(field_list);
+
+  if (field_list == NULL)
+    r = 1;
+
+  for (i = 0; field_list[i]; ++i) {
+    CHECKIi(i,strlen(field_list[i]), 5);
+
+    CHECKIi(i,field_list[i][0], 'd');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 't');
+    CHECKIi(i,field_list[i][3], 'a');
+
+    if (field_list[i][4] != '1' && field_list[i][4] != '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i, 2);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_type_invalid.c b/test/flist_type_invalid.c
new file mode 100644
index 0000000..33c2147
--- /dev/null
+++ b/test/flist_type_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char **fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_field_list_by_type(D, GD_STRING_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/flist_type_meta.c b/test/flist_type_meta.c
new file mode 100644
index 0000000..3fc6bd9
--- /dev/null
+++ b/test/flist_type_meta.c
@@ -0,0 +1,82 @@
+/* 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 <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 UINT8 1\n"
+    "META parent data1 STRING UINT8 1\n"
+    "META parent data2 STRING UINT8 1\n"
+    "META parent data3 STRING UINT8 1\n"
+    "META parent data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_mfield_list_by_type(D, "parent", GD_STRING_ENTRY);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    CHECKIi(i,strlen(field_list[i]), 5);
+
+    CHECKIi(i,field_list[i][0], 'd');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 't');
+    CHECKIi(i,field_list[i][3], 'a');
+
+    if (field_list[i][4] < '1' || field_list[i][4] > '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i, 3);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_type_meta_hidden.c b/test/flist_type_meta_hidden.c
new file mode 100644
index 0000000..496489f
--- /dev/null
+++ b/test/flist_type_meta_hidden.c
@@ -0,0 +1,74 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent STRING UINT8 1\n"
+    "META parent data1 STRING UINT8 1\n"
+    "META parent data2 STRING UINT8 1\n"
+    "/HIDDEN parent/data2\n"
+    "META parent data3 STRING UINT8 1\n"
+    "META parent data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_mfield_list_by_type(D, "parent", GD_STRING_ENTRY);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    CHECKIi(i,strlen(field_list[i]), 5);
+
+    CHECKIi(i,field_list[i][0], 'd');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 't');
+    CHECKIi(i,field_list[i][3], 'a');
+
+    if (field_list[i][4] != '1' && field_list[i][4] != '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i, 2);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flist_type_meta_invalid.c b/test/flist_type_meta_invalid.c
new file mode 100644
index 0000000..eb64d5a
--- /dev/null
+++ b/test/flist_type_meta_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char **fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_mfield_list_by_type(D, "parent", GD_STRING_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/flush.c b/test/flush.c
new file mode 100644
index 0000000..ff75c67
--- /dev/null
+++ b/test/flush.c
@@ -0,0 +1,88 @@
+/* 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
new file mode 100644
index 0000000..c2a7fe5
--- /dev/null
+++ b/test/flush_all.c
@@ -0,0 +1,88 @@
+/* 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, NULL);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf))
+    return 1;
+  if (buf.st_size != 40 + 8 * sizeof(uint8_t))
+    return 1;
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    if (i < 40 || i > 48) {
+      if (d != 0)
+        return 1;
+    } else if (d != i)
+      return 1;
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  if (error)
+    return 1;
+  if (n != 8)
+    return 1;
+
+  return 0;
+}
diff --git a/test/flush_bad_code.c b/test/flush_bad_code.c
new file mode 100644
index 0000000..2d8c713
--- /dev/null
+++ b/test/flush_bad_code.c
@@ -0,0 +1,58 @@
+/* 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 a non-existant field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "#\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_flush(D, "no-such-field");
+
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/flush_hex.c b/test/flush_hex.c
new file mode 100644
index 0000000..ce6c6e0
--- /dev/null
+++ b/test/flush_hex.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int e1, e2, r = 0;
+  const char *in =
+    "\xF\x1E\x2D\x3C\x4B\x5A\x69\x78\x87\x96\xA5\xB4\xC3\xD2\xE1\xF0";
+  char s[1000];
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC |
+      GD_VERBOSE);
+  gd_add_string(D, "STRING", in, 0);
+  e1 = gd_error(D);
+  CHECKI(e1, 0);
+
+  gd_close(D);
+  
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_get_string(D, "STRING", 1000, s);
+  e2 = gd_error(D);
+  CHECKI(e2, 0);
+  CHECKS(s, in);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/flush_invalid.c b/test/flush_invalid.c
new file mode 100644
index 0000000..60bac39
--- /dev/null
+++ b/test/flush_invalid.c
@@ -0,0 +1,45 @@
+/* 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
+ */
+/* Writing data to an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR);
+  gd_flush(D, NULL);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/flush_meta.c b/test/flush_meta.c
new file mode 100644
index 0000000..294a73e
--- /dev/null
+++ b/test/flush_meta.c
@@ -0,0 +1,60 @@
+/* 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 meta data */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/new";
+  struct stat buf;
+  int error, stat_format, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC |
+      GD_VERBOSE);
+  gd_add_raw(D, "new", GD_UINT8, 2, 0);
+  gd_metaflush(D);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  stat_format = stat(format, &buf);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(stat_format, 0);
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/flush_ref.c b/test/flush_ref.c
new file mode 100644
index 0000000..75a0b3f
--- /dev/null
+++ b/test/flush_ref.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
+ */
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format";
+  const char *format_data = "data RAW UINT8 1\nREFERENCE data\n";
+  const char *format1_data = "mata RAW UINT8 11\nREFERENCE mata\n";
+  int fd, e1, r = 0;
+  const char *r1;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_include_affix(D, "sub/format", 0, "prefix_", NULL, GD_IGNORE_REFS);
+  gd_rewrite_fragment(D, GD_ALL_FRAGMENTS);
+  gd_close(D);
+  D = gd_open(subdir, GD_RDONLY | GD_VERBOSE);
+  r1 = gd_reference(D, NULL);
+  CHECKS(r1, "mata");
+  e1 = gd_error(D);
+  gd_discard(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+
+  return r;
+}
diff --git a/test/flush_spec.c b/test/flush_spec.c
new file mode 100644
index 0000000..10fa57b
--- /dev/null
+++ b/test/flush_spec.c
@@ -0,0 +1,89 @@
+/* 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)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *apath = "dirfile/a";
+  const char *jpath = "dirfile/j";
+  const char *spec[] = {
+    "a RAW UINT8 1\n",
+    "c CONST UINT64 1\n",
+    "d CONST UINT64 2\n",
+    "e LINCOM 2 a c 1 h 3 d\n",
+    "f LINTERP a /lut/table\n",
+    "g MULTIPLY e f\n",
+    "h BIT a 2 d\n",
+    "i PHASE h c\n",
+    "j RAW UINT16 d\n",
+    "k PHASE h 3\n",
+    "l SBIT a d 2\n",
+    "m POLYNOM a 1 c 2 d\n",
+    "n STRING a\\ b\\ c\\ \\x01\\ ÿ\n",
+    "o DIVIDE j k\n",
+    "p RECIP e d\n",
+    "q WINDOW i m EQ c\n",
+    "r CARRAY FLOAT64 1.2 3.4 5.6 7.8\n",
+    NULL
+  };
+
+  int error, i = 0, r = 0;
+  FILE *stream;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC |
+      GD_VERBOSE);
+  for (i = 0; spec[i] != NULL; ++i)
+    gd_add_spec(D, spec[i], 0);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  stream = fopen(format, "rt");
+  i = 0;
+  while (!feof(stream)) {
+    char line[GD_MAX_LINE_LENGTH];
+    if (fgets(line, GD_MAX_LINE_LENGTH, stream) == NULL)
+      break;
+
+    if (line[0] == '/' || line[0] == '#' || line[0] < ' ')
+      continue;
+
+    if (strcmp(line, spec[i]) != 0) {
+      fprintf(stderr, "%s <=> %s", spec[i], line);
+      error = 1;
+    }
+    ++i;
+  }
+  fclose(stream);
+
+  unlink(apath);
+  unlink(jpath);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/foffs_alter.c b/test/foffs_alter.c
new file mode 100644
index 0000000..1b795c9
--- /dev/null
+++ b/test/foffs_alter.c
@@ -0,0 +1,75 @@
+/* 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 frameoffset */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 13\n";
+  unsigned char data_data[256];
+  int fd, ret, error, r = 0;
+  off_t fo, nf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_frameoffset(D, 16, 0, 0);
+  error = gd_error(D);
+  fo = gd_frameoffset(D, 0);
+  nf = gd_nframes(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKI(fo, 16);
+  CHECKI(nf, 48);
+
+  return r;
+}
diff --git a/test/foffs_get.c b/test/foffs_get.c
new file mode 100644
index 0000000..55470f1
--- /dev/null
+++ b/test/foffs_get.c
@@ -0,0 +1,70 @@
+/* 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 frameoffset */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 13\n";
+  unsigned char data_data[256];
+  int fd, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_frameoffset(D, 0);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n, 13);
+
+  return r;
+}
diff --git a/test/foffs_move.c b/test/foffs_move.c
new file mode 100644
index 0000000..5271090
--- /dev/null
+++ b/test/foffs_move.c
@@ -0,0 +1,75 @@
+/* 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 frameoffset */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 13\n";
+  unsigned char data_data[256];
+  int fd, ret, error, r = 0;
+  off_t fo, nf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_frameoffset(D, 16, 0, 1);
+  error = gd_error(D);
+  fo = gd_frameoffset(D, 0);
+  nf = gd_nframes(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKI(fo, 16);
+  CHECKI(nf, 45);
+
+  return r;
+}
diff --git a/test/fragment_affix.c b/test/fragment_affix.c
new file mode 100644
index 0000000..2832bb8
--- /dev/null
+++ b/test/fragment_affix.c
@@ -0,0 +1,63 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  char *prefix;
+  char *suffix;
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  ret = gd_fragment_affixes(D, 1, &prefix, &suffix);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKS(prefix,"A");
+  CHECKS(suffix,"Z");
+  CHECKI(ret,0);
+  CHECKI(error,0);
+  free(prefix);
+  free(suffix);
+
+  return r;
+}
diff --git a/test/fragment_affix_alter.c b/test/fragment_affix_alter.c
new file mode 100644
index 0000000..666813d
--- /dev/null
+++ b/test/fragment_affix_alter.c
@@ -0,0 +1,69 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "B CONST UINT8 1\nINCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  char *prefix;
+  char *suffix;
+  int fd, ret, e1, e2, e3, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_alter_affixes(D, 1, "C", NULL);
+  e1 = gd_error(D);
+  gd_fragment_affixes(D, 1, &prefix, &suffix);
+  e2 = gd_error(D);
+  gd_spf(D, "CdataZ");
+  e3 = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKS(prefix,"C");
+  CHECKS(suffix,"Z");
+  CHECKI(ret,0);
+  CHECKI(e1,0);
+  CHECKI(e2,0);
+  CHECKI(e3,0);
+  free(prefix);
+  free(suffix);
+
+  return r;
+}
diff --git a/test/fragment_affix_alter2.c b/test/fragment_affix_alter2.c
new file mode 100644
index 0000000..52f02ef
--- /dev/null
+++ b/test/fragment_affix_alter2.c
@@ -0,0 +1,67 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data = "B CONST UINT8 1\nINCLUDE format1 A Z\n";
+  const char *format1_data = "/INCLUDE format2 B Y\n";
+  const char *format2_data = "data RAW UINT8 11\n";
+  int fd, ret, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_alter_affixes(D, 1, NULL, "");
+  e1 = gd_error(D);
+  gd_spf(D, "ABdataY");
+  e2 = gd_error(D);
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret,0);
+  CHECKI(e1,0);
+  CHECKI(e2,0);
+
+  return r;
+}
diff --git a/test/fragment_affix_dup.c b/test/fragment_affix_dup.c
new file mode 100644
index 0000000..d9fa28a
--- /dev/null
+++ b/test/fragment_affix_dup.c
@@ -0,0 +1,66 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "CdataD CONST UINT8 1\nINCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  char *prefix;
+  char *suffix;
+  int fd, ret, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_alter_affixes(D, 1, "C", "D");
+  e1 = gd_error(D);
+  gd_fragment_affixes(D, 1, &prefix, &suffix);
+  e2 = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKS(prefix,"A");
+  CHECKS(suffix,"Z");
+  CHECKI(ret,-1);
+  CHECKI(e1,GD_E_DUPLICATE);
+  CHECKI(e2,0);
+  free(prefix);
+  free(suffix);
+
+  return r;
+}
diff --git a/test/fragment_index.c b/test/fragment_index.c
new file mode 100644
index 0000000..f79e4bb
--- /dev/null
+++ b/test/fragment_index.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Try to read fragment index */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1\n";
+  const char *format1_data = "data RAW UINT8 8\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_fragment_index(D, "data");
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 1);
+
+  return r;
+}
diff --git a/test/fragment_index_alias.c b/test/fragment_index_alias.c
new file mode 100644
index 0000000..aed2b59
--- /dev/null
+++ b/test/fragment_index_alias.c
@@ -0,0 +1,58 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1\n";
+  const char *format1_data = "/ALIAS alias target\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  n = gd_fragment_index(D, "alias");
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 1);
+
+  return r;
+}
diff --git a/test/fragment_name.c b/test/fragment_name.c
new file mode 100644
index 0000000..f1ba2c1
--- /dev/null
+++ b/test/fragment_name.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "INCLUDE format1\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  char *form0 = NULL;
+  char *form1 = NULL;
+  int fd, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  form0 = strdup(gd_fragmentname(D, 0));
+  form1 = strdup(gd_fragmentname(D, 1));
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  /* This only checks whether the end of the returned path is what we expect.
+   * This should work, since we can guarantee that both "dirfile" and "format*"
+   * aren't symlinks. */
+#if GD_DIRSEP == '/'
+  CHECKEOS(form0,"dirfile/format");
+  CHECKEOS(form1,"dirfile/format1");
+#else
+  CHECKEOS(form0,"dirfile\\format");
+  CHECKEOS(form1,"dirfile\\format1");
+#endif
+  free(form0);
+  free(form1);
+
+  return r;
+}
diff --git a/test/fragment_name_oor.c b/test/fragment_name_oor.c
new file mode 100644
index 0000000..b4e2680
--- /dev/null
+++ b/test/fragment_name_oor.c
@@ -0,0 +1,70 @@
+/* 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 gd_fragmentname out-of-range handling */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  const char *form0 = NULL;
+  const char *form1 = NULL;
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  form0 = gd_fragmentname(D, -3000);
+  form1 = gd_fragmentname(D, 1000);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKP(form0);
+  CHECKP(form1);
+  CHECKI(error, GD_E_BAD_INDEX);
+
+  return r;
+}
diff --git a/test/fragment_num.c b/test/fragment_num.c
new file mode 100644
index 0000000..e6cc8a9
--- /dev/null
+++ b/test/fragment_num.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, nfragments, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfragments = gd_nfragments(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(nfragments, 2);
+
+  return r;
+}
diff --git a/test/fragment_parent.c b/test/fragment_parent.c
new file mode 100644
index 0000000..ffbdddb
--- /dev/null
+++ b/test/fragment_parent.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n";
+  const char *format1_data = "b CONST UINT8 11\n/INCLUDE format2 UINT8 11";
+  const char *format2_data = "c CONST UINT8 11\n";
+  int fd, parent, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  parent = gd_parent_fragment(D, 2);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(parent, 1);
+
+  return r;
+}
diff --git a/test/get64.c b/test/get64.c
new file mode 100644
index 0000000..e05a589
--- /dev/null
+++ b/test/get64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#define _LARGEFILE64_SOURCE 1
+
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata64(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/get_affix.c b/test/get_affix.c
new file mode 100644
index 0000000..22193e7
--- /dev/null
+++ b/test/get_affix.c
@@ -0,0 +1,78 @@
+/* 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>
+#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 *data = "dirfile/data";
+  const char *format_data = "INCLUDE format1 A Z\n";
+  const char *format1_data = "phase PHASE data -2\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "AphaseZ", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKI(c, 3);
+
+  return r;
+}
diff --git a/test/get_bad_code.c b/test/get_bad_code.c
new file mode 100644
index 0000000..15af673
--- /dev/null
+++ b/test/get_bad_code.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read a non-existant field */
+#include "test.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "#\n";
+  unsigned char c = 0;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "no-such-field", 5, 0, 1, 0, GD_UINT8, &c);
+
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_CODE);
+  return r;
+}
diff --git a/test/get_bit.c b/test/get_bit.c
new file mode 100644
index 0000000..bee8b52
--- /dev/null
+++ b/test/get_bit.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read BIT */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "bit BIT data 1 3\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 2);
+
+  return r;
+}
diff --git a/test/get_carray.c b/test/get_carray.c
new file mode 100644
index 0000000..146f183
--- /dev/null
+++ b/test/get_carray.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "carray CARRAY FLOAT64 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n";
+  double c[7];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_get_carray(D, "carray", GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  for (i = 0; i < 7; ++i)
+    CHECKFi(i, c[i], 8.3 - i * 1.1);
+
+  return r;
+}
diff --git a/test/get_carray_c2r.c b/test/get_carray_c2r.c
new file mode 100644
index 0000000..e10b900
--- /dev/null
+++ b/test/get_carray_c2r.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 <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 = "carray CARRAY COMPLEX128 8.3;7.2 6.1;5.0 3.9;2.8 1.7;0.6\n";
+  double c[4];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_get_carray(D, "carray", GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  for (i = 0; i < 4; ++i)
+    CHECKFi(i, c[i], 8.3 - 2 * i * 1.1);
+
+  return r;
+}
diff --git a/test/get_carray_len.c b/test/get_carray_len.c
new file mode 100644
index 0000000..e0bf34e
--- /dev/null
+++ b/test/get_carray_len.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "carray CARRAY FLOAT64 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n";
+  int fd, error, r = 0;
+  size_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_carray_len(D, "carray");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 7);
+
+  return r;
+}
diff --git a/test/get_carray_slice.c b/test/get_carray_slice.c
new file mode 100644
index 0000000..129c1bb
--- /dev/null
+++ b/test/get_carray_slice.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "carray CARRAY FLOAT64 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n";
+  double c[4];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_get_carray_slice(D, "carray", 2, 4, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  for (i = 0; i < 4; ++i)
+    CHECKFi(i, c[i], 6.1 - i * 1.1);
+
+  return r;
+}
diff --git a/test/get_char.c b/test/get_char.c
new file mode 100644
index 0000000..9f98677
--- /dev/null
+++ b/test/get_char.c
@@ -0,0 +1,71 @@
+/* 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 use a old-style type character should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, (gd_type_t)'c', c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_TYPE);
+
+  return r;
+}
diff --git a/test/get_clincom.c b/test/get_clincom.c
new file mode 100644
index 0000000..4eff3f8
--- /dev/null
+++ b/test/get_clincom.c
@@ -0,0 +1,78 @@
+/* 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
+ */
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM 2 data 2;3 3;2 data 0;1 0\ndata RAW UINT8 1\n";
+#ifdef GD_NO_C99_API
+  double c[2] = {0, 0};
+  const double v[2] = {13, 22};
+#else
+  double complex c = 0;
+  const double complex v = 13 + _Complex_I * 22;
+#endif
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKC(c, v);
+
+  return r;
+}
diff --git a/test/get_complex128.c b/test/get_complex128.c
new file mode 100644
index 0000000..18c2057
--- /dev/null
+++ b/test/get_complex128.c
@@ -0,0 +1,90 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 */
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double c[16];
+  double data_data[256];
+#else
+  double complex c[8];
+  double complex data_data[128];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[2 * fd] = data_data[2 * fd + 1] = 1.5 * fd;
+#else
+    data_data[fd] = (double complex)(1.5 * (1 + _Complex_I) * fd);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    const double v[2] = {1.5 * (40 + i), 1.5 * (40 + i)};
+    CHECKCi(i, c + 2 * i, v);
+#else
+    CHECKCi(i, c[i], 1.5 * (1 + _Complex_I) * (40 + i));
+#endif
+  }
+
+  return r;
+}
diff --git a/test/get_complex64.c b/test/get_complex64.c
new file mode 100644
index 0000000..91b64ae
--- /dev/null
+++ b/test/get_complex64.c
@@ -0,0 +1,90 @@
+/* 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
+ */
+/* Attempt to read COMPLEX64 */
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 8\n";
+#ifdef GD_NO_C99_API
+  float c[16];
+  float data_data[256];
+#else
+  float complex c[8];
+  float complex data_data[128];
+#endif
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[2 * fd] = data_data[2 * fd + 1] = 1.5 * fd;
+#else
+    data_data[fd] = (float complex)(1.5 * (1 + _Complex_I) * fd);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    const float v[2] = {1.5 * (40 + i), 1.5 * (40 + i)};
+    CHECKCi(i, c + 2 * i, v);
+#else
+    CHECKCi(i, c[i], 1.5 * (1 + _Complex_I) * (40 + i));
+#endif
+  }
+
+  return r;
+}
diff --git a/test/get_const.c b/test/get_const.c
new file mode 100644
index 0000000..9c1358a
--- /dev/null
+++ b/test/get_const.c
@@ -0,0 +1,62 @@
+/* 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
+ */
+/* Attempt to read constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST FLOAT64 8.3\n";
+  double c;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_get_constant(D, "const", GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKF(c, 8.3);
+
+  return r;
+}
diff --git a/test/get_const_complex.c b/test/get_const_complex.c
new file mode 100644
index 0000000..13b5687
--- /dev/null
+++ b/test/get_const_complex.c
@@ -0,0 +1,72 @@
+/* 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
+ */
+/* Attempt to read complex constant */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST COMPLEX128 8.3;9.2\n";
+#ifdef GD_NO_C99_API
+  double c[2];
+  const double v[2] = {8.3, 9.2};
+#else
+  double complex c;
+  const double complex v = 8.3 + _Complex_I * 9.2;
+#endif
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#ifdef GD_NO_C99_API
+  n = gd_get_constant(D, "const", GD_COMPLEX128, c);
+#else
+  n = gd_get_constant(D, "const", GD_COMPLEX128, &c);
+#endif
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKC(c, v);
+
+  return r;
+}
diff --git a/test/get_const_repr.c b/test/get_const_repr.c
new file mode 100644
index 0000000..96a669c
--- /dev/null
+++ b/test/get_const_repr.c
@@ -0,0 +1,62 @@
+/* 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
+ */
+/* Attempt to read constant with repr */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "const CONST COMPLEX128 8.3;9.2\n";
+  double c;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_get_constant(D, "const.m", GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+  CHECKF(c, sqrt(8.3 * 8.3 + 9.2 * 9.2));
+
+  return r;
+}
diff --git a/test/get_cpolynom.c b/test/get_cpolynom.c
new file mode 100644
index 0000000..c195a15
--- /dev/null
+++ b/test/get_cpolynom.c
@@ -0,0 +1,78 @@
+/* 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
+ */
+/* Attempt to read POLYNOM */
+#include "test.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "polynom POLYNOM data 3;2 2;4 0;1\ndata RAW UINT8 1\n";
+#ifdef GD_NO_C99_API
+  double c[2] = {0, 0};
+  const double v[2] = {13, 47};
+#else
+  double complex c = 0;
+  const double complex v = 13 + _Complex_I * 47;
+#endif
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKC(c, v);
+
+  return r;
+}
diff --git a/test/get_cpolynom1.c b/test/get_cpolynom1.c
new file mode 100644
index 0000000..ef4e0b7
--- /dev/null
+++ b/test/get_cpolynom1.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 <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "polynom POLYNOM data 3;2 2;4\ndata RAW UINT8 1\n";
+  double c[16];
+  unsigned char data_data[256];
+  int i, fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "polynom", 5, 0, 8, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i) {
+    CHECKFi(i, c[i * 2], 3 + 2 * (5 + i));
+    CHECKFi(i, c[i * 2 + 1], 2 + 4 * (5 + i));
+  }
+
+  return r;
+}
diff --git a/test/get_cpolynom_int.c b/test/get_cpolynom_int.c
new file mode 100644
index 0000000..1c1e513
--- /dev/null
+++ b/test/get_cpolynom_int.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "polynom POLYNOM data 3;2 2;4 0;1\ndata RAW UINT8 1\n";
+  int32_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "polynom.r", 5, 0, 8, 0, GD_INT32, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 3 + 2 * (5 + i));
+
+  return r;
+}
diff --git a/test/get_divide.c b/test/get_divide.c
new file mode 100644
index 0000000..1f54191
--- /dev/null
+++ b/test/get_divide.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read DIVIDE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "div DIVIDE data INDEX\n"
+    "data RAW UINT8 1\n";
+  double c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)(fd + 2);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKF(c, 7. / 5);
+
+  return r;
+}
diff --git a/test/get_divide_ccin.c b/test/get_divide_ccin.c
new file mode 100644
index 0000000..e06f1f6
--- /dev/null
+++ b/test/get_divide_ccin.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "div DIVIDE data phase\n"
+    "phase PHASE data 1\n"
+    "data RAW COMPLEX128 1\n";
+  double c[16];
+  double data_data[512];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[i * 2] = (double)i;
+    data_data[i * 2 + 1] = (double)i / 256.;
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "div", 5, 0, 8, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i) {
+    CHECKFi(i, c[i * 2], (5. + i) / (6. + i));
+    CHECKFi(i, c[i * 2 + 1], 0);
+  }
+
+  return r;
+}
diff --git a/test/get_divide_crin.c b/test/get_divide_crin.c
new file mode 100644
index 0000000..abba583
--- /dev/null
+++ b/test/get_divide_crin.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "div DIVIDE data phase\n"
+    "phase PHASE data.r 1\n"
+    "data RAW COMPLEX128 1\n";
+  double c[16];
+  double data_data[512];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[i * 2] = (double)i;
+    data_data[i * 2 + 1] = (double)i / 256.;
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "div", 5, 0, 8, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i) {
+    CHECKFi(i, c[i * 2], (5. + i) / (6. + i));
+    CHECKFi(i, c[i * 2 + 1], (5. + i) / (6. + i) / 256.);
+  }
+
+  return r;
+}
diff --git a/test/get_divide_crinr.c b/test/get_divide_crinr.c
new file mode 100644
index 0000000..887f4b3
--- /dev/null
+++ b/test/get_divide_crinr.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "div DIVIDE data phase\n"
+    "phase PHASE data.r 1\n"
+    "data RAW COMPLEX128 1\n";
+  double c[8];
+  double data_data[512];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[i * 2] = (double)i;
+    data_data[i * 2 + 1] = (double)i / 256.;
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "div", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i, c[i], (5. + i) / (6. + i));
+
+  return r;
+}
diff --git a/test/get_divide_rcin.c b/test/get_divide_rcin.c
new file mode 100644
index 0000000..c605a88
--- /dev/null
+++ b/test/get_divide_rcin.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "div DIVIDE data.r phase\n"
+    "phase PHASE data 1\n"
+    "data RAW COMPLEX128 1\n";
+  double c[16];
+  double data_data[512];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[i * 2] = (double)i;
+    data_data[i * 2 + 1] = (double)i / 256.;
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "div", 5, 0, 8, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i) {
+    CHECKFi(i, c[i * 2], (5. + i) * 65536. / 65537. / (6. + i));
+    CHECKFi(i, c[i * 2 + 1], -(5. + i) * 256. / 65537. / (6. + i));
+  }
+
+  return r;
+}
diff --git a/test/get_divide_s.c b/test/get_divide_s.c
new file mode 100644
index 0000000..96c6e7e
--- /dev/null
+++ b/test/get_divide_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 =
+    "div DIVIDE data phase\n"
+    "phase PHASE data 128\n"
+    "data RAW UINT8 1\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "div", 0, 0, 1000, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 128);
+
+  return r;
+}
diff --git a/test/get_endian16.c b/test/get_endian16.c
new file mode 100644
index 0000000..0871c50
--- /dev/null
+++ b/test/get_endian16.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+static int BigEndian(void)
+{
+  union {
+    long int li;
+    char ch[sizeof(long int)];
+  } un;
+  un.li = 1;
+  return (un.ch[sizeof(long int) - 1] == 1);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  char format_data[1000];
+  uint16_t c = 0;
+  uint16_t data_data[128];
+  const int big_endian = BigEndian();
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  sprintf(format_data, "data RAW UINT16 1\nENDIAN %s\n", (big_endian)
+      ? "little" : "big");
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = (uint16_t)(fd * (0x0201));
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKX(c, 0x50a);
+
+  return r;
+}
diff --git a/test/get_endian32.c b/test/get_endian32.c
new file mode 100644
index 0000000..0bd5fcf
--- /dev/null
+++ b/test/get_endian32.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+static int BigEndian(void)
+{
+  union {
+    long int li;
+    char ch[sizeof(long int)];
+  } un;
+  un.li = 1;
+  return (un.ch[sizeof(long int) - 1] == 1);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  char format_data[1000];
+  uint32_t c = 0;
+  uint32_t data_data[128];
+  const int big_endian = BigEndian();
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  sprintf(format_data, "data RAW UINT32 1\nENDIAN %s\n", (big_endian)
+      ? "little" : "big");
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = fd * (0x020201);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKX(c, 0x50a0a00);
+
+  return r;
+}
diff --git a/test/get_endian64.c b/test/get_endian64.c
new file mode 100644
index 0000000..b750944
--- /dev/null
+++ b/test/get_endian64.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+static int BigEndian(void)
+{
+  union {
+    long int li;
+    char ch[sizeof(long int)];
+  } un;
+  un.li = 1;
+  return (un.ch[sizeof(long int) - 1] == 1);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  char format_data[1000];
+  uint64_t c = 0;
+  uint64_t data_data[128];
+  const int big_endian = BigEndian();
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  sprintf(format_data, "data RAW UINT64 1\nENDIAN %s\n", (big_endian)
+      ? "little" : "big");
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = fd * (0x020100000201);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKX(c, 0x50a0000050a0000);
+
+  return r;
+}
diff --git a/test/get_endian8.c b/test/get_endian8.c
new file mode 100644
index 0000000..fca7168
--- /dev/null
+++ b/test/get_endian8.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+static int BigEndian(void)
+{
+  union {
+    long int li;
+    char ch[sizeof(long int)];
+  } un;
+  un.li = 1;
+  return (un.ch[sizeof(long int) - 1] == 1);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  char format_data[1000];
+  uint8_t c = 0;
+  uint8_t data_data[128];
+  const int big_endian = BigEndian();
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  sprintf(format_data, "data RAW UINT8 1\nENDIAN %s\n", (big_endian)
+      ? "little" : "big");
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = (uint8_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint8_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKX(c, 0x5);
+
+  return r;
+}
diff --git a/test/get_endian_complex128_arm.c b/test/get_endian_complex128_arm.c
new file mode 100644
index 0000000..181567b
--- /dev/null
+++ b/test/get_endian_complex128_arm.c
@@ -0,0 +1,226 @@
+/* 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
+ */
+/* Attempt to read arm-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\nENDIAN little arm\n";
+#ifdef GD_NO_C99_API
+  double u[20];
+  double v[20][2];
+#else
+  double complex u[10];
+  double complex v[20];
+#endif
+  const unsigned char data_data[64 * 16] = {
+    0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x0b, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x60, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xc8, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x16, 0x31, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xa1, 0x39, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xc0, 0x38, 0x43, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x20, 0xd5, 0x4c, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xd8, 0x9f, 0x55, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xe2, 0x37, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xd3, 0x53, 0x68, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xde, 0x3e, 0x72, 0x40, 0x00, 0x00, 0x00, 0x40,
+    0x4d, 0x5e, 0x7b, 0x40, 0x00, 0x00, 0x00, 0x60,
+    0xba, 0x86, 0x84, 0x40, 0x00, 0x00, 0x00, 0x08,
+    0x17, 0xca, 0x8e, 0x40, 0x00, 0x00, 0x00, 0x0c,
+    0x91, 0x17, 0x97, 0x40, 0x00, 0x00, 0x00, 0x49,
+    0xac, 0x51, 0xa1, 0x40, 0x00, 0x00, 0xc0, 0xf6,
+    0x83, 0xfa, 0xa9, 0x40, 0x00, 0x00, 0x20, 0x72,
+    0xe2, 0x7b, 0xb3, 0x40, 0x00, 0x00, 0x98, 0x95,
+    0xd3, 0x39, 0xbd, 0x40, 0x00, 0x00, 0x64, 0xe0,
+    0x5e, 0xeb, 0xc5, 0x40, 0x00, 0x00, 0x4b, 0xe8,
+    0x87, 0x70, 0xd0, 0x40, 0x00, 0x40, 0x38, 0x2e,
+    0xca, 0xa8, 0xd8, 0x40, 0x00, 0x60, 0x54, 0xc5,
+    0x98, 0x7e, 0xe2, 0x40, 0x00, 0x48, 0xff, 0x13,
+    0xe4, 0xbd, 0xeb, 0x40, 0x00, 0xec, 0xfe, 0x1d,
+    0x6b, 0xce, 0xf4, 0x40, 0x00, 0x31, 0x7f, 0x16,
+    0xa0, 0x35, 0xff, 0x40, 0x80, 0xc9, 0xbe, 0xa1,
+    0x38, 0x68, 0x07, 0x41, 0x20, 0x17, 0x4f, 0x79,
+    0x2a, 0x8e, 0x11, 0x41, 0x58, 0x51, 0xfb, 0x5a,
+    0x3f, 0x55, 0x1a, 0x41, 0x04, 0xfa, 0x78, 0x88,
+    0xef, 0xbf, 0x23, 0x41, 0x83, 0xbb, 0x5a, 0xa6,
+    0xe7, 0x9f, 0x2d, 0x41, 0x44, 0x19, 0x88, 0x79,
+    0xed, 0x37, 0x36, 0x41, 0xf3, 0x12, 0x26, 0x9b,
+    0xf2, 0xa9, 0x40, 0x41, 0x36, 0x8e, 0x5c, 0x34,
+    0xeb, 0xfe, 0x48, 0x41, 0x51, 0xd5, 0x8a, 0x4e,
+    0x30, 0xbf, 0x52, 0x41, 0xfd, 0x1f, 0xe8, 0x7a,
+    0xc8, 0x1e, 0x5c, 0x41, 0xfc, 0x2f, 0x5c, 0xb8,
+    0x16, 0x17, 0x65, 0x41, 0xfd, 0x23, 0x45, 0x8a,
+    0xa1, 0xa2, 0x6f, 0x41, 0xfc, 0xb5, 0x67, 0xcf,
+    0xf9, 0xb9, 0x77, 0x41, 0x7d, 0xc8, 0x8d, 0x5b,
+    0x7b, 0xcb, 0x81, 0x41, 0x5e, 0x56, 0xaa, 0x04,
+    0x38, 0xb1, 0x8a, 0x41, 0x8d, 0x81, 0xff, 0x86,
+    0xea, 0x04, 0x94, 0x41, 0x2a, 0xa1, 0x3f, 0x65,
+    0x5f, 0x07, 0x9e, 0x41, 0xbf, 0x71, 0xdf, 0x97,
+    0x87, 0x85, 0xa6, 0x41, 0x4f, 0x95, 0xe7, 0xb1,
+    0x25, 0xe4, 0xb0, 0x41, 0xfb, 0xaf, 0x6d, 0xc5,
+    0x38, 0x56, 0xb9, 0x41, 0xf8, 0x87, 0x24, 0xa8,
+    0xaa, 0x00, 0xc3, 0x41, 0xfa, 0x65, 0x1b, 0x7e,
+    0xff, 0x80, 0xcc, 0x41, 0xf7, 0x18, 0x29, 0xbd,
+    0xbf, 0x60, 0xd5, 0x41, 0xb9, 0xd2, 0xde, 0xcd,
+    0x8f, 0x08, 0xe0, 0x41, 0x0b, 0x1e, 0x67, 0xda,
+    0xd7, 0x0c, 0xe8, 0x41, 0x10, 0xad, 0x9a, 0xc7,
+    0xa1, 0x09, 0xf2, 0x41, 0xcc, 0x01, 0xb4, 0xd5,
+    0x72, 0x0e, 0xfb, 0x41, 0xb2, 0x02, 0x8e, 0xc0,
+    0xd6, 0x4a, 0x04, 0x42, 0x06, 0x82, 0x6a, 0x10,
+    0x41, 0x70, 0x0e, 0x42, 0x09, 0xc3, 0x9f, 0x18,
+    0x30, 0xd4, 0x16, 0x42, 0x47, 0xd2, 0x77, 0xd2,
+    0x24, 0x1f, 0x21, 0x42, 0xb5, 0xdd, 0xd9, 0x9d,
+    0xb6, 0xae, 0x29, 0x42, 0x90, 0xcc, 0xc6, 0xec,
+    0x09, 0x43, 0x33, 0x42, 0x6c, 0x19, 0x95, 0x31,
+    0x8d, 0xe4, 0x3c, 0x42, 0x22, 0xa6, 0x5f, 0xca,
+    0x6a, 0xab, 0x45, 0x42, 0x9a, 0xbc, 0xc7, 0x57,
+    0x8f, 0x40, 0x50, 0x42, 0x74, 0xcd, 0xd5, 0xc1,
+    0xd7, 0x60, 0x58, 0x42, 0x2e, 0xb4, 0xc0, 0xa2,
+    0xa1, 0x48, 0x62, 0x42, 0x22, 0x87, 0x10, 0xba,
+    0xf2, 0x6c, 0x6b, 0x42, 0xb3, 0xca, 0x18, 0x97,
+    0xb5, 0x91, 0x74, 0x42, 0x06, 0x98, 0x52, 0xf1,
+    0x90, 0xda, 0x7e, 0x42, 0x09, 0xe4, 0xfb, 0xe9,
+    0xec, 0x23, 0x87, 0x42, 0x07, 0xeb, 0x7c, 0xaf,
+    0xf1, 0x5a, 0x91, 0x42, 0x45, 0xb0, 0x9d, 0x83,
+    0x6a, 0x08, 0x9a, 0x42, 0x68, 0x88, 0x6c, 0x45,
+    0x4f, 0x86, 0xa3, 0x42, 0x4e, 0x66, 0x11, 0xb4,
+    0x77, 0x49, 0xad, 0x42, 0x75, 0x19, 0x1a, 0x8e,
+    0x19, 0xf7, 0xb5, 0x42, 0x18, 0x93, 0x93, 0xaa,
+    0x53, 0x79, 0xc0, 0x42, 0x52, 0xae, 0xee, 0x3f,
+    0xfc, 0xb5, 0xc8, 0x42, 0x7b, 0x05, 0xe6, 0xdf,
+    0x7d, 0x88, 0xd2, 0x42, 0x1c, 0x84, 0xec, 0xa7,
+    0xbc, 0xcc, 0xdb, 0x42, 0x2a, 0xc6, 0xe2, 0x7b,
+    0x8d, 0xd9, 0xe4, 0x42, 0xa0, 0x14, 0xea, 0x5c,
+    0x54, 0x46, 0xef, 0x42, 0xf0, 0x1e, 0x5f, 0x0b,
+    0xbf, 0x74, 0xf7, 0x42, 0x34, 0x57, 0x87, 0x08,
+    0x8f, 0x97, 0x01, 0x43, 0x67, 0x81, 0x65, 0x46,
+    0x56, 0x63, 0x0a, 0x43, 0x1a, 0x42, 0x98, 0xe9,
+    0x81, 0xca, 0x13, 0x43, 0x94, 0x31, 0x32, 0x2f,
+    0xc1, 0xaf, 0x1d, 0x43, 0x5e, 0x4a, 0xcb, 0xc6,
+    0xd1, 0x43, 0x26, 0x43, 0xc6, 0x77, 0x18, 0x55,
+    0xdc, 0xb2, 0x30, 0x43, 0xd4, 0x59, 0xd2, 0xff,
+    0x4b, 0x0c, 0x39, 0x43, 0xbe, 0x86, 0xbb, 0x7f,
+    0x38, 0xc9, 0x42, 0x43, 0x0e, 0xa5, 0xcc, 0x9f,
+    0xd4, 0x2d, 0x4c, 0x43, 0x95, 0xf7, 0xb2, 0xef,
+    0x5f, 0x22, 0x55, 0x43, 0xb0, 0x39, 0xc6, 0xb3,
+    0x8f, 0xb3, 0x5f, 0x43, 0x88, 0x56, 0xa9, 0x8d,
+    0xab, 0xc6, 0x67, 0x43, 0xe6, 0x00, 0x3f, 0xaa,
+    0x00, 0xd5, 0x71, 0x43, 0xac, 0x40, 0xaf, 0xbf,
+    0x81, 0xbf, 0x7a, 0x43, 0x02, 0xe1, 0x86, 0x1f,
+    0xa0, 0x0f, 0x84, 0x43, 0xc2, 0x28, 0xa5, 0xd7,
+    0x71, 0x17, 0x8e, 0x43, 0x23, 0xbd, 0x77, 0x43,
+    0x94, 0x91, 0x96, 0x43, 0xda, 0xcd, 0x99, 0xf2,
+    0x2f, 0xed, 0xa0, 0x43, 0x64, 0x5a, 0xf3, 0xb5,
+    0xc7, 0x63, 0xa9, 0x43, 0x96, 0x07, 0xed, 0x90,
+    0xd5, 0x0a, 0xb3, 0x43, 0xb0, 0xc5, 0xb1, 0xac,
+    0x40, 0x90, 0xbc, 0x43, 0x88, 0xa8, 0x0a, 0x83,
+    0x30, 0x6c, 0xc5, 0x43, 0x66, 0xfe, 0x47, 0x62,
+    0x24, 0x11, 0xd0, 0x43, 0xcc, 0xfe, 0xb5, 0x49,
+    0xb6, 0x19, 0xd8, 0x43, 0x32, 0xfe, 0x90, 0x6e,
+    0x48, 0x13, 0xe2, 0x43, 0xa6, 0xbe, 0xec, 0xd2,
+    0xed, 0x1c, 0xeb, 0x43, 0xf9, 0x1d, 0x63, 0x3c,
+    0xb1, 0x55, 0xf4, 0x43, 0x7b, 0x56, 0x4a, 0xed,
+    0x8a, 0x80, 0xfe, 0x43, 0xb8, 0x81, 0xef, 0xe3,
+    0x68, 0xe0, 0x06, 0x44, 0x4a, 0xa1, 0xf3, 0x2a,
+    0x4e, 0x28, 0x11, 0x44, 0xf8, 0xb8, 0x36, 0x20,
+    0x75, 0xbc, 0x19, 0x44, 0x74, 0x15, 0x52, 0x30,
+    0x57, 0x4d, 0x23, 0x44, 0x17, 0x90, 0x3d, 0xe4,
+    0x03, 0xf4, 0x2c, 0x44, 0x22, 0x58, 0x5c, 0xd6,
+    0x02, 0xb7, 0x35, 0x44, 0x1a, 0x42, 0xc5, 0xe0,
+    0x42, 0x49, 0x40, 0x44, 0x94, 0xf1, 0x93, 0x28,
+    0xe3, 0x6d, 0x48, 0x44, 0x5e, 0xea, 0xdd, 0x3c,
+    0x6a, 0x52, 0x52, 0x44, 0xc6, 0x6f, 0xa6, 0x6d,
+    0x9f, 0x7b, 0x5b, 0x44, 0xa9, 0xa7, 0x79, 0xa4,
+    0xb7, 0x9c, 0x64, 0x44, 0xbf, 0x3d, 0x5b, 0xbb,
+    0x13, 0xeb, 0x6e, 0x44, 0x9e, 0xdc, 0x08, 0x99,
+    0x4e, 0x30, 0x77, 0x44, 0x76, 0xa5, 0xc6, 0xb2,
+    0x3b, 0x64, 0x81, 0x44, 0x18, 0xfc, 0x14, 0x06,
+    0x58, 0x16, 0x8a, 0x44, 0x24, 0x7a, 0x1f, 0x89,
+    0xc2, 0x90, 0x93, 0x44, 0x9b, 0x9b, 0xd7, 0x66,
+    0x23, 0x59, 0x9d, 0x44, 0x68, 0x69, 0x43, 0x9a
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+#ifdef GD_NO_C99_API
+  v[0][0] = 1.5;
+  v[0][1] = 2.25;
+  for (i = 1; i < 20; ++i) {
+    v[i][0] = v[i - 1][0] * 2.25;
+    v[i][1] = v[i - 1][1] * 2.25;
+  }
+#else
+  v[0] = 1.5 + _Complex_I * 2.25;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 2.25;
+#endif
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * 16 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i) {
+#ifdef GD_NO_C99_API
+    CHECKCi(i, u + 2 * i, v[i + 5]);
+#else
+    CHECKCi(i, u[i], v[i + 5]);
+#endif
+  }
+
+  return r;
+}
diff --git a/test/get_endian_complex128_big.c b/test/get_endian_complex128_big.c
new file mode 100644
index 0000000..b44246f
--- /dev/null
+++ b/test/get_endian_complex128_big.c
@@ -0,0 +1,225 @@
+/* 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
+ */
+/* Attempt to read big-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\nENDIAN big\n";
+#ifdef GD_NO_C99_API
+  double u[20];
+  double v[20][2];
+#else
+  double complex u[10];
+  double complex v[20];
+#endif
+  const unsigned char data_data[64 * 16] = {
+    0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x1e, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x26, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x31, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x39, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x43, 0x38, 0xc0, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x4c, 0xd5, 0x20, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x55, 0x9f, 0xd8, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x60, 0x37, 0xe2, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x68, 0x53, 0xd3, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x72, 0x3e, 0xde, 0x40, 0x00, 0x00, 0x00,
+    0x40, 0x7b, 0x5e, 0x4d, 0x60, 0x00, 0x00, 0x00,
+    0x40, 0x84, 0x86, 0xba, 0x08, 0x00, 0x00, 0x00,
+    0x40, 0x8e, 0xca, 0x17, 0x0c, 0x00, 0x00, 0x00,
+    0x40, 0x97, 0x17, 0x91, 0x49, 0x00, 0x00, 0x00,
+    0x40, 0xa1, 0x51, 0xac, 0xf6, 0xc0, 0x00, 0x00,
+    0x40, 0xa9, 0xfa, 0x83, 0x72, 0x20, 0x00, 0x00,
+    0x40, 0xb3, 0x7b, 0xe2, 0x95, 0x98, 0x00, 0x00,
+    0x40, 0xbd, 0x39, 0xd3, 0xe0, 0x64, 0x00, 0x00,
+    0x40, 0xc5, 0xeb, 0x5e, 0xe8, 0x4b, 0x00, 0x00,
+    0x40, 0xd0, 0x70, 0x87, 0x2e, 0x38, 0x40, 0x00,
+    0x40, 0xd8, 0xa8, 0xca, 0xc5, 0x54, 0x60, 0x00,
+    0x40, 0xe2, 0x7e, 0x98, 0x13, 0xff, 0x48, 0x00,
+    0x40, 0xeb, 0xbd, 0xe4, 0x1d, 0xfe, 0xec, 0x00,
+    0x40, 0xf4, 0xce, 0x6b, 0x16, 0x7f, 0x31, 0x00,
+    0x40, 0xff, 0x35, 0xa0, 0xa1, 0xbe, 0xc9, 0x80,
+    0x41, 0x07, 0x68, 0x38, 0x79, 0x4f, 0x17, 0x20,
+    0x41, 0x11, 0x8e, 0x2a, 0x5a, 0xfb, 0x51, 0x58,
+    0x41, 0x1a, 0x55, 0x3f, 0x88, 0x78, 0xfa, 0x04,
+    0x41, 0x23, 0xbf, 0xef, 0xa6, 0x5a, 0xbb, 0x83,
+    0x41, 0x2d, 0x9f, 0xe7, 0x79, 0x88, 0x19, 0x44,
+    0x41, 0x36, 0x37, 0xed, 0x9b, 0x26, 0x12, 0xf3,
+    0x41, 0x40, 0xa9, 0xf2, 0x34, 0x5c, 0x8e, 0x36,
+    0x41, 0x48, 0xfe, 0xeb, 0x4e, 0x8a, 0xd5, 0x51,
+    0x41, 0x52, 0xbf, 0x30, 0x7a, 0xe8, 0x1f, 0xfd,
+    0x41, 0x5c, 0x1e, 0xc8, 0xb8, 0x5c, 0x2f, 0xfc,
+    0x41, 0x65, 0x17, 0x16, 0x8a, 0x45, 0x23, 0xfd,
+    0x41, 0x6f, 0xa2, 0xa1, 0xcf, 0x67, 0xb5, 0xfc,
+    0x41, 0x77, 0xb9, 0xf9, 0x5b, 0x8d, 0xc8, 0x7d,
+    0x41, 0x81, 0xcb, 0x7b, 0x04, 0xaa, 0x56, 0x5e,
+    0x41, 0x8a, 0xb1, 0x38, 0x86, 0xff, 0x81, 0x8d,
+    0x41, 0x94, 0x04, 0xea, 0x65, 0x3f, 0xa1, 0x2a,
+    0x41, 0x9e, 0x07, 0x5f, 0x97, 0xdf, 0x71, 0xbf,
+    0x41, 0xa6, 0x85, 0x87, 0xb1, 0xe7, 0x95, 0x4f,
+    0x41, 0xb0, 0xe4, 0x25, 0xc5, 0x6d, 0xaf, 0xfb,
+    0x41, 0xb9, 0x56, 0x38, 0xa8, 0x24, 0x87, 0xf8,
+    0x41, 0xc3, 0x00, 0xaa, 0x7e, 0x1b, 0x65, 0xfa,
+    0x41, 0xcc, 0x80, 0xff, 0xbd, 0x29, 0x18, 0xf7,
+    0x41, 0xd5, 0x60, 0xbf, 0xcd, 0xde, 0xd2, 0xb9,
+    0x41, 0xe0, 0x08, 0x8f, 0xda, 0x67, 0x1e, 0x0b,
+    0x41, 0xe8, 0x0c, 0xd7, 0xc7, 0x9a, 0xad, 0x10,
+    0x41, 0xf2, 0x09, 0xa1, 0xd5, 0xb4, 0x01, 0xcc,
+    0x41, 0xfb, 0x0e, 0x72, 0xc0, 0x8e, 0x02, 0xb2,
+    0x42, 0x04, 0x4a, 0xd6, 0x10, 0x6a, 0x82, 0x06,
+    0x42, 0x0e, 0x70, 0x41, 0x18, 0x9f, 0xc3, 0x09,
+    0x42, 0x16, 0xd4, 0x30, 0xd2, 0x77, 0xd2, 0x47,
+    0x42, 0x21, 0x1f, 0x24, 0x9d, 0xd9, 0xdd, 0xb5,
+    0x42, 0x29, 0xae, 0xb6, 0xec, 0xc6, 0xcc, 0x90,
+    0x42, 0x33, 0x43, 0x09, 0x31, 0x95, 0x19, 0x6c,
+    0x42, 0x3c, 0xe4, 0x8d, 0xca, 0x5f, 0xa6, 0x22,
+    0x42, 0x45, 0xab, 0x6a, 0x57, 0xc7, 0xbc, 0x9a,
+    0x42, 0x50, 0x40, 0x8f, 0xc1, 0xd5, 0xcd, 0x74,
+    0x42, 0x58, 0x60, 0xd7, 0xa2, 0xc0, 0xb4, 0x2e,
+    0x42, 0x62, 0x48, 0xa1, 0xba, 0x10, 0x87, 0x22,
+    0x42, 0x6b, 0x6c, 0xf2, 0x97, 0x18, 0xca, 0xb3,
+    0x42, 0x74, 0x91, 0xb5, 0xf1, 0x52, 0x98, 0x06,
+    0x42, 0x7e, 0xda, 0x90, 0xe9, 0xfb, 0xe4, 0x09,
+    0x42, 0x87, 0x23, 0xec, 0xaf, 0x7c, 0xeb, 0x07,
+    0x42, 0x91, 0x5a, 0xf1, 0x83, 0x9d, 0xb0, 0x45,
+    0x42, 0x9a, 0x08, 0x6a, 0x45, 0x6c, 0x88, 0x68,
+    0x42, 0xa3, 0x86, 0x4f, 0xb4, 0x11, 0x66, 0x4e,
+    0x42, 0xad, 0x49, 0x77, 0x8e, 0x1a, 0x19, 0x75,
+    0x42, 0xb5, 0xf7, 0x19, 0xaa, 0x93, 0x93, 0x18,
+    0x42, 0xc0, 0x79, 0x53, 0x3f, 0xee, 0xae, 0x52,
+    0x42, 0xc8, 0xb5, 0xfc, 0xdf, 0xe6, 0x05, 0x7b,
+    0x42, 0xd2, 0x88, 0x7d, 0xa7, 0xec, 0x84, 0x1c,
+    0x42, 0xdb, 0xcc, 0xbc, 0x7b, 0xe2, 0xc6, 0x2a,
+    0x42, 0xe4, 0xd9, 0x8d, 0x5c, 0xea, 0x14, 0xa0,
+    0x42, 0xef, 0x46, 0x54, 0x0b, 0x5f, 0x1e, 0xf0,
+    0x42, 0xf7, 0x74, 0xbf, 0x08, 0x87, 0x57, 0x34,
+    0x43, 0x01, 0x97, 0x8f, 0x46, 0x65, 0x81, 0x67,
+    0x43, 0x0a, 0x63, 0x56, 0xe9, 0x98, 0x42, 0x1a,
+    0x43, 0x13, 0xca, 0x81, 0x2f, 0x32, 0x31, 0x94,
+    0x43, 0x1d, 0xaf, 0xc1, 0xc6, 0xcb, 0x4a, 0x5e,
+    0x43, 0x26, 0x43, 0xd1, 0x55, 0x18, 0x77, 0xc6,
+    0x43, 0x30, 0xb2, 0xdc, 0xff, 0xd2, 0x59, 0xd4,
+    0x43, 0x39, 0x0c, 0x4b, 0x7f, 0xbb, 0x86, 0xbe,
+    0x43, 0x42, 0xc9, 0x38, 0x9f, 0xcc, 0xa5, 0x0e,
+    0x43, 0x4c, 0x2d, 0xd4, 0xef, 0xb2, 0xf7, 0x95,
+    0x43, 0x55, 0x22, 0x5f, 0xb3, 0xc6, 0x39, 0xb0,
+    0x43, 0x5f, 0xb3, 0x8f, 0x8d, 0xa9, 0x56, 0x88,
+    0x43, 0x67, 0xc6, 0xab, 0xaa, 0x3f, 0x00, 0xe6,
+    0x43, 0x71, 0xd5, 0x00, 0xbf, 0xaf, 0x40, 0xac,
+    0x43, 0x7a, 0xbf, 0x81, 0x1f, 0x86, 0xe1, 0x02,
+    0x43, 0x84, 0x0f, 0xa0, 0xd7, 0xa5, 0x28, 0xc2,
+    0x43, 0x8e, 0x17, 0x71, 0x43, 0x77, 0xbd, 0x23,
+    0x43, 0x96, 0x91, 0x94, 0xf2, 0x99, 0xcd, 0xda,
+    0x43, 0xa0, 0xed, 0x2f, 0xb5, 0xf3, 0x5a, 0x64,
+    0x43, 0xa9, 0x63, 0xc7, 0x90, 0xed, 0x07, 0x96,
+    0x43, 0xb3, 0x0a, 0xd5, 0xac, 0xb1, 0xc5, 0xb0,
+    0x43, 0xbc, 0x90, 0x40, 0x83, 0x0a, 0xa8, 0x88,
+    0x43, 0xc5, 0x6c, 0x30, 0x62, 0x47, 0xfe, 0x66,
+    0x43, 0xd0, 0x11, 0x24, 0x49, 0xb5, 0xfe, 0xcc,
+    0x43, 0xd8, 0x19, 0xb6, 0x6e, 0x90, 0xfe, 0x32,
+    0x43, 0xe2, 0x13, 0x48, 0xd2, 0xec, 0xbe, 0xa6,
+    0x43, 0xeb, 0x1c, 0xed, 0x3c, 0x63, 0x1d, 0xf9,
+    0x43, 0xf4, 0x55, 0xb1, 0xed, 0x4a, 0x56, 0x7b,
+    0x43, 0xfe, 0x80, 0x8a, 0xe3, 0xef, 0x81, 0xb8,
+    0x44, 0x06, 0xe0, 0x68, 0x2a, 0xf3, 0xa1, 0x4a,
+    0x44, 0x11, 0x28, 0x4e, 0x20, 0x36, 0xb8, 0xf8,
+    0x44, 0x19, 0xbc, 0x75, 0x30, 0x52, 0x15, 0x74,
+    0x44, 0x23, 0x4d, 0x57, 0xe4, 0x3d, 0x90, 0x17,
+    0x44, 0x2c, 0xf4, 0x03, 0xd6, 0x5c, 0x58, 0x22,
+    0x44, 0x35, 0xb7, 0x02, 0xe0, 0xc5, 0x42, 0x1a,
+    0x44, 0x40, 0x49, 0x42, 0x28, 0x93, 0xf1, 0x94,
+    0x44, 0x48, 0x6d, 0xe3, 0x3c, 0xdd, 0xea, 0x5e,
+    0x44, 0x52, 0x52, 0x6a, 0x6d, 0xa6, 0x6f, 0xc6,
+    0x44, 0x5b, 0x7b, 0x9f, 0xa4, 0x79, 0xa7, 0xa9,
+    0x44, 0x64, 0x9c, 0xb7, 0xbb, 0x5b, 0x3d, 0xbf,
+    0x44, 0x6e, 0xeb, 0x13, 0x99, 0x08, 0xdc, 0x9e,
+    0x44, 0x77, 0x30, 0x4e, 0xb2, 0xc6, 0xa5, 0x76,
+    0x44, 0x81, 0x64, 0x3b, 0x06, 0x14, 0xfc, 0x18,
+    0x44, 0x8a, 0x16, 0x58, 0x89, 0x1f, 0x7a, 0x24,
+    0x44, 0x93, 0x90, 0xc2, 0x66, 0xd7, 0x9b, 0x9b,
+    0x44, 0x9d, 0x59, 0x23, 0x9a, 0x43, 0x69, 0x68
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+#ifdef GD_NO_C99_API
+  v[0][0] = 1.5;
+  v[0][1] = 2.25;
+  for (i = 1; i < 20; ++i) {
+    v[i][0] = v[i - 1][0] * 2.25;
+    v[i][1] = v[i - 1][1] * 2.25;
+  }
+#else
+  v[0] = 1.5 + _Complex_I * 2.25;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 2.25;
+#endif
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * 16 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+#ifdef GD_NO_C99_API
+    CHECKCi(i, u + 2 * i, v[i + 5]);
+#else
+    CHECKCi(i, u[i], v[i + 5]);
+#endif
+
+  return r;
+}
diff --git a/test/get_endian_complex128_little.c b/test/get_endian_complex128_little.c
new file mode 100644
index 0000000..8ffb539
--- /dev/null
+++ b/test/get_endian_complex128_little.c
@@ -0,0 +1,225 @@
+/* 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
+ */
+/* Attempt to read little-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\nENDIAN little\n";
+#ifdef GD_NO_C99_API
+  double u[20];
+  double v[20][2];
+#else
+  double complex u[10];
+  double complex v[20];
+#endif
+  const unsigned char data_data[64 * 16] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x14, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1e, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x26, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x31, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x39, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x43, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x20, 0xd5, 0x4c, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0xd8, 0x9f, 0x55, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0xe2, 0x37, 0x60, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0xd3, 0x53, 0x68, 0x40,
+    0x00, 0x00, 0x00, 0x40, 0xde, 0x3e, 0x72, 0x40,
+    0x00, 0x00, 0x00, 0x60, 0x4d, 0x5e, 0x7b, 0x40,
+    0x00, 0x00, 0x00, 0x08, 0xba, 0x86, 0x84, 0x40,
+    0x00, 0x00, 0x00, 0x0c, 0x17, 0xca, 0x8e, 0x40,
+    0x00, 0x00, 0x00, 0x49, 0x91, 0x17, 0x97, 0x40,
+    0x00, 0x00, 0xc0, 0xf6, 0xac, 0x51, 0xa1, 0x40,
+    0x00, 0x00, 0x20, 0x72, 0x83, 0xfa, 0xa9, 0x40,
+    0x00, 0x00, 0x98, 0x95, 0xe2, 0x7b, 0xb3, 0x40,
+    0x00, 0x00, 0x64, 0xe0, 0xd3, 0x39, 0xbd, 0x40,
+    0x00, 0x00, 0x4b, 0xe8, 0x5e, 0xeb, 0xc5, 0x40,
+    0x00, 0x40, 0x38, 0x2e, 0x87, 0x70, 0xd0, 0x40,
+    0x00, 0x60, 0x54, 0xc5, 0xca, 0xa8, 0xd8, 0x40,
+    0x00, 0x48, 0xff, 0x13, 0x98, 0x7e, 0xe2, 0x40,
+    0x00, 0xec, 0xfe, 0x1d, 0xe4, 0xbd, 0xeb, 0x40,
+    0x00, 0x31, 0x7f, 0x16, 0x6b, 0xce, 0xf4, 0x40,
+    0x80, 0xc9, 0xbe, 0xa1, 0xa0, 0x35, 0xff, 0x40,
+    0x20, 0x17, 0x4f, 0x79, 0x38, 0x68, 0x07, 0x41,
+    0x58, 0x51, 0xfb, 0x5a, 0x2a, 0x8e, 0x11, 0x41,
+    0x04, 0xfa, 0x78, 0x88, 0x3f, 0x55, 0x1a, 0x41,
+    0x83, 0xbb, 0x5a, 0xa6, 0xef, 0xbf, 0x23, 0x41,
+    0x44, 0x19, 0x88, 0x79, 0xe7, 0x9f, 0x2d, 0x41,
+    0xf3, 0x12, 0x26, 0x9b, 0xed, 0x37, 0x36, 0x41,
+    0x36, 0x8e, 0x5c, 0x34, 0xf2, 0xa9, 0x40, 0x41,
+    0x51, 0xd5, 0x8a, 0x4e, 0xeb, 0xfe, 0x48, 0x41,
+    0xfd, 0x1f, 0xe8, 0x7a, 0x30, 0xbf, 0x52, 0x41,
+    0xfc, 0x2f, 0x5c, 0xb8, 0xc8, 0x1e, 0x5c, 0x41,
+    0xfd, 0x23, 0x45, 0x8a, 0x16, 0x17, 0x65, 0x41,
+    0xfc, 0xb5, 0x67, 0xcf, 0xa1, 0xa2, 0x6f, 0x41,
+    0x7d, 0xc8, 0x8d, 0x5b, 0xf9, 0xb9, 0x77, 0x41,
+    0x5e, 0x56, 0xaa, 0x04, 0x7b, 0xcb, 0x81, 0x41,
+    0x8d, 0x81, 0xff, 0x86, 0x38, 0xb1, 0x8a, 0x41,
+    0x2a, 0xa1, 0x3f, 0x65, 0xea, 0x04, 0x94, 0x41,
+    0xbf, 0x71, 0xdf, 0x97, 0x5f, 0x07, 0x9e, 0x41,
+    0x4f, 0x95, 0xe7, 0xb1, 0x87, 0x85, 0xa6, 0x41,
+    0xfb, 0xaf, 0x6d, 0xc5, 0x25, 0xe4, 0xb0, 0x41,
+    0xf8, 0x87, 0x24, 0xa8, 0x38, 0x56, 0xb9, 0x41,
+    0xfa, 0x65, 0x1b, 0x7e, 0xaa, 0x00, 0xc3, 0x41,
+    0xf7, 0x18, 0x29, 0xbd, 0xff, 0x80, 0xcc, 0x41,
+    0xb9, 0xd2, 0xde, 0xcd, 0xbf, 0x60, 0xd5, 0x41,
+    0x0b, 0x1e, 0x67, 0xda, 0x8f, 0x08, 0xe0, 0x41,
+    0x10, 0xad, 0x9a, 0xc7, 0xd7, 0x0c, 0xe8, 0x41,
+    0xcc, 0x01, 0xb4, 0xd5, 0xa1, 0x09, 0xf2, 0x41,
+    0xb2, 0x02, 0x8e, 0xc0, 0x72, 0x0e, 0xfb, 0x41,
+    0x06, 0x82, 0x6a, 0x10, 0xd6, 0x4a, 0x04, 0x42,
+    0x09, 0xc3, 0x9f, 0x18, 0x41, 0x70, 0x0e, 0x42,
+    0x47, 0xd2, 0x77, 0xd2, 0x30, 0xd4, 0x16, 0x42,
+    0xb5, 0xdd, 0xd9, 0x9d, 0x24, 0x1f, 0x21, 0x42,
+    0x90, 0xcc, 0xc6, 0xec, 0xb6, 0xae, 0x29, 0x42,
+    0x6c, 0x19, 0x95, 0x31, 0x09, 0x43, 0x33, 0x42,
+    0x22, 0xa6, 0x5f, 0xca, 0x8d, 0xe4, 0x3c, 0x42,
+    0x9a, 0xbc, 0xc7, 0x57, 0x6a, 0xab, 0x45, 0x42,
+    0x74, 0xcd, 0xd5, 0xc1, 0x8f, 0x40, 0x50, 0x42,
+    0x2e, 0xb4, 0xc0, 0xa2, 0xd7, 0x60, 0x58, 0x42,
+    0x22, 0x87, 0x10, 0xba, 0xa1, 0x48, 0x62, 0x42,
+    0xb3, 0xca, 0x18, 0x97, 0xf2, 0x6c, 0x6b, 0x42,
+    0x06, 0x98, 0x52, 0xf1, 0xb5, 0x91, 0x74, 0x42,
+    0x09, 0xe4, 0xfb, 0xe9, 0x90, 0xda, 0x7e, 0x42,
+    0x07, 0xeb, 0x7c, 0xaf, 0xec, 0x23, 0x87, 0x42,
+    0x45, 0xb0, 0x9d, 0x83, 0xf1, 0x5a, 0x91, 0x42,
+    0x68, 0x88, 0x6c, 0x45, 0x6a, 0x08, 0x9a, 0x42,
+    0x4e, 0x66, 0x11, 0xb4, 0x4f, 0x86, 0xa3, 0x42,
+    0x75, 0x19, 0x1a, 0x8e, 0x77, 0x49, 0xad, 0x42,
+    0x18, 0x93, 0x93, 0xaa, 0x19, 0xf7, 0xb5, 0x42,
+    0x52, 0xae, 0xee, 0x3f, 0x53, 0x79, 0xc0, 0x42,
+    0x7b, 0x05, 0xe6, 0xdf, 0xfc, 0xb5, 0xc8, 0x42,
+    0x1c, 0x84, 0xec, 0xa7, 0x7d, 0x88, 0xd2, 0x42,
+    0x2a, 0xc6, 0xe2, 0x7b, 0xbc, 0xcc, 0xdb, 0x42,
+    0xa0, 0x14, 0xea, 0x5c, 0x8d, 0xd9, 0xe4, 0x42,
+    0xf0, 0x1e, 0x5f, 0x0b, 0x54, 0x46, 0xef, 0x42,
+    0x34, 0x57, 0x87, 0x08, 0xbf, 0x74, 0xf7, 0x42,
+    0x67, 0x81, 0x65, 0x46, 0x8f, 0x97, 0x01, 0x43,
+    0x1a, 0x42, 0x98, 0xe9, 0x56, 0x63, 0x0a, 0x43,
+    0x94, 0x31, 0x32, 0x2f, 0x81, 0xca, 0x13, 0x43,
+    0x5e, 0x4a, 0xcb, 0xc6, 0xc1, 0xaf, 0x1d, 0x43,
+    0xc6, 0x77, 0x18, 0x55, 0xd1, 0x43, 0x26, 0x43,
+    0xd4, 0x59, 0xd2, 0xff, 0xdc, 0xb2, 0x30, 0x43,
+    0xbe, 0x86, 0xbb, 0x7f, 0x4b, 0x0c, 0x39, 0x43,
+    0x0e, 0xa5, 0xcc, 0x9f, 0x38, 0xc9, 0x42, 0x43,
+    0x95, 0xf7, 0xb2, 0xef, 0xd4, 0x2d, 0x4c, 0x43,
+    0xb0, 0x39, 0xc6, 0xb3, 0x5f, 0x22, 0x55, 0x43,
+    0x88, 0x56, 0xa9, 0x8d, 0x8f, 0xb3, 0x5f, 0x43,
+    0xe6, 0x00, 0x3f, 0xaa, 0xab, 0xc6, 0x67, 0x43,
+    0xac, 0x40, 0xaf, 0xbf, 0x00, 0xd5, 0x71, 0x43,
+    0x02, 0xe1, 0x86, 0x1f, 0x81, 0xbf, 0x7a, 0x43,
+    0xc2, 0x28, 0xa5, 0xd7, 0xa0, 0x0f, 0x84, 0x43,
+    0x23, 0xbd, 0x77, 0x43, 0x71, 0x17, 0x8e, 0x43,
+    0xda, 0xcd, 0x99, 0xf2, 0x94, 0x91, 0x96, 0x43,
+    0x64, 0x5a, 0xf3, 0xb5, 0x2f, 0xed, 0xa0, 0x43,
+    0x96, 0x07, 0xed, 0x90, 0xc7, 0x63, 0xa9, 0x43,
+    0xb0, 0xc5, 0xb1, 0xac, 0xd5, 0x0a, 0xb3, 0x43,
+    0x88, 0xa8, 0x0a, 0x83, 0x40, 0x90, 0xbc, 0x43,
+    0x66, 0xfe, 0x47, 0x62, 0x30, 0x6c, 0xc5, 0x43,
+    0xcc, 0xfe, 0xb5, 0x49, 0x24, 0x11, 0xd0, 0x43,
+    0x32, 0xfe, 0x90, 0x6e, 0xb6, 0x19, 0xd8, 0x43,
+    0xa6, 0xbe, 0xec, 0xd2, 0x48, 0x13, 0xe2, 0x43,
+    0xf9, 0x1d, 0x63, 0x3c, 0xed, 0x1c, 0xeb, 0x43,
+    0x7b, 0x56, 0x4a, 0xed, 0xb1, 0x55, 0xf4, 0x43,
+    0xb8, 0x81, 0xef, 0xe3, 0x8a, 0x80, 0xfe, 0x43,
+    0x4a, 0xa1, 0xf3, 0x2a, 0x68, 0xe0, 0x06, 0x44,
+    0xf8, 0xb8, 0x36, 0x20, 0x4e, 0x28, 0x11, 0x44,
+    0x74, 0x15, 0x52, 0x30, 0x75, 0xbc, 0x19, 0x44,
+    0x17, 0x90, 0x3d, 0xe4, 0x57, 0x4d, 0x23, 0x44,
+    0x22, 0x58, 0x5c, 0xd6, 0x03, 0xf4, 0x2c, 0x44,
+    0x1a, 0x42, 0xc5, 0xe0, 0x02, 0xb7, 0x35, 0x44,
+    0x94, 0xf1, 0x93, 0x28, 0x42, 0x49, 0x40, 0x44,
+    0x5e, 0xea, 0xdd, 0x3c, 0xe3, 0x6d, 0x48, 0x44,
+    0xc6, 0x6f, 0xa6, 0x6d, 0x6a, 0x52, 0x52, 0x44,
+    0xa9, 0xa7, 0x79, 0xa4, 0x9f, 0x7b, 0x5b, 0x44,
+    0xbf, 0x3d, 0x5b, 0xbb, 0xb7, 0x9c, 0x64, 0x44,
+    0x9e, 0xdc, 0x08, 0x99, 0x13, 0xeb, 0x6e, 0x44,
+    0x76, 0xa5, 0xc6, 0xb2, 0x4e, 0x30, 0x77, 0x44,
+    0x18, 0xfc, 0x14, 0x06, 0x3b, 0x64, 0x81, 0x44,
+    0x24, 0x7a, 0x1f, 0x89, 0x58, 0x16, 0x8a, 0x44,
+    0x9b, 0x9b, 0xd7, 0x66, 0xc2, 0x90, 0x93, 0x44,
+    0x68, 0x69, 0x43, 0x9a, 0x23, 0x59, 0x9d, 0x44
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+#ifdef GD_NO_C99_API
+  v[0][0] = 1.5;
+  v[0][1] = 2.25;
+  for (i = 1; i < 20; ++i) {
+    v[i][0] = v[i - 1][0] * 2.25;
+    v[i][1] = v[i - 1][1] * 2.25;
+  }
+#else
+  v[0] = 1.5 + _Complex_I * 2.25;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 2.25;
+#endif
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * 16 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+#ifdef GD_NO_C99_API
+    CHECKCi(i, u + 2 * i, v[i + 5]);
+#else
+    CHECKCi(i, u[i], v[i + 5]);
+#endif
+
+  return r;
+}
diff --git a/test/get_endian_complex64_arm.c b/test/get_endian_complex64_arm.c
new file mode 100644
index 0000000..5aa8a07
--- /dev/null
+++ b/test/get_endian_complex64_arm.c
@@ -0,0 +1,161 @@
+/* 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
+ */
+/* Attempt to read arm-endian COMPLEX64 (which is just little endian) */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 1\nENDIAN little arm\n";
+#ifdef GD_NO_C99_API
+  float u[20];
+  float v[20][2];
+#else
+  float complex u[10];
+  float complex v[20];
+#endif
+  const unsigned char data_data[64 * 8] = {
+    0x00, 0x00, 0xC0, 0x3F,  0x00, 0x00, 0x10, 0x40,
+    0x00, 0x00, 0x58, 0x40,  0x00, 0x00, 0xA2, 0x40,
+    0x00, 0x00, 0xF3, 0x40,  0x00, 0x40, 0x36, 0x41,
+    0x00, 0xB0, 0x88, 0x41,  0x00, 0x08, 0xCD, 0x41,
+    0x00, 0xC6, 0x19, 0x42,  0x00, 0xA9, 0x66, 0x42,
+    0xC0, 0xFE, 0xAC, 0x42,  0x10, 0xBF, 0x01, 0x43,
+    0x98, 0x9E, 0x42, 0x43,  0xF2, 0xF6, 0x91, 0x43,
+    0x6B, 0xF2, 0xDA, 0x43,  0xD0, 0x35, 0x24, 0x44,
+    0xB8, 0x50, 0x76, 0x44,  0x8A, 0xBC, 0xB8, 0x44,
+    0x68, 0x8D, 0x0A, 0x45,  0x1C, 0xD4, 0x4F, 0x45,
+    0x15, 0xDF, 0x9B, 0x45,  0xA0, 0xCE, 0xE9, 0x45,
+    0xF8, 0x5A, 0x2F, 0x46,  0x3A, 0x84, 0x83, 0x46,
+    0x57, 0x46, 0xC5, 0x46,  0xC1, 0xF4, 0x13, 0x47,
+    0x22, 0xEF, 0x5D, 0x47,  0x5A, 0x73, 0xA6, 0x47,
+    0x07, 0xAD, 0xF9, 0x47,  0xC5, 0x41, 0x3B, 0x48,
+    0x54, 0x71, 0x8C, 0x48,  0xFE, 0xA9, 0xD2, 0x48,
+    0x7E, 0xFF, 0x1D, 0x49,  0x3D, 0xFF, 0x6C, 0x49,
+    0x6E, 0xBF, 0xB1, 0x49,  0x92, 0x4F, 0x05, 0x4A,
+    0x5B, 0xF7, 0x47, 0x4A,  0x84, 0xF9, 0x95, 0x4A,
+    0x46, 0xF6, 0xE0, 0x4A,  0xB4, 0xB8, 0x28, 0x4B,
+    0x0E, 0x15, 0x7D, 0x4B,  0xCA, 0xCF, 0xBD, 0x4B,
+    0xD8, 0x5B, 0x0E, 0x4C,  0xC4, 0x89, 0x55, 0x4C,
+    0x53, 0x27, 0xA0, 0x4C,  0xFC, 0x3A, 0xF0, 0x4C,
+    0x3D, 0x2C, 0x34, 0x4D,  0x2E, 0x21, 0x87, 0x4D,
+    0xC5, 0xB1, 0xCA, 0x4D,  0x54, 0x05, 0x18, 0x4E,
+    0xFE, 0x07, 0x64, 0x4E,  0xFE, 0x05, 0xAB, 0x4E,
+    0x7E, 0x44, 0x00, 0x4F,  0xBD, 0x66, 0x40, 0x4F,
+    0x0E, 0x4D, 0x90, 0x4F,  0x95, 0x73, 0xD8, 0x4F,
+    0xB0, 0x56, 0x22, 0x50,  0x08, 0x82, 0x73, 0x50,
+    0x86, 0xA1, 0xB6, 0x50,  0x24, 0xF9, 0x08, 0x51,
+    0xB6, 0x75, 0x4D, 0x51,  0x48, 0x18, 0x9A, 0x51,
+    0x6C, 0x24, 0xE7, 0x51,  0x51, 0x5B, 0x2D, 0x52,
+    0x7D, 0x04, 0x82, 0x52,  0xBC, 0x06, 0xC3, 0x52,
+    0x0D, 0x45, 0x12, 0x53,  0x94, 0x67, 0x5B, 0x53,
+    0xAF, 0x8D, 0xA4, 0x53,  0x86, 0xD4, 0xF6, 0x53,
+    0x64, 0x1F, 0x39, 0x54,  0x8B, 0xD7, 0x8A, 0x54,
+    0x50, 0x43, 0xD0, 0x54,  0x7C, 0x32, 0x1C, 0x55,
+    0xBA, 0x4B, 0x6A, 0x55,  0xCC, 0xB8, 0xAF, 0x55,
+    0x99, 0xCA, 0x03, 0x56,  0xE6, 0xAF, 0x45, 0x56,
+    0xEC, 0x43, 0x94, 0x56,  0xE2, 0x65, 0xDE, 0x56,
+    0x6A, 0xCC, 0x26, 0x57,  0x9F, 0x32, 0x7A, 0x57,
+    0xF7, 0xA5, 0xBB, 0x57,  0x79, 0xBC, 0x0C, 0x58,
+    0xB6, 0x1A, 0x53, 0x58,  0x08, 0x54, 0x9E, 0x58,
+    0x0C, 0x7E, 0xED, 0x58,  0x89, 0x1E, 0x32, 0x59,
+    0xE7, 0x96, 0x85, 0x59,  0x5A, 0x62, 0xC8, 0x59,
+    0xC4, 0x49, 0x16, 0x5A,  0xA6, 0x6E, 0x61, 0x5A,
+    0xFC, 0x12, 0xA9, 0x5A,  0x7A, 0x9C, 0xFD, 0x5A,
+    0x5C, 0x35, 0x3E, 0x5B,  0x05, 0xA8, 0x8E, 0x5B,
+    0x08, 0xFC, 0xD5, 0x5B,  0x06, 0x7D, 0x20, 0x5C,
+    0x89, 0xBB, 0x70, 0x5C,  0xA7, 0x8C, 0xB4, 0x5C,
+    0x7D, 0x69, 0x07, 0x5D,  0x3C, 0x1E, 0x4B, 0x5D,
+    0xAD, 0x56, 0x98, 0x5D,  0x04, 0x82, 0xE4, 0x5D,
+    0x83, 0x61, 0x2B, 0x5E,  0x22, 0x89, 0x80, 0x5E,
+    0xB3, 0xCD, 0xC0, 0x5E,  0x46, 0x9A, 0x10, 0x5F,
+    0x69, 0xE7, 0x58, 0x5F,  0x8F, 0xAD, 0xA2, 0x5F,
+    0x56, 0x04, 0xF4, 0x5F,  0x40, 0x03, 0x37, 0x60,
+    0x70, 0x42, 0x89, 0x60,  0xA8, 0xE3, 0xCD, 0x60,
+    0xBE, 0x6A, 0x1A, 0x61,  0x1D, 0xA0, 0x67, 0x61,
+    0x16, 0xB8, 0xAD, 0x61,  0x10, 0x4A, 0x02, 0x62,
+    0x18, 0x6F, 0x43, 0x62,  0x52, 0x93, 0x92, 0x62,
+    0xFB, 0xDC, 0xDB, 0x62,  0xBC, 0xE5, 0x24, 0x63,
+    0x9A, 0x58, 0x77, 0x63,  0x74, 0x82, 0xB9, 0x63,
+    0xD7, 0x21, 0x0B, 0x64,  0xC2, 0xB2, 0x50, 0x64,
+    0x12, 0x86, 0x9C, 0x64,  0x1B, 0xC9, 0xEA, 0x64
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+#ifdef GD_NO_C99_API
+  v[0][0] = 1.5;
+  v[0][1] = 2.25;
+  for (i = 1; i < 20; ++i) {
+    v[i][0] = v[i - 1][0] * 2.25;
+    v[i][1] = v[i - 1][1] * 2.25;
+  }
+#else
+  v[0] = 1.5 + _Complex_I * 2.25;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 2.25;
+#endif
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * 8 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+#ifdef GD_NO_C99_API
+    CHECKCi(i, u + 2 * i, v[i + 5]);
+#else
+    CHECKCi(i, u[i], v[i + 5]);
+#endif
+
+  return r;
+}
diff --git a/test/get_endian_complex64_big.c b/test/get_endian_complex64_big.c
new file mode 100644
index 0000000..930d29c
--- /dev/null
+++ b/test/get_endian_complex64_big.c
@@ -0,0 +1,161 @@
+/* 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
+ */
+/* Attempt to read big-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 1\nENDIAN big\n";
+#ifdef GD_NO_C99_API
+  float u[20];
+  float v[20][2];
+#else
+  float complex u[10];
+  float complex v[20];
+#endif
+  const unsigned char data_data[64 * 8] = {
+    0x3F, 0xC0, 0x00, 0x00,  0x40, 0x10, 0x00, 0x00,
+    0x40, 0x58, 0x00, 0x00,  0x40, 0xA2, 0x00, 0x00,
+    0x40, 0xF3, 0x00, 0x00,  0x41, 0x36, 0x40, 0x00,
+    0x41, 0x88, 0xB0, 0x00,  0x41, 0xCD, 0x08, 0x00,
+    0x42, 0x19, 0xC6, 0x00,  0x42, 0x66, 0xA9, 0x00,
+    0x42, 0xAC, 0xFE, 0xC0,  0x43, 0x01, 0xBF, 0x10,
+    0x43, 0x42, 0x9E, 0x98,  0x43, 0x91, 0xF6, 0xF2,
+    0x43, 0xDA, 0xF2, 0x6B,  0x44, 0x24, 0x35, 0xD0,
+    0x44, 0x76, 0x50, 0xB8,  0x44, 0xB8, 0xBC, 0x8A,
+    0x45, 0x0A, 0x8D, 0x68,  0x45, 0x4F, 0xD4, 0x1C,
+    0x45, 0x9B, 0xDF, 0x15,  0x45, 0xE9, 0xCE, 0xA0,
+    0x46, 0x2F, 0x5A, 0xF8,  0x46, 0x83, 0x84, 0x3A,
+    0x46, 0xC5, 0x46, 0x57,  0x47, 0x13, 0xF4, 0xC1,
+    0x47, 0x5D, 0xEF, 0x22,  0x47, 0xA6, 0x73, 0x5A,
+    0x47, 0xF9, 0xAD, 0x07,  0x48, 0x3B, 0x41, 0xC5,
+    0x48, 0x8C, 0x71, 0x54,  0x48, 0xD2, 0xA9, 0xFE,
+    0x49, 0x1D, 0xFF, 0x7E,  0x49, 0x6C, 0xFF, 0x3D,
+    0x49, 0xB1, 0xBF, 0x6E,  0x4A, 0x05, 0x4F, 0x92,
+    0x4A, 0x47, 0xF7, 0x5B,  0x4A, 0x95, 0xF9, 0x84,
+    0x4A, 0xE0, 0xF6, 0x46,  0x4B, 0x28, 0xB8, 0xB4,
+    0x4B, 0x7D, 0x15, 0x0E,  0x4B, 0xBD, 0xCF, 0xCA,
+    0x4C, 0x0E, 0x5B, 0xD8,  0x4C, 0x55, 0x89, 0xC4,
+    0x4C, 0xA0, 0x27, 0x53,  0x4C, 0xF0, 0x3A, 0xFC,
+    0x4D, 0x34, 0x2C, 0x3D,  0x4D, 0x87, 0x21, 0x2E,
+    0x4D, 0xCA, 0xB1, 0xC5,  0x4E, 0x18, 0x05, 0x54,
+    0x4E, 0x64, 0x07, 0xFE,  0x4E, 0xAB, 0x05, 0xFE,
+    0x4F, 0x00, 0x44, 0x7E,  0x4F, 0x40, 0x66, 0xBD,
+    0x4F, 0x90, 0x4D, 0x0E,  0x4F, 0xD8, 0x73, 0x95,
+    0x50, 0x22, 0x56, 0xB0,  0x50, 0x73, 0x82, 0x08,
+    0x50, 0xB6, 0xA1, 0x86,  0x51, 0x08, 0xF9, 0x24,
+    0x51, 0x4D, 0x75, 0xB6,  0x51, 0x9A, 0x18, 0x48,
+    0x51, 0xE7, 0x24, 0x6C,  0x52, 0x2D, 0x5B, 0x51,
+    0x52, 0x82, 0x04, 0x7D,  0x52, 0xC3, 0x06, 0xBC,
+    0x53, 0x12, 0x45, 0x0D,  0x53, 0x5B, 0x67, 0x94,
+    0x53, 0xA4, 0x8D, 0xAF,  0x53, 0xF6, 0xD4, 0x86,
+    0x54, 0x39, 0x1F, 0x64,  0x54, 0x8A, 0xD7, 0x8B,
+    0x54, 0xD0, 0x43, 0x50,  0x55, 0x1C, 0x32, 0x7C,
+    0x55, 0x6A, 0x4B, 0xBA,  0x55, 0xAF, 0xB8, 0xCC,
+    0x56, 0x03, 0xCA, 0x99,  0x56, 0x45, 0xAF, 0xE6,
+    0x56, 0x94, 0x43, 0xEC,  0x56, 0xDE, 0x65, 0xE2,
+    0x57, 0x26, 0xCC, 0x6A,  0x57, 0x7A, 0x32, 0x9F,
+    0x57, 0xBB, 0xA5, 0xF7,  0x58, 0x0C, 0xBC, 0x79,
+    0x58, 0x53, 0x1A, 0xB6,  0x58, 0x9E, 0x54, 0x08,
+    0x58, 0xED, 0x7E, 0x0C,  0x59, 0x32, 0x1E, 0x89,
+    0x59, 0x85, 0x96, 0xE7,  0x59, 0xC8, 0x62, 0x5A,
+    0x5A, 0x16, 0x49, 0xC4,  0x5A, 0x61, 0x6E, 0xA6,
+    0x5A, 0xA9, 0x12, 0xFC,  0x5A, 0xFD, 0x9C, 0x7A,
+    0x5B, 0x3E, 0x35, 0x5C,  0x5B, 0x8E, 0xA8, 0x05,
+    0x5B, 0xD5, 0xFC, 0x08,  0x5C, 0x20, 0x7D, 0x06,
+    0x5C, 0x70, 0xBB, 0x89,  0x5C, 0xB4, 0x8C, 0xA7,
+    0x5D, 0x07, 0x69, 0x7D,  0x5D, 0x4B, 0x1E, 0x3C,
+    0x5D, 0x98, 0x56, 0xAD,  0x5D, 0xE4, 0x82, 0x04,
+    0x5E, 0x2B, 0x61, 0x83,  0x5E, 0x80, 0x89, 0x22,
+    0x5E, 0xC0, 0xCD, 0xB3,  0x5F, 0x10, 0x9A, 0x46,
+    0x5F, 0x58, 0xE7, 0x69,  0x5F, 0xA2, 0xAD, 0x8F,
+    0x5F, 0xF4, 0x04, 0x56,  0x60, 0x37, 0x03, 0x40,
+    0x60, 0x89, 0x42, 0x70,  0x60, 0xCD, 0xE3, 0xA8,
+    0x61, 0x1A, 0x6A, 0xBE,  0x61, 0x67, 0xA0, 0x1D,
+    0x61, 0xAD, 0xB8, 0x16,  0x62, 0x02, 0x4A, 0x10,
+    0x62, 0x43, 0x6F, 0x18,  0x62, 0x92, 0x93, 0x52,
+    0x62, 0xDB, 0xDC, 0xFB,  0x63, 0x24, 0xE5, 0xBC,
+    0x63, 0x77, 0x58, 0x9A,  0x63, 0xB9, 0x82, 0x74,
+    0x64, 0x0B, 0x21, 0xD7,  0x64, 0x50, 0xB2, 0xC2,
+    0x64, 0x9C, 0x86, 0x12,  0x64, 0xEA, 0xC9, 0x1B
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+#ifdef GD_NO_C99_API
+  v[0][0] = 1.5;
+  v[0][1] = 2.25;
+  for (i = 1; i < 20; ++i) {
+    v[i][0] = v[i - 1][0] * 2.25;
+    v[i][1] = v[i - 1][1] * 2.25;
+  }
+#else
+  v[0] = 1.5 + _Complex_I * 2.25;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 2.25;
+#endif
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * 8 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+#ifdef GD_NO_C99_API
+    CHECKCi(i, u + 2 * i, v[i + 5]);
+#else
+    CHECKCi(i, u[i], v[i + 5]);
+#endif
+
+  return r;
+}
diff --git a/test/get_endian_complex64_little.c b/test/get_endian_complex64_little.c
new file mode 100644
index 0000000..191fcd9
--- /dev/null
+++ b/test/get_endian_complex64_little.c
@@ -0,0 +1,161 @@
+/* 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
+ */
+/* Attempt to read little-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 1\nENDIAN little\n";
+#ifdef GD_NO_C99_API
+  float u[20];
+  float v[20][2];
+#else
+  float complex u[10];
+  float complex v[20];
+#endif
+  const unsigned char data_data[64 * 8] = {
+    0x00, 0x00, 0xC0, 0x3F,  0x00, 0x00, 0x10, 0x40,
+    0x00, 0x00, 0x58, 0x40,  0x00, 0x00, 0xA2, 0x40,
+    0x00, 0x00, 0xF3, 0x40,  0x00, 0x40, 0x36, 0x41,
+    0x00, 0xB0, 0x88, 0x41,  0x00, 0x08, 0xCD, 0x41,
+    0x00, 0xC6, 0x19, 0x42,  0x00, 0xA9, 0x66, 0x42,
+    0xC0, 0xFE, 0xAC, 0x42,  0x10, 0xBF, 0x01, 0x43,
+    0x98, 0x9E, 0x42, 0x43,  0xF2, 0xF6, 0x91, 0x43,
+    0x6B, 0xF2, 0xDA, 0x43,  0xD0, 0x35, 0x24, 0x44,
+    0xB8, 0x50, 0x76, 0x44,  0x8A, 0xBC, 0xB8, 0x44,
+    0x68, 0x8D, 0x0A, 0x45,  0x1C, 0xD4, 0x4F, 0x45,
+    0x15, 0xDF, 0x9B, 0x45,  0xA0, 0xCE, 0xE9, 0x45,
+    0xF8, 0x5A, 0x2F, 0x46,  0x3A, 0x84, 0x83, 0x46,
+    0x57, 0x46, 0xC5, 0x46,  0xC1, 0xF4, 0x13, 0x47,
+    0x22, 0xEF, 0x5D, 0x47,  0x5A, 0x73, 0xA6, 0x47,
+    0x07, 0xAD, 0xF9, 0x47,  0xC5, 0x41, 0x3B, 0x48,
+    0x54, 0x71, 0x8C, 0x48,  0xFE, 0xA9, 0xD2, 0x48,
+    0x7E, 0xFF, 0x1D, 0x49,  0x3D, 0xFF, 0x6C, 0x49,
+    0x6E, 0xBF, 0xB1, 0x49,  0x92, 0x4F, 0x05, 0x4A,
+    0x5B, 0xF7, 0x47, 0x4A,  0x84, 0xF9, 0x95, 0x4A,
+    0x46, 0xF6, 0xE0, 0x4A,  0xB4, 0xB8, 0x28, 0x4B,
+    0x0E, 0x15, 0x7D, 0x4B,  0xCA, 0xCF, 0xBD, 0x4B,
+    0xD8, 0x5B, 0x0E, 0x4C,  0xC4, 0x89, 0x55, 0x4C,
+    0x53, 0x27, 0xA0, 0x4C,  0xFC, 0x3A, 0xF0, 0x4C,
+    0x3D, 0x2C, 0x34, 0x4D,  0x2E, 0x21, 0x87, 0x4D,
+    0xC5, 0xB1, 0xCA, 0x4D,  0x54, 0x05, 0x18, 0x4E,
+    0xFE, 0x07, 0x64, 0x4E,  0xFE, 0x05, 0xAB, 0x4E,
+    0x7E, 0x44, 0x00, 0x4F,  0xBD, 0x66, 0x40, 0x4F,
+    0x0E, 0x4D, 0x90, 0x4F,  0x95, 0x73, 0xD8, 0x4F,
+    0xB0, 0x56, 0x22, 0x50,  0x08, 0x82, 0x73, 0x50,
+    0x86, 0xA1, 0xB6, 0x50,  0x24, 0xF9, 0x08, 0x51,
+    0xB6, 0x75, 0x4D, 0x51,  0x48, 0x18, 0x9A, 0x51,
+    0x6C, 0x24, 0xE7, 0x51,  0x51, 0x5B, 0x2D, 0x52,
+    0x7D, 0x04, 0x82, 0x52,  0xBC, 0x06, 0xC3, 0x52,
+    0x0D, 0x45, 0x12, 0x53,  0x94, 0x67, 0x5B, 0x53,
+    0xAF, 0x8D, 0xA4, 0x53,  0x86, 0xD4, 0xF6, 0x53,
+    0x64, 0x1F, 0x39, 0x54,  0x8B, 0xD7, 0x8A, 0x54,
+    0x50, 0x43, 0xD0, 0x54,  0x7C, 0x32, 0x1C, 0x55,
+    0xBA, 0x4B, 0x6A, 0x55,  0xCC, 0xB8, 0xAF, 0x55,
+    0x99, 0xCA, 0x03, 0x56,  0xE6, 0xAF, 0x45, 0x56,
+    0xEC, 0x43, 0x94, 0x56,  0xE2, 0x65, 0xDE, 0x56,
+    0x6A, 0xCC, 0x26, 0x57,  0x9F, 0x32, 0x7A, 0x57,
+    0xF7, 0xA5, 0xBB, 0x57,  0x79, 0xBC, 0x0C, 0x58,
+    0xB6, 0x1A, 0x53, 0x58,  0x08, 0x54, 0x9E, 0x58,
+    0x0C, 0x7E, 0xED, 0x58,  0x89, 0x1E, 0x32, 0x59,
+    0xE7, 0x96, 0x85, 0x59,  0x5A, 0x62, 0xC8, 0x59,
+    0xC4, 0x49, 0x16, 0x5A,  0xA6, 0x6E, 0x61, 0x5A,
+    0xFC, 0x12, 0xA9, 0x5A,  0x7A, 0x9C, 0xFD, 0x5A,
+    0x5C, 0x35, 0x3E, 0x5B,  0x05, 0xA8, 0x8E, 0x5B,
+    0x08, 0xFC, 0xD5, 0x5B,  0x06, 0x7D, 0x20, 0x5C,
+    0x89, 0xBB, 0x70, 0x5C,  0xA7, 0x8C, 0xB4, 0x5C,
+    0x7D, 0x69, 0x07, 0x5D,  0x3C, 0x1E, 0x4B, 0x5D,
+    0xAD, 0x56, 0x98, 0x5D,  0x04, 0x82, 0xE4, 0x5D,
+    0x83, 0x61, 0x2B, 0x5E,  0x22, 0x89, 0x80, 0x5E,
+    0xB3, 0xCD, 0xC0, 0x5E,  0x46, 0x9A, 0x10, 0x5F,
+    0x69, 0xE7, 0x58, 0x5F,  0x8F, 0xAD, 0xA2, 0x5F,
+    0x56, 0x04, 0xF4, 0x5F,  0x40, 0x03, 0x37, 0x60,
+    0x70, 0x42, 0x89, 0x60,  0xA8, 0xE3, 0xCD, 0x60,
+    0xBE, 0x6A, 0x1A, 0x61,  0x1D, 0xA0, 0x67, 0x61,
+    0x16, 0xB8, 0xAD, 0x61,  0x10, 0x4A, 0x02, 0x62,
+    0x18, 0x6F, 0x43, 0x62,  0x52, 0x93, 0x92, 0x62,
+    0xFB, 0xDC, 0xDB, 0x62,  0xBC, 0xE5, 0x24, 0x63,
+    0x9A, 0x58, 0x77, 0x63,  0x74, 0x82, 0xB9, 0x63,
+    0xD7, 0x21, 0x0B, 0x64,  0xC2, 0xB2, 0x50, 0x64,
+    0x12, 0x86, 0x9C, 0x64,  0x1B, 0xC9, 0xEA, 0x64
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+#ifdef GD_NO_C99_API
+  v[0][0] = 1.5;
+  v[0][1] = 2.25;
+  for (i = 1; i < 20; ++i) {
+    v[i][0] = v[i - 1][0] * 2.25;
+    v[i][1] = v[i - 1][1] * 2.25;
+  }
+#else
+  v[0] = 1.5 + _Complex_I * 2.25;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 2.25;
+#endif
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * 8 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+#ifdef GD_NO_C99_API
+    CHECKCi(i, u + 2 * i, v[i + 5]);
+#else
+    CHECKCi(i, u[i], v[i + 5]);
+#endif
+
+  return r;
+}
diff --git a/test/get_endian_float32_arm.c b/test/get_endian_float32_arm.c
new file mode 100644
index 0000000..c76b6c9
--- /dev/null
+++ b/test/get_endian_float32_arm.c
@@ -0,0 +1,143 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read arm-endian FLOAT32 (which is just little endian) */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 1\nENDIAN little arm\n";
+  float u[10];
+  float v[20];
+  const unsigned char data_data[128 * 4] = {
+    0x00, 0x00, 0xC0, 0x3F,  0x00, 0x00, 0x10, 0x40,
+    0x00, 0x00, 0x58, 0x40,  0x00, 0x00, 0xA2, 0x40,
+    0x00, 0x00, 0xF3, 0x40,  0x00, 0x40, 0x36, 0x41,
+    0x00, 0xB0, 0x88, 0x41,  0x00, 0x08, 0xCD, 0x41,
+    0x00, 0xC6, 0x19, 0x42,  0x00, 0xA9, 0x66, 0x42,
+    0xC0, 0xFE, 0xAC, 0x42,  0x10, 0xBF, 0x01, 0x43,
+    0x98, 0x9E, 0x42, 0x43,  0xF2, 0xF6, 0x91, 0x43,
+    0x6B, 0xF2, 0xDA, 0x43,  0xD0, 0x35, 0x24, 0x44,
+    0xB8, 0x50, 0x76, 0x44,  0x8A, 0xBC, 0xB8, 0x44,
+    0x68, 0x8D, 0x0A, 0x45,  0x1C, 0xD4, 0x4F, 0x45,
+    0x15, 0xDF, 0x9B, 0x45,  0xA0, 0xCE, 0xE9, 0x45,
+    0xF8, 0x5A, 0x2F, 0x46,  0x3A, 0x84, 0x83, 0x46,
+    0x57, 0x46, 0xC5, 0x46,  0xC1, 0xF4, 0x13, 0x47,
+    0x22, 0xEF, 0x5D, 0x47,  0x5A, 0x73, 0xA6, 0x47,
+    0x07, 0xAD, 0xF9, 0x47,  0xC5, 0x41, 0x3B, 0x48,
+    0x54, 0x71, 0x8C, 0x48,  0xFE, 0xA9, 0xD2, 0x48,
+    0x7E, 0xFF, 0x1D, 0x49,  0x3D, 0xFF, 0x6C, 0x49,
+    0x6E, 0xBF, 0xB1, 0x49,  0x92, 0x4F, 0x05, 0x4A,
+    0x5B, 0xF7, 0x47, 0x4A,  0x84, 0xF9, 0x95, 0x4A,
+    0x46, 0xF6, 0xE0, 0x4A,  0xB4, 0xB8, 0x28, 0x4B,
+    0x0E, 0x15, 0x7D, 0x4B,  0xCA, 0xCF, 0xBD, 0x4B,
+    0xD8, 0x5B, 0x0E, 0x4C,  0xC4, 0x89, 0x55, 0x4C,
+    0x53, 0x27, 0xA0, 0x4C,  0xFC, 0x3A, 0xF0, 0x4C,
+    0x3D, 0x2C, 0x34, 0x4D,  0x2E, 0x21, 0x87, 0x4D,
+    0xC5, 0xB1, 0xCA, 0x4D,  0x54, 0x05, 0x18, 0x4E,
+    0xFE, 0x07, 0x64, 0x4E,  0xFE, 0x05, 0xAB, 0x4E,
+    0x7E, 0x44, 0x00, 0x4F,  0xBD, 0x66, 0x40, 0x4F,
+    0x0E, 0x4D, 0x90, 0x4F,  0x95, 0x73, 0xD8, 0x4F,
+    0xB0, 0x56, 0x22, 0x50,  0x08, 0x82, 0x73, 0x50,
+    0x86, 0xA1, 0xB6, 0x50,  0x24, 0xF9, 0x08, 0x51,
+    0xB6, 0x75, 0x4D, 0x51,  0x48, 0x18, 0x9A, 0x51,
+    0x6C, 0x24, 0xE7, 0x51,  0x51, 0x5B, 0x2D, 0x52,
+    0x7D, 0x04, 0x82, 0x52,  0xBC, 0x06, 0xC3, 0x52,
+    0x0D, 0x45, 0x12, 0x53,  0x94, 0x67, 0x5B, 0x53,
+    0xAF, 0x8D, 0xA4, 0x53,  0x86, 0xD4, 0xF6, 0x53,
+    0x64, 0x1F, 0x39, 0x54,  0x8B, 0xD7, 0x8A, 0x54,
+    0x50, 0x43, 0xD0, 0x54,  0x7C, 0x32, 0x1C, 0x55,
+    0xBA, 0x4B, 0x6A, 0x55,  0xCC, 0xB8, 0xAF, 0x55,
+    0x99, 0xCA, 0x03, 0x56,  0xE6, 0xAF, 0x45, 0x56,
+    0xEC, 0x43, 0x94, 0x56,  0xE2, 0x65, 0xDE, 0x56,
+    0x6A, 0xCC, 0x26, 0x57,  0x9F, 0x32, 0x7A, 0x57,
+    0xF7, 0xA5, 0xBB, 0x57,  0x79, 0xBC, 0x0C, 0x58,
+    0xB6, 0x1A, 0x53, 0x58,  0x08, 0x54, 0x9E, 0x58,
+    0x0C, 0x7E, 0xED, 0x58,  0x89, 0x1E, 0x32, 0x59,
+    0xE7, 0x96, 0x85, 0x59,  0x5A, 0x62, 0xC8, 0x59,
+    0xC4, 0x49, 0x16, 0x5A,  0xA6, 0x6E, 0x61, 0x5A,
+    0xFC, 0x12, 0xA9, 0x5A,  0x7A, 0x9C, 0xFD, 0x5A,
+    0x5C, 0x35, 0x3E, 0x5B,  0x05, 0xA8, 0x8E, 0x5B,
+    0x08, 0xFC, 0xD5, 0x5B,  0x06, 0x7D, 0x20, 0x5C,
+    0x89, 0xBB, 0x70, 0x5C,  0xA7, 0x8C, 0xB4, 0x5C,
+    0x7D, 0x69, 0x07, 0x5D,  0x3C, 0x1E, 0x4B, 0x5D,
+    0xAD, 0x56, 0x98, 0x5D,  0x04, 0x82, 0xE4, 0x5D,
+    0x83, 0x61, 0x2B, 0x5E,  0x22, 0x89, 0x80, 0x5E,
+    0xB3, 0xCD, 0xC0, 0x5E,  0x46, 0x9A, 0x10, 0x5F,
+    0x69, 0xE7, 0x58, 0x5F,  0x8F, 0xAD, 0xA2, 0x5F,
+    0x56, 0x04, 0xF4, 0x5F,  0x40, 0x03, 0x37, 0x60,
+    0x70, 0x42, 0x89, 0x60,  0xA8, 0xE3, 0xCD, 0x60,
+    0xBE, 0x6A, 0x1A, 0x61,  0x1D, 0xA0, 0x67, 0x61,
+    0x16, 0xB8, 0xAD, 0x61,  0x10, 0x4A, 0x02, 0x62,
+    0x18, 0x6F, 0x43, 0x62,  0x52, 0x93, 0x92, 0x62,
+    0xFB, 0xDC, 0xDB, 0x62,  0xBC, 0xE5, 0x24, 0x63,
+    0x9A, 0x58, 0x77, 0x63,  0x74, 0x82, 0xB9, 0x63,
+    0xD7, 0x21, 0x0B, 0x64,  0xC2, 0xB2, 0x50, 0x64,
+    0x12, 0x86, 0x9C, 0x64,  0x1B, 0xC9, 0xEA, 0x64
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  v[0] = 1.5;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 1.5;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+    CHECKFi(i, u[i], v[i + 5]);
+
+  return r;
+}
diff --git a/test/get_endian_float32_big.c b/test/get_endian_float32_big.c
new file mode 100644
index 0000000..f84c496
--- /dev/null
+++ b/test/get_endian_float32_big.c
@@ -0,0 +1,143 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read big-endian FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 1\nENDIAN big\n";
+  float u[10];
+  float v[20];
+  const unsigned char data_data[128 * 4] = {
+    0x3F, 0xC0, 0x00, 0x00,  0x40, 0x10, 0x00, 0x00,
+    0x40, 0x58, 0x00, 0x00,  0x40, 0xA2, 0x00, 0x00,
+    0x40, 0xF3, 0x00, 0x00,  0x41, 0x36, 0x40, 0x00,
+    0x41, 0x88, 0xB0, 0x00,  0x41, 0xCD, 0x08, 0x00,
+    0x42, 0x19, 0xC6, 0x00,  0x42, 0x66, 0xA9, 0x00,
+    0x42, 0xAC, 0xFE, 0xC0,  0x43, 0x01, 0xBF, 0x10,
+    0x43, 0x42, 0x9E, 0x98,  0x43, 0x91, 0xF6, 0xF2,
+    0x43, 0xDA, 0xF2, 0x6B,  0x44, 0x24, 0x35, 0xD0,
+    0x44, 0x76, 0x50, 0xB8,  0x44, 0xB8, 0xBC, 0x8A,
+    0x45, 0x0A, 0x8D, 0x68,  0x45, 0x4F, 0xD4, 0x1C,
+    0x45, 0x9B, 0xDF, 0x15,  0x45, 0xE9, 0xCE, 0xA0,
+    0x46, 0x2F, 0x5A, 0xF8,  0x46, 0x83, 0x84, 0x3A,
+    0x46, 0xC5, 0x46, 0x57,  0x47, 0x13, 0xF4, 0xC1,
+    0x47, 0x5D, 0xEF, 0x22,  0x47, 0xA6, 0x73, 0x5A,
+    0x47, 0xF9, 0xAD, 0x07,  0x48, 0x3B, 0x41, 0xC5,
+    0x48, 0x8C, 0x71, 0x54,  0x48, 0xD2, 0xA9, 0xFE,
+    0x49, 0x1D, 0xFF, 0x7E,  0x49, 0x6C, 0xFF, 0x3D,
+    0x49, 0xB1, 0xBF, 0x6E,  0x4A, 0x05, 0x4F, 0x92,
+    0x4A, 0x47, 0xF7, 0x5B,  0x4A, 0x95, 0xF9, 0x84,
+    0x4A, 0xE0, 0xF6, 0x46,  0x4B, 0x28, 0xB8, 0xB4,
+    0x4B, 0x7D, 0x15, 0x0E,  0x4B, 0xBD, 0xCF, 0xCA,
+    0x4C, 0x0E, 0x5B, 0xD8,  0x4C, 0x55, 0x89, 0xC4,
+    0x4C, 0xA0, 0x27, 0x53,  0x4C, 0xF0, 0x3A, 0xFC,
+    0x4D, 0x34, 0x2C, 0x3D,  0x4D, 0x87, 0x21, 0x2E,
+    0x4D, 0xCA, 0xB1, 0xC5,  0x4E, 0x18, 0x05, 0x54,
+    0x4E, 0x64, 0x07, 0xFE,  0x4E, 0xAB, 0x05, 0xFE,
+    0x4F, 0x00, 0x44, 0x7E,  0x4F, 0x40, 0x66, 0xBD,
+    0x4F, 0x90, 0x4D, 0x0E,  0x4F, 0xD8, 0x73, 0x95,
+    0x50, 0x22, 0x56, 0xB0,  0x50, 0x73, 0x82, 0x08,
+    0x50, 0xB6, 0xA1, 0x86,  0x51, 0x08, 0xF9, 0x24,
+    0x51, 0x4D, 0x75, 0xB6,  0x51, 0x9A, 0x18, 0x48,
+    0x51, 0xE7, 0x24, 0x6C,  0x52, 0x2D, 0x5B, 0x51,
+    0x52, 0x82, 0x04, 0x7D,  0x52, 0xC3, 0x06, 0xBC,
+    0x53, 0x12, 0x45, 0x0D,  0x53, 0x5B, 0x67, 0x94,
+    0x53, 0xA4, 0x8D, 0xAF,  0x53, 0xF6, 0xD4, 0x86,
+    0x54, 0x39, 0x1F, 0x64,  0x54, 0x8A, 0xD7, 0x8B,
+    0x54, 0xD0, 0x43, 0x50,  0x55, 0x1C, 0x32, 0x7C,
+    0x55, 0x6A, 0x4B, 0xBA,  0x55, 0xAF, 0xB8, 0xCC,
+    0x56, 0x03, 0xCA, 0x99,  0x56, 0x45, 0xAF, 0xE6,
+    0x56, 0x94, 0x43, 0xEC,  0x56, 0xDE, 0x65, 0xE2,
+    0x57, 0x26, 0xCC, 0x6A,  0x57, 0x7A, 0x32, 0x9F,
+    0x57, 0xBB, 0xA5, 0xF7,  0x58, 0x0C, 0xBC, 0x79,
+    0x58, 0x53, 0x1A, 0xB6,  0x58, 0x9E, 0x54, 0x08,
+    0x58, 0xED, 0x7E, 0x0C,  0x59, 0x32, 0x1E, 0x89,
+    0x59, 0x85, 0x96, 0xE7,  0x59, 0xC8, 0x62, 0x5A,
+    0x5A, 0x16, 0x49, 0xC4,  0x5A, 0x61, 0x6E, 0xA6,
+    0x5A, 0xA9, 0x12, 0xFC,  0x5A, 0xFD, 0x9C, 0x7A,
+    0x5B, 0x3E, 0x35, 0x5C,  0x5B, 0x8E, 0xA8, 0x05,
+    0x5B, 0xD5, 0xFC, 0x08,  0x5C, 0x20, 0x7D, 0x06,
+    0x5C, 0x70, 0xBB, 0x89,  0x5C, 0xB4, 0x8C, 0xA7,
+    0x5D, 0x07, 0x69, 0x7D,  0x5D, 0x4B, 0x1E, 0x3C,
+    0x5D, 0x98, 0x56, 0xAD,  0x5D, 0xE4, 0x82, 0x04,
+    0x5E, 0x2B, 0x61, 0x83,  0x5E, 0x80, 0x89, 0x22,
+    0x5E, 0xC0, 0xCD, 0xB3,  0x5F, 0x10, 0x9A, 0x46,
+    0x5F, 0x58, 0xE7, 0x69,  0x5F, 0xA2, 0xAD, 0x8F,
+    0x5F, 0xF4, 0x04, 0x56,  0x60, 0x37, 0x03, 0x40,
+    0x60, 0x89, 0x42, 0x70,  0x60, 0xCD, 0xE3, 0xA8,
+    0x61, 0x1A, 0x6A, 0xBE,  0x61, 0x67, 0xA0, 0x1D,
+    0x61, 0xAD, 0xB8, 0x16,  0x62, 0x02, 0x4A, 0x10,
+    0x62, 0x43, 0x6F, 0x18,  0x62, 0x92, 0x93, 0x52,
+    0x62, 0xDB, 0xDC, 0xFB,  0x63, 0x24, 0xE5, 0xBC,
+    0x63, 0x77, 0x58, 0x9A,  0x63, 0xB9, 0x82, 0x74,
+    0x64, 0x0B, 0x21, 0xD7,  0x64, 0x50, 0xB2, 0xC2,
+    0x64, 0x9C, 0x86, 0x12,  0x64, 0xEA, 0xC9, 0x1B
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  v[0] = 1.5;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 1.5;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+    CHECKFi(i, u[i], v[i + 5]);
+
+  return r;
+}
diff --git a/test/get_endian_float32_little.c b/test/get_endian_float32_little.c
new file mode 100644
index 0000000..535e1db
--- /dev/null
+++ b/test/get_endian_float32_little.c
@@ -0,0 +1,143 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read little-endian FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 1\nENDIAN little\n";
+  float u[10];
+  float v[20];
+  const unsigned char data_data[128 * 4] = {
+    0x00, 0x00, 0xC0, 0x3F,  0x00, 0x00, 0x10, 0x40,
+    0x00, 0x00, 0x58, 0x40,  0x00, 0x00, 0xA2, 0x40,
+    0x00, 0x00, 0xF3, 0x40,  0x00, 0x40, 0x36, 0x41,
+    0x00, 0xB0, 0x88, 0x41,  0x00, 0x08, 0xCD, 0x41,
+    0x00, 0xC6, 0x19, 0x42,  0x00, 0xA9, 0x66, 0x42,
+    0xC0, 0xFE, 0xAC, 0x42,  0x10, 0xBF, 0x01, 0x43,
+    0x98, 0x9E, 0x42, 0x43,  0xF2, 0xF6, 0x91, 0x43,
+    0x6B, 0xF2, 0xDA, 0x43,  0xD0, 0x35, 0x24, 0x44,
+    0xB8, 0x50, 0x76, 0x44,  0x8A, 0xBC, 0xB8, 0x44,
+    0x68, 0x8D, 0x0A, 0x45,  0x1C, 0xD4, 0x4F, 0x45,
+    0x15, 0xDF, 0x9B, 0x45,  0xA0, 0xCE, 0xE9, 0x45,
+    0xF8, 0x5A, 0x2F, 0x46,  0x3A, 0x84, 0x83, 0x46,
+    0x57, 0x46, 0xC5, 0x46,  0xC1, 0xF4, 0x13, 0x47,
+    0x22, 0xEF, 0x5D, 0x47,  0x5A, 0x73, 0xA6, 0x47,
+    0x07, 0xAD, 0xF9, 0x47,  0xC5, 0x41, 0x3B, 0x48,
+    0x54, 0x71, 0x8C, 0x48,  0xFE, 0xA9, 0xD2, 0x48,
+    0x7E, 0xFF, 0x1D, 0x49,  0x3D, 0xFF, 0x6C, 0x49,
+    0x6E, 0xBF, 0xB1, 0x49,  0x92, 0x4F, 0x05, 0x4A,
+    0x5B, 0xF7, 0x47, 0x4A,  0x84, 0xF9, 0x95, 0x4A,
+    0x46, 0xF6, 0xE0, 0x4A,  0xB4, 0xB8, 0x28, 0x4B,
+    0x0E, 0x15, 0x7D, 0x4B,  0xCA, 0xCF, 0xBD, 0x4B,
+    0xD8, 0x5B, 0x0E, 0x4C,  0xC4, 0x89, 0x55, 0x4C,
+    0x53, 0x27, 0xA0, 0x4C,  0xFC, 0x3A, 0xF0, 0x4C,
+    0x3D, 0x2C, 0x34, 0x4D,  0x2E, 0x21, 0x87, 0x4D,
+    0xC5, 0xB1, 0xCA, 0x4D,  0x54, 0x05, 0x18, 0x4E,
+    0xFE, 0x07, 0x64, 0x4E,  0xFE, 0x05, 0xAB, 0x4E,
+    0x7E, 0x44, 0x00, 0x4F,  0xBD, 0x66, 0x40, 0x4F,
+    0x0E, 0x4D, 0x90, 0x4F,  0x95, 0x73, 0xD8, 0x4F,
+    0xB0, 0x56, 0x22, 0x50,  0x08, 0x82, 0x73, 0x50,
+    0x86, 0xA1, 0xB6, 0x50,  0x24, 0xF9, 0x08, 0x51,
+    0xB6, 0x75, 0x4D, 0x51,  0x48, 0x18, 0x9A, 0x51,
+    0x6C, 0x24, 0xE7, 0x51,  0x51, 0x5B, 0x2D, 0x52,
+    0x7D, 0x04, 0x82, 0x52,  0xBC, 0x06, 0xC3, 0x52,
+    0x0D, 0x45, 0x12, 0x53,  0x94, 0x67, 0x5B, 0x53,
+    0xAF, 0x8D, 0xA4, 0x53,  0x86, 0xD4, 0xF6, 0x53,
+    0x64, 0x1F, 0x39, 0x54,  0x8B, 0xD7, 0x8A, 0x54,
+    0x50, 0x43, 0xD0, 0x54,  0x7C, 0x32, 0x1C, 0x55,
+    0xBA, 0x4B, 0x6A, 0x55,  0xCC, 0xB8, 0xAF, 0x55,
+    0x99, 0xCA, 0x03, 0x56,  0xE6, 0xAF, 0x45, 0x56,
+    0xEC, 0x43, 0x94, 0x56,  0xE2, 0x65, 0xDE, 0x56,
+    0x6A, 0xCC, 0x26, 0x57,  0x9F, 0x32, 0x7A, 0x57,
+    0xF7, 0xA5, 0xBB, 0x57,  0x79, 0xBC, 0x0C, 0x58,
+    0xB6, 0x1A, 0x53, 0x58,  0x08, 0x54, 0x9E, 0x58,
+    0x0C, 0x7E, 0xED, 0x58,  0x89, 0x1E, 0x32, 0x59,
+    0xE7, 0x96, 0x85, 0x59,  0x5A, 0x62, 0xC8, 0x59,
+    0xC4, 0x49, 0x16, 0x5A,  0xA6, 0x6E, 0x61, 0x5A,
+    0xFC, 0x12, 0xA9, 0x5A,  0x7A, 0x9C, 0xFD, 0x5A,
+    0x5C, 0x35, 0x3E, 0x5B,  0x05, 0xA8, 0x8E, 0x5B,
+    0x08, 0xFC, 0xD5, 0x5B,  0x06, 0x7D, 0x20, 0x5C,
+    0x89, 0xBB, 0x70, 0x5C,  0xA7, 0x8C, 0xB4, 0x5C,
+    0x7D, 0x69, 0x07, 0x5D,  0x3C, 0x1E, 0x4B, 0x5D,
+    0xAD, 0x56, 0x98, 0x5D,  0x04, 0x82, 0xE4, 0x5D,
+    0x83, 0x61, 0x2B, 0x5E,  0x22, 0x89, 0x80, 0x5E,
+    0xB3, 0xCD, 0xC0, 0x5E,  0x46, 0x9A, 0x10, 0x5F,
+    0x69, 0xE7, 0x58, 0x5F,  0x8F, 0xAD, 0xA2, 0x5F,
+    0x56, 0x04, 0xF4, 0x5F,  0x40, 0x03, 0x37, 0x60,
+    0x70, 0x42, 0x89, 0x60,  0xA8, 0xE3, 0xCD, 0x60,
+    0xBE, 0x6A, 0x1A, 0x61,  0x1D, 0xA0, 0x67, 0x61,
+    0x16, 0xB8, 0xAD, 0x61,  0x10, 0x4A, 0x02, 0x62,
+    0x18, 0x6F, 0x43, 0x62,  0x52, 0x93, 0x92, 0x62,
+    0xFB, 0xDC, 0xDB, 0x62,  0xBC, 0xE5, 0x24, 0x63,
+    0x9A, 0x58, 0x77, 0x63,  0x74, 0x82, 0xB9, 0x63,
+    0xD7, 0x21, 0x0B, 0x64,  0xC2, 0xB2, 0x50, 0x64,
+    0x12, 0x86, 0x9C, 0x64,  0x1B, 0xC9, 0xEA, 0x64
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  v[0] = 1.5;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 1.5;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+    CHECKFi(i, u[i], v[i + 5]);
+
+  return r;
+}
diff --git a/test/get_endian_float64_arm.c b/test/get_endian_float64_arm.c
new file mode 100644
index 0000000..ee554b6
--- /dev/null
+++ b/test/get_endian_float64_arm.c
@@ -0,0 +1,207 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read arm-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\nENDIAN little arm\n";
+  double u[10];
+  double v[20];
+  const unsigned char data_data[128 * 8] = {
+    0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x0b, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x60, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xc8, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x16, 0x31, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xa1, 0x39, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xc0, 0x38, 0x43, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0x20, 0xd5, 0x4c, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xd8, 0x9f, 0x55, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xe2, 0x37, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xd3, 0x53, 0x68, 0x40, 0x00, 0x00, 0x00, 0x00,
+    0xde, 0x3e, 0x72, 0x40, 0x00, 0x00, 0x00, 0x40,
+    0x4d, 0x5e, 0x7b, 0x40, 0x00, 0x00, 0x00, 0x60,
+    0xba, 0x86, 0x84, 0x40, 0x00, 0x00, 0x00, 0x08,
+    0x17, 0xca, 0x8e, 0x40, 0x00, 0x00, 0x00, 0x0c,
+    0x91, 0x17, 0x97, 0x40, 0x00, 0x00, 0x00, 0x49,
+    0xac, 0x51, 0xa1, 0x40, 0x00, 0x00, 0xc0, 0xf6,
+    0x83, 0xfa, 0xa9, 0x40, 0x00, 0x00, 0x20, 0x72,
+    0xe2, 0x7b, 0xb3, 0x40, 0x00, 0x00, 0x98, 0x95,
+    0xd3, 0x39, 0xbd, 0x40, 0x00, 0x00, 0x64, 0xe0,
+    0x5e, 0xeb, 0xc5, 0x40, 0x00, 0x00, 0x4b, 0xe8,
+    0x87, 0x70, 0xd0, 0x40, 0x00, 0x40, 0x38, 0x2e,
+    0xca, 0xa8, 0xd8, 0x40, 0x00, 0x60, 0x54, 0xc5,
+    0x98, 0x7e, 0xe2, 0x40, 0x00, 0x48, 0xff, 0x13,
+    0xe4, 0xbd, 0xeb, 0x40, 0x00, 0xec, 0xfe, 0x1d,
+    0x6b, 0xce, 0xf4, 0x40, 0x00, 0x31, 0x7f, 0x16,
+    0xa0, 0x35, 0xff, 0x40, 0x80, 0xc9, 0xbe, 0xa1,
+    0x38, 0x68, 0x07, 0x41, 0x20, 0x17, 0x4f, 0x79,
+    0x2a, 0x8e, 0x11, 0x41, 0x58, 0x51, 0xfb, 0x5a,
+    0x3f, 0x55, 0x1a, 0x41, 0x04, 0xfa, 0x78, 0x88,
+    0xef, 0xbf, 0x23, 0x41, 0x83, 0xbb, 0x5a, 0xa6,
+    0xe7, 0x9f, 0x2d, 0x41, 0x44, 0x19, 0x88, 0x79,
+    0xed, 0x37, 0x36, 0x41, 0xf3, 0x12, 0x26, 0x9b,
+    0xf2, 0xa9, 0x40, 0x41, 0x36, 0x8e, 0x5c, 0x34,
+    0xeb, 0xfe, 0x48, 0x41, 0x51, 0xd5, 0x8a, 0x4e,
+    0x30, 0xbf, 0x52, 0x41, 0xfd, 0x1f, 0xe8, 0x7a,
+    0xc8, 0x1e, 0x5c, 0x41, 0xfc, 0x2f, 0x5c, 0xb8,
+    0x16, 0x17, 0x65, 0x41, 0xfd, 0x23, 0x45, 0x8a,
+    0xa1, 0xa2, 0x6f, 0x41, 0xfc, 0xb5, 0x67, 0xcf,
+    0xf9, 0xb9, 0x77, 0x41, 0x7d, 0xc8, 0x8d, 0x5b,
+    0x7b, 0xcb, 0x81, 0x41, 0x5e, 0x56, 0xaa, 0x04,
+    0x38, 0xb1, 0x8a, 0x41, 0x8d, 0x81, 0xff, 0x86,
+    0xea, 0x04, 0x94, 0x41, 0x2a, 0xa1, 0x3f, 0x65,
+    0x5f, 0x07, 0x9e, 0x41, 0xbf, 0x71, 0xdf, 0x97,
+    0x87, 0x85, 0xa6, 0x41, 0x4f, 0x95, 0xe7, 0xb1,
+    0x25, 0xe4, 0xb0, 0x41, 0xfb, 0xaf, 0x6d, 0xc5,
+    0x38, 0x56, 0xb9, 0x41, 0xf8, 0x87, 0x24, 0xa8,
+    0xaa, 0x00, 0xc3, 0x41, 0xfa, 0x65, 0x1b, 0x7e,
+    0xff, 0x80, 0xcc, 0x41, 0xf7, 0x18, 0x29, 0xbd,
+    0xbf, 0x60, 0xd5, 0x41, 0xb9, 0xd2, 0xde, 0xcd,
+    0x8f, 0x08, 0xe0, 0x41, 0x0b, 0x1e, 0x67, 0xda,
+    0xd7, 0x0c, 0xe8, 0x41, 0x10, 0xad, 0x9a, 0xc7,
+    0xa1, 0x09, 0xf2, 0x41, 0xcc, 0x01, 0xb4, 0xd5,
+    0x72, 0x0e, 0xfb, 0x41, 0xb2, 0x02, 0x8e, 0xc0,
+    0xd6, 0x4a, 0x04, 0x42, 0x06, 0x82, 0x6a, 0x10,
+    0x41, 0x70, 0x0e, 0x42, 0x09, 0xc3, 0x9f, 0x18,
+    0x30, 0xd4, 0x16, 0x42, 0x47, 0xd2, 0x77, 0xd2,
+    0x24, 0x1f, 0x21, 0x42, 0xb5, 0xdd, 0xd9, 0x9d,
+    0xb6, 0xae, 0x29, 0x42, 0x90, 0xcc, 0xc6, 0xec,
+    0x09, 0x43, 0x33, 0x42, 0x6c, 0x19, 0x95, 0x31,
+    0x8d, 0xe4, 0x3c, 0x42, 0x22, 0xa6, 0x5f, 0xca,
+    0x6a, 0xab, 0x45, 0x42, 0x9a, 0xbc, 0xc7, 0x57,
+    0x8f, 0x40, 0x50, 0x42, 0x74, 0xcd, 0xd5, 0xc1,
+    0xd7, 0x60, 0x58, 0x42, 0x2e, 0xb4, 0xc0, 0xa2,
+    0xa1, 0x48, 0x62, 0x42, 0x22, 0x87, 0x10, 0xba,
+    0xf2, 0x6c, 0x6b, 0x42, 0xb3, 0xca, 0x18, 0x97,
+    0xb5, 0x91, 0x74, 0x42, 0x06, 0x98, 0x52, 0xf1,
+    0x90, 0xda, 0x7e, 0x42, 0x09, 0xe4, 0xfb, 0xe9,
+    0xec, 0x23, 0x87, 0x42, 0x07, 0xeb, 0x7c, 0xaf,
+    0xf1, 0x5a, 0x91, 0x42, 0x45, 0xb0, 0x9d, 0x83,
+    0x6a, 0x08, 0x9a, 0x42, 0x68, 0x88, 0x6c, 0x45,
+    0x4f, 0x86, 0xa3, 0x42, 0x4e, 0x66, 0x11, 0xb4,
+    0x77, 0x49, 0xad, 0x42, 0x75, 0x19, 0x1a, 0x8e,
+    0x19, 0xf7, 0xb5, 0x42, 0x18, 0x93, 0x93, 0xaa,
+    0x53, 0x79, 0xc0, 0x42, 0x52, 0xae, 0xee, 0x3f,
+    0xfc, 0xb5, 0xc8, 0x42, 0x7b, 0x05, 0xe6, 0xdf,
+    0x7d, 0x88, 0xd2, 0x42, 0x1c, 0x84, 0xec, 0xa7,
+    0xbc, 0xcc, 0xdb, 0x42, 0x2a, 0xc6, 0xe2, 0x7b,
+    0x8d, 0xd9, 0xe4, 0x42, 0xa0, 0x14, 0xea, 0x5c,
+    0x54, 0x46, 0xef, 0x42, 0xf0, 0x1e, 0x5f, 0x0b,
+    0xbf, 0x74, 0xf7, 0x42, 0x34, 0x57, 0x87, 0x08,
+    0x8f, 0x97, 0x01, 0x43, 0x67, 0x81, 0x65, 0x46,
+    0x56, 0x63, 0x0a, 0x43, 0x1a, 0x42, 0x98, 0xe9,
+    0x81, 0xca, 0x13, 0x43, 0x94, 0x31, 0x32, 0x2f,
+    0xc1, 0xaf, 0x1d, 0x43, 0x5e, 0x4a, 0xcb, 0xc6,
+    0xd1, 0x43, 0x26, 0x43, 0xc6, 0x77, 0x18, 0x55,
+    0xdc, 0xb2, 0x30, 0x43, 0xd4, 0x59, 0xd2, 0xff,
+    0x4b, 0x0c, 0x39, 0x43, 0xbe, 0x86, 0xbb, 0x7f,
+    0x38, 0xc9, 0x42, 0x43, 0x0e, 0xa5, 0xcc, 0x9f,
+    0xd4, 0x2d, 0x4c, 0x43, 0x95, 0xf7, 0xb2, 0xef,
+    0x5f, 0x22, 0x55, 0x43, 0xb0, 0x39, 0xc6, 0xb3,
+    0x8f, 0xb3, 0x5f, 0x43, 0x88, 0x56, 0xa9, 0x8d,
+    0xab, 0xc6, 0x67, 0x43, 0xe6, 0x00, 0x3f, 0xaa,
+    0x00, 0xd5, 0x71, 0x43, 0xac, 0x40, 0xaf, 0xbf,
+    0x81, 0xbf, 0x7a, 0x43, 0x02, 0xe1, 0x86, 0x1f,
+    0xa0, 0x0f, 0x84, 0x43, 0xc2, 0x28, 0xa5, 0xd7,
+    0x71, 0x17, 0x8e, 0x43, 0x23, 0xbd, 0x77, 0x43,
+    0x94, 0x91, 0x96, 0x43, 0xda, 0xcd, 0x99, 0xf2,
+    0x2f, 0xed, 0xa0, 0x43, 0x64, 0x5a, 0xf3, 0xb5,
+    0xc7, 0x63, 0xa9, 0x43, 0x96, 0x07, 0xed, 0x90,
+    0xd5, 0x0a, 0xb3, 0x43, 0xb0, 0xc5, 0xb1, 0xac,
+    0x40, 0x90, 0xbc, 0x43, 0x88, 0xa8, 0x0a, 0x83,
+    0x30, 0x6c, 0xc5, 0x43, 0x66, 0xfe, 0x47, 0x62,
+    0x24, 0x11, 0xd0, 0x43, 0xcc, 0xfe, 0xb5, 0x49,
+    0xb6, 0x19, 0xd8, 0x43, 0x32, 0xfe, 0x90, 0x6e,
+    0x48, 0x13, 0xe2, 0x43, 0xa6, 0xbe, 0xec, 0xd2,
+    0xed, 0x1c, 0xeb, 0x43, 0xf9, 0x1d, 0x63, 0x3c,
+    0xb1, 0x55, 0xf4, 0x43, 0x7b, 0x56, 0x4a, 0xed,
+    0x8a, 0x80, 0xfe, 0x43, 0xb8, 0x81, 0xef, 0xe3,
+    0x68, 0xe0, 0x06, 0x44, 0x4a, 0xa1, 0xf3, 0x2a,
+    0x4e, 0x28, 0x11, 0x44, 0xf8, 0xb8, 0x36, 0x20,
+    0x75, 0xbc, 0x19, 0x44, 0x74, 0x15, 0x52, 0x30,
+    0x57, 0x4d, 0x23, 0x44, 0x17, 0x90, 0x3d, 0xe4,
+    0x03, 0xf4, 0x2c, 0x44, 0x22, 0x58, 0x5c, 0xd6,
+    0x02, 0xb7, 0x35, 0x44, 0x1a, 0x42, 0xc5, 0xe0,
+    0x42, 0x49, 0x40, 0x44, 0x94, 0xf1, 0x93, 0x28,
+    0xe3, 0x6d, 0x48, 0x44, 0x5e, 0xea, 0xdd, 0x3c,
+    0x6a, 0x52, 0x52, 0x44, 0xc6, 0x6f, 0xa6, 0x6d,
+    0x9f, 0x7b, 0x5b, 0x44, 0xa9, 0xa7, 0x79, 0xa4,
+    0xb7, 0x9c, 0x64, 0x44, 0xbf, 0x3d, 0x5b, 0xbb,
+    0x13, 0xeb, 0x6e, 0x44, 0x9e, 0xdc, 0x08, 0x99,
+    0x4e, 0x30, 0x77, 0x44, 0x76, 0xa5, 0xc6, 0xb2,
+    0x3b, 0x64, 0x81, 0x44, 0x18, 0xfc, 0x14, 0x06,
+    0x58, 0x16, 0x8a, 0x44, 0x24, 0x7a, 0x1f, 0x89,
+    0xc2, 0x90, 0x93, 0x44, 0x9b, 0x9b, 0xd7, 0x66,
+    0x23, 0x59, 0x9d, 0x44, 0x68, 0x69, 0x43, 0x9a
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  v[0] = 1.5;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 1.5;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+    CHECKFi(i, u[i], v[i + 5]);
+
+  return r;
+}
diff --git a/test/get_endian_float64_big.c b/test/get_endian_float64_big.c
new file mode 100644
index 0000000..7d3c7fe
--- /dev/null
+++ b/test/get_endian_float64_big.c
@@ -0,0 +1,207 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read big-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\nENDIAN big\n";
+  double u[10];
+  double v[20];
+  const unsigned char data_data[128 * 8] = {
+    0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x1e, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x26, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x31, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x39, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x43, 0x38, 0xc0, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x4c, 0xd5, 0x20, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x55, 0x9f, 0xd8, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x60, 0x37, 0xe2, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x68, 0x53, 0xd3, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x72, 0x3e, 0xde, 0x40, 0x00, 0x00, 0x00,
+    0x40, 0x7b, 0x5e, 0x4d, 0x60, 0x00, 0x00, 0x00,
+    0x40, 0x84, 0x86, 0xba, 0x08, 0x00, 0x00, 0x00,
+    0x40, 0x8e, 0xca, 0x17, 0x0c, 0x00, 0x00, 0x00,
+    0x40, 0x97, 0x17, 0x91, 0x49, 0x00, 0x00, 0x00,
+    0x40, 0xa1, 0x51, 0xac, 0xf6, 0xc0, 0x00, 0x00,
+    0x40, 0xa9, 0xfa, 0x83, 0x72, 0x20, 0x00, 0x00,
+    0x40, 0xb3, 0x7b, 0xe2, 0x95, 0x98, 0x00, 0x00,
+    0x40, 0xbd, 0x39, 0xd3, 0xe0, 0x64, 0x00, 0x00,
+    0x40, 0xc5, 0xeb, 0x5e, 0xe8, 0x4b, 0x00, 0x00,
+    0x40, 0xd0, 0x70, 0x87, 0x2e, 0x38, 0x40, 0x00,
+    0x40, 0xd8, 0xa8, 0xca, 0xc5, 0x54, 0x60, 0x00,
+    0x40, 0xe2, 0x7e, 0x98, 0x13, 0xff, 0x48, 0x00,
+    0x40, 0xeb, 0xbd, 0xe4, 0x1d, 0xfe, 0xec, 0x00,
+    0x40, 0xf4, 0xce, 0x6b, 0x16, 0x7f, 0x31, 0x00,
+    0x40, 0xff, 0x35, 0xa0, 0xa1, 0xbe, 0xc9, 0x80,
+    0x41, 0x07, 0x68, 0x38, 0x79, 0x4f, 0x17, 0x20,
+    0x41, 0x11, 0x8e, 0x2a, 0x5a, 0xfb, 0x51, 0x58,
+    0x41, 0x1a, 0x55, 0x3f, 0x88, 0x78, 0xfa, 0x04,
+    0x41, 0x23, 0xbf, 0xef, 0xa6, 0x5a, 0xbb, 0x83,
+    0x41, 0x2d, 0x9f, 0xe7, 0x79, 0x88, 0x19, 0x44,
+    0x41, 0x36, 0x37, 0xed, 0x9b, 0x26, 0x12, 0xf3,
+    0x41, 0x40, 0xa9, 0xf2, 0x34, 0x5c, 0x8e, 0x36,
+    0x41, 0x48, 0xfe, 0xeb, 0x4e, 0x8a, 0xd5, 0x51,
+    0x41, 0x52, 0xbf, 0x30, 0x7a, 0xe8, 0x1f, 0xfd,
+    0x41, 0x5c, 0x1e, 0xc8, 0xb8, 0x5c, 0x2f, 0xfc,
+    0x41, 0x65, 0x17, 0x16, 0x8a, 0x45, 0x23, 0xfd,
+    0x41, 0x6f, 0xa2, 0xa1, 0xcf, 0x67, 0xb5, 0xfc,
+    0x41, 0x77, 0xb9, 0xf9, 0x5b, 0x8d, 0xc8, 0x7d,
+    0x41, 0x81, 0xcb, 0x7b, 0x04, 0xaa, 0x56, 0x5e,
+    0x41, 0x8a, 0xb1, 0x38, 0x86, 0xff, 0x81, 0x8d,
+    0x41, 0x94, 0x04, 0xea, 0x65, 0x3f, 0xa1, 0x2a,
+    0x41, 0x9e, 0x07, 0x5f, 0x97, 0xdf, 0x71, 0xbf,
+    0x41, 0xa6, 0x85, 0x87, 0xb1, 0xe7, 0x95, 0x4f,
+    0x41, 0xb0, 0xe4, 0x25, 0xc5, 0x6d, 0xaf, 0xfb,
+    0x41, 0xb9, 0x56, 0x38, 0xa8, 0x24, 0x87, 0xf8,
+    0x41, 0xc3, 0x00, 0xaa, 0x7e, 0x1b, 0x65, 0xfa,
+    0x41, 0xcc, 0x80, 0xff, 0xbd, 0x29, 0x18, 0xf7,
+    0x41, 0xd5, 0x60, 0xbf, 0xcd, 0xde, 0xd2, 0xb9,
+    0x41, 0xe0, 0x08, 0x8f, 0xda, 0x67, 0x1e, 0x0b,
+    0x41, 0xe8, 0x0c, 0xd7, 0xc7, 0x9a, 0xad, 0x10,
+    0x41, 0xf2, 0x09, 0xa1, 0xd5, 0xb4, 0x01, 0xcc,
+    0x41, 0xfb, 0x0e, 0x72, 0xc0, 0x8e, 0x02, 0xb2,
+    0x42, 0x04, 0x4a, 0xd6, 0x10, 0x6a, 0x82, 0x06,
+    0x42, 0x0e, 0x70, 0x41, 0x18, 0x9f, 0xc3, 0x09,
+    0x42, 0x16, 0xd4, 0x30, 0xd2, 0x77, 0xd2, 0x47,
+    0x42, 0x21, 0x1f, 0x24, 0x9d, 0xd9, 0xdd, 0xb5,
+    0x42, 0x29, 0xae, 0xb6, 0xec, 0xc6, 0xcc, 0x90,
+    0x42, 0x33, 0x43, 0x09, 0x31, 0x95, 0x19, 0x6c,
+    0x42, 0x3c, 0xe4, 0x8d, 0xca, 0x5f, 0xa6, 0x22,
+    0x42, 0x45, 0xab, 0x6a, 0x57, 0xc7, 0xbc, 0x9a,
+    0x42, 0x50, 0x40, 0x8f, 0xc1, 0xd5, 0xcd, 0x74,
+    0x42, 0x58, 0x60, 0xd7, 0xa2, 0xc0, 0xb4, 0x2e,
+    0x42, 0x62, 0x48, 0xa1, 0xba, 0x10, 0x87, 0x22,
+    0x42, 0x6b, 0x6c, 0xf2, 0x97, 0x18, 0xca, 0xb3,
+    0x42, 0x74, 0x91, 0xb5, 0xf1, 0x52, 0x98, 0x06,
+    0x42, 0x7e, 0xda, 0x90, 0xe9, 0xfb, 0xe4, 0x09,
+    0x42, 0x87, 0x23, 0xec, 0xaf, 0x7c, 0xeb, 0x07,
+    0x42, 0x91, 0x5a, 0xf1, 0x83, 0x9d, 0xb0, 0x45,
+    0x42, 0x9a, 0x08, 0x6a, 0x45, 0x6c, 0x88, 0x68,
+    0x42, 0xa3, 0x86, 0x4f, 0xb4, 0x11, 0x66, 0x4e,
+    0x42, 0xad, 0x49, 0x77, 0x8e, 0x1a, 0x19, 0x75,
+    0x42, 0xb5, 0xf7, 0x19, 0xaa, 0x93, 0x93, 0x18,
+    0x42, 0xc0, 0x79, 0x53, 0x3f, 0xee, 0xae, 0x52,
+    0x42, 0xc8, 0xb5, 0xfc, 0xdf, 0xe6, 0x05, 0x7b,
+    0x42, 0xd2, 0x88, 0x7d, 0xa7, 0xec, 0x84, 0x1c,
+    0x42, 0xdb, 0xcc, 0xbc, 0x7b, 0xe2, 0xc6, 0x2a,
+    0x42, 0xe4, 0xd9, 0x8d, 0x5c, 0xea, 0x14, 0xa0,
+    0x42, 0xef, 0x46, 0x54, 0x0b, 0x5f, 0x1e, 0xf0,
+    0x42, 0xf7, 0x74, 0xbf, 0x08, 0x87, 0x57, 0x34,
+    0x43, 0x01, 0x97, 0x8f, 0x46, 0x65, 0x81, 0x67,
+    0x43, 0x0a, 0x63, 0x56, 0xe9, 0x98, 0x42, 0x1a,
+    0x43, 0x13, 0xca, 0x81, 0x2f, 0x32, 0x31, 0x94,
+    0x43, 0x1d, 0xaf, 0xc1, 0xc6, 0xcb, 0x4a, 0x5e,
+    0x43, 0x26, 0x43, 0xd1, 0x55, 0x18, 0x77, 0xc6,
+    0x43, 0x30, 0xb2, 0xdc, 0xff, 0xd2, 0x59, 0xd4,
+    0x43, 0x39, 0x0c, 0x4b, 0x7f, 0xbb, 0x86, 0xbe,
+    0x43, 0x42, 0xc9, 0x38, 0x9f, 0xcc, 0xa5, 0x0e,
+    0x43, 0x4c, 0x2d, 0xd4, 0xef, 0xb2, 0xf7, 0x95,
+    0x43, 0x55, 0x22, 0x5f, 0xb3, 0xc6, 0x39, 0xb0,
+    0x43, 0x5f, 0xb3, 0x8f, 0x8d, 0xa9, 0x56, 0x88,
+    0x43, 0x67, 0xc6, 0xab, 0xaa, 0x3f, 0x00, 0xe6,
+    0x43, 0x71, 0xd5, 0x00, 0xbf, 0xaf, 0x40, 0xac,
+    0x43, 0x7a, 0xbf, 0x81, 0x1f, 0x86, 0xe1, 0x02,
+    0x43, 0x84, 0x0f, 0xa0, 0xd7, 0xa5, 0x28, 0xc2,
+    0x43, 0x8e, 0x17, 0x71, 0x43, 0x77, 0xbd, 0x23,
+    0x43, 0x96, 0x91, 0x94, 0xf2, 0x99, 0xcd, 0xda,
+    0x43, 0xa0, 0xed, 0x2f, 0xb5, 0xf3, 0x5a, 0x64,
+    0x43, 0xa9, 0x63, 0xc7, 0x90, 0xed, 0x07, 0x96,
+    0x43, 0xb3, 0x0a, 0xd5, 0xac, 0xb1, 0xc5, 0xb0,
+    0x43, 0xbc, 0x90, 0x40, 0x83, 0x0a, 0xa8, 0x88,
+    0x43, 0xc5, 0x6c, 0x30, 0x62, 0x47, 0xfe, 0x66,
+    0x43, 0xd0, 0x11, 0x24, 0x49, 0xb5, 0xfe, 0xcc,
+    0x43, 0xd8, 0x19, 0xb6, 0x6e, 0x90, 0xfe, 0x32,
+    0x43, 0xe2, 0x13, 0x48, 0xd2, 0xec, 0xbe, 0xa6,
+    0x43, 0xeb, 0x1c, 0xed, 0x3c, 0x63, 0x1d, 0xf9,
+    0x43, 0xf4, 0x55, 0xb1, 0xed, 0x4a, 0x56, 0x7b,
+    0x43, 0xfe, 0x80, 0x8a, 0xe3, 0xef, 0x81, 0xb8,
+    0x44, 0x06, 0xe0, 0x68, 0x2a, 0xf3, 0xa1, 0x4a,
+    0x44, 0x11, 0x28, 0x4e, 0x20, 0x36, 0xb8, 0xf8,
+    0x44, 0x19, 0xbc, 0x75, 0x30, 0x52, 0x15, 0x74,
+    0x44, 0x23, 0x4d, 0x57, 0xe4, 0x3d, 0x90, 0x17,
+    0x44, 0x2c, 0xf4, 0x03, 0xd6, 0x5c, 0x58, 0x22,
+    0x44, 0x35, 0xb7, 0x02, 0xe0, 0xc5, 0x42, 0x1a,
+    0x44, 0x40, 0x49, 0x42, 0x28, 0x93, 0xf1, 0x94,
+    0x44, 0x48, 0x6d, 0xe3, 0x3c, 0xdd, 0xea, 0x5e,
+    0x44, 0x52, 0x52, 0x6a, 0x6d, 0xa6, 0x6f, 0xc6,
+    0x44, 0x5b, 0x7b, 0x9f, 0xa4, 0x79, 0xa7, 0xa9,
+    0x44, 0x64, 0x9c, 0xb7, 0xbb, 0x5b, 0x3d, 0xbf,
+    0x44, 0x6e, 0xeb, 0x13, 0x99, 0x08, 0xdc, 0x9e,
+    0x44, 0x77, 0x30, 0x4e, 0xb2, 0xc6, 0xa5, 0x76,
+    0x44, 0x81, 0x64, 0x3b, 0x06, 0x14, 0xfc, 0x18,
+    0x44, 0x8a, 0x16, 0x58, 0x89, 0x1f, 0x7a, 0x24,
+    0x44, 0x93, 0x90, 0xc2, 0x66, 0xd7, 0x9b, 0x9b,
+    0x44, 0x9d, 0x59, 0x23, 0x9a, 0x43, 0x69, 0x68
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  v[0] = 1.5;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 1.5;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+    CHECKFi(i, u[i], v[i + 5]);
+
+  return r;
+}
diff --git a/test/get_endian_float64_little.c b/test/get_endian_float64_little.c
new file mode 100644
index 0000000..970aa46
--- /dev/null
+++ b/test/get_endian_float64_little.c
@@ -0,0 +1,207 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read little-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\nENDIAN little\n";
+  double u[10];
+  double v[20];
+  const unsigned char data_data[128 * 8] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x14, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1e, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x26, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x31, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x39, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x43, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x20, 0xd5, 0x4c, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0xd8, 0x9f, 0x55, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0xe2, 0x37, 0x60, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0xd3, 0x53, 0x68, 0x40,
+    0x00, 0x00, 0x00, 0x40, 0xde, 0x3e, 0x72, 0x40,
+    0x00, 0x00, 0x00, 0x60, 0x4d, 0x5e, 0x7b, 0x40,
+    0x00, 0x00, 0x00, 0x08, 0xba, 0x86, 0x84, 0x40,
+    0x00, 0x00, 0x00, 0x0c, 0x17, 0xca, 0x8e, 0x40,
+    0x00, 0x00, 0x00, 0x49, 0x91, 0x17, 0x97, 0x40,
+    0x00, 0x00, 0xc0, 0xf6, 0xac, 0x51, 0xa1, 0x40,
+    0x00, 0x00, 0x20, 0x72, 0x83, 0xfa, 0xa9, 0x40,
+    0x00, 0x00, 0x98, 0x95, 0xe2, 0x7b, 0xb3, 0x40,
+    0x00, 0x00, 0x64, 0xe0, 0xd3, 0x39, 0xbd, 0x40,
+    0x00, 0x00, 0x4b, 0xe8, 0x5e, 0xeb, 0xc5, 0x40,
+    0x00, 0x40, 0x38, 0x2e, 0x87, 0x70, 0xd0, 0x40,
+    0x00, 0x60, 0x54, 0xc5, 0xca, 0xa8, 0xd8, 0x40,
+    0x00, 0x48, 0xff, 0x13, 0x98, 0x7e, 0xe2, 0x40,
+    0x00, 0xec, 0xfe, 0x1d, 0xe4, 0xbd, 0xeb, 0x40,
+    0x00, 0x31, 0x7f, 0x16, 0x6b, 0xce, 0xf4, 0x40,
+    0x80, 0xc9, 0xbe, 0xa1, 0xa0, 0x35, 0xff, 0x40,
+    0x20, 0x17, 0x4f, 0x79, 0x38, 0x68, 0x07, 0x41,
+    0x58, 0x51, 0xfb, 0x5a, 0x2a, 0x8e, 0x11, 0x41,
+    0x04, 0xfa, 0x78, 0x88, 0x3f, 0x55, 0x1a, 0x41,
+    0x83, 0xbb, 0x5a, 0xa6, 0xef, 0xbf, 0x23, 0x41,
+    0x44, 0x19, 0x88, 0x79, 0xe7, 0x9f, 0x2d, 0x41,
+    0xf3, 0x12, 0x26, 0x9b, 0xed, 0x37, 0x36, 0x41,
+    0x36, 0x8e, 0x5c, 0x34, 0xf2, 0xa9, 0x40, 0x41,
+    0x51, 0xd5, 0x8a, 0x4e, 0xeb, 0xfe, 0x48, 0x41,
+    0xfd, 0x1f, 0xe8, 0x7a, 0x30, 0xbf, 0x52, 0x41,
+    0xfc, 0x2f, 0x5c, 0xb8, 0xc8, 0x1e, 0x5c, 0x41,
+    0xfd, 0x23, 0x45, 0x8a, 0x16, 0x17, 0x65, 0x41,
+    0xfc, 0xb5, 0x67, 0xcf, 0xa1, 0xa2, 0x6f, 0x41,
+    0x7d, 0xc8, 0x8d, 0x5b, 0xf9, 0xb9, 0x77, 0x41,
+    0x5e, 0x56, 0xaa, 0x04, 0x7b, 0xcb, 0x81, 0x41,
+    0x8d, 0x81, 0xff, 0x86, 0x38, 0xb1, 0x8a, 0x41,
+    0x2a, 0xa1, 0x3f, 0x65, 0xea, 0x04, 0x94, 0x41,
+    0xbf, 0x71, 0xdf, 0x97, 0x5f, 0x07, 0x9e, 0x41,
+    0x4f, 0x95, 0xe7, 0xb1, 0x87, 0x85, 0xa6, 0x41,
+    0xfb, 0xaf, 0x6d, 0xc5, 0x25, 0xe4, 0xb0, 0x41,
+    0xf8, 0x87, 0x24, 0xa8, 0x38, 0x56, 0xb9, 0x41,
+    0xfa, 0x65, 0x1b, 0x7e, 0xaa, 0x00, 0xc3, 0x41,
+    0xf7, 0x18, 0x29, 0xbd, 0xff, 0x80, 0xcc, 0x41,
+    0xb9, 0xd2, 0xde, 0xcd, 0xbf, 0x60, 0xd5, 0x41,
+    0x0b, 0x1e, 0x67, 0xda, 0x8f, 0x08, 0xe0, 0x41,
+    0x10, 0xad, 0x9a, 0xc7, 0xd7, 0x0c, 0xe8, 0x41,
+    0xcc, 0x01, 0xb4, 0xd5, 0xa1, 0x09, 0xf2, 0x41,
+    0xb2, 0x02, 0x8e, 0xc0, 0x72, 0x0e, 0xfb, 0x41,
+    0x06, 0x82, 0x6a, 0x10, 0xd6, 0x4a, 0x04, 0x42,
+    0x09, 0xc3, 0x9f, 0x18, 0x41, 0x70, 0x0e, 0x42,
+    0x47, 0xd2, 0x77, 0xd2, 0x30, 0xd4, 0x16, 0x42,
+    0xb5, 0xdd, 0xd9, 0x9d, 0x24, 0x1f, 0x21, 0x42,
+    0x90, 0xcc, 0xc6, 0xec, 0xb6, 0xae, 0x29, 0x42,
+    0x6c, 0x19, 0x95, 0x31, 0x09, 0x43, 0x33, 0x42,
+    0x22, 0xa6, 0x5f, 0xca, 0x8d, 0xe4, 0x3c, 0x42,
+    0x9a, 0xbc, 0xc7, 0x57, 0x6a, 0xab, 0x45, 0x42,
+    0x74, 0xcd, 0xd5, 0xc1, 0x8f, 0x40, 0x50, 0x42,
+    0x2e, 0xb4, 0xc0, 0xa2, 0xd7, 0x60, 0x58, 0x42,
+    0x22, 0x87, 0x10, 0xba, 0xa1, 0x48, 0x62, 0x42,
+    0xb3, 0xca, 0x18, 0x97, 0xf2, 0x6c, 0x6b, 0x42,
+    0x06, 0x98, 0x52, 0xf1, 0xb5, 0x91, 0x74, 0x42,
+    0x09, 0xe4, 0xfb, 0xe9, 0x90, 0xda, 0x7e, 0x42,
+    0x07, 0xeb, 0x7c, 0xaf, 0xec, 0x23, 0x87, 0x42,
+    0x45, 0xb0, 0x9d, 0x83, 0xf1, 0x5a, 0x91, 0x42,
+    0x68, 0x88, 0x6c, 0x45, 0x6a, 0x08, 0x9a, 0x42,
+    0x4e, 0x66, 0x11, 0xb4, 0x4f, 0x86, 0xa3, 0x42,
+    0x75, 0x19, 0x1a, 0x8e, 0x77, 0x49, 0xad, 0x42,
+    0x18, 0x93, 0x93, 0xaa, 0x19, 0xf7, 0xb5, 0x42,
+    0x52, 0xae, 0xee, 0x3f, 0x53, 0x79, 0xc0, 0x42,
+    0x7b, 0x05, 0xe6, 0xdf, 0xfc, 0xb5, 0xc8, 0x42,
+    0x1c, 0x84, 0xec, 0xa7, 0x7d, 0x88, 0xd2, 0x42,
+    0x2a, 0xc6, 0xe2, 0x7b, 0xbc, 0xcc, 0xdb, 0x42,
+    0xa0, 0x14, 0xea, 0x5c, 0x8d, 0xd9, 0xe4, 0x42,
+    0xf0, 0x1e, 0x5f, 0x0b, 0x54, 0x46, 0xef, 0x42,
+    0x34, 0x57, 0x87, 0x08, 0xbf, 0x74, 0xf7, 0x42,
+    0x67, 0x81, 0x65, 0x46, 0x8f, 0x97, 0x01, 0x43,
+    0x1a, 0x42, 0x98, 0xe9, 0x56, 0x63, 0x0a, 0x43,
+    0x94, 0x31, 0x32, 0x2f, 0x81, 0xca, 0x13, 0x43,
+    0x5e, 0x4a, 0xcb, 0xc6, 0xc1, 0xaf, 0x1d, 0x43,
+    0xc6, 0x77, 0x18, 0x55, 0xd1, 0x43, 0x26, 0x43,
+    0xd4, 0x59, 0xd2, 0xff, 0xdc, 0xb2, 0x30, 0x43,
+    0xbe, 0x86, 0xbb, 0x7f, 0x4b, 0x0c, 0x39, 0x43,
+    0x0e, 0xa5, 0xcc, 0x9f, 0x38, 0xc9, 0x42, 0x43,
+    0x95, 0xf7, 0xb2, 0xef, 0xd4, 0x2d, 0x4c, 0x43,
+    0xb0, 0x39, 0xc6, 0xb3, 0x5f, 0x22, 0x55, 0x43,
+    0x88, 0x56, 0xa9, 0x8d, 0x8f, 0xb3, 0x5f, 0x43,
+    0xe6, 0x00, 0x3f, 0xaa, 0xab, 0xc6, 0x67, 0x43,
+    0xac, 0x40, 0xaf, 0xbf, 0x00, 0xd5, 0x71, 0x43,
+    0x02, 0xe1, 0x86, 0x1f, 0x81, 0xbf, 0x7a, 0x43,
+    0xc2, 0x28, 0xa5, 0xd7, 0xa0, 0x0f, 0x84, 0x43,
+    0x23, 0xbd, 0x77, 0x43, 0x71, 0x17, 0x8e, 0x43,
+    0xda, 0xcd, 0x99, 0xf2, 0x94, 0x91, 0x96, 0x43,
+    0x64, 0x5a, 0xf3, 0xb5, 0x2f, 0xed, 0xa0, 0x43,
+    0x96, 0x07, 0xed, 0x90, 0xc7, 0x63, 0xa9, 0x43,
+    0xb0, 0xc5, 0xb1, 0xac, 0xd5, 0x0a, 0xb3, 0x43,
+    0x88, 0xa8, 0x0a, 0x83, 0x40, 0x90, 0xbc, 0x43,
+    0x66, 0xfe, 0x47, 0x62, 0x30, 0x6c, 0xc5, 0x43,
+    0xcc, 0xfe, 0xb5, 0x49, 0x24, 0x11, 0xd0, 0x43,
+    0x32, 0xfe, 0x90, 0x6e, 0xb6, 0x19, 0xd8, 0x43,
+    0xa6, 0xbe, 0xec, 0xd2, 0x48, 0x13, 0xe2, 0x43,
+    0xf9, 0x1d, 0x63, 0x3c, 0xed, 0x1c, 0xeb, 0x43,
+    0x7b, 0x56, 0x4a, 0xed, 0xb1, 0x55, 0xf4, 0x43,
+    0xb8, 0x81, 0xef, 0xe3, 0x8a, 0x80, 0xfe, 0x43,
+    0x4a, 0xa1, 0xf3, 0x2a, 0x68, 0xe0, 0x06, 0x44,
+    0xf8, 0xb8, 0x36, 0x20, 0x4e, 0x28, 0x11, 0x44,
+    0x74, 0x15, 0x52, 0x30, 0x75, 0xbc, 0x19, 0x44,
+    0x17, 0x90, 0x3d, 0xe4, 0x57, 0x4d, 0x23, 0x44,
+    0x22, 0x58, 0x5c, 0xd6, 0x03, 0xf4, 0x2c, 0x44,
+    0x1a, 0x42, 0xc5, 0xe0, 0x02, 0xb7, 0x35, 0x44,
+    0x94, 0xf1, 0x93, 0x28, 0x42, 0x49, 0x40, 0x44,
+    0x5e, 0xea, 0xdd, 0x3c, 0xe3, 0x6d, 0x48, 0x44,
+    0xc6, 0x6f, 0xa6, 0x6d, 0x6a, 0x52, 0x52, 0x44,
+    0xa9, 0xa7, 0x79, 0xa4, 0x9f, 0x7b, 0x5b, 0x44,
+    0xbf, 0x3d, 0x5b, 0xbb, 0xb7, 0x9c, 0x64, 0x44,
+    0x9e, 0xdc, 0x08, 0x99, 0x13, 0xeb, 0x6e, 0x44,
+    0x76, 0xa5, 0xc6, 0xb2, 0x4e, 0x30, 0x77, 0x44,
+    0x18, 0xfc, 0x14, 0x06, 0x3b, 0x64, 0x81, 0x44,
+    0x24, 0x7a, 0x1f, 0x89, 0x58, 0x16, 0x8a, 0x44,
+    0x9b, 0x9b, 0xd7, 0x66, 0xc2, 0x90, 0x93, 0x44,
+    0x68, 0x69, 0x43, 0x9a, 0x23, 0x59, 0x9d, 0x44
+  };
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  v[0] = 1.5;
+  for (i = 1; i < 20; ++i)
+    v[i] = v[i - 1] * 1.5;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (i = 0; i < 10; ++i)
+    CHECKFi(i, u[i], v[i + 5]);
+
+  return r;
+}
diff --git a/test/get_ff.c b/test/get_ff.c
new file mode 100644
index 0000000..5217c54
--- /dev/null
+++ b/test/get_ff.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i, c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/get_float32.c b/test/get_float32.c
new file mode 100644
index 0000000..ed16c3c
--- /dev/null
+++ b/test/get_float32.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float c[8];
+  float data_data[128];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = (float)(1.5 * fd);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(float));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 1.5 * (40 + i));
+
+  return r;
+}
diff --git a/test/get_float64.c b/test/get_float64.c
new file mode 100644
index 0000000..b2e1688
--- /dev/null
+++ b/test/get_float64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double c[8];
+  double data_data[128];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = 1.5 * fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], 1.5 * (40 + i));
+
+  return r;
+}
diff --git a/test/get_foffs.c b/test/get_foffs.c
new file mode 100644
index 0000000..15a8c94
--- /dev/null
+++ b/test/get_foffs.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 with a FRAMEOFFSET */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "FRAMEOFFSET 1\ndata RAW UINT8 1\n";
+  unsigned char c;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 4);
+
+  return r;
+}
diff --git a/test/get_foffs2.c b/test/get_foffs2.c
new file mode 100644
index 0000000..2b63c6c
--- /dev/null
+++ b/test/get_foffs2.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"
+
+#include <stdlib.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 = "FRAMEOFFSET 2\ndata RAW UINT8 1\n";
+  unsigned char c1[5], c2[5];
+  unsigned char data_data[256];
+  int i, fd, n1, n2, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (unsigned char)i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 0, 0, 5, 0, GD_UINT8, c1);
+  e1 = gd_error(D);
+  CHECKI(n1, 5);
+  CHECKI(e1, 0);
+
+  for (i = 0; i < 5; ++i)
+    CHECKUi(i, c1[i], (i < 2) ? 0 : i - 2);
+
+  n2 = gd_getdata(D, "data", 0, 0, 5, 0, GD_UINT8, c2);
+  e2 = gd_error(D);
+  CHECKI(n2, 5);
+  CHECKI(e2, 0);
+
+  for (i = 0; i < 5; ++i)
+    CHECKUi(i, c2[i], (i < 2) ? 0 : i - 2);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/get_fs.c b/test/get_fs.c
new file mode 100644
index 0000000..2c428e4
--- /dev/null
+++ b/test/get_fs.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 0, 8, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i, c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/get_here.c b/test/get_here.c
new file mode 100644
index 0000000..b0868fc
--- /dev/null
+++ b/test/get_here.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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, i, m, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  n = gd_getdata(D, "data", GD_HERE, 0, 0, 8, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(m, 40);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i, c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/get_here_foffs.c b/test/get_here_foffs.c
new file mode 100644
index 0000000..6074ac9
--- /dev/null
+++ b/test/get_here_foffs.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Check GD_HERE and FRAMEOFFSET */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "FRAMEOFFSET 2\ndata RAW UINT8 8\n";
+  unsigned char c[8], d[8];
+  unsigned char data_data[256];
+  int fd, i, j, k, l, m, n, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_seek(D, "data", 0, 4, GD_SEEK_SET);
+  m = gd_getdata(D, "data", GD_HERE, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  l = gd_tell(D, "data");
+  k = gd_getdata(D, "data", GD_HERE, 0, 1, 0, GD_UINT8, d);
+  e2 = gd_error(D);
+  j = gd_tell(D, "data");
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(n, 4);
+  CHECKI(m, 8);
+  CHECKI(l, 12);
+  CHECKI(k, 8);
+  CHECKI(j, 20);
+
+  for (i = 0; i < 8; ++i) {
+    CHECKUi(i, c[i], 0);
+    CHECKUi(i, d[i], (i < 4) ? 0 : i - 4);
+  }
+
+  return r;
+}
diff --git a/test/get_heres.c b/test/get_heres.c
new file mode 100644
index 0000000..49ad86f
--- /dev/null
+++ b/test/get_heres.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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, i, m, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek(D, "data", 5, 0, GD_SEEK_SET);
+  n = gd_getdata(D, "data", 0, GD_HERE, 0, 8, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(m, 40);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i, c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/get_int16.c b/test/get_int16.c
new file mode 100644
index 0000000..88e6b1b
--- /dev/null
+++ b/test/get_int16.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t c[8];
+  int16_t data_data[64];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = (int16_t)(fd * (0x0201) * (2 * (fd % 2) - 1));
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * sizeof(int16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (0x5028 + i * 0x0201)  * (2 * (i % 2) - 1));
+
+  return r;
+}
diff --git a/test/get_int32.c b/test/get_int32.c
new file mode 100644
index 0000000..3419fbc
--- /dev/null
+++ b/test/get_int32.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t c[8];
+  int32_t data_data[64];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = fd * (0x02000001) * (2 * (fd % 2) - 1);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * sizeof(int32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (0x50000028 + i * 0x02000001)  * (2 * (i % 2) - 1));
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/get_int64.c b/test/get_int64.c
new file mode 100644
index 0000000..87ccf25
--- /dev/null
+++ b/test/get_int64.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t c[8];
+  int64_t data_data[64];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = fd * (0x0200000000000001) * (2 * (fd % 2) - 1);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64 * sizeof(int64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], (0x5000000000000028 + i * 0x0200000000000001)
+        * (2 * (i % 2) - 1));
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/get_int8.c b/test/get_int8.c
new file mode 100644
index 0000000..3ed6a84
--- /dev/null
+++ b/test/get_int8.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read INT8 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  signed char c[8];
+  signed char data_data[128];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = (signed char)(fd * (2 * (fd % 2) - 1));
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (40 + i) * (2 * (i % 2) - 1));
+
+  return r;
+}
diff --git a/test/get_invalid.c b/test/get_invalid.c
new file mode 100644
index 0000000..2c680bb
--- /dev/null
+++ b/test/get_invalid.c
@@ -0,0 +1,48 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  char c[8];
+  int error, r = 0;
+  size_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/get_lincom1.c b/test/get_lincom1.c
new file mode 100644
index 0000000..3402c1d
--- /dev/null
+++ b/test/get_lincom1.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINCOM1 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM 1 data 2 3\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 13);
+
+  return r;
+}
diff --git a/test/get_lincom2.c b/test/get_lincom2.c
new file mode 100644
index 0000000..ed0cb97
--- /dev/null
+++ b/test/get_lincom2.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM 2 data 2 3 data 1 0\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 18);
+
+  return r;
+}
diff --git a/test/get_lincom3.c b/test/get_lincom3.c
new file mode 100644
index 0000000..28153e8
--- /dev/null
+++ b/test/get_lincom3.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM 3 data 2 3 data 1 0 data 10 4\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 72);
+
+  return r;
+}
diff --git a/test/get_lincom_noin.c b/test/get_lincom_noin.c
new file mode 100644
index 0000000..8315f4e
--- /dev/null
+++ b/test/get_lincom_noin.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINCOM1 */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "lincom LINCOM 1 data 2 3\n";
+  unsigned char c = 0;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/get_lincom_non.c b/test/get_lincom_non.c
new file mode 100644
index 0000000..e6bcaab
--- /dev/null
+++ b/test/get_lincom_non.c
@@ -0,0 +1,71 @@
+/* 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
+ */
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM data 2 3 data 1 0\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 18);
+
+  return r;
+}
diff --git a/test/get_lincom_null.c b/test/get_lincom_null.c
new file mode 100644
index 0000000..9e1f422
--- /dev/null
+++ b/test/get_lincom_null.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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 2 data 2 3 data 1 0\ndata RAW UINT8 1\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 5, 0, 10, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  return r;
+}
diff --git a/test/get_lincom_spf.c b/test/get_lincom_spf.c
new file mode 100644
index 0000000..1544870
--- /dev/null
+++ b/test/get_lincom_spf.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINCOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *cata = "dirfile/cata";
+  const char *format_data = "lincom LINCOM 2 data 2 3 cata 1 0\n"
+    "data RAW UINT8 2\n"
+    "cata RAW UINT8 3\n";
+  unsigned char c[10];
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 10);
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  fd = open(cata, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "lincom", 5, 0, 5, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(cata);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+  for (n = 0; n < 10; ++n)
+    CHECKUi(n, c[n], 38 + n * 7 / 2);
+
+  return r;
+}
diff --git a/test/get_linterp.c b/test/get_linterp.c
new file mode 100644
index 0000000..f7a9a1a
--- /dev/null
+++ b/test/get_linterp.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINTERP */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[64];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64);
+  close(fd);
+
+  t = fopen(table, "wt");
+  for (i = 0; i < 10; ++i)
+    fprintf(t, "%i %i\n", i * 6, i * 12);
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(table);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 10);
+
+  return r;
+}
diff --git a/test/get_linterp_noin.c b/test/get_linterp_noin.c
new file mode 100644
index 0000000..c291b8d
--- /dev/null
+++ b/test/get_linterp_noin.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINTERP */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\n";
+  unsigned char c = 0;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  t = fopen(table, "wt");
+  for (i = 0; i < 10; ++i)
+    fprintf(t, "%i %i\n", i * 6, i * 12);
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(table);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/get_linterp_notab.c b/test/get_linterp_notab.c
new file mode 100644
index 0000000..86b7733
--- /dev/null
+++ b/test/get_linterp_notab.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINTERP */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[64];
+  int fd, n1, error1, n2, error2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n1 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error1 = gd_error(D);
+  n2 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n1, 0);
+  CHECKI(error1, GD_E_OPEN_LINFILE);
+  CHECKI(n2, 0);
+  CHECKI(error2, GD_E_OPEN_LINFILE);
+
+  return r;
+}
diff --git a/test/get_linterp_sort.c b/test/get_linterp_sort.c
new file mode 100644
index 0000000..a07a1e5
--- /dev/null
+++ b/test/get_linterp_sort.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read LINTERP */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[64];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 64; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 64);
+  close(fd);
+
+  t = fopen(table, "wt");
+  fprintf(t, "%s", "100 600\n2 4\n50 100\n0 0\n7 14\n");
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(table);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 10);
+
+  return r;
+}
diff --git a/test/get_mplex.c b/test/get_mplex.c
new file mode 100644
index 0000000..c5638af
--- /dev/null
+++ b/test/get_mplex.c
@@ -0,0 +1,76 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 1 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] %= 3;
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 40 + 3 * (i / 3));
+
+  return r;
+}
diff --git a/test/get_mplex_bof.c b/test/get_mplex_bof.c
new file mode 100644
index 0000000..1fd7fd2
--- /dev/null
+++ b/test/get_mplex_bof.c
@@ -0,0 +1,76 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 2 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] %= 3;
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mplex", 0, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i < 2) ? 0 : 3 * ((i + 1) / 3) - 1);
+
+  return r;
+}
diff --git a/test/get_mplex_lb.c b/test/get_mplex_lb.c
new file mode 100644
index 0000000..b4ebdfe
--- /dev/null
+++ b/test/get_mplex_lb.c
@@ -0,0 +1,76 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 2 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] %= 3;
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 38 + 3 * ((i + 2) / 3));
+
+  return r;
+}
diff --git a/test/get_mplex_lball.c b/test/get_mplex_lball.c
new file mode 100644
index 0000000..74768a2
--- /dev/null
+++ b/test/get_mplex_lball.c
@@ -0,0 +1,81 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 7 8\n"
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+  data_data[0] = 111;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] %= 3;
+  data_data[0] = 7;
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_mplex_lookback(D, GD_LOOKBACK_ALL);
+  e1 = gd_error(D);
+  n = gd_getdata(D, "mplex", 12, 0, 1, 0, GD_UINT8, &c);
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 111);
+
+  return r;
+}
diff --git a/test/get_mplex_nolb.c b/test/get_mplex_nolb.c
new file mode 100644
index 0000000..f914e51
--- /dev/null
+++ b/test/get_mplex_nolb.c
@@ -0,0 +1,79 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 2 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] %= 3;
+
+  fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_mplex_lookback(D, 0);
+  e1 = gd_error(D);
+  n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c);
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i == 0) ? 0 : 38 + 3 * ((i + 2) / 3));
+
+  return r;
+}
diff --git a/test/get_multiply.c b/test/get_multiply.c
new file mode 100644
index 0000000..fe312b2
--- /dev/null
+++ b/test/get_multiply.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read MULTIPLY */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "mult MULTIPLY data data\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mult", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 25);
+
+  return r;
+}
diff --git a/test/get_multiply_ccin.c b/test/get_multiply_ccin.c
new file mode 100644
index 0000000..1aa268e
--- /dev/null
+++ b/test/get_multiply_ccin.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
+ */
+/* Attempt to read MULTIPLY */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "mult MULTIPLY data data\ndata RAW COMPLEX128 1\n";
+  double c[16];
+  double data_data[512];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[i * 2] = (double)i;
+    data_data[i * 2 + 1] = (double)i / 256.;
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mult", 5, 0, 8, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i) {
+    const double a = 5 + i;
+    const double b = a / 256.;
+    CHECKFi(i, c[i * 2], a * a - b * b);
+    CHECKFi(i, c[i * 2 + 1], 2 * a * b);
+  }
+
+  return r;
+}
diff --git a/test/get_multiply_crin.c b/test/get_multiply_crin.c
new file mode 100644
index 0000000..8252fec
--- /dev/null
+++ b/test/get_multiply_crin.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
+ */
+/* Attempt to read MULTIPLY */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "mult MULTIPLY data INDEX\ndata RAW COMPLEX128 1\n";
+  double c[16];
+  double data_data[512];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[i * 2] = (double)i;
+    data_data[i * 2 + 1] = (double)i / 256.;
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mult", 5, 0, 8, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i) {
+    const double a = 5 + i;
+    const double b = a / 256.;
+    CHECKFi(i, c[i * 2], a * a);
+    CHECKFi(i, c[i * 2 + 1], a * b);
+  }
+
+  return r;
+}
diff --git a/test/get_multiply_crinr.c b/test/get_multiply_crinr.c
new file mode 100644
index 0000000..ec5c706
--- /dev/null
+++ b/test/get_multiply_crinr.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
+ */
+/* Attempt to read MULTIPLY */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "mult MULTIPLY data INDEX\ndata RAW COMPLEX128 1\n";
+  double c[8];
+  double data_data[512];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[i * 2] = (double)i;
+    data_data[i * 2 + 1] = (double)i / 256.;
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mult", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i, c[i], (5. + i) * (5 + i));
+
+  return r;
+}
diff --git a/test/get_multiply_noin.c b/test/get_multiply_noin.c
new file mode 100644
index 0000000..4e464c9
--- /dev/null
+++ b/test/get_multiply_noin.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
+ */
+/* Attempt to read MULTIPLY */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "mult MULTIPLY data data\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "mult", 5, 0, 1, 0, GD_UINT8, &c);
+
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/get_multiply_rcin.c b/test/get_multiply_rcin.c
new file mode 100644
index 0000000..be49d1a
--- /dev/null
+++ b/test/get_multiply_rcin.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
+ */
+/* Attempt to read MULTIPLY */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "mult MULTIPLY INDEX data\ndata RAW COMPLEX128 1\n";
+  double c[16];
+  double data_data[512];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i) {
+    data_data[i * 2] = (double)i;
+    data_data[i * 2 + 1] = (double)i / 256.;
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 512 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mult", 5, 0, 8, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i) {
+    const double a = 5 + i;
+    const double b = a / 256.;
+    CHECKFi(i, c[i * 2], a * a);
+    CHECKFi(i, c[i * 2 + 1], a * b);
+  }
+
+  return r;
+}
diff --git a/test/get_multiply_s.c b/test/get_multiply_s.c
new file mode 100644
index 0000000..9e2c914
--- /dev/null
+++ b/test/get_multiply_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 =
+    "mult MULTIPLY data phase\n"
+    "phase PHASE data 128\n"
+    "data RAW UINT8 1\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "mult", 0, 0, 1000, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 128);
+
+  return r;
+}
diff --git a/test/get_nonexistent.c b/test/get_nonexistent.c
new file mode 100644
index 0000000..a03eca1
--- /dev/null
+++ b/test/get_nonexistent.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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\n";
+  unsigned char c[8];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_UNKNOWN_ENCODING);
+
+  return r;
+}
diff --git a/test/get_null.c b/test/get_null.c
new file mode 100644
index 0000000..e9d7796
--- /dev/null
+++ b/test/get_null.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read returning GD_NULL */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  return r;
+}
diff --git a/test/get_off64.c b/test/get_off64.c
new file mode 100644
index 0000000..6bb1fc9
--- /dev/null
+++ b/test/get_off64.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#if (defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64) || __MSVCRT__
+#  define SKIP_TEST
+#else
+#  define _FILE_OFFSET_BITS 64
+#endif
+
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifdef SKIP_TEST
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 40 + i);
+
+  return r;
+#endif
+}
diff --git a/test/get_phase.c b/test/get_phase.c
new file mode 100644
index 0000000..453707d
--- /dev/null
+++ b/test/get_phase.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read PHASE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "phase PHASE data -2\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "phase", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKI(c, 3);
+
+  return r;
+}
diff --git a/test/get_phase_affix.c b/test/get_phase_affix.c
new file mode 100644
index 0000000..6b30a7d
--- /dev/null
+++ b/test/get_phase_affix.c
@@ -0,0 +1,73 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data = "/INCLUDE format1 pre post\n";
+  const char *format1_data =
+    "shift CONST INT32 -2\n"
+    "phase PHASE data shift\n"
+    "data RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "prephasepost", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKI(c, 3);
+
+  return r;
+}
diff --git a/test/get_polynom.c b/test/get_polynom.c
new file mode 100644
index 0000000..84bb6f7
--- /dev/null
+++ b/test/get_polynom.c
@@ -0,0 +1,72 @@
+/* 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
+ */
+/* Attempt to read POLYNOM */
+#include "test.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "polynom POLYNOM data 3 2 1\ndata RAW UINT8 1\n";
+  unsigned char c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKU(c, 3 + 2 * 5 + 1 * 5 * 5);
+
+  return r;
+}
diff --git a/test/get_polynom_cmpin.c b/test/get_polynom_cmpin.c
new file mode 100644
index 0000000..ac38bf2
--- /dev/null
+++ b/test/get_polynom_cmpin.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "polynom POLYNOM data 3 2 1\n"
+    "data RAW COMPLEX128 1\n";
+  double c[16];
+  double data_data[512];
+  int i, fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, sizeof(double) * 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+    data_data[2 * fd] = (double)fd;
+    data_data[2 * fd + 1] = fd / 256.;
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "polynom", 5, 0, 8, 0, GD_COMPLEX128, &c);
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i) {
+    const double a = 5. + i; /* Re(data) */
+    const double b = a / 256.; /* Im(data) */
+    CHECKFi(i, c[i * 2], 3 + 2 * a + a * a - b * b);
+    CHECKFi(i, c[i * 2 + 1], 2 * b + 2 * a * b);
+  }
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/get_polynom_noin.c b/test/get_polynom_noin.c
new file mode 100644
index 0000000..05b74ff
--- /dev/null
+++ b/test/get_polynom_noin.c
@@ -0,0 +1,61 @@
+/* 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
+ */
+/* Attempt to read POLYNOM */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "polynom POLYNOM data 2 3\n";
+  unsigned char c = 0;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/get_recip.c b/test/get_recip.c
new file mode 100644
index 0000000..5815f0c
--- /dev/null
+++ b/test/get_recip.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read DIVIDE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "div RECIP data 2.\n"
+    "data RAW UINT8 1\n";
+  double c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)(fd + 2);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKF(c, 2. / 7.);
+
+  return r;
+}
diff --git a/test/get_recip_const.c b/test/get_recip_const.c
new file mode 100644
index 0000000..d8eb64c
--- /dev/null
+++ b/test/get_recip_const.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read DIVIDE */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data =
+    "div RECIP data const\n"
+    "const CONST FLOAT64 2.\n"
+    "data RAW UINT8 1\n";
+  double c = 0;
+  unsigned char data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)(fd + 2);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  CHECKF(c, 2. / 7.);
+
+  return r;
+}
diff --git a/test/get_recurse.c b/test/get_recurse.c
new file mode 100644
index 0000000..51adc9d
--- /dev/null
+++ b/test/get_recurse.c
@@ -0,0 +1,61 @@
+/* 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
+ */
+/* Attempting to resove a recursively defined field should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "in1 RAW UINT8 11\n"
+    "lincom LINCOM 2 lincom 1 0 in1 1 0\n";
+  unsigned char c[8];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error,GD_E_RECURSE_LEVEL);
+
+  return r;
+}
diff --git a/test/get_rofs.c b/test/get_rofs.c
new file mode 100644
index 0000000..90a2287
--- /dev/null
+++ b/test/get_rofs.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Should be able to read from a R/O dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int i, fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+  chmod(data, 0555);
+
+  /* ensure filesystem honours read-onlyness */
+  if ((fd = open(data, O_RDWR)) >= 0 || errno != EACCES) {
+    if (fd >= 0)
+      close(fd);
+    unlink(format);
+    unlink(data);
+    rmdir(filedir);
+    return 77;
+  }
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i, c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/get_sbit.c b/test/get_sbit.c
new file mode 100644
index 0000000..00a31ed
--- /dev/null
+++ b/test/get_sbit.c
@@ -0,0 +1,75 @@
+/* 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
+ */
+/* Attempt to read SBIT */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "bit SBIT data 7 4\ndata RAW UINT16 1\n";
+  int16_t c[10];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = 0x0101 * (uint16_t)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "bit", 5, 0, 10, 0, GD_INT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 10);
+
+  for (fd = 0; fd < 10; ++fd)
+    CHECKIi(fd, c[fd], fd * 2 - ((fd > 6) ? 22 : 6));
+
+  return r;
+}
diff --git a/test/get_sf.c b/test/get_sf.c
new file mode 100644
index 0000000..ade4922
--- /dev/null
+++ b/test/get_sf.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 0, 40, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/get_ss.c b/test/get_ss.c
new file mode 100644
index 0000000..0d7cd83
--- /dev/null
+++ b/test/get_ss.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 0, 40, 0, 8, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/get_type.c b/test/get_type.c
new file mode 100644
index 0000000..7a17bcc
--- /dev/null
+++ b/test/get_type.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#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", 5, 0, 1, 0, GD_UNKNOWN, c);
+
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_TYPE);
+
+  return r;
+}
diff --git a/test/get_uint16.c b/test/get_uint16.c
new file mode 100644
index 0000000..f2caac8
--- /dev/null
+++ b/test/get_uint16.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8], i;
+  uint16_t data_data[128];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = (uint16_t)(fd * (0x0201));
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint16_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKXi(i,c[i], 0x5028 + i * 0x0201);
+
+  return r;
+}
diff --git a/test/get_uint32.c b/test/get_uint32.c
new file mode 100644
index 0000000..e2f911f
--- /dev/null
+++ b/test/get_uint32.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t c[8], i;
+  uint32_t data_data[128];
+  int fd, n, error, r = 0;
+  unsigned j;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (j = 0; j < 128; ++j)
+    data_data[j] = j * 0x02000001LU;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint32_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 0x50000028 + i * 0x02000001);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/get_uint64.c b/test/get_uint64.c
new file mode 100644
index 0000000..4669990
--- /dev/null
+++ b/test/get_uint64.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t c[8];
+  uint64_t data_data[128];
+  int fd, i, n, error, r = 0;
+  unsigned j;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (j = 0; j < 128; ++j)
+    data_data[j] = j * 0x0200000000000001LU;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint64_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],0x5000000000000028U + i * 0x0200000000000001U);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/get_window.c b/test/get_window.c
new file mode 100644
index 0000000..19d44cb
--- /dev/null
+++ b/test/get_window.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read WINDOW */
+#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 EQ 44\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i == 4) ? 40 + i : 0);
+
+  return r;
+}
diff --git a/test/get_window_clr.c b/test/get_window_clr.c
new file mode 100644
index 0000000..aeda830
--- /dev/null
+++ b/test/get_window_clr.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read WINDOW */
+#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 CLR 0x2\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (~i & 2) ? 40 + i : 0);
+
+  return r;
+}
diff --git a/test/get_window_ge.c b/test/get_window_ge.c
new file mode 100644
index 0000000..cf2e637
--- /dev/null
+++ b/test/get_window_ge.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read WINDOW */
+#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 GE 44\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i >= 4) ? 40 + i : 0);
+
+  return r;
+}
diff --git a/test/get_window_gt.c b/test/get_window_gt.c
new file mode 100644
index 0000000..23198db
--- /dev/null
+++ b/test/get_window_gt.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read WINDOW */
+#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 GT 44\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i > 4) ? 40 + i : 0);
+
+  return r;
+}
diff --git a/test/get_window_le.c b/test/get_window_le.c
new file mode 100644
index 0000000..61ce7a7
--- /dev/null
+++ b/test/get_window_le.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read WINDOW */
+#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 LE 44\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i <= 4) ? 40 + i : 0);
+
+  return r;
+}
diff --git a/test/get_window_lt.c b/test/get_window_lt.c
new file mode 100644
index 0000000..54b3c6c
--- /dev/null
+++ b/test/get_window_lt.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read WINDOW */
+#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 LT 44\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i < 4) ? 40 + i : 0);
+
+  return r;
+}
diff --git a/test/get_window_ne.c b/test/get_window_ne.c
new file mode 100644
index 0000000..3cc6938
--- /dev/null
+++ b/test/get_window_ne.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read WINDOW */
+#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 NE 44\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i != 4) ? 40 + i : 0);
+
+  return r;
+}
diff --git a/test/get_window_set.c b/test/get_window_set.c
new file mode 100644
index 0000000..3d0de94
--- /dev/null
+++ b/test/get_window_set.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read WINDOW */
+#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 SET 2\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, n, i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], (i & 2) ? 40 + i : 0);
+
+  return r;
+}
diff --git a/test/get_zero.c b/test/get_zero.c
new file mode 100644
index 0000000..2f20b4f
--- /dev/null
+++ b/test/get_zero.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Attempt to read from before the BOF */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "/FRAMEOFFSET 100\ndata RAW UINT8 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i, c[i], 0);
+
+  return r;
+}
diff --git a/test/global_flags.c b/test/global_flags.c
new file mode 100644
index 0000000..4b109dd
--- /dev/null
+++ b/test/global_flags.c
@@ -0,0 +1,88 @@
+/* Copyright (C) :e2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  int i, r = 0;
+  int n[7], e[7];
+  const int v[7] = {
+             0 | GD_PRETTY_PRINT,
+    GD_VERBOSE | GD_PRETTY_PRINT,
+    GD_VERBOSE | 0,
+             0 | GD_PRETTY_PRINT,
+    GD_VERBOSE | 0,
+             0 | GD_PRETTY_PRINT,
+    GD_VERBOSE | 0
+  };
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_PRETTY_PRINT);
+  n[0] = gd_flags(D, 0, 0);
+  e[0] = gd_error(D);
+
+  n[1] = gd_flags(D, GD_VERBOSE, 0);
+  e[1] = gd_error(D);
+
+  n[2] = gd_flags(D, 0, GD_PRETTY_PRINT);
+  e[2] = gd_error(D);
+
+  n[3] = gd_flags(D, GD_VERBOSE | GD_PRETTY_PRINT,
+      GD_VERBOSE | GD_PRETTY_PRINT);
+  e[3] = gd_error(D);
+
+  n[4] = gd_flags(D, GD_VERBOSE, GD_PRETTY_PRINT);
+  e[4] = gd_error(D);
+
+  n[5] = gd_flags(D, GD_VERBOSE | GD_PRETTY_PRINT, GD_VERBOSE);
+  e[5] = gd_error(D);
+
+  n[6] = gd_flags(D, GD_VERBOSE, GD_VERBOSE | GD_PRETTY_PRINT);
+  e[6] = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < 7; ++i) {
+    CHECKIi(i, e[i], 0);
+    CHECKXi(i, n[i], v[i]);
+  }
+
+  return r;
+}
diff --git a/test/global_name.c b/test/global_name.c
new file mode 100644
index 0000000..cf0701a
--- /dev/null
+++ b/test/global_name.c
@@ -0,0 +1,62 @@
+/* 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
+ */
+/* Global metadata check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data1 CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+  char *name;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  name = strdup(gd_dirfilename(D));
+  error = gd_error(D);
+  gd_close(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
new file mode 100644
index 0000000..bd4e461
--- /dev/null
+++ b/test/global_ref.c
@@ -0,0 +1,62 @@
+/* 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
+ */
+/* Global metadata check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 1\n";
+  int fd, error, r = 0;
+  char *ref;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  ref = strdup(gd_reference(D, NULL));
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKS(ref, "data");
+  free(ref);
+
+  return r;
+}
diff --git a/test/global_ref_empty.c b/test/global_ref_empty.c
new file mode 100644
index 0000000..7a7471b
--- /dev/null
+++ b/test/global_ref_empty.c
@@ -0,0 +1,61 @@
+/* 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
+ */
+/* Global metadata check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data CONST UINT8 1\n";
+  int fd, error, r = 0;
+  const char *ref;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  ref = gd_reference(D, NULL);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKP(ref);
+
+  return r;
+}
diff --git a/test/global_ref_set.c b/test/global_ref_set.c
new file mode 100644
index 0000000..9c368f7
--- /dev/null
+++ b/test/global_ref_set.c
@@ -0,0 +1,63 @@
+/* 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
+ */
+/* Global metadata check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data1 RAW UINT8 1\n"
+                            "data2 RAW UINT8 1\n";
+  int fd, error, r = 0;
+  char *ref;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ref = strdup(gd_reference(D, "data2"));
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKS(ref, "data2");
+  free(ref);
+
+  return r;
+}
diff --git a/test/gzip_add.c b/test/gzip_add.c
new file mode 100644
index 0000000..9e8e8f7
--- /dev/null
+++ b/test/gzip_add.c
@@ -0,0 +1,84 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.gz";
+  gd_entry_t e;
+  int e1, e2, unlink_data, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_GZIP_ENCODED);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_GZIP_ENCODED);
+#endif
+  gd_add_raw(D, "data", GD_UINT8, 2, 0);
+  e1 = gd_error(D);
+
+  /* check */
+  e2 = gd_entry(D, "data", &e);
+#ifdef USE_GZIP
+  CHECKI(e2, 0);
+  if (e2 == 0) {
+    CHECKI(e.field_type, GD_RAW_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(raw,spf), 2);
+    CHECKI(e.EN(raw,data_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+#else
+  CHECKI(e2, -1);
+#endif
+
+  gd_close(D);
+  unlink_data = unlink(data);
+
+#ifdef USE_GZIP
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+#endif
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_get.c b/test/gzip_get.c
new file mode 100644
index 0000000..863485a
--- /dev/null
+++ b/test/gzip_get.c
@@ -0,0 +1,96 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_GZIP
+  return 77;
+#else
+  const char *filedir = "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, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40+i);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/gzip_get_get.c b/test/gzip_get_get.c
new file mode 100644
index 0000000..5f9f36f
--- /dev/null
+++ b/test/gzip_get_get.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#if !defined USE_GZIP || !defined TEST_GZIP
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *gzipdata = "dirfile/data.gz";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, error1, n2, error2, r = 0;
+  DIRFILE *D;
+
+  memset(c1, 0, 16);
+  memset(c2, 0, 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1);
+  error1 = gd_error(D);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
+  error2 = gd_error(D);
+  gd_close(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKI(n1, 8);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKUi(i,c1[i], 40 + i);
+    CHECKUi(i,c2[i], 40 + i);
+  }
+
+  return r;
+#endif
+}
diff --git a/test/gzip_get_get2.c b/test/gzip_get_get2.c
new file mode 100644
index 0000000..f2ed632
--- /dev/null
+++ b/test/gzip_get_get2.c
@@ -0,0 +1,92 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#if !defined USE_GZIP || !defined TEST_GZIP
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *gzipdata = "dirfile/data.gz";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, error1, n2, error2, r = 0;
+  DIRFILE *D;
+
+  memset(c1, 0, 16);
+  memset(c2, 0, 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data);
+  if (gd_system(command))
+    return 1;
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c1);
+  error1 = gd_error(D);
+  n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2);
+  error2 = gd_error(D);
+  gd_close(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKI(n1, 8);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKUi(i,c1[i], i);
+    CHECKUi(i,c2[i], i);
+  }
+
+  return r;
+#endif
+}
diff --git a/test/gzip_get_put.c b/test/gzip_get_put.c
new file mode 100644
index 0000000..68969e3
--- /dev/null
+++ b/test/gzip_get_put.c
@@ -0,0 +1,160 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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 UINT8 8\n";
+  const unsigned char gzdata[279] = {
+    0x1f, 0x8b, 0x08, 0x00, 0x0d, 0x87, 0xb0, 0x4e,
+    0x00, 0x03, 0x01, 0x00, 0x01, 0xff, 0xfe, 0x00,
+    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+    0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
+    0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
+    0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
+    0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
+    0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
+    0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
+    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
+    0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
+    0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
+    0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
+    0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+    0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
+    0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
+    0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80,
+    0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88,
+    0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90,
+    0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
+    0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0,
+    0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
+    0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,
+    0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8,
+    0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0,
+    0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8,
+    0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
+    0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8,
+    0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0,
+    0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8,
+    0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0,
+    0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
+    0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x73,
+    0x8c, 0x05, 0x29, 0x00, 0x01, 0x00, 0x00
+  };
+  uint8_t b, c[8], d[8];
+  char command[4096];
+  int fd, i, m, n, e1, e2, unlink_data, unlink_datagz, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    d[i] = (uint8_t)(80 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data_gz, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, gzdata, 279);
+  close(fd);
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  m = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+#ifdef USE_GZIP
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &b, sizeof(uint8_t))) {
+        if (i < 40 || i >= 48) {
+          CHECKIi(i, b, i);
+        } else
+          CHECKIi(i, b, i + 40);
+        i++;
+      }
+      CHECKI(i, 256);
+      close(fd);
+    }
+  }
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], 40 + i);
+#endif
+
+  unlink_data = unlink(data);
+  unlink_datagz = unlink(data_gz);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_datagz, -1);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n, 8);
+  CHECKI(m, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(unlink_datagz, 0);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(e2, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+  CHECKI(m, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/gzip_move_from.c b/test/gzip_move_from.c
new file mode 100644
index 0000000..321f8a1
--- /dev/null
+++ b/test/gzip_move_from.c
@@ -0,0 +1,126 @@
+/* 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>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *gzdata = "dirfile/data.gz";
+  const char *format_data =
+    "/INCLUDE format1\ndata RAW UINT16 11\nENCODING gzip\n";
+  const char *format1_data = "ENCODING none\n";
+  uint16_t data_data[128];
+  char command[4096];
+  int fd, ret, ge_ret, unlink_data, unlink_gzdata, error, i = 0, r = 0;
+  DIRFILE *D;
+  gd_entry_t E;
+  uint16_t d;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = fd * 0x201;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 128 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE | GD_UNENCODED);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+#endif
+  ret = gd_move(D, "data", 1, 1);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+#ifdef USE_GZIP
+  fd = open(data, O_RDONLY | O_BINARY);
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKUi(i, d, i * 0x201);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+#endif
+
+  unlink(format1);
+  unlink(format);
+  unlink_data = unlink(data);
+  unlink_gzdata = unlink(gzdata);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(ret, 0);
+  CHECKI(error, 0);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_gzdata, -1);
+#else
+  CHECKI(ret, -1);
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 0);
+  CHECKI(unlink_data, -1);
+  CHECKI(unlink_gzdata, 0);
+#endif
+  gd_free_entry_strings(&E);
+
+  return r;
+#endif
+}
diff --git a/test/gzip_move_to.c b/test/gzip_move_to.c
new file mode 100644
index 0000000..5d689b1
--- /dev/null
+++ b/test/gzip_move_to.c
@@ -0,0 +1,116 @@
+/* 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
+ */
+/* Attempt to gzip compress a file */
+#include "test.h"
+
+#include <stdlib.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 *data_gz = "dirfile/data.gz";
+  const char *data_raw = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING none\n/ENDIAN little\n";
+  uint8_t data_in[256];
+  DIRFILE *D;
+#ifdef USE_GZIP
+  uint8_t d;
+  char command[4096];
+  int i;
+#endif
+  int fd, error, unlink_raw, r = 0;
+  struct stat buf;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  for (fd = 0; fd < 256; ++fd)
+    data_in[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data_raw, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_in, 256);
+  close(fd);
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR);
+#endif
+  gd_alter_encoding(D, GD_GZIP_ENCODED, 0, 1);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+#ifdef USE_GZIP
+  if (stat(data_gz, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(stat(data_raw, &buf), -1);
+#else
+  if (stat(data_raw, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(stat(data_gz, &buf), -1);
+#endif
+
+#ifdef USE_GZIP
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data_gz);
+  if (gd_system(command)) {
+    fprintf(stderr, "command failed: %s\n", command);
+    r = 1;
+  } else {
+    fd = open(data_raw, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 256);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_raw = unlink(data_raw);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_raw, 0);
+#ifdef USE_GZIP
+  CHECKI(error, GD_E_OK);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+#endif
+
+  return r;
+}
diff --git a/test/gzip_nframes.c b/test/gzip_nframes.c
new file mode 100644
index 0000000..3680857
--- /dev/null
+++ b/test/gzip_nframes.c
@@ -0,0 +1,89 @@
+/* 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 <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_GZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *gzipdata = "dirfile/data.gz";
+  const char *format_data = "data RAW UINT16 1\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int i, error, r = 0;
+  size_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (uint16_t)i;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256 * sizeof(uint16_t));
+  close(i);
+
+  /* compress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(gzipdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(error, 0);
+  CHECKI(n, 256);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/gzip_put.c b/test/gzip_put.c
new file mode 100644
index 0000000..f88b3af
--- /dev/null
+++ b/test/gzip_put.c
@@ -0,0 +1,121 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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 UINT8 8\n";
+  uint8_t c[8];
+#ifdef USE_GZIP
+  char command[4096];
+  uint8_t d;
+#endif
+  struct stat buf;
+  int fd, i, n, error, stat_data, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  stat_data = stat(data_gz, &buf);
+#ifdef USE_GZIP
+  if (stat_data) {
+    perror("stat");
+  }
+  CHECKI(stat_data, 0);
+#else
+  CHECKI(stat_data, -1);
+#endif
+
+#ifdef USE_GZIP
+  /* uncompress */
+  snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data);
+  if (gd_system(command)) {
+    r = 1;
+  } else {
+    fd = open(data, O_RDONLY | O_BINARY);
+    if (fd >= 0) {
+      i = 0;
+      while (read(fd, &d, sizeof(uint8_t))) {
+        if (i < 40 || i > 48) {
+          CHECKIi(i, d, 0);
+        } else
+          CHECKIi(i, d, i);
+        i++;
+      }
+      CHECKI(i, 48);
+      close(fd);
+    }
+  }
+#endif
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(unlink_data, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/gzip_put_get.c b/test/gzip_put_get.c
new file mode 100644
index 0000000..3d0fe9c
--- /dev/null
+++ b/test/gzip_put_get.c
@@ -0,0 +1,92 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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 = "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;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+#ifdef USE_GZIP
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED);
+#endif
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d);
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_GZIP
+  CHECKI(unlink_data, 0);
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(n, 8);
+  CHECKI(m, 8);
+#else
+  CHECKI(unlink_data, -1);
+  CHECKI(e1, GD_E_UNSUPPORTED);
+  CHECKI(e2, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+  CHECKI(m, 0);
+#endif
+  
+  for (i = 0; i < m; ++i)
+    CHECKIi(i, d[i], c[i]);
+
+  return r;
+#endif
+}
diff --git a/test/header_complex.c b/test/header_complex.c
new file mode 100644
index 0000000..7a55814
--- /dev/null
+++ b/test/header_complex.c
@@ -0,0 +1,93 @@
+/* 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
+ */
+/* Check if GD_C89_API produces a useable API */
+#define GD_C89_API
+#include "test.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "lincom LINCOM data 3.3;4.4 5.5;6.6 data 7.7;8.8 9.9;1.1\n";
+  int fd, error, error2, error3, r = 0;
+  const double ca[] = { 2.1, 3.2, 4.3, 5.4, 6.5, 7.6 };
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_entry(D, "lincom", &E);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKIi(0,E.comp_scal, 1);
+  CHECKFi(0,E.EN(lincom,cm)[0][0], 3.3);
+  CHECKFi(0,E.EN(lincom,cm)[0][1], 4.4);
+  CHECKFi(0,E.EN(lincom,cb)[0][0], 5.5);
+  CHECKFi(0,E.EN(lincom,cb)[0][1], 6.6);
+  CHECKFi(0,E.EN(lincom,cm)[1][0], 7.7);
+  CHECKFi(0,E.EN(lincom,cm)[1][1], 8.8);
+  CHECKFi(0,E.EN(lincom,cb)[1][0], 9.9);
+  CHECKFi(0,E.EN(lincom,cb)[1][1], 1.1);
+  gd_free_entry_strings(&E);
+
+  gd_add_cpolynom(D, "polynom", 2, "in", ca, 0);
+
+  error2 = gd_error(D);
+  CHECKI(error2, 0);
+
+  gd_entry(D, "polynom", &E);
+
+  error3 = gd_error(D);
+  CHECKI(error3, 0);
+  CHECKIi(1,E.EN(polynom,poly_ord),2);
+  CHECKIi(1,E.comp_scal,1);
+  CHECKFi(1,E.EN(polynom,ca)[0][0], ca[0]);
+  CHECKFi(1,E.EN(polynom,ca)[0][1], ca[1]);
+  CHECKFi(1,E.EN(polynom,ca)[1][0], ca[2]);
+  CHECKFi(1,E.EN(polynom,ca)[1][1], ca[3]);
+  CHECKFi(1,E.EN(polynom,ca)[2][0], ca[4]);
+  CHECKFi(1,E.EN(polynom,ca)[2][1], ca[5]);
+  gd_free_entry_strings(&E);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/hide.c b/test/hide.c
new file mode 100644
index 0000000..f13d228
--- /dev/null
+++ b/test/hide.c
@@ -0,0 +1,54 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, n, h, m, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_nfields(D);
+  h = gd_hide(D, "data");
+  error = gd_error(D);
+  m = gd_nfields(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 2);
+  CHECKI(h, 0);
+  CHECKI(m, 1);
+
+  return r;
+}
diff --git a/test/hide_hidden.c b/test/hide_hidden.c
new file mode 100644
index 0000000..67c9da6
--- /dev/null
+++ b/test/hide_hidden.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 8\n"
+    "hata RAW UINT8 8\n"
+    "/HIDDEN hata\n";
+  int fd, h1, h2, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  h1 = gd_hidden(D, "data");
+  e1 = gd_error(D);
+  h2 = gd_hidden(D, "hata");
+  e2 = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(h1, 0);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(h2, 1);
+
+  return r;
+}
diff --git a/test/hide_unhide.c b/test/hide_unhide.c
new file mode 100644
index 0000000..784b011
--- /dev/null
+++ b/test/hide_unhide.c
@@ -0,0 +1,54 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n/HIDDEN data\n";
+  int fd, n, h, m, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_nfields(D);
+  h = gd_unhide(D, "data");
+  error = gd_error(D);
+  m = gd_nfields(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 1);
+  CHECKI(h, 0);
+  CHECKI(m, 2);
+
+  return r;
+}
diff --git a/test/include.c b/test/include.c
new file mode 100644
index 0000000..48ae58b
--- /dev/null
+++ b/test/include.c
@@ -0,0 +1,67 @@
+/* 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
new file mode 100644
index 0000000..5a5afc4
--- /dev/null
+++ b/test/include_accmode.c
@@ -0,0 +1,55 @@
+/* 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";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  gd_include(D, "format1", 0, GD_CREAT);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_ACCMODE);
+
+  return r;
+}
diff --git a/test/include_affix.c b/test/include_affix.c
new file mode 100644
index 0000000..c8e8573
--- /dev/null
+++ b/test/include_affix.c
@@ -0,0 +1,59 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "#\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_include_affix(D, "format1", 0, "A", "Z", 0);
+  error = gd_error(D);
+  spf = gd_spf(D, "AdataZ");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKU(spf, 11);
+
+  return r;
+}
diff --git a/test/include_auto.c b/test/include_auto.c
new file mode 100644
index 0000000..c77bd98
--- /dev/null
+++ b/test/include_auto.c
@@ -0,0 +1,77 @@
+/* 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>
+#include <stdio.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, error1, error2, r = 0;
+  const char *ptr;
+  char *reference;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_include(D, "format1", 0, GD_VERBOSE);
+  error1 = gd_error(D);
+  ptr = gd_reference(D, NULL);
+  reference = strdup(ptr);
+  error2 = gd_error(D);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKPN(ptr);
+  CHECKS(reference, "data");
+  CHECKU(spf, 11);
+  free(reference);
+
+  return r;
+}
diff --git a/test/include_cb.c b/test/include_cb.c
new file mode 100644
index 0000000..8355b1c
--- /dev/null
+++ b/test/include_cb.c
@@ -0,0 +1,74 @@
+/* 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>
+#include <stdio.h>
+
+int saw_callback = 0;
+int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_)
+{
+  saw_callback++;
+
+  return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "#\n";
+  const char *format1_data = "data ROW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDWR, callback, NULL);
+  gd_include(D, "format1", 0, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(saw_callback, 1);
+
+  return r;
+}
diff --git a/test/include_creat.c b/test/include_creat.c
new file mode 100644
index 0000000..e74f98e
--- /dev/null
+++ b/test/include_creat.c
@@ -0,0 +1,58 @@
+/* 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";
+  int fd, error, unlink_format1, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_include(D, "format1", 0, GD_CREAT);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink_format1 = unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+  
+  CHECKI(error,0);
+  CHECKI(unlink_format1, 0);
+
+  return r;
+}
diff --git a/test/include_ignore.c b/test/include_ignore.c
new file mode 100644
index 0000000..6b2099f
--- /dev/null
+++ b/test/include_ignore.c
@@ -0,0 +1,74 @@
+/* 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>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "data1 RAW UINT8 1\n";
+  const char *format1_data = "data RAW UINT8 11\nREFERENCE data\n";
+  int fd, error1, error2, r = 0;
+  char *reference;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_include(D, "format1", 0, GD_IGNORE_REFS | GD_VERBOSE);
+  error1 = gd_error(D);
+  reference = strdup(gd_reference(D, NULL));
+  error2 = gd_error(D);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKS(reference, "data1");
+  CHECKU(spf, 11);
+  free(reference);
+
+  return r;
+}
diff --git a/test/include_index.c b/test/include_index.c
new file mode 100644
index 0000000..bb7efb6
--- /dev/null
+++ b/test/include_index.c
@@ -0,0 +1,57 @@
+/* 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 *format_data = "#\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_include(D, "format1", 1, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_INDEX);
+
+  return r;
+}
diff --git a/test/include_invalid.c b/test/include_invalid.c
new file mode 100644
index 0000000..d11d95e
--- /dev/null
+++ b/test/include_invalid.c
@@ -0,0 +1,57 @@
+/* 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 *format1 = "dirfile/format1";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  gd_include(D, "format1", 0, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/include_nonexistent.c b/test/include_nonexistent.c
new file mode 100644
index 0000000..248a980
--- /dev/null
+++ b/test/include_nonexistent.c
@@ -0,0 +1,57 @@
+/* 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 *format_data = "#\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_include(D, "format1", 0, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OPEN_INCLUDE);
+
+  return r;
+}
diff --git a/test/include_pc.c b/test/include_pc.c
new file mode 100644
index 0000000..829b510
--- /dev/null
+++ b/test/include_pc.c
@@ -0,0 +1,75 @@
+/* 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>
+#include <stdio.h>
+
+int saw_callback = 0;
+int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_)
+{
+  saw_callback++;
+
+  return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "data PAW UINT8 1\n";
+  const char *format1_data = "data ROW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDWR, callback, NULL);
+  gd_parser_callback(D, NULL, NULL);
+  gd_include(D, "format1", 0, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_FORMAT);
+  CHECKI(saw_callback, 1);
+
+  return r;
+}
diff --git a/test/include_ref.c b/test/include_ref.c
new file mode 100644
index 0000000..8cecba0
--- /dev/null
+++ b/test/include_ref.c
@@ -0,0 +1,74 @@
+/* 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>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "data1 RAW UINT8 1\n";
+  const char *format1_data = "data RAW UINT8 11\nREFERENCE data\n";
+  int fd, error1, error2, r = 0;
+  char *reference;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_include(D, "format1", 0, GD_VERBOSE);
+  error1 = gd_error(D);
+  reference = strdup(gd_reference(D, NULL));
+  error2 = gd_error(D);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKS(reference, "data");
+  CHECKU(spf, 11);
+  free(reference);
+
+  return r;
+}
diff --git a/test/include_sub.c b/test/include_sub.c
new file mode 100644
index 0000000..a1eeaea
--- /dev/null
+++ b/test/include_sub.c
@@ -0,0 +1,77 @@
+/* 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 *format2 = "dirfile/format2";
+  const char *format_data = "#\n";
+  const char *format1_data = "data RAW UINT8 11\nINCLUDE format2";
+  const char *format2_data = "#\n";
+  int fd, n, error, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+
+  n = gd_include(D, "format1", 0, 0);
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_entry(D, "data", &E);
+  CHECKI(n, E.fragment_index);
+
+  gd_free_entry_strings(&E);
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/include_syntax.c b/test/include_syntax.c
new file mode 100644
index 0000000..ad870de
--- /dev/null
+++ b/test/include_syntax.c
@@ -0,0 +1,65 @@
+/* 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>
+#include <stdio.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 ROW UINT8 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_include(D, "format1", 0, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_FORMAT);
+
+  return r;
+}
diff --git a/test/index.c b/test/index.c
new file mode 100644
index 0000000..969a6de
--- /dev/null
+++ b/test/index.c
@@ -0,0 +1,75 @@
+/* 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
new file mode 100644
index 0000000..ba59817
--- /dev/null
+++ b/test/index_domain.c
@@ -0,0 +1,71 @@
+/* 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;
+  int i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 1000; ++i)
+    d[i] = 0;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, d, sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY);
+  f1 = gd_framenum(D, "data", 1.09);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_DOMAIN);
+  CHECK(!isnan(f1),f1,"%.15g","%s",f1,"not a number");
+
+  return r;
+}
diff --git a/test/index_range.c b/test/index_range.c
new file mode 100644
index 0000000..bb11399
--- /dev/null
+++ b/test/index_range.c
@@ -0,0 +1,71 @@
+/* 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;
+  int i, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 1000; ++i)
+    d[i] = 0;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, d, 1000 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY);
+  f1 = gd_framenum(D, "data", 1.09);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_RANGE);
+  CHECK(!isnan(f1),f1,"%.15g","%s",f1,"not a number");
+
+  return r;
+}
diff --git a/test/legacy_get.c b/test/legacy_get.c
new file mode 100644
index 0000000..017ca6d
--- /dev/null
+++ b/test/legacy_get.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 via the legacy interface */
+#include "test.h"
+
+#include <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_get_put.c b/test/legacy_get_put.c
new file mode 100644
index 0000000..33bb05d
--- /dev/null
+++ b/test/legacy_get_put.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt a write following a read via the legacy API -- this requires
+ * closing and then re-opening the legacy dirfile */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+  return 77; /* skipped */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  unsigned char data_data[256];
+  int fd, i, get_error, put_error, n, r = 0;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  GetData(filedir, "data", 5, 0, 1, 0, 'c', c, &get_error);
+  n = PutData(filedir, "data", 5, 0, 1, 0, 'c', c, &put_error);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(get_error,0);
+  CHECKI(put_error,0);
+  CHECKI(n,8);
+
+  return r;
+#endif
+}
diff --git a/test/legacy_get_rofs.c b/test/legacy_get_rofs.c
new file mode 100644
index 0000000..7efbe3e
--- /dev/null
+++ b/test/legacy_get_rofs.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 from a read-only filesystem via the legacy interface */
+#include "test.h"
+
+#include <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, 0444);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0444);
+  write(fd, data_data, 256);
+  close(fd);
+
+  n = GetData(filedir, "data", 5, 0, 1, 0, 'c', c, &error);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  return r;
+#endif
+}
diff --git a/test/legacy_nframes.c b/test/legacy_nframes.c
new file mode 100644
index 0000000..5447eaf
--- /dev/null
+++ b/test/legacy_nframes.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Retreiving the number of frames via the legacy API should succeed cleanly */
+#include "test.h"
+
+#include <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 1\n";
+  int fd, error, r = 0;
+  const size_t len = strlen(data);
+  size_t n;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  n = GetNFrames(filedir, &error, NULL);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(n,len);
+
+  return r;
+#endif
+}
diff --git a/test/legacy_nonexistent.c b/test/legacy_nonexistent.c
new file mode 100644
index 0000000..b0660e4
--- /dev/null
+++ b/test/legacy_nonexistent.c
@@ -0,0 +1,45 @@
+/* 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
+ */
+/* Reference to a non-existent dirfile from the legacy API should fail cleanly
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+  return 77; /* skipped */
+#else
+  int error, r = 0;
+  size_t n = GetNFrames("no such dirfile", &error, NULL);
+
+  CHECKI(n,0);
+  CHECKI(error, GD_E_OPEN);
+
+  return r;
+#endif
+}
diff --git a/test/legacy_put.c b/test/legacy_put.c
new file mode 100644
index 0000000..8782620
--- /dev/null
+++ b/test/legacy_put.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 via the legacy interface*/
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+  return 77; /* skipped */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d;
+  int fd, i, n, error, r = 0;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  n = PutData(filedir, "data", 5, 0, 1, 0, 'c', c, &error);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKUi(i,d,0);
+      } else
+        CHECKUi(i,d,i);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  return r;
+#endif
+}
diff --git a/test/legacy_spf.c b/test/legacy_spf.c
new file mode 100644
index 0000000..32e616e
--- /dev/null
+++ b/test/legacy_spf.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Retreiving the samples-per-frame of a field via the legacy API should
+ * succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef GD_LEGACY_API
+  return 77; /* skip */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 11\n";
+  int fd, error, r = 0;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  spf = GetSamplesPerFrame(filedir, "data", &error);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf, 11);
+  return r;
+#endif
+}
diff --git a/test/lzma_get.c b/test/lzma_get.c
new file mode 100644
index 0000000..bbd8041
--- /dev/null
+++ b/test/lzma_get.c
@@ -0,0 +1,87 @@
+/* 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 *lzmadata = "dirfile/data.lzma";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+#ifdef USE_LZMA
+  int i;
+#endif
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -F lzma -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(lzmadata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i, c[i], 40 + i);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/lzma_nframes.c b/test/lzma_nframes.c
new file mode 100644
index 0000000..8849c74
--- /dev/null
+++ b/test/lzma_nframes.c
@@ -0,0 +1,90 @@
+/* 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
+ */
+/* Retreiving 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.lzma";
+  const char *format_data = "data RAW UINT16 1\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int i, error, r = 0;
+  DIRFILE *D;
+  size_t n;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (uint16_t)i;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256 * sizeof(uint16_t));
+  close(i);
+
+  /* compress */
+  snprintf(command, 4096, "%s -F lzma -f %s > /dev/null", XZ, data);
+  if (gd_system(command))
+    return 1;
+
+#ifdef USE_LZMA
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(xzdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_LZMA
+  CHECKI(error, 0);
+  CHECKI(n, 256);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/madd.c b/test/madd.c
new file mode 100644
index 0000000..c104547
--- /dev/null
+++ b/test/madd.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, ge_error, n, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  gd_entry_t E;
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 0;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add(D, &E);
+  E.field_type = GD_CONST_ENTRY;
+  E.EN(scalar,const_type) = GD_UINT8;
+  gd_madd(D, &E, "data");
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+  gd_entry(D, "data/data", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/madd_affix.c b/test/madd_affix.c
new file mode 100644
index 0000000..1ac1fbf
--- /dev/null
+++ b/test/madd_affix.c
@@ -0,0 +1,84 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/data";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  int fd, e1, e2, e3, r = 0;
+  DIRFILE *D;
+  gd_entry_t E, e;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  memset(&E, 0, sizeof(E));
+  E.field = "AdataZ";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 1;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+  E.scalar[0] = NULL;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  close(open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  gd_add(D, &E);
+  e1 = gd_error(D);
+
+  E.field = "data";
+  E.field_type = GD_CONST_ENTRY;
+  E.EN(scalar,const_type) = GD_UINT8;
+  E.fragment_index = 99; /* ignored */
+
+  gd_madd(D, &E, "AdataZ");
+  e2 = gd_error(D);
+
+  /* check */
+  gd_entry(D, "AdataZ/data", &e);
+  e3 = gd_error(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_OK);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(e3, GD_E_OK);
+  if (e3 == 0) {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 1);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  return r;
+}
diff --git a/test/madd_alias.c b/test/madd_alias.c
new file mode 100644
index 0000000..aaf1336
--- /dev/null
+++ b/test/madd_alias.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, i, n, r = 0;
+  DIRFILE *D;
+  const char *target;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_raw(D, "data", GD_UINT8, 1, 0);
+  gd_madd_alias(D, "data", "alias", "data");
+  error = gd_error(D);
+
+  /* check */
+  target = gd_alias_target(D, "data/alias");
+  CHECKS(target, "data");
+  i = gd_fragment_index(D, "data/alias");
+  n = gd_naliases(D, "data/alias");
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(i, 0);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/madd_alias_affix.c b/test/madd_alias_affix.c
new file mode 100644
index 0000000..4a5952c
--- /dev/null
+++ b/test/madd_alias_affix.c
@@ -0,0 +1,75 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *target1, *target2;
+  int e1, e2, e3, e4, e5, i, n, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+
+  gd_include_affix(D, "format1", 0, "A", "Z", GD_CREAT);
+  gd_add_raw(D, "AdataZ", GD_UINT8, 1, 1);
+  gd_madd_alias(D, "data", "AaliasZ", "AdataZ");
+  e1 = gd_error(D);
+  gd_madd_alias(D, "AdataZ", "alias", "AdataZ");
+  e2 = gd_error(D);
+  gd_madd_alias(D, "AdataZ", "AaliasZ", "data");
+  e3 = gd_error(D);
+  gd_madd_alias(D, "AdataZ", "AaliasZ", "AdataZ");
+  e4 = gd_error(D);
+  gd_add_alias(D, "AdataZ/alias2", "AdataZ", 1);
+  e5 = gd_error(D);
+
+  /* check */
+  target1 = gd_alias_target(D, "AdataZ/AaliasZ");
+  CHECKS(target1, "AdataZ");
+  target2 = gd_alias_target(D, "AdataZ/alias2");
+  CHECKS(target2, "AdataZ");
+
+  i = gd_fragment_index(D, "AdataZ/AaliasZ");
+  n = gd_naliases(D, "AdataZ/AaliasZ");
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_BAD_CODE);
+  CHECKI(e2, GD_E_OK);
+  CHECKI(e3, GD_E_BAD_CODE);
+  CHECKI(e4, GD_E_OK);
+  CHECKI(e5, GD_E_OK);
+  CHECKI(i, 1);
+  CHECKI(n, 4);
+
+  return r;
+}
diff --git a/test/madd_bit.c b/test/madd_bit.c
new file mode 100644
index 0000000..96dd068
--- /dev/null
+++ b/test/madd_bit.c
@@ -0,0 +1,67 @@
+/* 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 BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int ge_error, error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_bit(D, "new", "meta", "input", 1, 1);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_BIT_ENTRY);
+    CHECKS(e.in_fields[0], "input");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(bit,bitnum), 1);
+    CHECKI(e.EN(bit,numbits), 1);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/madd_bit_invalid.c b/test/madd_bit_invalid.c
new file mode 100644
index 0000000..ac57ac7
--- /dev/null
+++ b/test/madd_bit_invalid.c
@@ -0,0 +1,45 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_madd_bit(D, "new", "meta", "input", 1, 1);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/madd_carray.c b/test/madd_carray.c
new file mode 100644
index 0000000..427c1e7
--- /dev/null
+++ b/test/madd_carray.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  uint8_t val[] = {3, 4, 5, 6, 7};
+  uint8_t data[5];
+  int error, n, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_carray(D, "new", "data", GD_UINT8, 5, GD_UINT8, &val);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/data", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_CARRAY_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+  n = (int)gd_carray_len(D, "new/data");
+  CHECKI(n, 5);
+  gd_get_carray(D, "new/data", GD_UINT8, &data);
+  for (n = 0; n < 5; ++n)
+    CHECKIi(n, data[n], 3 + n);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_clincom.c b/test/madd_clincom.c
new file mode 100644
index 0000000..93c301a
--- /dev/null
+++ b/test/madd_clincom.c
@@ -0,0 +1,82 @@
+/* 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
+ */
+/* Add a LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  const char *in_fields[2] = {"in1", "in2"};
+#ifdef GD_NO_C99_API
+  const double m[2][2] = {{1, 3.3}, {0.3, 18.3}};
+  const double b[2][2] = {{2, 3.8}, {2.1, 9.8}};
+#else
+  const double complex m[2] = {1 + _Complex_I * 3.3, 0.3 + _Complex_I * 18.3};
+  const double complex b[2] = {2 + _Complex_I * 3.8, 2.1 + _Complex_I * 9.8};
+#endif
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+#ifdef GD_NO_C99_API
+  gd_madd_clincom(D, "new", "meta", 2, in_fields, (double*)m, (double*)b);
+#else
+  gd_madd_clincom(D, "new", "meta", 2, in_fields, m, b);
+#endif
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_LINCOM_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(lincom,n_fields), 2);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKS(e.in_fields[1], "in2");
+    CHECKC(e.EN(lincom,cm)[0], m[0]);
+    CHECKC(e.EN(lincom,cm)[1], m[1]);
+    CHECKC(e.EN(lincom,cb)[0], b[0]);
+    CHECKC(e.EN(lincom,cb)[1], b[1]);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_const.c b/test/madd_const.c
new file mode 100644
index 0000000..609a1d9
--- /dev/null
+++ b/test/madd_const.c
@@ -0,0 +1,68 @@
+/* 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
+ */
+/* Add a CONST field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  uint8_t val = 3;
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_const(D, "new", "data", GD_UINT8, GD_UINT8, &val);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/data", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_get_constant(D, "new/data", GD_UINT8, &val);
+    CHECKU(val, 3);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_cpolynom.c b/test/madd_cpolynom.c
new file mode 100644
index 0000000..beb649b
--- /dev/null
+++ b/test/madd_cpolynom.c
@@ -0,0 +1,79 @@
+/* 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
+ */
+/* Add a complex POLYNOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int j, error, ge_error, r = 0;
+  gd_entry_t e;
+#ifdef GD_NO_C99_API
+  const double a[4][2] = {{1, 29.03}, {0.3, 12.34}, {0.5, 99.55}, {1.8, 45.32}};
+#else
+  const double complex a[4] = {1 + _Complex_I * 29.03, 0.3 + _Complex_I * 12.34,
+    0.5 + _Complex_I * 99.55, 1.8 + _Complex_I * 45.32};
+#endif
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+#ifdef GD_NO_C99_API
+  gd_madd_cpolynom(D, "new", "meta", 3, "in", (const double *)a);
+#else
+  gd_madd_cpolynom(D, "new", "meta", 3, "in", a);
+#endif
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_POLYNOM_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(polynom,poly_ord), 3);
+    CHECKI(e.comp_scal, 1);
+    for (j = 0; j < 4; ++j)
+      CHECKCi(j,e.EN(polynom,ca)[j], a[j]);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_crecip.c b/test/madd_crecip.c
new file mode 100644
index 0000000..abdef86
--- /dev/null
+++ b/test/madd_crecip.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+#ifdef GD_NO_C99_API
+  const double v[] = {3.2, 3.1};
+#else
+  const double complex v = 3.2 + _Complex_I * 3.1;
+#endif
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_crecip(D, "new", "meta", "in1", v);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_RECIP_ENTRY);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKC(e.EN(recip,cdividend), v);
+    CHECKI(e.comp_scal, 1);
+    CHECKI(e.fragment_index, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_crecip89.c b/test/madd_crecip89.c
new file mode 100644
index 0000000..7610f08
--- /dev/null
+++ b/test/madd_crecip89.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#define GD_C89_API
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  double div[2] = {3.2, 3.1};
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_crecip(D, "new", "meta", "in1", div);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_RECIP_ENTRY);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKF(e.EN(recip,cdividend)[0], div[0]);
+    CHECKF(e.EN(recip,cdividend)[1], div[1]);
+    CHECKI(e.comp_scal, 1);
+    CHECKI(e.fragment_index, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_divide.c b/test/madd_divide.c
new file mode 100644
index 0000000..41ab1eb
--- /dev/null
+++ b/test/madd_divide.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_divide(D, "new", "meta", "in1", "in2");
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_DIVIDE_ENTRY);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKS(e.in_fields[1], "in2");
+    CHECKI(e.fragment_index, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_index.c b/test/madd_index.c
new file mode 100644
index 0000000..731a714
--- /dev/null
+++ b/test/madd_index.c
@@ -0,0 +1,72 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, ge_error, n, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  gd_entry_t E;
+  memset(&E, 0, sizeof(E));
+  E.field = "data";
+  E.field_type = GD_RAW_ENTRY;
+  E.fragment_index = 0;
+  E.EN(raw,spf) = 2;
+  E.EN(raw,data_type) = GD_UINT8;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add(D, &E);
+  E.field_type = GD_CONST_ENTRY;
+  E.EN(scalar,const_type) = GD_UINT8;
+  E.fragment_index = 99;
+  gd_madd(D, &E, "data");
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+  gd_entry(D, "data/data", &e);
+  ge_error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_error, 0);
+  CHECKI(n, 2);
+
+  if (!r) {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_free_entry_strings(&e);
+  }
+
+  return r;
+}
diff --git a/test/madd_lincom.c b/test/madd_lincom.c
new file mode 100644
index 0000000..e5fb6f8
--- /dev/null
+++ b/test/madd_lincom.c
@@ -0,0 +1,75 @@
+/* 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 LINCOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  const char *in_fields[2] = {"in1", "in2"};
+  const double m[2] = {1, 0.3};
+  const double b[2] = {0, 0.9};
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_lincom(D, "new", "meta", 2, in_fields, m, b);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_LINCOM_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(lincom,n_fields), 2);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKS(e.in_fields[1], "in2");
+    CHECKF(e.EN(lincom,m)[0], m[0]);
+    CHECKF(e.EN(lincom,m)[1], m[1]);
+    CHECKF(e.EN(lincom,b)[0], b[0]);
+    CHECKF(e.EN(lincom,b)[1], b[1]);
+    CHECKI(e.comp_scal, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+}
diff --git a/test/madd_lincom_invalid.c b/test/madd_lincom_invalid.c
new file mode 100644
index 0000000..7e72a52
--- /dev/null
+++ b/test/madd_lincom_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char *in_fields[2] = {"in1", "in2"};
+  const double m[2] = {1, 0.3};
+  const double b[2] = {0, 0.9};
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_madd_lincom(D, "new", "meta", 2, in_fields, m, b);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/madd_linterp.c b/test/madd_linterp.c
new file mode 100644
index 0000000..ccb4400
--- /dev/null
+++ b/test/madd_linterp.c
@@ -0,0 +1,65 @@
+/* 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 LINTERP field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_linterp(D, "new", "meta", "in", "table");
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_LINTERP_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKS(e.EN(linterp,table), "table");
+    CHECKI(e.fragment_index, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK); 
+  return r;
+}
diff --git a/test/madd_linterp_invalid.c b/test/madd_linterp_invalid.c
new file mode 100644
index 0000000..0d5b054
--- /dev/null
+++ b/test/madd_linterp_invalid.c
@@ -0,0 +1,44 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_madd_linterp(D, "new", "meta", "in", "table");
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/madd_mplex.c b/test/madd_mplex.c
new file mode 100644
index 0000000..bdee8b1
--- /dev/null
+++ b/test/madd_mplex.c
@@ -0,0 +1,59 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_mplex(D, "new", "in", "count", 3, 4, 0);
+  gd_madd_mplex(D, "new", "meta", "in", "count", 5, 6);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  if (gd_error(D))
+    r = 1;
+  else {
+    CHECKI(e.field_type, GD_MPLEX_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKS(e.in_fields[1], "count");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(mplex,count_val), 5);
+    CHECKF(e.EN(mplex,period), 6);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/madd_multiply.c b/test/madd_multiply.c
new file mode 100644
index 0000000..47f2c1e
--- /dev/null
+++ b/test/madd_multiply.c
@@ -0,0 +1,65 @@
+/* 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 MULTIPLY field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_multiply(D, "new", "meta", "in1", "in2");
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_MULTIPLY_ENTRY);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKS(e.in_fields[1], "in2");
+    CHECKI(e.fragment_index, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_multiply_invalid.c b/test/madd_multiply_invalid.c
new file mode 100644
index 0000000..91d57f1
--- /dev/null
+++ b/test/madd_multiply_invalid.c
@@ -0,0 +1,44 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_madd_multiply(D, "new", "meta", "in1", "in2");
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/madd_phase.c b/test/madd_phase.c
new file mode 100644
index 0000000..e322dde
--- /dev/null
+++ b/test/madd_phase.c
@@ -0,0 +1,65 @@
+/* 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 PHASE field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_phase(D, "new", "meta", "in", 3);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_PHASE_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(phase,shift), 3);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_phase_invalid.c b/test/madd_phase_invalid.c
new file mode 100644
index 0000000..54fa983
--- /dev/null
+++ b/test/madd_phase_invalid.c
@@ -0,0 +1,44 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_madd_phase(D, "new", "meta", "in", 3);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/madd_polynom.c b/test/madd_polynom.c
new file mode 100644
index 0000000..e1a45a8
--- /dev/null
+++ b/test/madd_polynom.c
@@ -0,0 +1,71 @@
+/* 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
+ */
+/* Add a POLYNOM field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int j, error, ge_error, r = 0;
+  gd_entry_t e;
+  const char *in_field = "in";
+  const double a[4] = {1, 0.3, 0.5, 1.8};
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_polynom(D, "new", "meta", 3, in_field, a);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_POLYNOM_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(polynom,poly_ord), 3);
+    CHECKI(e.comp_scal, 0);
+    for (j = 0; j < 4; ++j)
+      CHECKFi(j, e.EN(polynom,a)[j], a[j]);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_recip.c b/test/madd_recip.c
new file mode 100644
index 0000000..4d56a1b
--- /dev/null
+++ b/test/madd_recip.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_recip(D, "new", "meta", "in1", 3.2);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_RECIP_ENTRY);
+    CHECKS(e.in_fields[0], "in1");
+    CHECKF(e.EN(recip,dividend), 3.2);
+    CHECKI(e.comp_scal, 0);
+    CHECKI(e.fragment_index, 0);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_sbit.c b/test/madd_sbit.c
new file mode 100644
index 0000000..fa2e393
--- /dev/null
+++ b/test/madd_sbit.c
@@ -0,0 +1,66 @@
+/* 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
+ */
+/* Add a BIT field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_sbit(D, "new", "meta", "input", 1, 1);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_SBIT_ENTRY);
+    CHECKS(e.in_fields[0], "input");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(bit,bitnum), 1);
+    CHECKI(e.EN(bit,numbits), 1);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_spec.c b/test/madd_spec.c
new file mode 100644
index 0000000..515f37c
--- /dev/null
+++ b/test/madd_spec.c
@@ -0,0 +1,70 @@
+/* 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
+ */
+/* gd_madd_spec() */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, n, r = 0;
+  unsigned char val;
+  gd_entry_t e;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_madd_spec(D, "meta CONST UINT8 2", "INDEX");
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+
+  CHECKI(n, 1);
+
+  gd_entry(D, "INDEX/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_CONST_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(scalar,const_type), GD_UINT8);
+    gd_get_constant(D, "INDEX/meta", GD_UINT8, &val);
+    CHECKU(val, 2);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_spec_directive.c b/test/madd_spec_directive.c
new file mode 100644
index 0000000..3692b2f
--- /dev/null
+++ b/test/madd_spec_directive.c
@@ -0,0 +1,57 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, n, m, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT);
+  gd_madd_spec(D, "META INDEX RAW UINT8 2", "INDEX");
+  error = gd_error(D);
+
+  /* check */
+  n = gd_nfields(D);
+  m = gd_nmfields(D, "INDEX");
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 1);
+  CHECKI(m, 0);
+  CHECKI(error, GD_E_FORMAT);
+
+  return r;
+}
diff --git a/test/madd_spec_invalid.c b/test/madd_spec_invalid.c
new file mode 100644
index 0000000..0faca57
--- /dev/null
+++ b/test/madd_spec_invalid.c
@@ -0,0 +1,44 @@
+/* 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
+ */
+/* Getting data from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  gd_madd_spec(D, "data RAW UINT8 2", "INDEX");
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(error, GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/madd_spec_resolv.c b/test/madd_spec_resolv.c
new file mode 100644
index 0000000..34a63f7
--- /dev/null
+++ b/test/madd_spec_resolv.c
@@ -0,0 +1,58 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, i, n, r = 0;
+  DIRFILE *D;
+  const char *target;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+
+  gd_add_spec(D, "data RAW UINT8 1", 0);
+  gd_add_alias(D, "alias", "data/data", 0);
+  gd_madd_spec(D, "data CONST UINT8 1", "data");
+  error = gd_error(D);
+
+  /* check */
+  target = gd_alias_target(D, "alias");
+  CHECKS(target, "data/data");
+  i = gd_fragment_index(D, "alias");
+  n = gd_naliases(D, "alias");
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  CHECKI(i, 0);
+  CHECKI(n, 2);
+
+  return r;
+}
diff --git a/test/madd_string.c b/test/madd_string.c
new file mode 100644
index 0000000..f43f3e6
--- /dev/null
+++ b/test/madd_string.c
@@ -0,0 +1,67 @@
+/* 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
+ */
+/* Add a RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  char val[1000];
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_phase(D, "new", "in", 3, 0);
+  gd_madd_string(D, "new", "meta", "A string.");
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_STRING_ENTRY);
+    CHECKI(e.fragment_index, 0);
+    gd_get_string(D, "new/meta", 1000, val);
+    CHECKS(val, "A string.");
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/madd_window.c b/test/madd_window.c
new file mode 100644
index 0000000..2c9aa40
--- /dev/null
+++ b/test/madd_window.c
@@ -0,0 +1,70 @@
+/* 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 WINDOW 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";
+  int error, ge_error, r = 0;
+  gd_entry_t e;
+  gd_triplet_t thresh;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  thresh.r = 0.1;
+  gd_add_window(D, "new", "in", "check", GD_WINDOP_GT, thresh, 0);
+  thresh.u = 0x1F000;
+  gd_madd_window(D, "new", "meta", "in", "check", GD_WINDOP_CLR, thresh);
+  error = gd_error(D);
+
+  /* check */
+  gd_entry(D, "new/meta", &e);
+  ge_error = gd_error(D);
+  CHECKI(ge_error, 0);
+  if (!r) {
+    CHECKI(e.field_type, GD_WINDOW_ENTRY);
+    CHECKS(e.in_fields[0], "in");
+    CHECKS(e.in_fields[1], "check");
+    CHECKI(e.fragment_index, 0);
+    CHECKI(e.EN(window,windop), GD_WINDOP_CLR);
+    CHECKI(e.EN(window,threshold.u), 0x1F000);
+    gd_free_entry_strings(&e);
+  }
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/move.c b/test/move.c
new file mode 100644
index 0000000..44eb725
--- /dev/null
+++ b/test/move.c
@@ -0,0 +1,71 @@
+/* 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
new file mode 100644
index 0000000..b719ea7
--- /dev/null
+++ b/test/move_affix.c
@@ -0,0 +1,71 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data =
+    "INCLUDE format1 A B\n"
+    "INCLUDE format2 C D\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  const char *format2_data = "#\n";
+  int fd, ret, error, ge_ret, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move(D, "AdataB", 2, 0);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "CdataD", &E);
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 2);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_affix_dup.c b/test/move_affix_dup.c
new file mode 100644
index 0000000..f0ac7f3
--- /dev/null
+++ b/test/move_affix_dup.c
@@ -0,0 +1,59 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "INCLUDE format1 A B\n"
+    "INCLUDE format1 C D\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, ret, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  ret = gd_move(D, "AdataB", 2, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret, -1);
+  CHECKI(error, GD_E_DUPLICATE);
+
+  return r;
+}
diff --git a/test/move_alias.c b/test/move_alias.c
new file mode 100644
index 0000000..bf88eb4
--- /dev/null
+++ b/test/move_alias.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data =
+    "INCLUDE format1\n"
+    "/ALIAS alias data\n"
+    "data RAW UINT8 11\n";
+  const char *format1_data = "#\n";
+  int fd, ret, error, fa, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move_alias(D, "alias", 1);
+  error = gd_error(D);
+  fa =  gd_fragment_index(D, "alias");
+  fd =  gd_fragment_index(D, "data");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(fa, 1);
+  CHECKI(fd, 0);
+
+  return r;
+}
diff --git a/test/move_data_enc_ar.c b/test/move_data_enc_ar.c
new file mode 100644
index 0000000..30657ec
--- /dev/null
+++ b/test/move_data_enc_ar.c
@@ -0,0 +1,101 @@
+/* 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>
+#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 *txtdata = "dirfile/data.txt";
+  const char *format_data =
+    "/INCLUDE format1\ndata RAW UINT16 11\nENCODING text\n";
+  const char *format1_data = "ENCODING none\n";
+  int r = 0;
+  uint16_t d;
+  int fd, i, ret, error, ge_ret, unlink_data, unlink_txtdata;
+  FILE* stream;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  stream = fopen(txtdata, "w");
+  for (i = 0; i < 128; ++i)
+    fprintf(stream, "%i\n", i * 0x201);
+  fclose(stream);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move(D, "data", 1, 1);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+
+  if (fd >= 0) {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKXi(i,d,i * 0x201);
+      i++;
+    }
+    close(fd);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(format1);
+  unlink(format);
+  unlink_data = unlink(data);
+  unlink_txtdata = unlink(txtdata);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_txtdata, -1);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_data_enc_ra.c b/test/move_data_enc_ra.c
new file mode 100644
index 0000000..f84d8a7
--- /dev/null
+++ b/test/move_data_enc_ra.c
@@ -0,0 +1,106 @@
+/* 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>
+#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 *txtdata = "dirfile/data.txt";
+  const char *format_data = "/INCLUDE format1\ndata RAW UINT16 11";
+  const char *format1_data = "ENCODING text\n";
+  uint16_t data_data[128];
+  int r = 0;
+  uint16_t d;
+  char line[100];
+  int fd, i, ret, error, ge_ret, unlink_data, unlink_txtdata;
+  FILE* stream;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = fd * 0x201;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move(D, "data", 1, 1);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+  stream = fopen(txtdata, "rt");
+
+  if (stream != NULL) {
+    i = 0;
+
+    while (fgets(line, 100, stream)) {
+      d = strtoul(line, NULL, 10);
+      CHECKXi(i, d, (unsigned)i * 0x201);
+      i++;
+    }
+    fclose(stream);
+  } else {
+    perror("open");
+    r = 1;
+  }
+
+  unlink(format1);
+  unlink(format);
+  unlink_data = unlink(data);
+  unlink_txtdata = unlink(txtdata);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  CHECKI(unlink_data, -1);
+  CHECKI(unlink_txtdata, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_data_endian.c b/test/move_data_endian.c
new file mode 100644
index 0000000..ebe7f69
--- /dev/null
+++ b/test/move_data_endian.c
@@ -0,0 +1,100 @@
+/* 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>
+#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\ndata RAW UINT16 11";
+#ifdef WORDS_BIGENDIAN
+  const char *format1_data = "ENDIAN little\n";
+#else
+  const char *format1_data = "ENDIAN big\n";
+#endif
+  uint16_t d, data_data[128];
+  int fd, i, ret, error, ge_ret, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 128; ++fd)
+    data_data[fd] = fd * 0x201;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move(D, "data", 1, 1);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+
+  if (fd == -1) {
+    perror("open: ");
+    r = 1;
+  } else {
+    while (read(fd, &d, sizeof(uint16_t))) {
+      CHECKXi(i, d, i * 0x102);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(format1);
+  unlink(format);
+  unlink(data);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_data_foffs.c b/test/move_data_foffs.c
new file mode 100644
index 0000000..fe0615a
--- /dev/null
+++ b/test/move_data_foffs.c
@@ -0,0 +1,90 @@
+/* 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>
+#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\ndata RAW UINT8 11";
+  const char *format1_data = "FRAMEOFFSET 1\n";
+  uint8_t d, data_data[256];
+  int fd, i, ret, error, ge_ret, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  ret = gd_move(D, "data", 1, 1);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    CHECKUi(i,d,i + 11);
+    i++;
+  }
+  close(fd);
+
+  unlink(format1);
+  unlink(format);
+  unlink(data);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_data_nop.c b/test/move_data_nop.c
new file mode 100644
index 0000000..7d778b5
--- /dev/null
+++ b/test/move_data_nop.c
@@ -0,0 +1,81 @@
+/* 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 *data = "dirfile/data";
+  const char *format_data = "/INCLUDE format1\ndata RAW UINT8 11";
+  const char *format1_data = "#\n";
+  unsigned char data_data[256];
+  int fd, ret, error, ge_ret, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  ret = gd_move(D, "data", 1, 1);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  unlink(data);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_index.c b/test/move_index.c
new file mode 100644
index 0000000..8dc9a00
--- /dev/null
+++ b/test/move_index.c
@@ -0,0 +1,71 @@
+/* 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);
+  ret = gd_move(D, "data", 2, 0);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret, -1);
+  CHECKI(error, GD_E_BAD_INDEX);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_meta.c b/test/move_meta.c
new file mode 100644
index 0000000..3d26f68
--- /dev/null
+++ b/test/move_meta.c
@@ -0,0 +1,72 @@
+/* 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
+ */
+/* 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\n"
+    "data/meta CONST UINT8 11\n";
+  const char *format1_data = "#\n";
+  int fd, ret, error, ge_ret, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move(D, "data", 1, 0);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data/meta", &E);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_protect.c b/test/move_protect.c
new file mode 100644
index 0000000..8a04e58
--- /dev/null
+++ b/test/move_protect.c
@@ -0,0 +1,71 @@
+/* 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 = "/PROTECT all\n";
+  int fd, ret, error, ge_ret, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  ret = gd_move(D, "data", 1, 0);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(ret, -1);
+  CHECKI(error, GD_E_PROTECTED);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/move_subdir.c b/test/move_subdir.c
new file mode 100644
index 0000000..5c6b004
--- /dev/null
+++ b/test/move_subdir.c
@@ -0,0 +1,84 @@
+/* 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 *subdir = "dirfile/subdir";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/subdir/format1";
+  const char *data = "dirfile/data";
+  const char *new_data = "dirfile/subdir/data";
+  const char *format_data = "INCLUDE subdir/format1\ndata RAW UINT8 11\n";
+  const char *format1_data = "#\n";
+  int fd, ret, error, ge_ret, unlink_data, unlink_new_data, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  ret = gd_move(D, "data", 1, 1);
+  error = gd_error(D);
+  ge_ret =  gd_entry(D, "data", &E);
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  unlink_new_data = unlink(new_data);
+  unlink(format1);
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  CHECKI(ret, 0);
+  CHECKI(error, GD_E_OK);
+  CHECKI(ge_ret, 0);
+  CHECKI(E.fragment_index, 1);
+  CHECKI(unlink_data, -1);
+  CHECKI(unlink_new_data, 0);
+  gd_free_entry_strings(&E);
+
+  return r;
+}
diff --git a/test/name.c b/test/name.c
new file mode 100644
index 0000000..7ddc93b
--- /dev/null
+++ b/test/name.c
@@ -0,0 +1,133 @@
+/* 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
new file mode 100644
index 0000000..0c64a4e
--- /dev/null
+++ b/test/name_affix.c
@@ -0,0 +1,63 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 8\n";
+  int fd, ret, e1, e2, r = 0;
+  gd_entype_t type;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_rename(D, "AdataZ", "AzataZ", 0);
+  e1 = gd_error(D);
+  type = gd_entry_type(D, "AzataZ");
+  e2 = gd_error(D);
+
+  gd_close(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
new file mode 100644
index 0000000..d2a4aad
--- /dev/null
+++ b/test/name_affix_bad.c
@@ -0,0 +1,58 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  const char *format1_data = "data RAW UINT8 8\n";
+  int fd, ret, e1, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_rename(D, "AdataZ", "zata", 0);
+  e1 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(e1,GD_E_BAD_CODE);
+  CHECKI(ret,-1);
+
+  return r;
+}
diff --git a/test/name_alias.c b/test/name_alias.c
new file mode 100644
index 0000000..67aba75
--- /dev/null
+++ b/test/name_alias.c
@@ -0,0 +1,173 @@
+/* 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>
+#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 cata 0\n"
+    "earlya PHASE data 0\n"
+    "/ALIAS aata cata\n"
+    "/ALIAS bata data\n"
+    "late PHASE cata 0\n"
+    "latea PHASE data 0\n"
+    "cata RAW UINT8 8\n"
+    "/ALIAS data cata\n"
+    "eata RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, e0, e1, e2, e3, e4, e5, e6, unlink_data, unlink_zata, r = 0;
+  const char **fl;
+  char *field_list[9];
+  char *s1, *s2, *s3, *s4, *s5, *s6;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_validate(D, "early");
+  gd_validate(D, "earlya");
+  ret = gd_rename(D, "data", "zata", 0);
+  e0 = gd_error(D);
+  gd_spf(D, "early");
+  e1 = gd_error(D);
+  gd_spf(D, "late");
+  e2 = gd_error(D);
+  gd_spf(D, "earlya");
+  e3 = gd_error(D);
+  gd_spf(D, "latea");
+  e4 = 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]);
+  field_list[6] = strdup(fl[6]);
+  field_list[7] = strdup(fl[7]);
+  field_list[8] = strdup(fl[8]);
+
+  gd_entry(D, "early", &E);
+  s1 = E.in_fields[0];
+  E.in_fields[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "earlya", &E);
+  s2 = E.in_fields[0];
+  E.in_fields[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "late", &E);
+  s3 = E.in_fields[0];
+  E.in_fields[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "latea", &E);
+  s4 = E.in_fields[0];
+  E.in_fields[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "aata", &E);
+  e5 = gd_error(D);
+  s5 = strdup(gd_alias_target(D, "aata"));
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "bata", &E);
+  e6 = gd_error(D);
+  s6 = strdup(gd_alias_target(D, "bata"));
+
+  gd_close(D);
+
+  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_dup.c b/test/name_dup.c
new file mode 100644
index 0000000..d654a21
--- /dev/null
+++ b/test/name_dup.c
@@ -0,0 +1,51 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\nzata RAW UINT8 1\n";
+  int fd, ret, e1, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  ret = gd_rename(D, "data", "zata", 0);
+  e1 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1,GD_E_DUPLICATE);
+  CHECKI(ret,-1);
+
+  return r;
+}
diff --git a/test/name_move.c b/test/name_move.c
new file mode 100644
index 0000000..3b0c9ee
--- /dev/null
+++ b/test/name_move.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *zata = "dirfile/zata";
+  const char *format_data = "cata RAW UINT8 8\ndata RAW UINT8 8\n"
+    "eata RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, error, unlink_data, unlink_zata, r = 0;
+  const char **fl;
+  char *field_list[4];
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_rename(D, "data", "zata", GD_REN_DATA);
+  error = gd_error(D);
+  fl = gd_field_list(D);
+
+  field_list[0] = strdup(fl[0]);
+  field_list[1] = strdup(fl[1]);
+  field_list[2] = strdup(fl[2]);
+  field_list[3] = strdup(fl[3]);
+
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  unlink_zata = unlink(zata);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKS(field_list[0], "INDEX");
+  CHECKS(field_list[1], "cata");
+  CHECKS(field_list[2], "eata");
+  CHECKS(field_list[3], "zata");
+  CHECKI(unlink_data, -1);
+  CHECKI(unlink_zata, 0);
+  free(field_list[0]);
+  free(field_list[1]);
+  free(field_list[2]);
+  free(field_list[3]);
+
+  return r;
+}
diff --git a/test/name_move_alias.c b/test/name_move_alias.c
new file mode 100644
index 0000000..95325b9
--- /dev/null
+++ b/test/name_move_alias.c
@@ -0,0 +1,82 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *zata = "dirfile/zata";
+  const char *format_data = "cata RAW UINT8 8\n/ALIAS data cata\n"
+    "eata RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, ret, error, unlink_data, unlink_zata, r = 0;
+  const char **fl;
+  char *field_list[4];
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_rename(D, "data", "zata", GD_REN_DATA);
+  error = gd_error(D);
+  fl = gd_field_list(D);
+
+  field_list[0] = strdup(fl[0]);
+  field_list[1] = strdup(fl[1]);
+  field_list[2] = strdup(fl[2]);
+  field_list[3] = strdup(fl[3]);
+
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  unlink_zata = unlink(zata);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKS(field_list[0], "INDEX");
+  CHECKS(field_list[1], "cata");
+  CHECKS(field_list[2], "eata");
+  CHECKS(field_list[3], "zata");
+  CHECKI(unlink_data, 0);
+  CHECKI(unlink_zata, -1);
+  free(field_list[0]);
+  free(field_list[1]);
+  free(field_list[2]);
+  free(field_list[3]);
+
+  return r;
+}
diff --git a/test/name_updb.c b/test/name_updb.c
new file mode 100644
index 0000000..f3d8524
--- /dev/null
+++ b/test/name_updb.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2011-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = 
+    "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;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_validate(D, "early");
+  gd_rename(D, "data", "zata", GD_REN_UPDB);
+  e1 = gd_error(D);
+  gd_spf(D, "early");
+  e2 = gd_error(D);
+  gd_spf(D, "late");
+  e3 = gd_error(D);
+
+  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_free_entry_strings(&E);
+
+  gd_discard(D);
+
+  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_alias.c b/test/name_updb_alias.c
new file mode 100644
index 0000000..ba471f4
--- /dev/null
+++ b/test/name_updb_alias.c
@@ -0,0 +1,119 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = 
+    "early  PHASE cata 0\n"
+    "earlya PHASE data 0\n"
+    "/ALIAS aata cata\n"
+    "/ALIAS bata data\n"
+    "late   PHASE cata 0\n"
+    "latea  PHASE data 0\n"
+    "cata RAW UINT8 8\n"
+    "/ALIAS data cata\n";
+  int fd, e0, e1, e2, e3, e4, e5, e6, r = 0;
+  char *s1, *s2, *s3, *s4, *s5, *s6;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_validate(D, "early");
+  gd_validate(D, "earlya");
+  gd_rename(D, "data", "zata", GD_REN_UPDB);
+  e0 = gd_error(D);
+  gd_spf(D, "early");
+  e1 = gd_error(D);
+  gd_spf(D, "earlya");
+  e2 = gd_error(D);
+  gd_spf(D, "late");
+  e3 = gd_error(D);
+  gd_spf(D, "latea");
+  e4 = gd_error(D);
+
+  gd_entry(D, "early", &E);
+  s1 = E.in_fields[0];
+  E.in_fields[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "earlya", &E);
+  s2 = E.in_fields[0];
+  E.in_fields[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "late", &E);
+  s3 = E.in_fields[0];
+  E.in_fields[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "latea", &E);
+  s4 = E.in_fields[0];
+  E.in_fields[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "aata", &E);
+  e5 = gd_error(D);
+  s5 = strdup(gd_alias_target(D, "aata"));
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "bata", &E);
+  e6 = gd_error(D);
+  s6 = strdup(gd_alias_target(D, "bata"));
+  gd_free_entry_strings(&E);
+
+  gd_discard(D);
+
+  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_const.c b/test/name_updb_const.c
new file mode 100644
index 0000000..f366e4a
--- /dev/null
+++ b/test/name_updb_const.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2011-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = 
+    "early RAW UINT8 c\n"
+    "late RAW UINT8 c\n"
+    "/ALIAS b c\n"
+    "c CONST UINT8 2\n";
+  int fd, e1, e2, e3, e4, r = 0;
+  char *s1, *s2, *s3;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_validate(D, "early");
+  gd_rename(D, "c", "d", GD_REN_UPDB);
+  e1 = gd_error(D);
+  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;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "late", &E);
+  s2 = E.scalar[0];
+  E.scalar[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "b", &E);
+  e4 = gd_error(D);
+  s3 = strdup(gd_alias_target(D, "b"));
+  gd_free_entry_strings(&E);
+
+  gd_discard(D);
+
+  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
new file mode 100644
index 0000000..1ea7c00
--- /dev/null
+++ b/test/name_updb_const_alias.c
@@ -0,0 +1,87 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = 
+    "early RAW UINT8 c\n"
+    "late RAW UINT8 c\n"
+    "/ALIAS b c\n"
+    "e CONST UINT8 2\n"
+    "/ALIAS c e\n";
+  int fd, e1, e2, e3, e4, r = 0;
+  char *s1, *s2, *s3;
+  DIRFILE *D;
+  gd_entry_t E;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR);
+  gd_validate(D, "early");
+  gd_rename(D, "c", "d", GD_REN_UPDB);
+  e1 = gd_error(D);
+  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;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "late", &E);
+  s2 = E.scalar[0];
+  E.scalar[0] = NULL;
+  gd_free_entry_strings(&E);
+
+  gd_entry(D, "b", &E);
+  e4 = gd_error(D);
+  s3 = strdup(gd_alias_target(D, "b"));
+  gd_free_entry_strings(&E);
+
+  gd_discard(D);
+
+  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/nentries_alias.c b/test/nentries_alias.c
new file mode 100644
index 0000000..0ee52a0
--- /dev/null
+++ b/test/nentries_alias.c
@@ -0,0 +1,61 @@
+/* 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>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 RAW UINT8 1\n"
+    "/ALIAS data2 data1\n"
+    "/ALIAS data3 data4\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nentries(D, NULL, GD_ALIAS_ENTRIES, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 2);
+
+  return r;
+}
diff --git a/test/nentries_hidden.c b/test/nentries_hidden.c
new file mode 100644
index 0000000..90a2d42
--- /dev/null
+++ b/test/nentries_hidden.c
@@ -0,0 +1,66 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "/HIDDEN raw1\n"
+    "/HIDDEN raw1/const\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nentries(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_HIDDEN);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 8);
+
+  return r;
+}
diff --git a/test/nentries_noalias.c b/test/nentries_noalias.c
new file mode 100644
index 0000000..d27ece8
--- /dev/null
+++ b/test/nentries_noalias.c
@@ -0,0 +1,66 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "/ALIAS raw0 raw1\n"
+    "/ALIAS raw1/const2 raw1/const\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nentries(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_NOALIAS);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 8);
+
+  return r;
+}
diff --git a/test/nentries_scalar.c b/test/nentries_scalar.c
new file mode 100644
index 0000000..aa0e240
--- /dev/null
+++ b/test/nentries_scalar.c
@@ -0,0 +1,66 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "/HIDDEN raw1\n"
+    "/HIDDEN raw1/const\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nentries(D, NULL, GD_SCALAR_ENTRIES, 0);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 3);
+
+  return r;
+}
diff --git a/test/nfields.c b/test/nfields.c
new file mode 100644
index 0000000..a3cc2fd
--- /dev/null
+++ b/test/nfields.c
@@ -0,0 +1,72 @@
+/* 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
new file mode 100644
index 0000000..eb1c6ea
--- /dev/null
+++ b/test/nfields_hidden.c
@@ -0,0 +1,66 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "/HIDDEN raw1\n"
+    "/HIDDEN raw1/const\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nfields(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 7);
+
+  return r;
+}
diff --git a/test/nfields_invalid.c b/test/nfields_invalid.c
new file mode 100644
index 0000000..ba1d615
--- /dev/null
+++ b/test/nfields_invalid.c
@@ -0,0 +1,48 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  unsigned int n;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_nfields(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/nfields_type.c b/test/nfields_type.c
new file mode 100644
index 0000000..010ff59
--- /dev/null
+++ b/test/nfields_type.c
@@ -0,0 +1,72 @@
+/* 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_by_type(D, GD_STRING_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 2);
+
+  return r;
+}
diff --git a/test/nfields_type_hidden.c b/test/nfields_type_hidden.c
new file mode 100644
index 0000000..c9fdd03
--- /dev/null
+++ b/test/nfields_type_hidden.c
@@ -0,0 +1,65 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "/HIDDEN string\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nfields_by_type(D, GD_STRING_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 1);
+
+  return r;
+}
diff --git a/test/nfields_type_invalid.c b/test/nfields_type_invalid.c
new file mode 100644
index 0000000..3377e25
--- /dev/null
+++ b/test/nfields_type_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  unsigned int n;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_nfields_by_type(D, GD_RAW_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/nfields_vector.c b/test/nfields_vector.c
new file mode 100644
index 0000000..0563790
--- /dev/null
+++ b/test/nfields_vector.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "carray CARRAY UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nvectors(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 5);
+
+  return r;
+}
diff --git a/test/nfields_vector_hidden.c b/test/nfields_vector_hidden.c
new file mode 100644
index 0000000..42d4ffc
--- /dev/null
+++ b/test/nfields_vector_hidden.c
@@ -0,0 +1,66 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "/HIDDEN raw1\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "carray CARRAY UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nvectors(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(nfields, 4);
+
+  return r;
+}
diff --git a/test/nfields_vector_invalid.c b/test/nfields_vector_invalid.c
new file mode 100644
index 0000000..e3b8bf5
--- /dev/null
+++ b/test/nfields_vector_invalid.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  unsigned int n;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_nvectors(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(n, 0);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/nframes.c b/test/nframes.c
new file mode 100644
index 0000000..9cb1124
--- /dev/null
+++ b/test/nframes.c
@@ -0,0 +1,66 @@
+/* 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
new file mode 100644
index 0000000..eff713d
--- /dev/null
+++ b/test/nframes64.c
@@ -0,0 +1,66 @@
+/* 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 */
+#define _LARGEFILE64_SOURCE 1
+
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 1\n";
+  int fd, r = 0;
+  size_t n;
+  const size_t len = strlen(data);
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_nframes64(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(n, len);
+
+  return r;
+}
diff --git a/test/nframes_empty.c b/test/nframes_empty.c
new file mode 100644
index 0000000..3dcd0eb
--- /dev/null
+++ b/test/nframes_empty.c
@@ -0,0 +1,54 @@
+/* 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
+ */
+/* Requesting the number of frames from an empty dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int error, r = 0;
+  DIRFILE *D;
+  size_t n;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(n, 0);
+  CHECKI(error, GD_E_OK);
+
+  return r;
+}
diff --git a/test/nframes_invalid.c b/test/nframes_invalid.c
new file mode 100644
index 0000000..e4d7f1d
--- /dev/null
+++ b/test/nframes_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of frames from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  size_t n;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKU(n, 0);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/nframes_off64.c b/test/nframes_off64.c
new file mode 100644
index 0000000..cf78345
--- /dev/null
+++ b/test/nframes_off64.c
@@ -0,0 +1,74 @@
+/* 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 */
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+#  define SKIP_TEST
+#else
+#  define _FILE_OFFSET_BITS 64
+#endif
+
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifdef SKIP_TEST
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 1\n";
+  int fd, r = 0;
+  size_t n;
+  const size_t len = strlen(data);
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_nframes(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(n, len);
+
+  return r;
+#endif
+}
diff --git a/test/nframes_spf.c b/test/nframes_spf.c
new file mode 100644
index 0000000..875897c
--- /dev/null
+++ b/test/nframes_spf.c
@@ -0,0 +1,76 @@
+/* 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
+ */
+/* The number of frames should track the samples per frame */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+static void write_format(const char *format, int spf)
+{
+  char format_data[100];
+  int fd;
+  sprintf(format_data, "data RAW UINT8 %i\n", spf);
+
+  fd = open(format, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int fd, i, r = 0;
+  const size_t len = strlen(data);
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data, len);
+  close(fd);
+
+  for (i = 1; i < (int)len + 1; ++i) {
+    DIRFILE *D;
+    unsigned int spf;
+    size_t n;
+
+    write_format(format, i);
+    D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+    spf = gd_spf(D, "data");
+    n = gd_nframes(D);
+    CHECKUi(i, n, len / spf);
+    gd_close(D);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/nmeta.c b/test/nmeta.c
new file mode 100644
index 0000000..58fa577
--- /dev/null
+++ b/test/nmeta.c
@@ -0,0 +1,72 @@
+/* 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_nmfields(D, "raw1");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKU(nfields, 6);
+
+  return r;
+}
diff --git a/test/nmeta_hidden.c b/test/nmeta_hidden.c
new file mode 100644
index 0000000..0f4a43e
--- /dev/null
+++ b/test/nmeta_hidden.c
@@ -0,0 +1,65 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "/HIDDEN raw1/const\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nmfields(D, "raw1");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKU(nfields, 5);
+
+  return r;
+}
diff --git a/test/nmeta_invalid.c b/test/nmeta_invalid.c
new file mode 100644
index 0000000..f045afc
--- /dev/null
+++ b/test/nmeta_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  unsigned int n;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_nmfields(D, "raw1");
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKU(n, 0);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/nmeta_parent.c b/test/nmeta_parent.c
new file mode 100644
index 0000000..0d2e01a
--- /dev/null
+++ b/test/nmeta_parent.c
@@ -0,0 +1,72 @@
+/* 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);
+  nfields = gd_nmfields(D, "raw9");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(nfields, 0);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/nmeta_type.c b/test/nmeta_type.c
new file mode 100644
index 0000000..1c0780a
--- /dev/null
+++ b/test/nmeta_type.c
@@ -0,0 +1,72 @@
+/* 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_nmfields_by_type(D, "raw1", GD_STRING_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKU(nfields, 2);
+
+  return r;
+}
diff --git a/test/nmeta_type_hidden.c b/test/nmeta_type_hidden.c
new file mode 100644
index 0000000..4a45b9c
--- /dev/null
+++ b/test/nmeta_type_hidden.c
@@ -0,0 +1,65 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "/HIDDEN raw1/string\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nmfields_by_type(D, "raw1", GD_STRING_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKU(nfields, 1);
+
+  return r;
+}
diff --git a/test/nmeta_type_invalid.c b/test/nmeta_type_invalid.c
new file mode 100644
index 0000000..2cb6187
--- /dev/null
+++ b/test/nmeta_type_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  unsigned int n;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_nmfields_by_type(D, "raw1", GD_STRING_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKU(n, 0);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/nmeta_type_parent.c b/test/nmeta_type_parent.c
new file mode 100644
index 0000000..0611137
--- /dev/null
+++ b/test/nmeta_type_parent.c
@@ -0,0 +1,72 @@
+/* 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);
+  nfields = gd_nmfields_by_type(D, "raw9", GD_STRING_ENTRY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(nfields, 0);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/nmeta_vectors.c b/test/nmeta_vectors.c
new file mode 100644
index 0000000..4b2c222
--- /dev/null
+++ b/test/nmeta_vectors.c
@@ -0,0 +1,72 @@
+/* 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_nmvectors(D, "raw1");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKU(nfields, 3);
+
+  return r;
+}
diff --git a/test/nmeta_vectors_del.c b/test/nmeta_vectors_del.c
new file mode 100644
index 0000000..5d95c91
--- /dev/null
+++ b/test/nmeta_vectors_del.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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, error2, error3, r = 0;
+  unsigned int nvec, nvec2, nvec3;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  nvec = gd_nmvectors(D, "raw1");
+  error = gd_error(D);
+  gd_delete(D, "raw1/linterp3", 0);
+  nvec2 = gd_nmvectors(D, "raw1");
+  error2 = gd_error(D);
+  gd_delete(D, "raw1/string", 0);
+  nvec3 = gd_nmvectors(D, "raw1");
+  error3 = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(nvec,3);
+  CHECKI(error2,0);
+  CHECKI(nvec2,2);
+  CHECKI(error3,0);
+  CHECKI(nvec3,2);
+
+  return r;
+}
diff --git a/test/nmeta_vectors_hidden.c b/test/nmeta_vectors_hidden.c
new file mode 100644
index 0000000..ecd2b18
--- /dev/null
+++ b/test/nmeta_vectors_hidden.c
@@ -0,0 +1,65 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "raw1 RAW UINT8 1\n"
+    "META raw1 linterp1 LINTERP raw2 table\n"
+    "META raw1 linterp2 LINTERP raw3 table\n"
+    "META raw1 linterp3 LINTERP raw4 table\n"
+    "META raw1 const CONST UINT8 1\n"
+    "META raw1 string STRING value\n"
+    "META raw1 string2 STRING value\n"
+    "/HIDDEN raw1/linterp2\n"
+    "raw2 RAW UINT8 1\n"
+    "raw3 RAW UINT8 1\n"
+    "raw4 RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "string STRING value\n"
+    "string2 STRING value\n";
+  int fd, error, r = 0;
+  unsigned int nfields;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  nfields = gd_nmvectors(D, "raw1");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKU(nfields, 2);
+
+  return r;
+}
diff --git a/test/nmeta_vectors_invalid.c b/test/nmeta_vectors_invalid.c
new file mode 100644
index 0000000..14b2884
--- /dev/null
+++ b/test/nmeta_vectors_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  unsigned int n;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_nmvectors(D, "raw1");
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKU(n, 0);
+  CHECKI(error, GD_E_BAD_DIRFILE);
+
+  return r;
+}
diff --git a/test/nmeta_vectors_parent.c b/test/nmeta_vectors_parent.c
new file mode 100644
index 0000000..c64b2c7
--- /dev/null
+++ b/test/nmeta_vectors_parent.c
@@ -0,0 +1,72 @@
+/* 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);
+  nfields = gd_nmvectors(D, "raw9");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(nfields, 0);
+  CHECKI(error, GD_E_BAD_CODE);
+
+  return r;
+}
diff --git a/test/open.c b/test/open.c
new file mode 100644
index 0000000..f0d03ed
--- /dev/null
+++ b/test/open.c
@@ -0,0 +1,50 @@
+/* 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
new file mode 100644
index 0000000..a054aae
--- /dev/null
+++ b/test/open_abs.c
@@ -0,0 +1,53 @@
+/* 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)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  char path[4096];
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  getcwd(path, 4096);
+  strcat(path, "/");
+  strcat(path, filedir);
+  D = gd_open(path, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+}
diff --git a/test/open_cb_abort.c b/test/open_cb_abort.c
new file mode 100644
index 0000000..366c3d3
--- /dev/null
+++ b/test/open_cb_abort.c
@@ -0,0 +1,70 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_)
+{
+  saw_callback++;
+
+  return GD_SYNTAX_ABORT;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "BADDIRECTIVE BADTYPE\n"
+    "BADDIRECTIVE BADTYPE\n"
+    "BADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(saw_callback, 1);
+  CHECKI(error, GD_E_FORMAT);
+
+  return r;
+}
diff --git a/test/open_cb_cont.c b/test/open_cb_cont.c
new file mode 100644
index 0000000..05b8d9a
--- /dev/null
+++ b/test/open_cb_cont.c
@@ -0,0 +1,69 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_)
+{
+  saw_callback++;
+
+  return GD_SYNTAX_CONTINUE;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "BADDIRECTIVE BADTYPE\n"
+    "BADDIRECTIVE BADTYPE\n"
+    "BADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(saw_callback, 3);
+  CHECKI(error, GD_E_FORMAT);
+
+  return r;
+}
diff --git a/test/open_cb_ignore.c b/test/open_cb_ignore.c
new file mode 100644
index 0000000..198ba6b
--- /dev/null
+++ b/test/open_cb_ignore.c
@@ -0,0 +1,66 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_)
+{
+  saw_callback = 1;
+
+  return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "BADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(saw_callback, 1);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/open_cb_invalid.c b/test/open_cb_invalid.c
new file mode 100644
index 0000000..119d805
--- /dev/null
+++ b/test/open_cb_invalid.c
@@ -0,0 +1,70 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_)
+{
+  saw_callback++;
+
+  return -1;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "BADDIRECTIVE BADTYPE\n"
+    "BADDIRECTIVE BADTYPE\n"
+    "BADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(saw_callback, 1);
+  CHECKI(error, GD_E_CALLBACK);
+
+  return r;
+}
diff --git a/test/open_cb_rescan.c b/test/open_cb_rescan.c
new file mode 100644
index 0000000..95c8409
--- /dev/null
+++ b/test/open_cb_rescan.c
@@ -0,0 +1,72 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+static int saw_callback = 0;
+
+int callback(gd_parser_data_t *pdata, void *extra gd_unused_)
+{
+  if (saw_callback)
+    return GD_SYNTAX_ABORT;
+
+  saw_callback = 1;
+
+  strcpy(pdata->line, "/REFERENCE data\n");
+
+  return GD_SYNTAX_RESCAN;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "BADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY, callback, NULL);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(saw_callback, 1);
+  CHECKI(error, GD_E_BAD_REFERENCE);
+
+  return r;
+}
diff --git a/test/open_eaccess.c b/test/open_eaccess.c
new file mode 100644
index 0000000..25052b9
--- /dev/null
+++ b/test/open_eaccess.c
@@ -0,0 +1,60 @@
+/* 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 dirfile with no read permission should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0000));
+
+  /* ensure filesystem honours access */
+  if ((fd = open(format, O_RDONLY)) >= 0 || errno != EACCES) {
+    if (fd >= 0)
+      close(fd);
+    unlink(format);
+    rmdir(filedir);
+    return 77;
+  }
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OPEN);
+  return r;
+}
diff --git a/test/open_nonexistent.c b/test/open_nonexistent.c
new file mode 100644
index 0000000..af91ccf
--- /dev/null
+++ b/test/open_nonexistent.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Opening a non-existent dirfile should fail cleanly */
+#include "test.h"
+
+int main(void)
+{
+  DIRFILE *D = gd_open("a non_existant dirfile", 0);
+  int error, r = 0;
+
+  error = gd_error(D);
+  CHECKI(error, GD_E_OPEN);
+  gd_discard(D);
+
+  return r;
+}
diff --git a/test/open_notdirfile.c b/test/open_notdirfile.c
new file mode 100644
index 0000000..6ab64ff
--- /dev/null
+++ b/test/open_notdirfile.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Opening an non-dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  D = gd_open(filedir, GD_RDONLY);
+
+  rmdir(filedir);
+  error = gd_error(D);
+  CHECKI(error, GD_E_OPEN);
+  gd_discard(D);
+
+  return r;
+}
diff --git a/test/open_rofs.c b/test/open_rofs.c
new file mode 100644
index 0000000..dfba438
--- /dev/null
+++ b/test/open_rofs.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Truncating a read-only dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "/INCLUDE format1\n";
+  int error, fd, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0444);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  close(open(format1, O_CREAT | O_EXCL | O_WRONLY, 0444));
+  chmod(filedir, 0555);
+
+  /* ensure filesystem honours read-onlyness */
+  if (!unlink(format1) || errno != EACCES) {
+    unlink(format);
+    rmdir(filedir);
+    return 77;
+  }
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  error = gd_error(D);
+  gd_discard(D);
+
+  chmod(filedir, 0777);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+}
diff --git a/test/open_sym_a.c b/test/open_sym_a.c
new file mode 100644
index 0000000..ee151b6
--- /dev/null
+++ b/test/open_sym_a.c
@@ -0,0 +1,66 @@
+/* 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
new file mode 100644
index 0000000..48ac87f
--- /dev/null
+++ b/test/open_sym_al.c
@@ -0,0 +1,66 @@
+/* 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_at.c b/test/open_sym_at.c
new file mode 100644
index 0000000..bddb7a2
--- /dev/null
+++ b/test/open_sym_at.c
@@ -0,0 +1,66 @@
+/* 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, "dirfile/link");
+  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_c.c b/test/open_sym_c.c
new file mode 100644
index 0000000..57afe87
--- /dev/null
+++ b/test/open_sym_c.c
@@ -0,0 +1,57 @@
+/* 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
+  return 77;
+#else
+  const char *filedir = "dirfile/link";
+  const char *format = "dirfile/format";
+  const char *targ = ".";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir("dirfile", 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  /* make a symlink */
+  symlink(targ, filedir);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+#endif
+}
diff --git a/test/open_sym_cl.c b/test/open_sym_cl.c
new file mode 100644
index 0000000..e40db2c
--- /dev/null
+++ b/test/open_sym_cl.c
@@ -0,0 +1,57 @@
+/* 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
+  return 77;
+#else
+  const char *filedir = "dirfile/link";
+  const char *format = "dirfile/format";
+  const char *targ = "./";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir("dirfile", 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  /* make a symlink */
+  symlink(targ, filedir);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+#endif
+}
diff --git a/test/open_sym_ct.c b/test/open_sym_ct.c
new file mode 100644
index 0000000..cac53ee
--- /dev/null
+++ b/test/open_sym_ct.c
@@ -0,0 +1,57 @@
+/* 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
+  return 77;
+#else
+  const char *filedir = "dirfile/link/";
+  const char *format = "dirfile/format";
+  const char *targ = ".";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir("dirfile", 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  /* make a symlink */
+  symlink(targ, "dirfile/link");
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+#endif
+}
diff --git a/test/open_sym_p.c b/test/open_sym_p.c
new file mode 100644
index 0000000..4520568
--- /dev/null
+++ b/test/open_sym_p.c
@@ -0,0 +1,57 @@
+/* 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
+  return 77;
+#else
+  const char *filedir = "dirfile/link";
+  const char *format = "dirfile/format";
+  const char *targ = "../dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir("dirfile", 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  /* make a symlink */
+  symlink(targ, filedir);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+#endif
+}
diff --git a/test/open_sym_pl.c b/test/open_sym_pl.c
new file mode 100644
index 0000000..fd2e3a3
--- /dev/null
+++ b/test/open_sym_pl.c
@@ -0,0 +1,57 @@
+/* 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
+  return 77;
+#else
+  const char *filedir = "dirfile/link";
+  const char *format = "dirfile/format";
+  const char *targ = "../dirfile/";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir("dirfile", 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  /* make a symlink */
+  symlink(targ, filedir);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+#endif
+}
diff --git a/test/open_sym_pt.c b/test/open_sym_pt.c
new file mode 100644
index 0000000..09a4ac4
--- /dev/null
+++ b/test/open_sym_pt.c
@@ -0,0 +1,57 @@
+/* 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
+  return 77;
+#else
+  const char *filedir = "dirfile/link/";
+  const char *format = "dirfile/format";
+  const char *targ = "../dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir("dirfile", 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+
+  /* make a symlink */
+  symlink(targ, "dirfile/link");
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  return r;
+#endif
+}
diff --git a/test/parse_alias.c b/test/parse_alias.c
new file mode 100644
index 0000000..ecfa88d
--- /dev/null
+++ b/test/parse_alias.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 1\n/ALIAS rata data\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_alias_code.c b/test/parse_alias_code.c
new file mode 100644
index 0000000..3860eed
--- /dev/null
+++ b/test/parse_alias_code.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 1\n/ALIAS ra.ta data\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_alias_dup.c b/test/parse_alias_dup.c
new file mode 100644
index 0000000..a1cc501
--- /dev/null
+++ b/test/parse_alias_dup.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 1\n"
+    "cata RAW UINT8 1\n"
+    "/ALIAS cata data\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_alias_meta.c b/test/parse_alias_meta.c
new file mode 100644
index 0000000..de0fbde
--- /dev/null
+++ b/test/parse_alias_meta.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 1\n"
+    "data/cata CONST UINT8 1\n"
+    "/ALIAS data/eata data\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  return r;
+}
diff --git a/test/parse_alias_missing.c b/test/parse_alias_missing.c
new file mode 100644
index 0000000..f662a78
--- /dev/null
+++ b/test/parse_alias_missing.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/ALIAS alias target\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_badline.c b/test/parse_badline.c
new file mode 100644
index 0000000..8218dea
--- /dev/null
+++ b/test/parse_badline.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "BADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_bit.c b/test/parse_bit.c
new file mode 100644
index 0000000..52dfdf0
--- /dev/null
+++ b/test/parse_bit.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data BIT in1 3\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_bit4.c b/test/parse_bit4.c
new file mode 100644
index 0000000..4fbd65b
--- /dev/null
+++ b/test/parse_bit4.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data BIT in1 3 4\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_bit_bitnum.c b/test/parse_bit_bitnum.c
new file mode 100644
index 0000000..542557f
--- /dev/null
+++ b/test/parse_bit_bitnum.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data BIT in1 -1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_bit_bitsize.c b/test/parse_bit_bitsize.c
new file mode 100644
index 0000000..66dc66d
--- /dev/null
+++ b/test/parse_bit_bitsize.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data BIT in1 63 2\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_bit_ncols.c b/test/parse_bit_ncols.c
new file mode 100644
index 0000000..a8da6e4
--- /dev/null
+++ b/test/parse_bit_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data BIT in1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_bit_numbits.c b/test/parse_bit_numbits.c
new file mode 100644
index 0000000..ef84c53
--- /dev/null
+++ b/test/parse_bit_numbits.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data BIT in1 1 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_bit_scalar.c b/test/parse_bit_scalar.c
new file mode 100644
index 0000000..e042c11
--- /dev/null
+++ b/test/parse_bit_scalar.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 INT32 3\ndata BIT in1 const\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_carray.c b/test/parse_carray.c
new file mode 100644
index 0000000..070b2a0
--- /dev/null
+++ b/test/parse_carray.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* 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 = "c CARRAY UINT8 1 2 3 4\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_carray_long.c b/test/parse_carray_long.c
new file mode 100644
index 0000000..55c7206
--- /dev/null
+++ b/test/parse_carray_long.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* 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 = "c CARRAY UINT8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_const.c b/test/parse_const.c
new file mode 100644
index 0000000..dbe3579
--- /dev/null
+++ b/test/parse_const.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_const_complex.c b/test/parse_const_complex.c
new file mode 100644
index 0000000..cd28c66
--- /dev/null
+++ b/test/parse_const_complex.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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;2\n";
+  int fd, e1, e2, r = 0;
+#ifdef GD_NO_C99_API
+  double c[2];
+  const double v[2] = {1, 2};
+#else
+  complex double c;
+#endif
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  e1 = gd_error(D);
+
+#ifdef GD_NO_C99_API
+  gd_get_constant(D, "const", GD_COMPLEX128, c);
+#else
+  gd_get_constant(D, "const", GD_COMPLEX128, &c);
+#endif
+  e2 = gd_error(D);
+  
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1,GD_E_OK);
+  CHECKI(e2,GD_E_OK);
+#ifdef GD_NO_C99_API
+  CHECKC(c,v);
+#else
+  CHECKC(c,1 + _Complex_I * 2);
+#endif
+  return r;
+}
diff --git a/test/parse_const_ncols.c b/test/parse_const_ncols.c
new file mode 100644
index 0000000..9c617d8
--- /dev/null
+++ b/test/parse_const_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 RAW UINT8\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_divide.c b/test/parse_divide.c
new file mode 100644
index 0000000..15a9014
--- /dev/null
+++ b/test/parse_divide.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* 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 = "data DIVIDE in1 in2\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_double.c b/test/parse_double.c
new file mode 100644
index 0000000..3f9dd7f
--- /dev/null
+++ b/test/parse_double.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "hex CONST FLOAT64 0xABC\n"
+    "dec CONST FLOAT64 1.3e3\n"
+    "flt CONST FLOAT64 -0x1.3p+3\n"
+    "inf CONST FLOAT64 INF\n"
+    "nan CONST FLOAT64 NAN\n";
+  int fd, e1, e2, e3, e4, e5, e6, r = 0;
+  double d, h, i, n, p;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  e1 = gd_error(D);
+
+  gd_get_constant(D, "dec", GD_FLOAT64, &d);
+  e2 = gd_error(D);
+  
+  gd_get_constant(D, "flt", GD_FLOAT64, &p);
+  e3 = gd_error(D);
+  
+  gd_get_constant(D, "inf", GD_FLOAT64, &i);
+  e4 = gd_error(D);
+  
+  gd_get_constant(D, "nan", GD_FLOAT64, &n);
+  e5 = gd_error(D);
+  
+  gd_get_constant(D, "hex", GD_FLOAT64, &h);
+  e6 = gd_error(D);
+  
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1,GD_E_OK);
+  CHECKI(e2,GD_E_OK);
+  CHECKI(e3,GD_E_OK);
+  CHECKI(e4,GD_E_OK);
+  CHECKI(e5,GD_E_OK);
+  CHECKI(e6,GD_E_OK);
+  CHECKF(h,2748.);
+  CHECKF(d,1300.);
+  CHECKF(p,-9.5);
+  CHECK(isfinite(i),i,"%g","infinity",i);
+  CHECKNAN(n);
+  return r;
+}
diff --git a/test/parse_duplicate.c b/test/parse_duplicate.c
new file mode 100644
index 0000000..520d4f8
--- /dev/null
+++ b/test/parse_duplicate.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW UINT8 1\ndata RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_duplicate_ignore.c b/test/parse_duplicate_ignore.c
new file mode 100644
index 0000000..ab8f2c1
--- /dev/null
+++ b/test/parse_duplicate_ignore.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW UINT8 1\ndata RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_IGNORE_DUPS | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_endian_bad.c b/test/parse_endian_bad.c
new file mode 100644
index 0000000..746b5c4
--- /dev/null
+++ b/test/parse_endian_bad.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "ENDIAN badendianness\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_endian_big.c b/test/parse_endian_big.c
new file mode 100644
index 0000000..b6c2bdf
--- /dev/null
+++ b/test/parse_endian_big.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "ENDIAN big\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_endian_force.c b/test/parse_endian_force.c
new file mode 100644
index 0000000..be406f1
--- /dev/null
+++ b/test/parse_endian_force.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "ENDIAN badendianness\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_FORCE_ENDIAN | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_endian_little.c b/test/parse_endian_little.c
new file mode 100644
index 0000000..baa7c55
--- /dev/null
+++ b/test/parse_endian_little.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "ENDIAN little\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_endian_slash.c b/test/parse_endian_slash.c
new file mode 100644
index 0000000..77f53fd
--- /dev/null
+++ b/test/parse_endian_slash.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "/ENDIAN big\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_eol.c b/test/parse_eol.c
new file mode 100644
index 0000000..c43e7b2
--- /dev/null
+++ b/test/parse_eol.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW UINT8 1\\\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_foffs.c b/test/parse_foffs.c
new file mode 100644
index 0000000..7d7cd60
--- /dev/null
+++ b/test/parse_foffs.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "FRAMEOFFSET 73\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_foffs_include.c b/test/parse_foffs_include.c
new file mode 100644
index 0000000..0389757
--- /dev/null
+++ b/test/parse_foffs_include.c
@@ -0,0 +1,101 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "FRAMEOFFSET 1\nINCLUDE format1\nINCLUDE format2";
+
+  const char *data1 = "dirfile/data1";
+  const char *format1 = "dirfile/format1";
+  const char *format1_data = "data1 RAW UINT8 1\n";
+
+  const char *data2 = "dirfile/data2";
+  const char *format2 = "dirfile/format2";
+  const char *format2_data = "data2 RAW UINT8 1\nFRAMEOFFSET 2";
+
+  int fd, error, error2, error3, r = 0;
+  uint8_t data_data[4] = { 0, 1, 2, 3 };
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  fd = open(data1, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 4);
+  close(fd);
+
+  fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 4);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  gd_getdata(D, "data1", 3, 0, 1, 0, GD_UINT8, data_data);
+
+  error2 = gd_error(D);
+  CHECKI(error2, 0);
+  CHECKU(data_data[0], 2);
+
+  gd_getdata(D, "data2", 3, 0, 1, 0, GD_UINT8, data_data);
+
+  error3 = gd_error(D);
+  CHECKI(error3, 0);
+  CHECKU(data_data[0], 1);
+
+  gd_close(D);
+
+  unlink(format);
+  unlink(format1);
+  unlink(format2);
+  unlink(data1);
+  unlink(data2);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_foffs_slash.c b/test/parse_foffs_slash.c
new file mode 100644
index 0000000..5a235f0
--- /dev/null
+++ b/test/parse_foffs_slash.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "/FRAMEOFFSET 73\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_hex.c b/test/parse_hex.c
new file mode 100644
index 0000000..61fbabe
--- /dev/null
+++ b/test/parse_hex.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with 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>
+
+#define GOOD  "z\\x1y\\xcx\\xDw\\x0eE\\x0Ff\\x10g\\x1ah\\x1Ei"
+#define GOODs "z\x1y\xcx\xDw\x0e" "E\x0F" "f\x10g\x1ah\x1Ei"
+#define BAD0  "a\\x00g"
+#define BAD1  "a\\xg"
+static const char *goods = GOODs;
+
+static int callback(gd_parser_data_t *p, void *extra)
+{
+  int *le = (int*)extra;
+  le[p->linenum - 1] = 1;
+  return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "good STRING " GOOD "\n"
+    "bad0 STRING " BAD0 "\n"
+    "bad1 STRING " BAD1 "\n";
+  int fd, error, r = 0;
+  int le[3] = {0, 0, 0};
+  char s[100];
+  size_t i;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY, callback, le);
+  error = gd_error(D);
+  gd_get_string(D, "good", 100, s);
+  gd_discard(D);
+
+  CHECKI(le[0], 0);
+  CHECKI(le[1], 1);
+  CHECKI(le[2], 1);
+
+  for (i = 0; i < sizeof(GOODs); ++i)
+    CHECKIi(i, s[i], goods[i]);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_hidden.c b/test/parse_hidden.c
new file mode 100644
index 0000000..c2b8773
--- /dev/null
+++ b/test/parse_hidden.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 1\n/HIDDEN data\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_hidden_field.c b/test/parse_hidden_field.c
new file mode 100644
index 0000000..12ac204
--- /dev/null
+++ b/test/parse_hidden_field.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/HIDDEN data\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_hidden_meta.c b/test/parse_hidden_meta.c
new file mode 100644
index 0000000..6873f02
--- /dev/null
+++ b/test/parse_hidden_meta.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 1\n"
+    "data/meta CONST UINT8 1\n"
+    "/HIDDEN data/meta\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_include.c b/test/parse_include.c
new file mode 100644
index 0000000..f0d40e8
--- /dev/null
+++ b/test/parse_include.c
@@ -0,0 +1,63 @@
+/* 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 = "INCLUDE format1\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf, 11);
+  return r;
+}
diff --git a/test/parse_include_absolute.c b/test/parse_include_absolute.c
new file mode 100644
index 0000000..097bce5
--- /dev/null
+++ b/test/parse_include_absolute.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2011-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#if defined GD_NO_GETCWD
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data1 = "INCLUDE ";
+  const char *format_data2 = "/dirfile/format1\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int cwd_size = 2048;
+  char *ptr, *cwd = NULL;
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  gdtest_getcwd(ptr, cwd, cwd_size);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data1, strlen(format_data1));
+  gd_pathwrite(fd, cwd);
+  write(fd, format_data2, strlen(format_data2));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf, 11);
+  free(cwd);
+  return r;
+#endif
+}
diff --git a/test/parse_include_absrel.c b/test/parse_include_absrel.c
new file mode 100644
index 0000000..566fac6
--- /dev/null
+++ b/test/parse_include_absrel.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2011-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#if defined GD_NO_GETCWD
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data1 = "INCLUDE ";
+  const char *format_data2 = "/dirfile/format1\n";
+  const char *format1_data = "INCLUDE format2\n";
+  const char *format2_data = "data RAW UINT8 11\n";
+  int cwd_size = 2048;
+  char *ptr, *cwd = NULL;
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  gdtest_getcwd(ptr, cwd, cwd_size);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data1, strlen(format_data1));
+  gd_pathwrite(fd, cwd);
+  write(fd, format_data2, strlen(format_data2));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf, 11);
+  free(cwd);
+  return r;
+#endif
+}
diff --git a/test/parse_include_affix_ref.c b/test/parse_include_affix_ref.c
new file mode 100644
index 0000000..6130a00
--- /dev/null
+++ b/test/parse_include_affix_ref.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
+ */
+/* 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 A B\n";
+  const char *format1_data = "zata RAW UINT8 11\n/REFERENCE zata\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  const char *ref;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  ref = gd_reference(D, NULL);
+  CHECKS(ref, "AzataB");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_include_dir.c b/test/parse_include_dir.c
new file mode 100644
index 0000000..741fd41
--- /dev/null
+++ b/test/parse_include_dir.c
@@ -0,0 +1,58 @@
+/* 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 <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 *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format_data = "INCLUDE sub\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OPEN_FRAGMENT);
+  return r;
+}
diff --git a/test/parse_include_loop.c b/test/parse_include_loop.c
new file mode 100644
index 0000000..9241cf3
--- /dev/null
+++ b/test/parse_include_loop.c
@@ -0,0 +1,55 @@
+/* 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 *format_data = "INCLUDE format\n";
+  int fd, e, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  e = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e, GD_E_RECURSE_LEVEL);
+  return r;
+}
diff --git a/test/parse_include_nonexistent.c b/test/parse_include_nonexistent.c
new file mode 100644
index 0000000..16f14ed
--- /dev/null
+++ b/test/parse_include_nonexistent.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "INCLUDE non_existent_file\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OPEN_INCLUDE);
+  return r;
+}
diff --git a/test/parse_include_prefix.c b/test/parse_include_prefix.c
new file mode 100644
index 0000000..89971ea
--- /dev/null
+++ b/test/parse_include_prefix.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1 pre\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf, spfaff;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  spf = gd_spf(D, "data");
+  spfaff = gd_spf(D, "predata");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf, 0);
+  CHECKU(spfaff, 11);
+  return r;
+}
diff --git a/test/parse_include_prefix_dup.c b/test/parse_include_prefix_dup.c
new file mode 100644
index 0000000..0404872
--- /dev/null
+++ b/test/parse_include_prefix_dup.c
@@ -0,0 +1,54 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1 pre\npredata RAW UINT8 1\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, e, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  e = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e, GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_include_preprefix.c b/test/parse_include_preprefix.c
new file mode 100644
index 0000000..3187ec5
--- /dev/null
+++ b/test/parse_include_preprefix.c
@@ -0,0 +1,66 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data = "INCLUDE format1 pre\n";
+  const char *format1_data = "INCLUDE format2 PRE\n";
+  const char *format2_data = "data RAW UINT8 11\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf, spf1, spf2;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  spf = gd_spf(D, "data");
+  spf1 = gd_spf(D, "predata");
+  spf2 = gd_spf(D, "prePREdata");
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf, 0);
+  CHECKU(spf1, 0);
+  CHECKU(spf2, 11);
+  return r;
+}
diff --git a/test/parse_include_ref.c b/test/parse_include_ref.c
new file mode 100644
index 0000000..6dcadd4
--- /dev/null
+++ b/test/parse_include_ref.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test 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"
+    "/REFERENCE data\n"
+    "INCLUDE format1\n";
+  const char *format1_data = "zata RAW UINT8 11\n/REFERENCE zata\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  const char *ref;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  ref = gd_reference(D, NULL);
+  CHECKS(ref, "zata");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_include_relabs.c b/test/parse_include_relabs.c
new file mode 100644
index 0000000..2cf28b9
--- /dev/null
+++ b/test/parse_include_relabs.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2011-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#if defined GD_NO_GETCWD
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *format2 = "dirfile/sub/format2";
+  const char *format_data = "INCLUDE sub/format1\n";
+  const char *format1_data1 = "INCLUDE ";
+  const char *format1_data2 = "/dirfile/sub/format2\n";
+  const char *format2_data = "data RAW UINT8 11\n";
+  int cwd_size = 2048;
+  char *ptr, *cwd = NULL;
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  gdtest_getcwd(ptr, cwd, cwd_size);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data1, strlen(format1_data1));
+  gd_pathwrite(fd, cwd);
+  write(fd, format1_data2, strlen(format1_data2));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  CHECKU(spf, 11);
+  free(cwd);
+  return r;
+#endif
+}
diff --git a/test/parse_include_relrel.c b/test/parse_include_relrel.c
new file mode 100644
index 0000000..adadc35
--- /dev/null
+++ b/test/parse_include_relrel.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Test include */
+#include "test.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *subdir = "dirfile/sub";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/sub/format1";
+  const char *format2 = "dirfile/sub/format2";
+  const char *format_data = "INCLUDE sub/format1\n";
+  const char *format1_data = "INCLUDE format2\n";
+  const char *format2_data = "data RAW UINT8 11\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(subdir);
+  rmdir(filedir);
+
+  CHECKU(spf, 11);
+  return r;
+}
diff --git a/test/parse_include_slash.c b/test/parse_include_slash.c
new file mode 100644
index 0000000..2a500fb
--- /dev/null
+++ b/test/parse_include_slash.c
@@ -0,0 +1,63 @@
+/* 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 = "/INCLUDE format1\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "data");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf,11);
+  return r;
+}
diff --git a/test/parse_include_suffix.c b/test/parse_include_suffix.c
new file mode 100644
index 0000000..6d0738f
--- /dev/null
+++ b/test/parse_include_suffix.c
@@ -0,0 +1,57 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "INCLUDE format1 pre post\n";
+  const char *format1_data = "data RAW UINT8 11\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf, spfaff;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  spf = gd_spf(D, "data");
+  spfaff = gd_spf(D, "predatapost");
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf, 0);
+  CHECKU(spfaff, 11);
+  return r;
+}
diff --git a/test/parse_include_sufsuffix.c b/test/parse_include_sufsuffix.c
new file mode 100644
index 0000000..2b6136a
--- /dev/null
+++ b/test/parse_include_sufsuffix.c
@@ -0,0 +1,66 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data = "INCLUDE format1 pre post\n";
+  const char *format1_data = "INCLUDE format2 \"\" POST\n";
+  const char *format2_data = "data RAW UINT8 11\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf, spf1, spf2;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  spf = gd_spf(D, "data");
+  spf1 = gd_spf(D, "predatapost");
+  spf2 = gd_spf(D, "predataPOSTpost");
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(spf, 0);
+  CHECKU(spf1, 0);
+  CHECKU(spf2, 11);
+  return r;
+}
diff --git a/test/parse_index.c b/test/parse_index.c
new file mode 100644
index 0000000..a61e346
--- /dev/null
+++ b/test/parse_index.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "INDEX RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_lincom.c b/test/parse_lincom.c
new file mode 100644
index 0000000..9ad7060
--- /dev/null
+++ b/test/parse_lincom.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "lincom LINCOM 2 in1 1 0 in2 1 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_lincom_ncols1.c b/test/parse_lincom_ncols1.c
new file mode 100644
index 0000000..8562cba
--- /dev/null
+++ b/test/parse_lincom_ncols1.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "lincom LINCOM\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_lincom_ncols2.c b/test/parse_lincom_ncols2.c
new file mode 100644
index 0000000..211f589
--- /dev/null
+++ b/test/parse_lincom_ncols2.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "lincom LINCOM 2 in1 1 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_lincom_nfields.c b/test/parse_lincom_nfields.c
new file mode 100644
index 0000000..2d4c4fe
--- /dev/null
+++ b/test/parse_lincom_nfields.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "lincom LINCOM 4 in1 1 0 in2 1 0 in1 1 0 in2 1 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_lincom_nofields.c b/test/parse_lincom_nofields.c
new file mode 100644
index 0000000..23d5d7c
--- /dev/null
+++ b/test/parse_lincom_nofields.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "lincom LINCOM 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_lincom_non.c b/test/parse_lincom_non.c
new file mode 100644
index 0000000..0f656b6
--- /dev/null
+++ b/test/parse_lincom_non.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "lincom LINCOM in1 1 0 in2 1 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_lincom_non_ncols.c b/test/parse_lincom_non_ncols.c
new file mode 100644
index 0000000..42c41a0
--- /dev/null
+++ b/test/parse_lincom_non_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "lincom LINCOM in1 1 0 in2\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_lincom_scalar.c b/test/parse_lincom_scalar.c
new file mode 100644
index 0000000..9d2481f
--- /dev/null
+++ b/test/parse_lincom_scalar.c
@@ -0,0 +1,57 @@
+/* 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
+ */
+/* 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 3.2\n"
+    "lincom LINCOM 1 in1 const 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_linterp.c b/test/parse_linterp.c
new file mode 100644
index 0000000..6184cb2
--- /dev/null
+++ b/test/parse_linterp.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data LINTERP in1 lut\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_linterp_ncols.c b/test/parse_linterp_ncols.c
new file mode 100644
index 0000000..25dba8c
--- /dev/null
+++ b/test/parse_linterp_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data LINTERP in1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_malias.c b/test/parse_malias.c
new file mode 100644
index 0000000..d084bf3
--- /dev/null
+++ b/test/parse_malias.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 1\n"
+    "cata CONST UINT8 1\n"
+    "/ALIAS data/eata cata\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  return r;
+}
diff --git a/test/parse_malias_dup.c b/test/parse_malias_dup.c
new file mode 100644
index 0000000..7c506f3
--- /dev/null
+++ b/test/parse_malias_dup.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 1\n"
+    "data/cata CONST UINT8 1\n"
+    "/ALIAS eata data\n"
+    "/ALIAS eata/cata data/cata\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_malias_meta.c b/test/parse_malias_meta.c
new file mode 100644
index 0000000..db5c642
--- /dev/null
+++ b/test/parse_malias_meta.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2011-2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 1\n"
+    "data/cata CONST UINT8 1\n"
+    "/ALIAS data/eata data\n";
+  int fd, e1, e2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  e1 = gd_error(D);
+  e2 = gd_validate(D, "data/eata/cata");
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1,0);
+  CHECKI(e2,-1);
+  return r;
+}
diff --git a/test/parse_meta.c b/test/parse_meta.c
new file mode 100644
index 0000000..e759261
--- /dev/null
+++ b/test/parse_meta.c
@@ -0,0 +1,57 @@
+/* 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
+ */
+/* 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 =
+    "parent RAW UINT8 1\n"
+    "META parent child CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_meta_affix.c b/test/parse_meta_affix.c
new file mode 100644
index 0000000..ba47031
--- /dev/null
+++ b/test/parse_meta_affix.c
@@ -0,0 +1,56 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  const char *format1_data =
+    "parent RAW UINT8 1\n"
+    "META parent child CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_meta_alias.c b/test/parse_meta_alias.c
new file mode 100644
index 0000000..04eb6c3
--- /dev/null
+++ b/test/parse_meta_alias.c
@@ -0,0 +1,58 @@
+/* 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
+ */
+/* 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 =
+    "parent RAW UINT8 1\n"
+    "/ALIAS alias parent\n"
+    "META alias child CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_meta_implicit.c b/test/parse_meta_implicit.c
new file mode 100644
index 0000000..c2b63b2
--- /dev/null
+++ b/test/parse_meta_implicit.c
@@ -0,0 +1,64 @@
+/* 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
+ */
+/* 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 =
+    "parent RAW UINT8 1\n"
+    "parent/child CONST UINT8 1\n";
+  signed char c;
+  int fd, error, error2, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  CHECKI(error,0);
+
+  gd_get_constant(D, "parent/child", GD_INT8, &c);
+  error2 = gd_error(D);
+  CHECKI(error2,0);
+  CHECKI(c,1);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_meta_implicit2.c b/test/parse_meta_implicit2.c
new file mode 100644
index 0000000..862c1bf
--- /dev/null
+++ b/test/parse_meta_implicit2.c
@@ -0,0 +1,57 @@
+/* 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
+ */
+/* 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 =
+    "parent RAW UINT8 1\n"
+    "parent/child/extra CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_meta_implicit_affix.c b/test/parse_meta_implicit_affix.c
new file mode 100644
index 0000000..cceb277
--- /dev/null
+++ b/test/parse_meta_implicit_affix.c
@@ -0,0 +1,56 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "/INCLUDE format1 A Z\n";
+  const char *format1_data =
+    "parent RAW UINT8 1\n"
+    "parent/child CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_meta_index.c b/test/parse_meta_index.c
new file mode 100644
index 0000000..9c6a8d6
--- /dev/null
+++ b/test/parse_meta_index.c
@@ -0,0 +1,56 @@
+/* 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
+ */
+/* 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 =
+    "META INDEX child CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_meta_index2.c b/test/parse_meta_index2.c
new file mode 100644
index 0000000..bc17fba
--- /dev/null
+++ b/test/parse_meta_index2.c
@@ -0,0 +1,57 @@
+/* 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
+ */
+/* 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 =
+    "parent RAW UINT8 1\n"
+    "META parent INDEX CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_meta_jump.c b/test/parse_meta_jump.c
new file mode 100644
index 0000000..ef5f29c
--- /dev/null
+++ b/test/parse_meta_jump.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent RAW UINT8 1\n"
+    "META parent child CONST UINT8 1\n"
+    "ALIAS alias parent/child\n"
+    "META alias grandchild CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_meta_malias.c b/test/parse_meta_malias.c
new file mode 100644
index 0000000..e560afb
--- /dev/null
+++ b/test/parse_meta_malias.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent RAW UINT8 1\n"
+    "const CONST UINT8 1\n"
+    "ALIAS parent/alias const\n"
+    "META parent/alias grandchild CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_meta_meta.c b/test/parse_meta_meta.c
new file mode 100644
index 0000000..bd11235
--- /dev/null
+++ b/test/parse_meta_meta.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent RAW UINT8 1\n"
+    "META parent child CONST UINT8 1\n"
+    "META parent/child grandchild CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_meta_parent.c b/test/parse_meta_parent.c
new file mode 100644
index 0000000..f723a64
--- /dev/null
+++ b/test/parse_meta_parent.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "META parent child CONST UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_meta_raw.c b/test/parse_meta_raw.c
new file mode 100644
index 0000000..894759f
--- /dev/null
+++ b/test/parse_meta_raw.c
@@ -0,0 +1,57 @@
+/* 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
+ */
+/* 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 =
+    "parent RAW UINT8 1\n"
+    "META parent child RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_mplex.c b/test/parse_mplex.c
new file mode 100644
index 0000000..2d65c50
--- /dev/null
+++ b/test/parse_mplex.c
@@ -0,0 +1,47 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data MPLEX in1 in2 1 2\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_mplex_ncols.c b/test/parse_mplex_ncols.c
new file mode 100644
index 0000000..a07889e
--- /dev/null
+++ b/test/parse_mplex_ncols.c
@@ -0,0 +1,47 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data MPLEX in1 in2\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_mplex_nomax.c b/test/parse_mplex_nomax.c
new file mode 100644
index 0000000..1f6b26a
--- /dev/null
+++ b/test/parse_mplex_nomax.c
@@ -0,0 +1,53 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data MPLEX in1 in2 6\n";
+  int fd, e1, e2, r = 0;
+  gd_entry_t E;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  e1 = gd_error(D);
+  e2 = gd_entry(D, "data", &E);
+  gd_close(D);
+  gd_free_entry_strings(&E);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1,0);
+  CHECKI(e2,0);
+  CHECKI(E.EN(mplex,period),0);
+  CHECKI(E.EN(mplex,count_val),6);
+  return r;
+}
diff --git a/test/parse_mplex_scalar.c b/test/parse_mplex_scalar.c
new file mode 100644
index 0000000..a3aa0be
--- /dev/null
+++ b/test/parse_mplex_scalar.c
@@ -0,0 +1,47 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data MPLEX in1 in2 a b\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_multiply.c b/test/parse_multiply.c
new file mode 100644
index 0000000..161a7dd
--- /dev/null
+++ b/test/parse_multiply.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data MULTIPLY in1 in2\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_multiply_ncols.c b/test/parse_multiply_ncols.c
new file mode 100644
index 0000000..36eca45
--- /dev/null
+++ b/test/parse_multiply_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data MULTIPLY in1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_name.c b/test/parse_name.c
new file mode 100644
index 0000000..31d3f36
--- /dev/null
+++ b/test/parse_name.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "d/ta RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_name_dot.c b/test/parse_name_dot.c
new file mode 100644
index 0000000..e3d2704
--- /dev/null
+++ b/test/parse_name_dot.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "d.ta RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_name_ext.c b/test/parse_name_ext.c
new file mode 100644
index 0000000..62b2eab
--- /dev/null
+++ b/test/parse_name_ext.c
@@ -0,0 +1,57 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data.txt RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+
+  return r;
+}
diff --git a/test/parse_name_pedantic.c b/test/parse_name_pedantic.c
new file mode 100644
index 0000000..ec2abf1
--- /dev/null
+++ b/test/parse_name_pedantic.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "d.ta RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_PEDANTIC);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_ncols.c b/test/parse_ncols.c
new file mode 100644
index 0000000..878ed41
--- /dev/null
+++ b/test/parse_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "ENDIAN\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_phase.c b/test/parse_phase.c
new file mode 100644
index 0000000..646de17
--- /dev/null
+++ b/test/parse_phase.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data PHASE in1 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_phase_ncols.c b/test/parse_phase_ncols.c
new file mode 100644
index 0000000..0007bd9
--- /dev/null
+++ b/test/parse_phase_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data PHASE in1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_phase_scalar.c b/test/parse_phase_scalar.c
new file mode 100644
index 0000000..fda3b0a
--- /dev/null
+++ b/test/parse_phase_scalar.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 INT32 1\ndata PHASE in1 const\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_polynom.c b/test/parse_polynom.c
new file mode 100644
index 0000000..81863f6
--- /dev/null
+++ b/test/parse_polynom.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "polynom POLYNOM in 1 2 3 4\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_polynom_ncols1.c b/test/parse_polynom_ncols1.c
new file mode 100644
index 0000000..edea942
--- /dev/null
+++ b/test/parse_polynom_ncols1.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "polynom POLYNOM in 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_polynom_ncols2.c b/test/parse_polynom_ncols2.c
new file mode 100644
index 0000000..2d6d214
--- /dev/null
+++ b/test/parse_polynom_ncols2.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "polynom POLYNOM in 1 2 3 4 5 6 7 8 9\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_polynom_scalar.c b/test/parse_polynom_scalar.c
new file mode 100644
index 0000000..6f93483
--- /dev/null
+++ b/test/parse_polynom_scalar.c
@@ -0,0 +1,57 @@
+/* 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
+ */
+/* 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 3.2\n"
+    "polynom POLYNOM in const 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_protect_all.c b/test/parse_protect_all.c
new file mode 100644
index 0000000..70d0b18
--- /dev/null
+++ b/test/parse_protect_all.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "PROTECT all\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_protect_bad.c b/test/parse_protect_bad.c
new file mode 100644
index 0000000..52d501d
--- /dev/null
+++ b/test/parse_protect_bad.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "PROTECT badprotection\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_protect_data.c b/test/parse_protect_data.c
new file mode 100644
index 0000000..cb4d98d
--- /dev/null
+++ b/test/parse_protect_data.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "PROTECT data\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_protect_format.c b/test/parse_protect_format.c
new file mode 100644
index 0000000..ea76b9e
--- /dev/null
+++ b/test/parse_protect_format.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "PROTECT format\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_protect_none.c b/test/parse_protect_none.c
new file mode 100644
index 0000000..ec2b84d
--- /dev/null
+++ b/test/parse_protect_none.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "PROTECT none\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_quote.c b/test/parse_quote.c
new file mode 100644
index 0000000..57f19e5
--- /dev/null
+++ b/test/parse_quote.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "\"da ta\" RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_quote_mismatch.c b/test/parse_quote_mismatch.c
new file mode 100644
index 0000000..64a1261
--- /dev/null
+++ b/test/parse_quote_mismatch.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW UINT8 \"1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_raw.c b/test/parse_raw.c
new file mode 100644
index 0000000..1f4ceac
--- /dev/null
+++ b/test/parse_raw.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_raw_char.c b/test/parse_raw_char.c
new file mode 100644
index 0000000..e323a39
--- /dev/null
+++ b/test/parse_raw_char.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW c 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_raw_ncols.c b/test/parse_raw_ncols.c
new file mode 100644
index 0000000..ef97312
--- /dev/null
+++ b/test/parse_raw_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW UINT8\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_raw_scalar.c b/test/parse_raw_scalar.c
new file mode 100644
index 0000000..39a1dc5
--- /dev/null
+++ b/test/parse_raw_scalar.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 INT8 1\ndata RAW UINT8 const\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_raw_spf.c b/test/parse_raw_spf.c
new file mode 100644
index 0000000..b4793f4
--- /dev/null
+++ b/test/parse_raw_spf.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW UINT8 0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_raw_type.c b/test/parse_raw_type.c
new file mode 100644
index 0000000..4d2ca56
--- /dev/null
+++ b/test/parse_raw_type.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data RAW BADTYPE 11\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_recip.c b/test/parse_recip.c
new file mode 100644
index 0000000..984c22d
--- /dev/null
+++ b/test/parse_recip.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* 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 = "data RECIP in2 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_ref.c b/test/parse_ref.c
new file mode 100644
index 0000000..c7956e4
--- /dev/null
+++ b/test/parse_ref.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "REFERENCE data\ndata RAW UINT8 1";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_ref_nonexistent.c b/test/parse_ref_nonexistent.c
new file mode 100644
index 0000000..90af2fa
--- /dev/null
+++ b/test/parse_ref_nonexistent.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "REFERENCE data\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_BAD_REFERENCE);
+  return r;
+}
diff --git a/test/parse_sbit.c b/test/parse_sbit.c
new file mode 100644
index 0000000..370c10d
--- /dev/null
+++ b/test/parse_sbit.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data SBIT in1 3\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_sort.c b/test/parse_sort.c
new file mode 100644
index 0000000..6b367f1
--- /dev/null
+++ b/test/parse_sort.c
@@ -0,0 +1,96 @@
+/* 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
+ */
+/* Field sort check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "c RAW UINT8 1\n"
+    "d RAW UINT8 1\n"
+    "g RAW UINT8 1\n"
+    "h RAW UINT8 1\n"
+    "i RAW UINT8 1\n"
+    "k RAW UINT8 1\n"
+    "f RAW UINT8 1\n"
+    "b RAW UINT8 1\n"
+    "a RAW UINT8 1\n"
+    "j RAW UINT8 1\n"
+    "e RAW UINT8 1\n";
+  int fd, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_field_list(D);
+
+  if (gd_error(D))
+    r = 1;
+  else if (field_list == NULL)
+    r = 1;
+  else if (field_list[0][0] != 'I')
+    r = 1;
+  else if (field_list[1][0] != 'a')
+    r = 1;
+  else if (field_list[2][0] != 'b')
+    r = 1;
+  else if (field_list[3][0] != 'c')
+    r = 1;
+  else if (field_list[4][0] != 'd')
+    r = 1;
+  else if (field_list[5][0] != 'e')
+    r = 1;
+  else if (field_list[6][0] != 'f')
+    r = 1;
+  else if (field_list[7][0] != 'g')
+    r = 1;
+  else if (field_list[8][0] != 'h')
+    r = 1;
+  else if (field_list[9][0] != 'i')
+    r = 1;
+  else if (field_list[10][0] != 'j')
+    r = 1;
+  else if (field_list[11][0] != 'k')
+    r = 1;
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_string.c b/test/parse_string.c
new file mode 100644
index 0000000..179b33f
--- /dev/null
+++ b/test/parse_string.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "string STRING value\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_string_ncols.c b/test/parse_string_ncols.c
new file mode 100644
index 0000000..57f5012
--- /dev/null
+++ b/test/parse_string_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "string STRING\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_string_null.c b/test/parse_string_null.c
new file mode 100644
index 0000000..3dc31fe
--- /dev/null
+++ b/test/parse_string_null.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "string STRING \"\"\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_utf8.c b/test/parse_utf8.c
new file mode 100644
index 0000000..fc23f04
--- /dev/null
+++ b/test/parse_utf8.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
+ */
+/* 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 = "string STRING \\u65\\u654\\u6543\\u65432\n";
+  int i, fd, error, r = 0;
+#define STRLEN 11
+  const unsigned char u[STRLEN] =
+  {
+    0x65, /* U+65 */
+    0xD9, 0x94, /* U+654 */
+    0xE6, 0x95, 0x83, /* U+6543 */
+    0xF1, 0xA5, 0x90, 0xB2, /* U+65432 */
+    0x00
+  };
+  unsigned char s[STRLEN];
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  CHECKI(error,GD_E_OK);
+
+  gd_get_string(D, "string", STRLEN, (char*)s);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < STRLEN; ++i)
+    CHECKXi(i, s[i], u[i]);
+
+  return r;
+}
diff --git a/test/parse_utf8_invalid.c b/test/parse_utf8_invalid.c
new file mode 100644
index 0000000..d33cff4
--- /dev/null
+++ b/test/parse_utf8_invalid.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 \\u654321\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error,GD_E_FORMAT);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_utf8_zero.c b/test/parse_utf8_zero.c
new file mode 100644
index 0000000..911cf5f
--- /dev/null
+++ b/test/parse_utf8_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 \\u0\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  CHECKI(error,GD_E_FORMAT);
+
+  gd_discard(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/parse_version.c b/test/parse_version.c
new file mode 100644
index 0000000..3d5648d
--- /dev/null
+++ b/test/parse_version.c
@@ -0,0 +1,56 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "VERSION 999999\nBADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_version_89.c b/test/parse_version_89.c
new file mode 100644
index 0000000..a6859d3
--- /dev/null
+++ b/test/parse_version_89.c
@@ -0,0 +1,62 @@
+/* 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
+ */
+/* Test version leakage */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 8\n"
+    "/INCLUDE format1\n"
+    "r WINDOW a b EQ 1.\n";
+  const char *format1_data = "/VERSION 9\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+
+  return r;
+}
diff --git a/test/parse_version_98.c b/test/parse_version_98.c
new file mode 100644
index 0000000..f318f26
--- /dev/null
+++ b/test/parse_version_98.c
@@ -0,0 +1,62 @@
+/* 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
+ */
+/* Test version leakage */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 9\n"
+    "/INCLUDE format1\n"
+    "r WINDOW a b EQ 1.\n";
+  const char *format1_data = "/VERSION 8\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+
+  return r;
+}
diff --git a/test/parse_version_include.c b/test/parse_version_include.c
new file mode 100644
index 0000000..d6019a1
--- /dev/null
+++ b/test/parse_version_include.c
@@ -0,0 +1,62 @@
+/* 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
+ */
+/* VERSION should cross INCLUDEs */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format_data = "VERSION 999999\nINCLUDE format1\n";
+  const char *format1_data = "BADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_PERMISSIVE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_version_p8.c b/test/parse_version_p8.c
new file mode 100644
index 0000000..f1aea59
--- /dev/null
+++ b/test/parse_version_p8.c
@@ -0,0 +1,61 @@
+/* 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
+ */
+/* Test version leakage */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/INCLUDE format1\n"
+    "r.d RECIP a b EQ 1.\n";
+  const char *format1_data = "/VERSION 8\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+
+  return r;
+}
diff --git a/test/parse_version_p9.c b/test/parse_version_p9.c
new file mode 100644
index 0000000..0039221
--- /dev/null
+++ b/test/parse_version_p9.c
@@ -0,0 +1,61 @@
+/* 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
+ */
+/* Test version leakage */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/INCLUDE format1\n"
+    "r.d WINDOW a b EQ 1.\n";
+  const char *format1_data = "/VERSION 9\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+
+  return r;
+}
diff --git a/test/parse_version_permissive.c b/test/parse_version_permissive.c
new file mode 100644
index 0000000..5a6a86e
--- /dev/null
+++ b/test/parse_version_permissive.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "VERSION 999999\nBADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_PERMISSIVE | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_OK);
+  return r;
+}
diff --git a/test/parse_version_slash.c b/test/parse_version_slash.c
new file mode 100644
index 0000000..36c88ce
--- /dev/null
+++ b/test/parse_version_slash.c
@@ -0,0 +1,56 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/VERSION 999999\nBADDIRECTIVE BADTYPE\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_whitespace.c b/test/parse_whitespace.c
new file mode 100644
index 0000000..580d0f5
--- /dev/null
+++ b/test/parse_whitespace.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "da\\ ta RAW UINT8 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_window.c b/test/parse_window.c
new file mode 100644
index 0000000..0fe7ecf
--- /dev/null
+++ b/test/parse_window.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data WINDOW in1 in2 EQ 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/parse_window_ncols.c b/test/parse_window_ncols.c
new file mode 100644
index 0000000..e805008
--- /dev/null
+++ b/test/parse_window_ncols.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 = "data WINDOW in1 XOR 0x10\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_window_op.c b/test/parse_window_op.c
new file mode 100644
index 0000000..04b4ff7
--- /dev/null
+++ b/test/parse_window_op.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Parser check */
+#include "test.h"
+
+#include <stdlib.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 WINDOW in1 in2 = 1\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_FORMAT);
+  return r;
+}
diff --git a/test/parse_window_scalar.c b/test/parse_window_scalar.c
new file mode 100644
index 0000000..aa2cbc1
--- /dev/null
+++ b/test/parse_window_scalar.c
@@ -0,0 +1,55 @@
+/* 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
+ */
+/* 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 INT32 1\ndata WINDOW a b LT const\n";
+  int fd, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/protect_alter.c b/test/protect_alter.c
new file mode 100644
index 0000000..260044f
--- /dev/null
+++ b/test/protect_alter.c
@@ -0,0 +1,72 @@
+/* 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 frameoffset */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nPROTECT format\n";
+  unsigned char data_data[256];
+  int fd, ret, p, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_alter_protection(D, GD_PROTECT_DATA, 0);
+  error = gd_error(D);
+  p = gd_protection(D, 0);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(ret, 0);
+  CHECKI(p, GD_PROTECT_DATA);
+
+  return r;
+}
diff --git a/test/protect_get.c b/test/protect_get.c
new file mode 100644
index 0000000..fb66993
--- /dev/null
+++ b/test/protect_get.c
@@ -0,0 +1,69 @@
+/* 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 protection */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nPROTECT format\n";
+  unsigned char data_data[256];
+  int fd, p, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  p = gd_protection(D, 0);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(p, GD_PROTECT_FORMAT);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put64.c b/test/put64.c
new file mode 100644
index 0000000..cb30f93
--- /dev/null
+++ b/test/put64.c
@@ -0,0 +1,89 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#define _LARGEFILE64_SOURCE 1
+
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d;
+  int fd, n, error, i;
+  struct stat buf;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata64(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf))
+    return 1;
+  if (buf.st_size != 40 + 8 * sizeof(uint8_t))
+    return 1;
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    if (i < 40 || i > 48) {
+      if (d != 0)
+        return 1;
+    } else if (d != i)
+      return 1;
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  if (error)
+    return 1;
+  if (n != 8)
+    return 1;
+
+  return 0;
+}
diff --git a/test/put_bad_code.c b/test/put_bad_code.c
new file mode 100644
index 0000000..aaaa267
--- /dev/null
+++ b/test/put_bad_code.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write a non-existant field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "#\n";
+  unsigned char c = 0;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "no-such-field", 5, 0, 1, 0, GD_UINT8, &c);
+
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n, 0);
+  CHECKI(error,GD_E_BAD_CODE);
+  return r;
+}
diff --git a/test/put_bit.c b/test/put_bit.c
new file mode 100644
index 0000000..50c8e6d
--- /dev/null
+++ b/test/put_bit.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write BIT */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "bit BIT data 2 3\ndata RAW UINT8 8\n";
+  uint8_t c[8];
+  uint8_t d = 0xA5;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  for (i = 0; i < 50; ++i)
+    write(fd, &d, sizeof(uint8_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "bit", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(uint8_t))) {
+    if (i < 40 || i >= 48) {
+      CHECKXi(i,d, 0xA5);
+    } else
+      CHECKXi(i,d,(0xA1 | (i - 40) << 2));
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+
+  return r;
+}
diff --git a/test/put_bof.c b/test/put_bof.c
new file mode 100644
index 0000000..229a61f
--- /dev/null
+++ b/test/put_bof.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 past the beginning-of-field*/
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 10000";
+  uint8_t c[8];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_RANGE);
+  return r;
+}
diff --git a/test/put_carray.c b/test/put_carray.c
new file mode 100644
index 0000000..f8607c1
--- /dev/null
+++ b/test/put_carray.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+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;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_carray(D, "data", GD_UINT8, 8, GD_UINT8, &val, 0);
+  for (i = 0; i < 8; ++i)
+    val[i] = i * (i + 1);
+  gd_put_carray(D, "data", GD_UINT8, &val);
+  error = gd_error(D);
+  gd_close(D);
+
+  /* check */
+  memset(val, 0, 8);
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_get_carray(D, "data", GD_UINT8, &val);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, val[i], i * (i + 1));
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/put_carray_slice.c b/test/put_carray_slice.c
new file mode 100644
index 0000000..519029c
--- /dev/null
+++ b/test/put_carray_slice.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Add a RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0};
+  int r = 0, error, i;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_carray(D, "data", GD_UINT8, 8, GD_UINT8, &val, 0);
+  for (i = 0; i < 8; ++i)
+    val[i] = i * (i + 1);
+  gd_put_carray_slice(D, "data", 2, 3, GD_UINT8, &val);
+  error = gd_error(D);
+  gd_close(D);
+
+  /* check */
+  memset(val, 0, 8);
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_get_carray(D, "data", GD_UINT8, &val);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < 8; ++i)
+    if (i >= 2 && i <= 4) {
+      CHECKIi(i, val[i], (i - 2) * (i - 1));
+    } else
+      CHECKIi(i, val[i], 0);
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/put_char.c b/test/put_char.c
new file mode 100644
index 0000000..315ec98
--- /dev/null
+++ b/test/put_char.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 c/ an old-style type character should fail cleanly */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, (gd_type_t)'c', c);
+  error = gd_error(D);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_TYPE);
+  return r;
+}
diff --git a/test/put_complex128.c b/test/put_complex128.c
new file mode 100644
index 0000000..e1f9fc5
--- /dev/null
+++ b/test/put_complex128.c
@@ -0,0 +1,115 @@
+/* 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
+ */
+/* Attempt to write COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double c[8][2], d[2];
+  const double zero[] = {0, 0};
+#else
+  double complex c[8], d;
+  const double complex zero = 0;
+#endif
+  int fd, i, n, error, r = 0;
+  struct stat buf;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    c[i][0] = 40 + i;
+    c[i][1] = i;
+#else
+    c[i] = 40 + i * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(buf.st_size, 48 * 2 * sizeof(double));
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  if (fd < 0) {
+    perror("open");
+    r = 1;
+  } else {
+    i = 0;
+#ifdef GD_NO_C99_API
+    while (read(fd, d, 2 * sizeof(double)))
+#else
+      while (read(fd, &d, sizeof(double complex)))
+#endif
+      {
+        if (i < 40 || i > 48) {
+          CHECKCi(i,d,zero);
+        } else {
+#ifdef GD_NO_C99_API
+          double v[] = {i, i - 40};
+#else
+          double complex v = i + _Complex_I * (i - 40);
+#endif
+          CHECKCi(i,d,v);
+        }
+        i++;
+      }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n,8);
+
+  return r;
+}
diff --git a/test/put_complex64.c b/test/put_complex64.c
new file mode 100644
index 0000000..56afedf
--- /dev/null
+++ b/test/put_complex64.c
@@ -0,0 +1,111 @@
+/* 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
+ */
+/* Attempt to write COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 8\n";
+#ifdef GD_NO_C99_API
+  float c[8][2], d[2];
+  const float zero[] = {0, 0};
+#else
+  float complex c[8], d;
+  const float complex zero = 0;
+#endif
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i) {
+#ifdef GD_NO_C99_API
+    c[i][0] = 40 + i;
+    c[i][1] = i;
+#else
+    c[i] = 40 + i * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * 2 * sizeof(float));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+#ifdef GD_NO_C99_API
+    while (read(fd, d, 2 * sizeof(float)))
+#else
+      while (read(fd, &d, sizeof(float complex)))
+#endif
+      {
+        if (i < 40 || i > 48) {
+          CHECKCi(i,d,zero);
+        } else {
+#ifdef GD_NO_C99_API
+          float v[] = {i, i - 40};
+#else
+          float complex v = i + _Complex_I * (i - 40);
+#endif
+          CHECKCi(i,d,v);
+        }
+        i++;
+      }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  return r;
+}
diff --git a/test/put_const.c b/test/put_const.c
new file mode 100644
index 0000000..151af3d
--- /dev/null
+++ b/test/put_const.c
@@ -0,0 +1,61 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  uint8_t val = 0;
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
+  gd_add_const(D, "data", GD_UINT8, GD_UINT8, &val, 0);
+  val = 23;
+  gd_put_constant(D, "data", GD_UINT8, &val);
+  error = gd_error(D);
+  gd_close(D);
+
+  /* check */
+  val = 0;
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_get_constant(D, "data", GD_UINT8, &val);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKU(val, 23);
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/put_const_protect.c b/test/put_const_protect.c
new file mode 100644
index 0000000..1f89d82
--- /dev/null
+++ b/test/put_const_protect.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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 *format_data = "data CONST UINT8 8\nPROTECT all\n";
+  uint8_t d = 3;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_put_constant(D, "data", GD_UINT8, &d);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_PROTECTED);
+  CHECKI(n, -1);
+  return r;
+}
diff --git a/test/put_divide.c b/test/put_divide.c
new file mode 100644
index 0000000..795bb7b
--- /dev/null
+++ b/test/put_divide.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write DIVIDE */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "div DIVIDE data data\ndata RAW INT8 8\n";
+  int8_t c[8];
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "div", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (!stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_FIELD_TYPE);
+  return r;
+}
diff --git a/test/put_endian16.c b/test/put_endian16.c
new file mode 100644
index 0000000..a5092ce
--- /dev/null
+++ b/test/put_endian16.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT16 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+static int BigEndian(void)
+{
+  union {
+    long int li;
+    char ch[sizeof(long int)];
+  } un;
+  un.li = 1;
+  return (un.ch[sizeof(long int) - 1] == 1);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  char format_data[1000];
+  uint16_t c = 0x201, d = 0;
+  const int big_endian = BigEndian();
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  sprintf(format_data, "data RAW UINT16 1\nENDIAN %s\n", (big_endian)
+      ? "little" : "big");
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  lseek(fd, 5 * sizeof(uint16_t), SEEK_SET);
+  read(fd, &d, sizeof(uint16_t));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,1);
+  CHECKX(d,0x102);
+
+  return r;
+}
diff --git a/test/put_endian32.c b/test/put_endian32.c
new file mode 100644
index 0000000..977ca86
--- /dev/null
+++ b/test/put_endian32.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT32 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+static int BigEndian(void)
+{
+  union {
+    long int li;
+    char ch[sizeof(long int)];
+  } un;
+  un.li = 1;
+  return (un.ch[sizeof(long int) - 1] == 1);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  char format_data[1000];
+  uint32_t c = 0x2000001, d = 0;
+  const int big_endian = BigEndian();
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  sprintf(format_data, "data RAW UINT32 1\nENDIAN %s\n", (big_endian)
+      ? "little" : "big");
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT32, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  lseek(fd, 5 * sizeof(uint32_t), SEEK_SET);
+  read(fd, &d, sizeof(uint32_t));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,1);
+  CHECKX(d,0x1000002);
+
+  return r;
+}
diff --git a/test/put_endian64.c b/test/put_endian64.c
new file mode 100644
index 0000000..b1defaa
--- /dev/null
+++ b/test/put_endian64.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT64 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+static int BigEndian(void)
+{
+  union {
+    long int li;
+    char ch[sizeof(long int)];
+  } un;
+  un.li = 1;
+  return (un.ch[sizeof(long int) - 1] == 1);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  char format_data[1000];
+  uint64_t c = 0x0203000000040001, d = 0;
+  const int big_endian = BigEndian();
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  sprintf(format_data, "data RAW UINT64 1\nENDIAN %s\n", (big_endian)
+      ? "little" : "big");
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  lseek(fd, 5 * sizeof(uint64_t), SEEK_SET);
+  read(fd, &d, sizeof(uint64_t));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKX(d,0x0100040000000302);
+  CHECKI(n,1);
+  CHECKI(error,0);
+
+  return r;
+}
diff --git a/test/put_endian8.c b/test/put_endian8.c
new file mode 100644
index 0000000..ca26ab3
--- /dev/null
+++ b/test/put_endian8.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 with the opposite endianness */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+static int BigEndian(void)
+{
+  union {
+    long int li;
+    char ch[sizeof(long int)];
+  } un;
+  un.li = 1;
+  return (un.ch[sizeof(long int) - 1] == 1);
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  char format_data[1000];
+  uint8_t c = 0x21, d = 0;
+  const int big_endian = BigEndian();
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  sprintf(format_data, "data RAW UINT8 1\nENDIAN %s\n", (big_endian)
+      ? "little" : "big");
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  lseek(fd, 5 * sizeof(uint8_t), SEEK_SET);
+  read(fd, &d, sizeof(uint8_t));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKX(d,0x21);
+  CHECKI(n,1);
+  CHECKI(error,0);
+  return r;
+}
diff --git a/test/put_endian_complex128_arm.c b/test/put_endian_complex128_arm.c
new file mode 100644
index 0000000..af292cc
--- /dev/null
+++ b/test/put_endian_complex128_arm.c
@@ -0,0 +1,86 @@
+/* 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
+ */
+/* Attempt to write arm-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\nENDIAN little arm\n";
+  unsigned int i;
+#ifdef GD_NO_C99_API
+  const double c[] = {1.5, 2.25};
+#else
+  const double complex c = 1.5 + _Complex_I * 2.25;
+#endif
+  unsigned char x[2 * sizeof(double)] = {
+    0x00, 0x00, 0xF8, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00
+  };
+  unsigned char u[2 * sizeof(double)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+#ifdef GD_NO_C99_API
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+#else
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, &c);
+#endif
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 10 * sizeof(double), SEEK_SET);
+  read(fd, u, 2 * sizeof(double));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < 2 * sizeof(double); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_complex128_big.c b/test/put_endian_complex128_big.c
new file mode 100644
index 0000000..6c4ce04
--- /dev/null
+++ b/test/put_endian_complex128_big.c
@@ -0,0 +1,86 @@
+/* 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
+ */
+/* Attempt to write big-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\nENDIAN big\n";
+  unsigned int i;
+#ifdef GD_NO_C99_API
+  const double c[] = {1.5, 2.25};
+#else
+  const double complex c = 1.5 + _Complex_I * 2.25;
+#endif
+  unsigned char x[2 * sizeof(double)] = {
+    0x3F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+  };
+  unsigned char u[2 * sizeof(double)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+#ifdef GD_NO_C99_API
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+#else
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, &c);
+#endif
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * 2 * sizeof(double), SEEK_SET);
+  read(fd, u, 2 * sizeof(double));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < 2 * sizeof(double); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_complex128_little.c b/test/put_endian_complex128_little.c
new file mode 100644
index 0000000..8f8dcdb
--- /dev/null
+++ b/test/put_endian_complex128_little.c
@@ -0,0 +1,86 @@
+/* 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
+ */
+/* Attempt to write little-endian COMPLEX128 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\nENDIAN little\n";
+  unsigned int i;
+#ifdef GD_NO_C99_API
+  const double c[] = {1.5, 2.25};
+#else
+  const double complex c = 1.5 + _Complex_I * 2.25;
+#endif
+  unsigned char x[2 * sizeof(double)] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x3F,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40
+  };
+  unsigned char u[2 * sizeof(double)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+#ifdef GD_NO_C99_API
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c);
+#else
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, &c);
+#endif
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * 2 * sizeof(double), SEEK_SET);
+  read(fd, u, 2 * sizeof(double));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < 2 * sizeof(double); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_complex64_arm.c b/test/put_endian_complex64_arm.c
new file mode 100644
index 0000000..bcd8ae4
--- /dev/null
+++ b/test/put_endian_complex64_arm.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to write arm-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 1\nENDIAN little arm\n";
+  unsigned int i;
+#ifdef GD_NO_C99_API
+  const float c[] = {1.5, 2.25};
+#else
+  const float complex c = 1.5 + _Complex_I * 2.25;
+#endif
+  unsigned char x[2 * sizeof(float)] = {
+    0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x10, 0x40
+  };
+  unsigned char u[2 * sizeof(float)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+#ifdef GD_NO_C99_API
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+#else
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, &c);
+#endif
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * 2 * sizeof(float), SEEK_SET);
+  read(fd, u, 2 * sizeof(float));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < 2 * sizeof(float); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_complex64_big.c b/test/put_endian_complex64_big.c
new file mode 100644
index 0000000..507558a
--- /dev/null
+++ b/test/put_endian_complex64_big.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to write big-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 1\nENDIAN big\n";
+  unsigned int i;
+#ifdef GD_NO_C99_API
+  const float c[] = {1.5, 2.25};
+#else
+  const float complex c = 1.5 + _Complex_I * 2.25;
+#endif
+  unsigned char x[2 * sizeof(float)] = {
+    0x3F, 0xC0, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00
+  };
+  unsigned char u[2 * sizeof(float)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+#ifdef GD_NO_C99_API
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+#else
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, &c);
+#endif
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * 2 * sizeof(float), SEEK_SET);
+  read(fd, u, 2 * sizeof(float));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < 2 * sizeof(float); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_complex64_little.c b/test/put_endian_complex64_little.c
new file mode 100644
index 0000000..393b29b
--- /dev/null
+++ b/test/put_endian_complex64_little.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to write little-endian COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 1\nENDIAN little\n";
+  unsigned int i;
+#ifdef GD_NO_C99_API
+  const float c[] = {1.5, 2.25};
+#else
+  const float complex c = 1.5 + _Complex_I * 2.25;
+#endif
+  unsigned char x[2 * sizeof(float)] = {
+    0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x10, 0x40
+  };
+  unsigned char u[2 * sizeof(float)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+#ifdef GD_NO_C99_API
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c);
+#else
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, &c);
+#endif
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * 2 * sizeof(float), SEEK_SET);
+  read(fd, u, 2 * sizeof(float));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < 2 * sizeof(float); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_float32_arm.c b/test/put_endian_float32_arm.c
new file mode 100644
index 0000000..7f5a9c7
--- /dev/null
+++ b/test/put_endian_float32_arm.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write arm-endian FLOAT32 (which is just little endian) */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 1\nENDIAN little arm\n";
+  unsigned int i;
+  const float c = 1.5;
+  unsigned char x[sizeof(float)] = { 0x00, 0x00, 0xC0, 0x3F };
+  unsigned char u[sizeof(float)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * sizeof(float), SEEK_SET);
+  read(fd, u, sizeof(float));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < sizeof(float); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_float32_big.c b/test/put_endian_float32_big.c
new file mode 100644
index 0000000..240c6b4
--- /dev/null
+++ b/test/put_endian_float32_big.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write big-endian FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 1\nENDIAN big\n";
+  unsigned int i;
+  const float c = 1.5;
+  unsigned char x[sizeof(float)] = { 0x3F, 0xC0, 0x00, 0x00 };
+  unsigned char u[sizeof(float)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * sizeof(float), SEEK_SET);
+  read(fd, u, sizeof(float));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < sizeof(float); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_float32_little.c b/test/put_endian_float32_little.c
new file mode 100644
index 0000000..a451e9e
--- /dev/null
+++ b/test/put_endian_float32_little.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write little-endian FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 1\nENDIAN little\n";
+  unsigned int i;
+  const float c = 1.5;
+  unsigned char x[sizeof(float)] = { 0x00, 0x00, 0xC0, 0x3F };
+  unsigned char u[sizeof(float)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * sizeof(float), SEEK_SET);
+  read(fd, u, sizeof(float));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < sizeof(float); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_float64_arm.c b/test/put_endian_float64_arm.c
new file mode 100644
index 0000000..e580285
--- /dev/null
+++ b/test/put_endian_float64_arm.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write arm-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\nENDIAN little arm\n";
+  unsigned int i;
+  const double c = 1.5;
+  unsigned char x[sizeof(double)] = {
+    0x00, 0x00, 0xF8, 0x3F, 0x00, 0x00, 0x00, 0x00
+  };
+  unsigned char u[sizeof(double)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * sizeof(double), SEEK_SET);
+  read(fd, u, sizeof(double));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < sizeof(double); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_float64_big.c b/test/put_endian_float64_big.c
new file mode 100644
index 0000000..869d749
--- /dev/null
+++ b/test/put_endian_float64_big.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write big-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\nENDIAN big\n";
+  unsigned int i;
+  const double c = 1.5;
+  unsigned char x[sizeof(double)] = {
+    0x3F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+  };
+  unsigned char u[sizeof(double)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * sizeof(double), SEEK_SET);
+  read(fd, u, sizeof(double));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < sizeof(double); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_endian_float64_little.c b/test/put_endian_float64_little.c
new file mode 100644
index 0000000..89e4007
--- /dev/null
+++ b/test/put_endian_float64_little.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write little-endian FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\nENDIAN little\n";
+  unsigned int i;
+  const double c = 1.5;
+  unsigned char x[sizeof(double)] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x3F
+  };
+  unsigned char u[sizeof(double)];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY);
+  lseek(fd, 5 * sizeof(double), SEEK_SET);
+  read(fd, u, sizeof(double));
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 1);
+  
+  for (i = 0; i < sizeof(double); ++i)
+    CHECKXi(i, u[i], x[i]);
+
+  return r;
+}
diff --git a/test/put_ff.c b/test/put_ff.c
new file mode 100644
index 0000000..192328b
--- /dev/null
+++ b/test/put_ff.c
@@ -0,0 +1,90 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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, r = 0;
+  DIRFILE *D;
+  struct stat buf;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+  CHECKI(buf.st_size, 48 * sizeof(uint8_t));
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  if (fd < 0) {
+    perror("open");
+    r = 1;
+  } else {
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKUi(i,d,0);
+      } else
+        CHECKUi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_float32.c b/test/put_float32.c
new file mode 100644
index 0000000..bfb51d8
--- /dev/null
+++ b/test/put_float32.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write FLOAT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT32 8\n";
+  float c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (float)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(float));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(float))) {
+      if (i < 40 || i > 48) {
+        CHECKFi(i,d,0);
+      } else
+        CHECKFi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_float64.c b/test/put_float64.c
new file mode 100644
index 0000000..16cd776
--- /dev/null
+++ b/test/put_float64.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write FLOAT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 8\n";
+  double c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 40 + i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(double));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(double))) {
+      if (i < 40 || i > 48) {
+        CHECKFi(i,d,0);
+      } else
+        CHECKFi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_foffs.c b/test/put_foffs.c
new file mode 100644
index 0000000..3557a26
--- /dev/null
+++ b/test/put_foffs.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 with FRAMEOFFSET */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 2\n";
+  uint8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 32 * sizeof(uint8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 24 || i >= 32) {
+        CHECKUi(i,d,0);
+      } else
+        CHECKUi(i,d,i+16);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_fs.c b/test/put_fs.c
new file mode 100644
index 0000000..7057a6b
--- /dev/null
+++ b/test/put_fs.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 0, 8, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(uint8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKUi(i,d,0);
+      } else
+        CHECKUi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_here.c b/test/put_here.c
new file mode 100644
index 0000000..d187a41
--- /dev/null
+++ b/test/put_here.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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;
+  struct stat buf;
+  int fd, i, m, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  m = gd_seek(D, "data", 5, 0, GD_SEEK_WRITE | GD_SEEK_SET);
+  n = gd_putdata(D, "data", GD_HERE, 0, 0, 8, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(uint8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKUi(i,d,0);
+      } else
+        CHECKUi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(m,40);
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_heres.c b/test/put_heres.c
new file mode 100644
index 0000000..7ae7a36
--- /dev/null
+++ b/test/put_heres.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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;
+  struct stat buf;
+  int fd, i, m, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  m = gd_seek(D, "data", 5, 0, GD_SEEK_WRITE | GD_SEEK_SET);
+  n = gd_putdata(D, "data", 0, GD_HERE, 0, 8, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(uint8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKUi(i,d,0);
+      } else
+        CHECKUi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(m,40);
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_int16.c b/test/put_int16.c
new file mode 100644
index 0000000..cd30069
--- /dev/null
+++ b/test/put_int16.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT16 8\n";
+  int16_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int16_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int16_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int16_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_int32.c b/test/put_int32.c
new file mode 100644
index 0000000..9d1673f
--- /dev/null
+++ b/test/put_int32.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT32 8\n";
+  int32_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 40 + i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int32_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int32_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_int64.c b/test/put_int64.c
new file mode 100644
index 0000000..5aab118
--- /dev/null
+++ b/test/put_int64.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write INT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT64 8\n";
+  int64_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 40 + i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_INT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int64_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int64_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_int8.c b/test/put_int8.c
new file mode 100644
index 0000000..3560589
--- /dev/null
+++ b/test/put_int8.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW INT8 8\n";
+  int8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } 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);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_invalid.c b/test/put_invalid.c
new file mode 100644
index 0000000..1df11eb
--- /dev/null
+++ b/test/put_invalid.c
@@ -0,0 +1,48 @@
+/* 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
+ */
+/* Writing data to an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  char c[8];
+  int error, r = 0;
+  DIRFILE *D;
+  size_t n;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKI(n,0);
+
+  CHECKI(error,GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/put_lincom1.c b/test/put_lincom1.c
new file mode 100644
index 0000000..8dc81a2
--- /dev/null
+++ b/test/put_lincom1.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write LINCOM 1 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM 1 data 0.5 3.0\ndata RAW INT8 8\n";
+  int8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d, (i - 3) * 2);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_lincom2.c b/test/put_lincom2.c
new file mode 100644
index 0000000..8112546
--- /dev/null
+++ b/test/put_lincom2.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write LINCOM 2 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "lincom LINCOM 2 data 0.5 3.0 data 1.0 2.0\ndata RAW INT8 8\n";
+  int8_t c[8];
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (!stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_FIELD_TYPE);
+  return r;
+}
diff --git a/test/put_lincom_noin.c b/test/put_lincom_noin.c
new file mode 100644
index 0000000..ef81809
--- /dev/null
+++ b/test/put_lincom_noin.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write LINCOM 1 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "lincom LINCOM 1 data 0.5 3.0\n";
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_CODE);
+  return r;
+}
diff --git a/test/put_linterp.c b/test/put_linterp.c
new file mode 100644
index 0000000..3d00d2f
--- /dev/null
+++ b/test/put_linterp.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write LINTERP */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW INT8 8\n";
+  int8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  t = fopen(table, "wt");
+  for (i = 0; i < 10; ++i)
+    fprintf(t, "%i %i\n", i * 6, i * 3);
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i * 2);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(table);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_linterp_noin.c b/test/put_linterp_noin.c
new file mode 100644
index 0000000..eae7c6c
--- /dev/null
+++ b/test/put_linterp_noin.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write LINTERP */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\n";
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  t = fopen(table, "wt");
+  for (i = 0; i < 10; ++i)
+    fprintf(t, "%i %i\n", i * 6, i * 3);
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(table);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_CODE);
+  return r;
+}
diff --git a/test/put_linterp_nomono.c b/test/put_linterp_nomono.c
new file mode 100644
index 0000000..52c2933
--- /dev/null
+++ b/test/put_linterp_nomono.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write LINTERP */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW INT8 8\n";
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  t = fopen(table, "wt");
+  for (i = 0; i < 10; ++i)
+    fprintf(t, "%i %i\n", i * 6, (i - 5) * (i - 5));
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(table);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error, GD_E_DOMAIN);
+
+  return r;
+}
diff --git a/test/put_linterp_notab.c b/test/put_linterp_notab.c
new file mode 100644
index 0000000..e07ea60
--- /dev/null
+++ b/test/put_linterp_notab.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write LINCOM 1 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW INT8 8\n";
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_OPEN_LINFILE);
+  return r;
+}
diff --git a/test/put_linterp_reverse.c b/test/put_linterp_reverse.c
new file mode 100644
index 0000000..6830597
--- /dev/null
+++ b/test/put_linterp_reverse.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write LINTERP */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *table = "dirfile/table";
+  const char *format_data = "linterp LINTERP data ./table\ndata RAW INT8 8\n";
+  int8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+  FILE *t;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  t = fopen(table, "wt");
+  for (i = 0; i < 10; ++i)
+    fprintf(t, "%i %i\n", i, 100 - i);
+  fclose(t);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,100 - i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(table);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_mplex.c b/test/put_mplex.c
new file mode 100644
index 0000000..d2488ab
--- /dev/null
+++ b/test/put_mplex.c
@@ -0,0 +1,81 @@
+/* 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"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *count = "dirfile/count";
+  const char *format_data =
+    "mplex MPLEX data count 1 3\n"
+    "count RAW UINT8 8\n"
+    "data RAW UINT8 8\n";
+  unsigned char c[8], d[8];
+  unsigned char data_data[256];
+  int i, n, m, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (unsigned char)i;
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256);
+  close(i);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] %= 3;
+
+  i = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256);
+  close(i);
+
+  for (i = 0; i < 8; ++i)
+    d[i] = 80 + i;
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &d);
+  error = gd_error(D);
+  m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
+
+  gd_close(D);
+
+  unlink(count);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  CHECKI(m, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i, c[i], ((i % 3) == 0) ? 80 + i : 40 + i);
+
+  return r;
+}
diff --git a/test/put_multiply.c b/test/put_multiply.c
new file mode 100644
index 0000000..8c43588
--- /dev/null
+++ b/test/put_multiply.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write MULTIPLY */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "mult MULTIPLY data data\ndata RAW INT8 8\n";
+  int8_t c[8];
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "mult", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (!stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_FIELD_TYPE);
+  return r;
+}
diff --git a/test/put_null.c b/test/put_null.c
new file mode 100644
index 0000000..55eef54
--- /dev/null
+++ b/test/put_null.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write NULL */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_TYPE);
+  return r;
+}
diff --git a/test/put_off64.c b/test/put_off64.c
new file mode 100644
index 0000000..d19e139
--- /dev/null
+++ b/test/put_off64.c
@@ -0,0 +1,96 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#if (defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64) || __MSVCRT__
+#  define SKIP_TEST
+#else
+#  define _FILE_OFFSET_BITS 64
+#endif
+
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifdef SKIP_TEST
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  uint8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(uint8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+#endif
+}
diff --git a/test/put_phase.c b/test/put_phase.c
new file mode 100644
index 0000000..8109c04
--- /dev/null
+++ b/test/put_phase.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write PHASE */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "phase PHASE data -2\ndata RAW INT8 8\n";
+  int8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "phase", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 46 * sizeof(int8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int8_t))) {
+      if (i < 38 || i > 46) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i + 2);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_phase_noin.c b/test/put_phase_noin.c
new file mode 100644
index 0000000..8e9adef
--- /dev/null
+++ b/test/put_phase_noin.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write PHASE */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "phase PHASE data -2\n";
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "phase", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_CODE);
+  return r;
+}
diff --git a/test/put_polynom1.c b/test/put_polynom1.c
new file mode 100644
index 0000000..8dbcdc8
--- /dev/null
+++ b/test/put_polynom1.c
@@ -0,0 +1,86 @@
+/* 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
+ */
+/* Attempt to write POLYNOM 1 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "polynom POLYNOM data 3.0 0.5\ndata RAW INT8 8\n";
+  int8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(int8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(int8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,(i - 3) * 2);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_polynom2.c b/test/put_polynom2.c
new file mode 100644
index 0000000..5eedc4e
--- /dev/null
+++ b/test/put_polynom2.c
@@ -0,0 +1,71 @@
+/* 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
+ */
+/* Attempt to write POLYNOM */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "polynom POLYNOM data 3.0 2.0 1.0 0.5\ndata RAW INT8 8\n";
+  int8_t c[8];
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (!stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_FIELD_TYPE);
+  return r;
+}
diff --git a/test/put_polynom_noin.c b/test/put_polynom_noin.c
new file mode 100644
index 0000000..4ad2a3b
--- /dev/null
+++ b/test/put_polynom_noin.c
@@ -0,0 +1,64 @@
+/* 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
+ */
+/* Attempt to write POLYNOM */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "polynom POLYNOM data 0.5 3.0\n";
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_CODE);
+  return r;
+}
diff --git a/test/put_protect.c b/test/put_protect.c
new file mode 100644
index 0000000..0f0017b
--- /dev/null
+++ b/test/put_protect.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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 *format_data = "data RAW UINT8 8\nPROTECT all\n";
+  uint8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error, GD_E_PROTECTED);
+
+  return r;
+}
diff --git a/test/put_rdonly.c b/test/put_rdonly.c
new file mode 100644
index 0000000..ccd6d8c
--- /dev/null
+++ b/test/put_rdonly.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write to a read only dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char c[8];
+  int fd, n, error, unlink_data, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_UNENCODED);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(unlink_data, -1);
+  CHECKI(n,0);
+  CHECKI(error,GD_E_ACCMODE);
+  return r;
+}
diff --git a/test/put_recip.c b/test/put_recip.c
new file mode 100644
index 0000000..897cbd8
--- /dev/null
+++ b/test/put_recip.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write DIVIDE */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "div RECIP data 1000.\ndata RAW INT8 8\n";
+  int8_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "div", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } 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);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_recurse.c b/test/put_recurse.c
new file mode 100644
index 0000000..bb9e56b
--- /dev/null
+++ b/test/put_recurse.c
@@ -0,0 +1,60 @@
+/* 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
+ */
+/* Attempting to resove a recursively defined field should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "in1 RAW UINT8 11\n"
+    "lincom LINCOM 1 lincom 1 0\n";
+  unsigned char c[8];
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_RECURSE_LEVEL);
+  return r;
+}
diff --git a/test/put_repr.c b/test/put_repr.c
new file mode 100644
index 0000000..8db10a0
--- /dev/null
+++ b/test/put_repr.c
@@ -0,0 +1,69 @@
+/* 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
+ */
+/* Attempt to write COMPLEX64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX64 8\n";
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 40 + i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "data.r", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_REPR);
+  CHECKI(n,0);
+
+  return r;
+}
diff --git a/test/put_rofs.c b/test/put_rofs.c
new file mode 100644
index 0000000..576e646
--- /dev/null
+++ b/test/put_rofs.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write a read-only dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 1\n";
+  unsigned char c = 0;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0555));
+
+  /* ensure filesystem honours read-onlyness */
+  if ((fd = open(data, O_RDWR)) >= 0 || errno != EACCES) {
+    if (fd >= 0)
+      close(fd);
+    unlink(format);
+    unlink(data);
+    rmdir(filedir);
+    return 77;
+  }
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c);
+
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_RAW_IO);
+  return r;
+}
diff --git a/test/put_sbit.c b/test/put_sbit.c
new file mode 100644
index 0000000..bbe8a3b
--- /dev/null
+++ b/test/put_sbit.c
@@ -0,0 +1,84 @@
+/* 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
+ */
+/* Attempt to write BIT */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "bit SBIT data 2 3\ndata RAW INT8 8\n";
+  int8_t c[8];
+  int8_t d = 0xA5;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  for (i = 0; i < 50; ++i)
+    write(fd, &d, sizeof(int8_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "bit", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  i = 0;
+  while (read(fd, &d, sizeof(int8_t))) {
+    if (i < 40 || i >= 48) {
+      CHECKIi(i,d,-91);
+    } else
+      CHECKIi(i,d,(-95 | (i - 40) << 2));
+    i++;
+  }
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_sf.c b/test/put_sf.c
new file mode 100644
index 0000000..4970cb5
--- /dev/null
+++ b/test/put_sf.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 0, 40, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_ss.c b/test/put_ss.c
new file mode 100644
index 0000000..24028d5
--- /dev/null
+++ b/test/put_ss.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 0, 40, 0, 8, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint8_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_string.c b/test/put_string.c
new file mode 100644
index 0000000..978dbc9
--- /dev/null
+++ b/test/put_string.c
@@ -0,0 +1,59 @@
+/* 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 RAW field */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  char string[1024] = "";
+  int error, 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);
+
+  /* check */
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_get_string(D, "data", 1023, string);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKS(string,"some other string");
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/put_string_protect.c b/test/put_string_protect.c
new file mode 100644
index 0000000..cd06187
--- /dev/null
+++ b/test/put_string_protect.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT8 */
+#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 *format_data = "data STRING UINT8\nPROTECT all\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_put_string(D, "data", "some string");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error, GD_E_PROTECTED);
+
+  return r;
+}
diff --git a/test/put_type.c b/test/put_type.c
new file mode 100644
index 0000000..ac3db8b
--- /dev/null
+++ b/test/put_type.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write an invalid type */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 8\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UNKNOWN, NULL);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_TYPE);
+  return r;
+}
diff --git a/test/put_uint16.c b/test/put_uint16.c
new file mode 100644
index 0000000..30f4f44
--- /dev/null
+++ b/test/put_uint16.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8], d;
+  struct stat buf;
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (uint16_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(uint16_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint16_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_uint32.c b/test/put_uint32.c
new file mode 100644
index 0000000..2f184df
--- /dev/null
+++ b/test/put_uint32.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT32 8\n";
+  uint32_t c[8], d, i;
+  struct stat buf;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 40 + i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(uint32_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint32_t))) {
+      if (i < 40 || i > 48) {
+        CHECKIi(i,d,0);
+      } else
+        CHECKIi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_uint64.c b/test/put_uint64.c
new file mode 100644
index 0000000..5953e4f
--- /dev/null
+++ b/test/put_uint64.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT64 8\n";
+  uint64_t c[8], d, i;
+  struct stat buf;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = 40 + i;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  } else {
+    CHECKI(buf.st_size, 48 * sizeof(uint64_t));
+
+    fd = open(data, O_RDONLY | O_BINARY);
+    i = 0;
+    while (read(fd, &d, sizeof(uint64_t))) {
+      if (i < 40 || i > 48) {
+        CHECKUi(i,d,0);
+      } else
+        CHECKUi(i,d,i);
+      i++;
+    }
+    close(fd);
+  }
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/put_window.c b/test/put_window.c
new file mode 100644
index 0000000..d158d69
--- /dev/null
+++ b/test/put_window.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to write WINDOW */
+#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 = "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;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 8; ++i)
+    c[i] = (int8_t)(40 + i);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED);
+  n = gd_putdata(D, "window", 5, 0, 1, 0, GD_INT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  if (!stat(data, &buf)) {
+    perror("stat");
+    r = 1;
+  }
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error,GD_E_BAD_FIELD_TYPE);
+  return r;
+}
diff --git a/test/put_zero.c b/test/put_zero.c
new file mode 100644
index 0000000..e99d71b
--- /dev/null
+++ b/test/put_zero.c
@@ -0,0 +1,60 @@
+/* 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>
+#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 UINT16 8\n";
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE);
+  n = gd_putdata(D, "data", 0, 0, 0, 0, GD_UINT8, NULL);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,0);
+  CHECKI(error, 0);
+
+  return r;
+}
diff --git a/test/ref.c b/test/ref.c
new file mode 100644
index 0000000..a751ecd
--- /dev/null
+++ b/test/ref.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 RAW UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    "REFERENCE data2\n"
+    ;
+
+  const char *data1 = "dirfile/data1";
+  const char *data2 = "dirfile/data2";
+
+  uint8_t data_data[4] = { 0, 1, 2, 3 };
+  int fd, error, error2, r = 0;
+  DIRFILE *D;
+  off_t nf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data1, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 4);
+  close(fd);
+
+  fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+
+  nf = gd_nframes(D);
+
+  error2 = gd_error(D);
+  CHECKI(error2,0);
+  CHECKI(nf,3);
+
+  gd_close(D);
+
+  unlink(format);
+  unlink(data1);
+  unlink(data2);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/ref_none.c b/test/ref_none.c
new file mode 100644
index 0000000..debe297
--- /dev/null
+++ b/test/ref_none.c
@@ -0,0 +1,84 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 RAW UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    ;
+
+  const char *data1 = "dirfile/data1";
+  const char *data2 = "dirfile/data2";
+
+  uint8_t data_data[4] = { 0, 1, 2, 3 };
+  int fd, error, error2, r = 0;
+  DIRFILE *D;
+  off_t nf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data1, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 4);
+  close(fd);
+
+  fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  nf = gd_nframes(D);
+
+  error2 = gd_error(D);
+  CHECKI(error2, 0);
+  CHECKI(nf,4);
+
+  gd_close(D);
+
+  unlink(format);
+  unlink(data1);
+  unlink(data2);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/ref_two.c b/test/ref_two.c
new file mode 100644
index 0000000..00a1116
--- /dev/null
+++ b/test/ref_two.c
@@ -0,0 +1,86 @@
+/* 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
+ */
+/* Parser check */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "REFERENCE data1\n"
+    "data1 RAW UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    "REFERENCE data2\n"
+    ;
+
+  const char *data1 = "dirfile/data1";
+  const char *data2 = "dirfile/data2";
+
+  uint8_t data_data[4] = { 0, 1, 2, 3 };
+  int fd, error, error2, r = 0;
+  DIRFILE *D;
+  off_t nf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data1, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 4);
+  close(fd);
+
+  fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+
+  nf = gd_nframes(D);
+
+  error2 = gd_error(D);
+  CHECKI(error2, 0);
+  CHECKI(nf,3);
+
+  gd_close(D);
+
+  unlink(format);
+  unlink(data1);
+  unlink(data2);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/repr_a.c b/test/repr_a.c
new file mode 100644
index 0000000..d8f6f83
--- /dev/null
+++ b/test/repr_a.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\n";
+  double c[8];
+#ifdef GD_NO_C99_API
+  double data_data[100][2];
+#else
+  double complex data_data[100];
+#endif
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 100; ++i) {
+#ifdef GD_NO_C99_API
+    const double v = i * 3.14159265358979323846 / 5.;
+    data_data[i][0] = cos(v);
+    data_data[i][1] = sin(v);
+#else
+    data_data[i] = cexp(_Complex_I * i * 3.14159265358979323846 / 5.);
+#endif
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 200 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data.a", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i],carg(data_data[5 + i]));
+
+  return r;
+}
diff --git a/test/repr_float32.c b/test/repr_float32.c
new file mode 100644
index 0000000..54f871b
--- /dev/null
+++ b/test/repr_float32.c
@@ -0,0 +1,84 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as FLOAT32 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  float c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i, c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/repr_float64.c b/test/repr_float64.c
new file mode 100644
index 0000000..a7c6f07
--- /dev/null
+++ b/test/repr_float64.c
@@ -0,0 +1,84 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as FLOAT64 */
+#include "test.h"
+
+#include <math.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  double c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i, c[i], 40 + i);
+
+  return r;
+}
diff --git a/test/repr_i.c b/test/repr_i.c
new file mode 100644
index 0000000..4d3e3e8
--- /dev/null
+++ b/test/repr_i.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\n";
+  double c[8];
+#ifdef GD_NO_C99_API
+  double data_data[100][2];
+#else
+  double complex data_data[100];
+#endif
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 100; ++i) {
+#ifdef GD_NO_C99_API
+    const double v = i * 3.14159265358979323846 / 5.;
+    data_data[i][0] = cos(v);
+    data_data[i][1] = sin(v);
+#else
+    data_data[i] = cexp(_Complex_I * i * 3.14159265358979323846 / 5.);
+#endif
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 200 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data.i", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(n,8);
+  CHECKI(error,0);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i],cimag(data_data[5 + i]));
+
+  return r;
+}
diff --git a/test/repr_int16.c b/test/repr_int16.c
new file mode 100644
index 0000000..bbb4972
--- /dev/null
+++ b/test/repr_int16.c
@@ -0,0 +1,84 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as INT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  int16_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    if (c[i] != 40 + i)
+      CHECKIi(i,c[i], 40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/repr_int32.c b/test/repr_int32.c
new file mode 100644
index 0000000..0530b60
--- /dev/null
+++ b/test/repr_int32.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as INT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  int32_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i],40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/repr_int64.c b/test/repr_int64.c
new file mode 100644
index 0000000..1a3adfa
--- /dev/null
+++ b/test/repr_int64.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  uint64_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i],40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/repr_int8.c b/test/repr_int8.c
new file mode 100644
index 0000000..66ee8e8
--- /dev/null
+++ b/test/repr_int8.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as INT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  int8_t c[8];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/repr_m.c b/test/repr_m.c
new file mode 100644
index 0000000..105d9ce
--- /dev/null
+++ b/test/repr_m.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\n";
+  double c[8];
+#ifdef GD_NO_C99_API
+  double data_data[100][2];
+#else
+  double complex data_data[100];
+#endif
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 100; ++i) {
+#ifdef GD_NO_C99_API
+    const double v = i * 3.14159265358979323846 / 5.;
+    data_data[i][0] = cos(v);
+    data_data[i][1] = sin(v);
+#else
+    data_data[i] = cexp(_Complex_I * i * 3.14159265358979323846 / 5.);
+#endif
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 200 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data.m", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i], cabs(data_data[5 + i]));
+
+  return r;
+}
diff --git a/test/repr_r.c b/test/repr_r.c
new file mode 100644
index 0000000..2ea466d
--- /dev/null
+++ b/test/repr_r.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 1\n";
+  double c[8];
+#ifdef GD_NO_C99_API
+  double data_data[100][2];
+#else
+  double complex data_data[100];
+#endif
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 100; ++i) {
+#ifdef GD_NO_C99_API
+    const double v = i * 3.14159265358979323846 / 5.;
+    data_data[i][0] = cos(v);
+    data_data[i][1] = sin(v);
+#else
+    data_data[i] = cexp(_Complex_I * i * 3.14159265358979323846 / 5.);
+#endif
+  }
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 200 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data.r", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i],creal(data_data[5 + i]));
+
+  return r;
+}
diff --git a/test/repr_real_a.c b/test/repr_real_a.c
new file mode 100644
index 0000000..3fd9624
--- /dev/null
+++ b/test/repr_real_a.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Attempt to read argument representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\n";
+  double c[8];
+  double data_data[100];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 100; ++i)
+    data_data[i] = sin(i * 3.14159265358979323846 / 5.);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 100 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data.a", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i],(data_data[i] > 0) ? 3.14159265358979323846 : 0);
+
+  return r;
+}
diff --git a/test/repr_real_i.c b/test/repr_real_i.c
new file mode 100644
index 0000000..48aa323
--- /dev/null
+++ b/test/repr_real_i.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Attempt to read imaginary representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\n";
+  double c[8];
+  double data_data[100];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 100; ++i)
+    data_data[i] = sin(i * 3.14159265358979323846 / 5.);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 100 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data.i", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i],0);
+
+  return r;
+}
diff --git a/test/repr_real_m.c b/test/repr_real_m.c
new file mode 100644
index 0000000..a927d9c
--- /dev/null
+++ b/test/repr_real_m.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Attempt to read modulus representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\n";
+  double c[8];
+  double data_data[100];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 100; ++i)
+    data_data[i] = sin(i * 3.14159265358979323846 / 5.);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 100 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data.m", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i],fabs(data_data[5 + i]));
+
+  return r;
+}
diff --git a/test/repr_real_r.c b/test/repr_real_r.c
new file mode 100644
index 0000000..1743387
--- /dev/null
+++ b/test/repr_real_r.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* Attempt to read real representation */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <math.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW FLOAT64 1\n";
+  double c[8];
+  double data_data[100];
+  int i, n, error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 100; ++i)
+    data_data[i] = sin(i * 3.14159265358979323846 / 5.);
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 100 * sizeof(double));
+  close(i);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data.r", 5, 0, 8, 0, GD_FLOAT64, &c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i],data_data[5 + i]);
+
+  return r;
+}
diff --git a/test/repr_uint16.c b/test/repr_uint16.c
new file mode 100644
index 0000000..5d2b4f9
--- /dev/null
+++ b/test/repr_uint16.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as UINT16 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  uint16_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/repr_uint32.c b/test/repr_uint32.c
new file mode 100644
index 0000000..9fa0e02
--- /dev/null
+++ b/test/repr_uint32.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as UINT32 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  uint32_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/repr_uint64.c b/test/repr_uint64.c
new file mode 100644
index 0000000..b4e4a6d
--- /dev/null
+++ b/test/repr_uint64.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as UINT64 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  uint64_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/repr_uint8.c b/test/repr_uint8.c
new file mode 100644
index 0000000..66c0727
--- /dev/null
+++ b/test/repr_uint8.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to read COMPLEX128 as UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW COMPLEX128 8\n";
+#ifdef GD_NO_C99_API
+  double data_data[256][2];
+#else
+  double complex data_data[256];
+#endif
+  uint8_t c[8], i;
+  int fd, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd) {
+#ifdef GD_NO_C99_API
+    data_data[fd][0] = data_data[fd][1] = fd;
+#else
+    data_data[fd] = fd * (1 + _Complex_I);
+#endif
+  }
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 512 * sizeof(double));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i], 40 + i);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/seek64.c b/test/seek64.c
new file mode 100644
index 0000000..4c4365d
--- /dev/null
+++ b/test/seek64.c
@@ -0,0 +1,76 @@
+/* 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
+ */
+/* gd_seek() */
+#define _LARGEFILE64_SOURCE 1
+
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, e1, e2, r = 0;
+  off64_t m, n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek64(D, "data", 6, 0, GD_SEEK_SET);
+  e1 = gd_error(D);
+  n = gd_tell64(D, "data");
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(m, 48);
+  CHECKI(n, 48);
+
+  return r;
+}
diff --git a/test/seek_cur.c b/test/seek_cur.c
new file mode 100644
index 0000000..427ab7d
--- /dev/null
+++ b/test/seek_cur.c
@@ -0,0 +1,75 @@
+/* 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
+ */
+/* 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);
+  gd_seek(D, "data", 6, 0, GD_SEEK_SET);
+  m = gd_seek(D, "data", -3, 0, GD_SEEK_CUR);
+  e1 = gd_error(D);
+  n = gd_tell(D, "data");
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(m, 24);
+  CHECKI(n, 24);
+
+  return r;
+}
diff --git a/test/seek_end.c b/test/seek_end.c
new file mode 100644
index 0000000..b8e8743
--- /dev/null
+++ b/test/seek_end.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* 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", -2, 0, GD_SEEK_END);
+  e1 = gd_error(D);
+  n = gd_tell(D, "data");
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(m, 240);
+  CHECKI(n, 240);
+
+  return r;
+}
diff --git a/test/seek_foffs.c b/test/seek_foffs.c
new file mode 100644
index 0000000..48cf0a2
--- /dev/null
+++ b/test/seek_foffs.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* 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\nFRAMEOFFSET 5\n";
+  unsigned char data_data[256];
+  int fd, e1, e2, r = 0;
+  off_t m, n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  m = gd_seek(D, "data", 6, 0, GD_SEEK_SET);
+  e1 = gd_error(D);
+  n = gd_tell(D, "data");
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(m, 48);
+  CHECKI(n, 48);
+
+  return r;
+}
diff --git a/test/seek_foffs2.c b/test/seek_foffs2.c
new file mode 100644
index 0000000..cc6d1d3
--- /dev/null
+++ b/test/seek_foffs2.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"
+
+#include <stdlib.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 = "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;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  memset(data_data, 0, 256);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+
+  for (i = 0; i < 10; ++i) {
+    s = gd_seek(D, "data", i, 0, GD_SEEK_SET);
+    e = gd_error(D);
+    t = gd_tell(D, "data"); 
+    CHECKIi(i, s, i);
+    CHECKIi(i, e, GD_E_OK);
+    CHECKIi(i, t, i);
+  }
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/seek_neg.c b/test/seek_neg.c
new file mode 100644
index 0000000..4d31067
--- /dev/null
+++ b/test/seek_neg.c
@@ -0,0 +1,70 @@
+/* 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
+ */
+/* 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, r = 0;
+  off_t m;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  m = gd_seek(D, "data", -3, 0, GD_SEEK_CUR);
+  e1 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, GD_E_RANGE);
+  CHECKI(m, -1);
+
+  return r;
+}
diff --git a/test/seek_set.c b/test/seek_set.c
new file mode 100644
index 0000000..4c7158e
--- /dev/null
+++ b/test/seek_set.c
@@ -0,0 +1,74 @@
+/* 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
+ */
+/* 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", 6, 0, GD_SEEK_SET);
+  e1 = gd_error(D);
+  n = gd_tell(D, "data");
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(m, 48);
+  CHECKI(n, 48);
+
+  return r;
+}
diff --git a/test/sie_get_big.c b/test/sie_get_big.c
new file mode 100644
index 0000000..1671a86
--- /dev/null
+++ b/test/sie_get_big.c
@@ -0,0 +1,68 @@
+/* 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
+ */
+/* Attempt to read big-endian SIE data */
+#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 big\n";
+  unsigned char c[16];
+  const uint8_t data_data[] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32
+  };
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+  for (i = 0; i < 16; ++i)
+    CHECKIi(i,c[i], (i <= 8) ? 0x22 : 0x32);
+
+  return r;
+}
diff --git a/test/sie_get_little.c b/test/sie_get_little.c
new file mode 100644
index 0000000..bc83c48
--- /dev/null
+++ b/test/sie_get_little.c
@@ -0,0 +1,68 @@
+/* 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
+ */
+/* Attempt to read little-endian SIE data */
+#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";
+  unsigned char c[16];
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+  for (i = 0; i < 16; ++i)
+    CHECKIi(i,c[i], (i <= 8) ? 0x22 : 0x32);
+
+  return r;
+}
diff --git a/test/sie_move_from.c b/test/sie_move_from.c
new file mode 100644
index 0000000..7e61aec
--- /dev/null
+++ b/test/sie_move_from.c
@@ -0,0 +1,84 @@
+/* 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
+ */
+/* Attempt to decompress an SIE file */
+#include "test.h"
+
+#include <stdlib.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_sie = "dirfile/data.sie";
+  const char *data_raw = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n";
+  uint8_t check[0x31];
+  const uint8_t data_in[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  const uint8_t data_out[] = {
+    0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
+    0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
+    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
+    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
+    0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32,
+    0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32
+  };
+  DIRFILE *D;
+  int fd, i, error, r = 0, unlink_data_sie, unlink_data_raw;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data_sie, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_in, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_alter_encoding(D, GD_UNENCODED, 0, 1);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data_raw, O_RDONLY | O_BINARY);
+  read(fd, check, 0x31);
+  close(fd);
+
+  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
new file mode 100644
index 0000000..738b514
--- /dev/null
+++ b/test/sie_move_to.c
@@ -0,0 +1,84 @@
+/* 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
+ */
+/* Attempt to compress an SIE file */
+#include "test.h"
+
+#include <stdlib.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data_sie = "dirfile/data.sie";
+  const char *data_raw = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING none\n/ENDIAN little\n";
+  uint8_t check[27];
+  const uint8_t data_out[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  const uint8_t data_in[] = {
+    0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
+    0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
+    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
+    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
+    0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32,
+    0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32
+  };
+  DIRFILE *D;
+  int fd, i, error, r = 0, unlink_data_sie, unlink_data_raw;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data_raw, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_in, 0x31 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_alter_encoding(D, GD_SIE_ENCODED, 0, 1);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data_sie, O_RDONLY | O_BINARY);
+  read(fd, check, 27);
+  close(fd);
+
+  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
new file mode 100644
index 0000000..1ae9fd4
--- /dev/null
+++ b/test/sie_nframes_big.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 2011, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read little-endian SIE data */
+#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 1\n/ENCODING sie\n/ENDIAN big\n";
+  const uint8_t data_data[] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32
+  };
+  DIRFILE *D;
+  off_t n;
+  int fd, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 9 * 3 * sizeof(uint8_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_nframes(D);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0x31);
+
+  return r;
+}
diff --git a/test/sie_nframes_little.c b/test/sie_nframes_little.c
new file mode 100644
index 0000000..c9c1a62
--- /dev/null
+++ b/test/sie_nframes_little.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 2011, 2015 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read little-endian SIE data */
+#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 1\n/ENCODING sie\n/ENDIAN little\n";
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  DIRFILE *D;
+  off_t n;
+  int fd, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 9 * 3 * sizeof(uint8_t));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_nframes(D);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  CHECKI(error, 0);
+  CHECKI(n, 0x31);
+
+  return r;
+}
diff --git a/test/sie_put_append.c b/test/sie_put_append.c
new file mode 100644
index 0000000..c3b0df8
--- /dev/null
+++ b/test/sie_put_append.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n";
+  unsigned char c[16] = {
+    0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34,
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
+  };
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42,
+  };
+#define NREC 4
+  const uint8_t data_out[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42,
+    0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34
+  };
+  uint8_t check[(NREC + 1) * 9];
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+  ssize_t l;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 2 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  l = read(fd, check, (NREC + 1) * 9);
+  close(fd);
+  CHECKI(l, NREC * 9);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < 4 * 9; ++i)
+    CHECKXi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_append2.c b/test/sie_put_append2.c
new file mode 100644
index 0000000..6d6223e
--- /dev/null
+++ b/test/sie_put_append2.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n";
+  unsigned char c[16] = {
+    0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34,
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
+  };
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+  };
+#define NREC 3
+  const uint8_t data_out[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34
+  };
+  uint8_t check[(NREC + 1) * 9];
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+  ssize_t l;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 2 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  l = read(fd, check, (NREC + 1) * 9);
+  close(fd);
+  CHECKI(l, NREC * 9);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < NREC * 9; ++i)
+    CHECKXi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_back.c b/test/sie_put_back.c
new file mode 100644
index 0000000..84efe6c
--- /dev/null
+++ b/test/sie_put_back.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 <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";
+  unsigned char c[16] = {
+    0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34,
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
+  };
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  const uint8_t data_out[] = {
+    0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34,
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  uint8_t check[6 * 9];
+  DIRFILE *D;
+  int fd, i, n1, n2, e1, e2, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n1 = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+  e1 = gd_error(D);
+  CHECKI(n1, 16);
+  CHECKI(e1, 0);
+
+  n2 = gd_putdata(D, "data", 0, 0, 2, 0, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(n2, 16);
+  CHECKI(e2, 0);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  read(fd, check, 6 * 9);
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < 6 * 9; ++i)
+    CHECKXi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_big.c b/test/sie_put_big.c
new file mode 100644
index 0000000..b9018f9
--- /dev/null
+++ b/test/sie_put_big.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to write little-endian SIE data */
+#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 big\n";
+  unsigned char c[16] = {
+    0x23, 0x23, 0x23, 0x34, 0x34, 0x34, 0x34, 0x34,
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
+  };
+  const uint8_t data_data[] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32
+  };
+  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];
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "data", 0, 0x11, 2, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  read(fd, check, 4 * 9);
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+
+  for (i = 0; i < 4 * 9; ++i)
+    CHECKIi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_little.c b/test/sie_put_little.c
new file mode 100644
index 0000000..c6bc389
--- /dev/null
+++ b/test/sie_put_little.c
@@ -0,0 +1,83 @@
+/* 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
+ */
+/* Attempt to write little-endian SIE data */
+#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";
+  unsigned char c[16] = {
+    0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34,
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
+  };
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  const uint8_t data_out[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  uint8_t check[4 * 9];
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  read(fd, check, 4 * 9);
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+
+  for (i = 0; i < 4 * 9; ++i)
+    CHECKIi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_many.c b/test/sie_put_many.c
new file mode 100644
index 0000000..434fc4e
--- /dev/null
+++ b/test/sie_put_many.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";
+  uint8_t c[60], d[60];
+  DIRFILE *D;
+  int i, n1, n2, n3, e1, e2, e3, r = 0;
+
+  rmdirfile();
+
+  for (i = 0; i < 60; ++i)
+    c[i] = i;
+
+  D = gd_open(filedir, GD_RDWR | GD_SIE_ENCODED | GD_CREAT | GD_LITTLE_ENDIAN
+      | GD_VERBOSE);
+  n1 = gd_add_raw(D, "data", GD_UINT8, 20, 0);
+  e1 = gd_error(D);
+  CHECKI(n1, 0);
+  CHECKI(e1, 0);
+  n2 = gd_putdata(D, "data", 0, 10, 0, 60, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(n2, 60);
+  CHECKI(e2, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n3 = gd_getdata(D, "data", 0, 10, 0, 60, GD_UINT8, d);
+  e3 = gd_error(D);
+  CHECKI(n3, 60);
+  CHECKI(e3, 0);
+
+  for (i = 0; i < 60; ++i)
+    CHECKIi(i, c[i], d[i]);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+  return r;
+}
diff --git a/test/sie_put_newo.c b/test/sie_put_newo.c
new file mode 100644
index 0000000..6e12b42
--- /dev/null
+++ b/test/sie_put_newo.c
@@ -0,0 +1,69 @@
+/* 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";
+  uint8_t c[6], d[20];
+  DIRFILE *D;
+  int i, n1, n2, n3, e1, e2, e3, r = 0;
+
+  rmdirfile();
+
+  for (i = 0; i < 6; ++i)
+    c[i] = i + 10;
+
+  D = gd_open(filedir, GD_RDWR | GD_SIE_ENCODED | GD_CREAT | GD_LITTLE_ENDIAN
+      | GD_VERBOSE);
+  n1 = gd_add_raw(D, "data", GD_UINT8, 20, 0);
+  e1 = gd_error(D);
+  CHECKI(n1, 0);
+  CHECKI(e1, 0);
+  n2 = gd_putdata(D, "data", 0, 10, 0, 6, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(n2, 6);
+  CHECKI(e2, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n3 = gd_getdata(D, "data", 0, 0, 0, 20, GD_UINT8, d);
+  e3 = gd_error(D);
+  CHECKI(n3, 16);
+  CHECKI(e3, 0);
+
+  for (i = 0; i < 16; ++i)
+    if (i < 10)
+      CHECKIi(i, d[i], 0);
+    else
+      CHECKIi(i, d[i], c[i - 10]);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+  return r;
+}
diff --git a/test/sie_put_newo0.c b/test/sie_put_newo0.c
new file mode 100644
index 0000000..cfc54ce
--- /dev/null
+++ b/test/sie_put_newo0.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"
+
+#include <stdlib.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  uint8_t check[9];
+  uint8_t c[6], d[16];
+  DIRFILE *D;
+  int fd, i, j, n1, n2, n3, e1, e2, e3, r = 0;
+
+  rmdirfile();
+
+  for (i = 0; i < 6; ++i)
+    c[i] = i;
+
+  D = gd_open(filedir, GD_RDWR | GD_SIE_ENCODED | GD_CREAT | GD_LITTLE_ENDIAN
+      | GD_VERBOSE);
+  n1 = gd_add_raw(D, "data", GD_UINT8, 20, 0);
+  e1 = gd_error(D);
+  CHECKI(n1, 0);
+  CHECKI(e1, 0);
+  n2 = gd_putdata(D, "data", 0, 10, 0, 6, GD_UINT8, c);
+  e2 = gd_error(D);
+  CHECKI(n2, 6);
+  CHECKI(e2, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n3 = gd_getdata(D, "data", 0, 0, 0, 16, GD_UINT8, d);
+  e3 = gd_error(D);
+  CHECKI(n3, 16);
+  CHECKI(e3, 0);
+
+  for (i = 0; i < 16; ++i)
+    if (i < 10)
+      CHECKIi(i, d[i], 0);
+    else
+      CHECKIi(i, d[i], c[i - 10]);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+
+  j = 0;
+  while (read(fd, check, 9) == 9) {
+    CHECKIi(j * 10 + 0, check[0], 10 + j);
+    for (i = 1; i < 8; ++i)
+      CHECKIi(j * 10 + i, check[i], 0);
+    CHECKIi(j * 10 + 8, check[8], j);
+    j++;
+  }
+  CHECKI(j, 6);
+
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+  return r;
+}
diff --git a/test/sie_put_pad.c b/test/sie_put_pad.c
new file mode 100644
index 0000000..e93278b
--- /dev/null
+++ b/test/sie_put_pad.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with 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";
+  unsigned char c[16] = {
+    0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34,
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
+  };
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12
+  };
+#define NREC 4
+  const uint8_t data_out[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34
+  };
+  uint8_t check[NREC * 9];
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 1 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  read(fd, check, NREC * 9);
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+
+  for (i = 0; i < NREC * 9; ++i)
+    CHECKXi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_pad0.c b/test/sie_put_pad0.c
new file mode 100644
index 0000000..e9eab4d
--- /dev/null
+++ b/test/sie_put_pad0.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n";
+  unsigned char c[16] = {
+    0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34,
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
+  };
+  const uint8_t data_data[] = {
+    0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+  };
+#define NREC 4
+  const uint8_t data_out[] = {
+    0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34
+  };
+  uint8_t check[(1 + NREC) * 9];
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+  ssize_t l;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 2 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  CHECKI(error, 0);
+  CHECKI(n, 16);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  l = read(fd, check, (1 + NREC) * 9);
+  close(fd);
+  CHECKI(l, NREC * 9);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < NREC * 9; ++i)
+    CHECKXi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_trunc.c b/test/sie_put_trunc.c
new file mode 100644
index 0000000..9831303
--- /dev/null
+++ b/test/sie_put_trunc.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n";
+  unsigned char c[0x32];
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  const uint8_t data_out[] = {
+    0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43
+  };
+  uint8_t check[2 * 9];
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+  ssize_t l;
+
+  memset(c, 0x43, 0x32);
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "data", 0, 0, 0, 0x32, GD_UINT8, c);
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 0x32);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  l = read(fd, check, 2 * 9);
+  CHECKI(l, 9);
+  close(fd);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < 9; ++i)
+    CHECKXi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_trunc2.c b/test/sie_put_trunc2.c
new file mode 100644
index 0000000..53f2b17
--- /dev/null
+++ b/test/sie_put_trunc2.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n";
+  unsigned char c[0x32];
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+#define NREC 2
+  const uint8_t data_out[] = {
+    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29
+  };
+  uint8_t check[(NREC + 1) * 9];
+  DIRFILE *D;
+  int fd, i, n, error, r = 0;
+  ssize_t l;
+
+  memset(c, 0x29, 0x32);
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  n = gd_putdata(D, "data", 0, 2, 0, 0x32, GD_UINT8, c);
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 0x32);
+
+  gd_discard(D);
+
+  fd = open(data, O_RDONLY | O_BINARY);
+  l = read(fd, check, (NREC + 1) * 9);
+  close(fd);
+  CHECKI(l, NREC * 9);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  for (i = 0; i < NREC * 9; ++i)
+    CHECKXi(i, check[i], data_out[i]);
+
+  return r;
+}
diff --git a/test/sie_put_trunc_nf.c b/test/sie_put_trunc_nf.c
new file mode 100644
index 0000000..47f13bc
--- /dev/null
+++ b/test/sie_put_trunc_nf.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>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data.sie";
+  const char *format_data = "/ENCODING sie\n/ENDIAN little\n";
+  unsigned char c[] = {1, 1, 2, 1};
+  DIRFILE *D;
+  int fd, n1, n2, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_add_raw(D, "data", GD_UINT8, 1, 0);
+  gd_putdata(D, "data", 0, 0, 0, 4, GD_UINT8, c);
+  gd_raw_close(D, "data");
+  n1 = gd_nframes(D);
+  CHECKI(n1, 4);
+
+  gd_putdata(D, "data", 0, 2, 0, 2, GD_UINT8, c);
+  n2 = gd_nframes(D);
+  CHECKI(n2, 4);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/sie_sync.c b/test/sie_sync.c
new file mode 100644
index 0000000..9956aca
--- /dev/null
+++ b/test/sie_sync.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"
+
+#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";
+  unsigned char c[16] = {
+    0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34,
+    0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34
+  };
+  const uint8_t data_data[] = {
+    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+    0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22,
+    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32
+  };
+  DIRFILE *D;
+  int fd, n, error, r = 0;
+
+  rmdirfile();
+  mkdir(filedir, 0777); 
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 3 * 9 * sizeof(unsigned char));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c);
+
+  n = gd_flush(D, "data");
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKI(n, 0);
+
+  gd_discard(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/slim_get.c b/test/slim_get.c
new file mode 100644
index 0000000..f2ba453
--- /dev/null
+++ b/test/slim_get.c
@@ -0,0 +1,100 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Attempt to read UINT8 */
+#include "test.h"
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+#ifndef TEST_SLIM
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *slimdata = "dirfile/data.slm";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+#ifdef USE_SLIM
+  int i;
+#endif
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIM, data);
+  if (gd_system(command)) {
+    perror("command");
+    r = 1;
+  }
+
+#ifdef USE_SLIM
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(slimdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_SLIM
+  CHECKI(error,0);
+  CHECKI(n,8);
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n,0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/slim_nframes.c b/test/slim_nframes.c
new file mode 100644
index 0000000..388e187
--- /dev/null
+++ b/test/slim_nframes.c
@@ -0,0 +1,92 @@
+/* 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 <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_SLIM
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *slimdata = "dirfile/data.slm";
+  const char *format_data = "data RAW UINT16 1\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int i, error, r = 0;
+  size_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (uint16_t)i;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256 * sizeof(uint16_t));
+  close(i);
+
+  /* compress */
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIM, data);
+  if (gd_system(command)) {
+    perror("command");
+    r = 1;
+  }
+
+#ifdef USE_SLIM
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(slimdata);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_SLIM
+  CHECKI(error, 0);
+  CHECKI(n,256);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n,0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/spf.c b/test/spf.c
new file mode 100644
index 0000000..127314e
--- /dev/null
+++ b/test/spf.c
@@ -0,0 +1,58 @@
+/* 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
new file mode 100644
index 0000000..d3c5121
--- /dev/null
+++ b/test/spf_alias.c
@@ -0,0 +1,50 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "data RAW UINT8 11\n/ALIAS alias data\n";
+  int fd, error, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "alias");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(spf,11);
+  return r;
+}
diff --git a/test/spf_alias_meta.c b/test/spf_alias_meta.c
new file mode 100644
index 0000000..f8620ba
--- /dev/null
+++ b/test/spf_alias_meta.c
@@ -0,0 +1,53 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data RAW UINT8 11\n"
+    "data/sub PHASE data 0\n"
+    "/ALIAS alias data\n";
+  int fd, error, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "alias/sub");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(spf,11);
+  return r;
+}
diff --git a/test/spf_alias_missing.c b/test/spf_alias_missing.c
new file mode 100644
index 0000000..53620cf
--- /dev/null
+++ b/test/spf_alias_missing.c
@@ -0,0 +1,50 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "/ALIAS alias data\n";
+  int fd, error, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  spf = gd_spf(D, "alias");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_BAD_CODE);
+  CHECKI(spf,0);
+  return r;
+}
diff --git a/test/spf_divide.c b/test/spf_divide.c
new file mode 100644
index 0000000..562d993
--- /dev/null
+++ b/test/spf_divide.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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 =
+    "in1 RAW UINT8 11\n"
+    "in2 RAW UINT8 13\n"
+    "div DIVIDE in1 in2\n";
+  int fd, r = 0;
+  DIRFILE *D;
+  unsigned int spf;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "div");
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(spf,11);
+  return r;
+}
diff --git a/test/spf_lincom.c b/test/spf_lincom.c
new file mode 100644
index 0000000..bc59139
--- /dev/null
+++ b/test/spf_lincom.c
@@ -0,0 +1,59 @@
+/* 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
+ */
+/* The SPF of a lincom should equal the SPF of the first field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "in1 RAW UINT8 11\n"
+    "in2 RAW UINT8 13\n"
+    "lincom LINCOM 2 in1 1 0 in2 1 0\n";
+  int fd, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "lincom");
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(spf,11);
+  return r;
+}
diff --git a/test/spf_multiply.c b/test/spf_multiply.c
new file mode 100644
index 0000000..8f24821
--- /dev/null
+++ b/test/spf_multiply.c
@@ -0,0 +1,59 @@
+/* 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
+ */
+/* The SPF of a MULTIPLY should equal the SPF of the first field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "in1 RAW UINT8 11\n"
+    "in2 RAW UINT8 13\n"
+    "lincom MULTIPLY in1 in2\n";
+  int fd, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "lincom");
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(spf,11);
+  return r;
+}
diff --git a/test/spf_polynom.c b/test/spf_polynom.c
new file mode 100644
index 0000000..80018ac
--- /dev/null
+++ b/test/spf_polynom.c
@@ -0,0 +1,58 @@
+/* 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
+ */
+/* The SPF of a polynom should equal the SPF of its input field */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "in RAW UINT8 11\n"
+    "polynom POLYNOM in 1 2 1 3\n";
+  int fd, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "polynom");
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(spf,11);
+  return r;
+}
diff --git a/test/spf_recip.c b/test/spf_recip.c
new file mode 100644
index 0000000..b896d83
--- /dev/null
+++ b/test/spf_recip.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <stdlib.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 =
+    "in2 RAW UINT8 13\n"
+    "div RECIP in2 3.\n";
+  int fd, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  spf = gd_spf(D, "div");
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(spf,13);
+  return r;
+}
diff --git a/test/spf_recurse.c b/test/spf_recurse.c
new file mode 100644
index 0000000..ee4872f
--- /dev/null
+++ b/test/spf_recurse.c
@@ -0,0 +1,61 @@
+/* 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
+ */
+/* Attempting to resove a recursively defined field should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "in1 RAW UINT8 11\n"
+    "lincom LINCOM 2 lincom 1 0 in1 1 0\n";
+  int fd, error, r = 0;
+  unsigned int spf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  spf = gd_spf(D, "lincom");
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(spf,0);
+
+  CHECKI(error,GD_E_RECURSE_LEVEL);
+  return r;
+}
diff --git a/test/svlist.c b/test/svlist.c
new file mode 100644
index 0000000..1ec5039
--- /dev/null
+++ b/test/svlist.c
@@ -0,0 +1,81 @@
+/* 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 <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, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_strings(D);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    int len = strlen(field_list[i]);
+    CHECKIi(i,len,5);
+
+    CHECKIi(i,field_list[i][0], 'v');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 'l');
+    CHECKIi(i,field_list[i][3], 'u');
+
+    if (field_list[i][4] < '1' || field_list[i][4] > '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i,3);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/svlist_hidden.c b/test/svlist_hidden.c
new file mode 100644
index 0000000..98f53ed
--- /dev/null
+++ b/test/svlist_hidden.c
@@ -0,0 +1,73 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 STRING valu1\n"
+    "data2 STRING valu2\n"
+    "/HIDDEN data2\n"
+    "data3 STRING valu3\n"
+    "data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_strings(D);
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    int len = strlen(field_list[i]);
+    CHECKIi(i,len,5);
+
+    CHECKIi(i,field_list[i][0], 'v');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 'l');
+    CHECKIi(i,field_list[i][3], 'u');
+
+    if (field_list[i][4] != '1' && field_list[i][4] != '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i,2);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/svlist_invalid.c b/test/svlist_invalid.c
new file mode 100644
index 0000000..4e70717
--- /dev/null
+++ b/test/svlist_invalid.c
@@ -0,0 +1,46 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char **fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_strings(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error,GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/svlist_meta.c b/test/svlist_meta.c
new file mode 100644
index 0000000..3ad1484
--- /dev/null
+++ b/test/svlist_meta.c
@@ -0,0 +1,85 @@
+/* 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
+ */
+/* Retrieve a list of string metafields */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent STRING valu1\n"
+    "META parent data1 STRING valu1\n"
+    "META parent data2 STRING valu2\n"
+    "META parent data3 STRING valu3\n"
+    "META parent data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_nfields(D);
+  gd_nmfields(D, "parent");
+  gd_nmfields_by_type(D, "parent", GD_STRING_ENTRY);
+  field_list = gd_mstrings(D, "parent");
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    int len = strlen(field_list[i]);
+    CHECKIi(i,len,5);
+
+    CHECKIi(i,field_list[i][0], 'v');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 'l');
+    CHECKIi(i,field_list[i][3], 'u');
+
+    if (field_list[i][4] < '1' || field_list[i][4] > '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i,3);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/svlist_meta_hidden.c b/test/svlist_meta_hidden.c
new file mode 100644
index 0000000..94bcacd
--- /dev/null
+++ b/test/svlist_meta_hidden.c
@@ -0,0 +1,77 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent STRING valu1\n"
+    "META parent data1 STRING valu1\n"
+    "META parent data2 STRING valu2\n"
+    "/HIDDEN parent/data2\n"
+    "META parent data3 STRING valu3\n"
+    "META parent data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_nfields(D);
+  gd_nmfields(D, "parent");
+  gd_nmfields_by_type(D, "parent", GD_STRING_ENTRY);
+  field_list = gd_mstrings(D, "parent");
+
+  error = gd_error(D);
+  CHECKI(error, 0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    int len = strlen(field_list[i]);
+    CHECKIi(i,len,5);
+
+    CHECKIi(i,field_list[i][0], 'v');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 'l');
+    CHECKIi(i,field_list[i][3], 'u');
+
+    if (field_list[i][4] != '1' && field_list[i][4] != '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i,2);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/svlist_meta_invalid.c b/test/svlist_meta_invalid.c
new file mode 100644
index 0000000..30fc116
--- /dev/null
+++ b/test/svlist_meta_invalid.c
@@ -0,0 +1,46 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char **fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_mstrings(D, "parent");
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error,GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/table.c b/test/table.c
new file mode 100644
index 0000000..5d25843
--- /dev/null
+++ b/test/table.c
@@ -0,0 +1,67 @@
+/* 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>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "linterp LINTERP INDEX table\n";
+  int fd, error, r = 0;
+  char *path;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  path = gd_linterp_tablename(D, "linterp");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, 0);
+  /* This only checks whether the end of the returned path is what we expect.
+   * This should work, since we can guarantee that both "dirfile" and "data"
+   * aren't symlinks. */
+#if GD_DIRSEP == '/'
+  CHECKEOS(path,"dirfile/table");
+#else
+  CHECKEOS(path,"dirfile\\table");
+#endif
+  free(path);
+
+  return r;
+}
diff --git a/test/table_code.c b/test/table_code.c
new file mode 100644
index 0000000..0121fa0
--- /dev/null
+++ b/test/table_code.c
@@ -0,0 +1,59 @@
+/* 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>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data = "linterp LINTERP INDEX table\n";
+  int fd, error, r = 0;
+  const char *path;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  path = gd_linterp_tablename(D, "bata");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_CODE);
+  CHECKP(path);
+
+  return r;
+}
diff --git a/test/table_type.c b/test/table_type.c
new file mode 100644
index 0000000..4d4bc2f
--- /dev/null
+++ b/test/table_type.c
@@ -0,0 +1,59 @@
+/* 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>
+#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, error, r = 0;
+  const char *path;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  path = gd_linterp_tablename(D, "data");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_BAD_FIELD_TYPE);
+  CHECKP(path);
+
+  return r;
+}
diff --git a/test/tell.c b/test/tell.c
new file mode 100644
index 0000000..c9e5029
--- /dev/null
+++ b/test/tell.c
@@ -0,0 +1,73 @@
+/* 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
+ */
+/* gd_tell() */
+#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 n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL);
+  e1 = gd_error(D);
+  n = gd_tell(D, "data");
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(n, 48);
+
+  return r;
+}
diff --git a/test/tell64.c b/test/tell64.c
new file mode 100644
index 0000000..79ada4a
--- /dev/null
+++ b/test/tell64.c
@@ -0,0 +1,75 @@
+/* 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
+ */
+/* gd_tell() */
+#define _LARGEFILE64_SOURCE 1
+
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *format_data = "data RAW UINT8 8\n";
+  unsigned char data_data[256];
+  int fd, e1, e2, r = 0;
+  off64_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL);
+  e1 = gd_error(D);
+  n = gd_tell64(D, "data");
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1, 0);
+  CHECKI(e2, 0);
+  CHECKI(n, 48);
+
+  return r;
+}
diff --git a/test/tell_multidiv.c b/test/tell_multidiv.c
new file mode 100644
index 0000000..6d260af
--- /dev/null
+++ b/test/tell_multidiv.c
@@ -0,0 +1,70 @@
+/* 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
+ */
+/* 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\nphase PHASE data 1\ndiv DIVIDE phase data";
+  unsigned char data_data[256];
+  int fd, error, r = 0;
+  off_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY);
+  n = gd_tell(D, "div");
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_DOMAIN);
+  CHECKI(n, -1);
+
+  return r;
+}
diff --git a/test/test.h b/test/test.h
new file mode 100644
index 0000000..bba416c
--- /dev/null
+++ b/test/test.h
@@ -0,0 +1,161 @@
+/* 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
+ */
+#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>
+#endif
+
+#if defined HAVE__ISNAN && ! defined HAVE_ISNAN
+#define isnan _isnan
+#endif
+
+#if defined HAVE__FINITE && \
+  (! defined HAVE_DECL_ISFINITE || HAVE_DECL_ISFINITE == 0)
+#define isfinite _finite
+#endif
+
+/* System call kludge for Win32 */
+#if defined __MSVCRT__ && defined MSYS_SHELL
+#include <process.h>
+int gd_system(const char* command)
+{
+  int ret = -1;
+
+  char* ptr = malloc(strlen(command) + 3);
+  sprintf(ptr, "\"%s\"", command);
+  
+  ret = _spawnlp(_P_WAIT, MSYS_SHELL, MSYS_SHELL, "-c", ptr, NULL); 
+  free(ptr);
+
+  return ret;
+}
+#else
+#define gd_system system
+#endif
+
+/* rm for MSVC */
+#ifdef _WIN32
+#define rmdirfile() system("rmdir /q/s dirfile");
+#else
+#define rmdirfile() chmod("dirfile", 0755); system("rm -rf dirfile");
+#endif
+
+/* sleep for WIN32/64 */
+#if defined _WIN32 || defined _WIN64
+#include <windows.h>
+#define sleep(x) Sleep(1000 * (x))
+#endif
+
+/* path munging for WIN32/64 */
+#if defined _WIN32 || defined _WIN64
+#define gd_pathwrite(x,y) do { \
+  char *ptr; \
+  for (ptr = y; *ptr != '\0'; ++ptr) { \
+    if (*ptr == '\\') write(x,ptr,1); \
+    write(x,ptr,1); \
+  } \
+} while (0)
+#else
+#define gd_pathwrite(x,y) write(x,y,strlen(y))
+#endif
+
+/* getcwd abstraction */
+#if defined HAVE_GETCWD || defined HAVE__GETCWD
+# ifdef HAVE__GETCWD
+#  define getcwd _getcwd
+# endif
+# define gdtest_getcwd(ptr,cwd,cwd_size) \
+  do { \
+    ptr = (char*)realloc(cwd, cwd_size *= 2); \
+    if (ptr == NULL) { \
+      fprintf(stderr, "out of memory for cwd!\n"); \
+      exit(1); \
+    } \
+  } while (!getcwd(cwd = ptr, cwd_size));
+#else
+# define GD_NO_GETCWD
+#endif
+
+
+#define CHECK(e,n,nf,vf,...) \
+  do { if (e) { r = 1; \
+    fprintf(stderr, #n " = " nf " (expected " vf ")\n", __VA_ARGS__); } \
+  } while(0)
+
+#define CHECKi(i,e,n,nf,vf,...) \
+  do { if (e) { r = 1; \
+    fprintf(stderr, #i ":%i " #n " = " nf " (expected " vf ")\n", (int)(i), \
+        __VA_ARGS__); } \
+  } while(0)
+
+#define strcmpn(n,v) (((n) == NULL) ? 1 : strcmp((n),(v)))
+
+#ifdef GD_NO_C99_API
+#define CHECKC(n,v)    CHECK(sqrt(((n)[0]-(v)[0])*((n)[0]-(v)[0]) + \
+      (((n)[1]-(v)[1])*((n)[1]-(v)[1])))>1e-10,n,"%.15g;%.15g","%.15g;%.15g",\
+    creal((n)), cimag((n)), creal((v)), cimag((v)))
+#define CHECKCi(i,n,v) CHECKi(i,sqrt(((n)[0]-(v)[0])*((n)[0]-(v)[0]) + \
+            (((n)[1]-(v)[1])*((n)[1]-(v)[1]))) / cabs((v))>3e-6,n,\
+    "%.15g;%.15g","%.15g;%.15g",creal((n)), cimag((n)), creal((v)), cimag((v)))
+#else
+#define CHECKC(n,v)    CHECK(cabs((n)-(v))>1e-10,n,"%.15g;%.15g","%.15g;%.15g",\
+    creal((n)), cimag((n)), creal((v)), cimag((v)))
+#define CHECKCi(i,n,v) CHECKi(i,cabs((n)-(v)) / cabs((v))>3e-6,n,"%.15g;%.15g",\
+    "%.15g;%.15g",creal((n)), cimag((n)), creal((v)), cimag((v)))
+#endif
+
+#define CHECKF(n,v)    CHECK(fabs((n)-(v))>1e-10,n,"%.15g","%.15g",(double)(n),\
+    (double)(v))
+#define CHECKFi(i,n,v) CHECKi(i,fabs((n)-(v)) > 1e-10,n,"%.15g","%.15g",\
+    (double)(n),(double)(v))
+#define CHECKI(n,v)    CHECK((n) != (v),n,"%lli","%lli",(long long)(n),\
+    (long long)(v))
+#define CHECKIi(i,n,v) CHECKi(i,(long long)(n) != (long long)(v),n,"%lli",\
+    "%lli", (long long)(n),(long long)(v))
+#define CHECKNAN(n)    CHECK(!isnan(n),n,"%.15g","%s",(double)(n),"nan")
+#define CHECKNANi(i,n) CHECKi(i,!isnan(n),n,"%.15g","%s",(double)(n),"nan")
+#define CHECKP(n)      CHECK((n) != NULL,n,"%p","%s",n,"NULL")
+#define CHECKPi(i,n)   CHECKi(i,(n) != NULL,n,"%p","%s",n,"NULL")
+#define CHECKPN(n)     CHECK((n) == NULL,n,"%p","%s",n,"non-NULL")
+#define CHECKPNi(i,n)  CHECKi(i,(n) == NULL,n,"%p","%s",n,"non-NULL")
+#define CHECKS(n,v)    CHECK(strcmpn((n),(v)),n,"\"%s\"","\"%s\"",(n),(v));
+#define CHECKSi(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 CHECKEOS(n,v)  CHECK(strcmp((n) + strlen(n) - sizeof(v) + 1,(v)),n,\
+    "...\"%s\"","\"%s\"",(n) + strlen(n) - sizeof(v) + 1,(v));
+#define CHECKU(n,v)    CHECK((n) != (v),n,"%llu","%llu",\
+    (unsigned long long)(n),(unsigned long long)(v))
+#define CHECKUi(i,n,v) CHECKi(i,(n) != (v),n,"%llu","%llu",\
+    (unsigned long long)(n),(unsigned long long)(v))
+#define CHECKX(n,v)    CHECK((n) != (v),n,"0x%llX","0x%llX",\
+    (unsigned long long)(n),(unsigned long long)(v))
+#define CHECKXi(i,n,v) CHECKi(i,(n) != (v),n,"0x%llX","0x%llX",\
+    (unsigned long long)(n),(unsigned long long)(v))
diff --git a/test/tok_arg.c b/test/tok_arg.c
new file mode 100644
index 0000000..7659683
--- /dev/null
+++ b/test/tok_arg.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";
+  int e1, e2, r = 0;
+  char *tok;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL);
+  e1 = gd_error(D);
+
+  tok = gd_strtok(D, NULL);
+  e2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e1,GD_E_OK);
+  CHECKI(e2,GD_E_ARGUMENT);
+  CHECKP(tok);
+  return r;
+}
diff --git a/test/tok_escape.c b/test/tok_escape.c
new file mode 100644
index 0000000..b9e6527
--- /dev/null
+++ b/test/tok_escape.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General 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 *spec = "string STRING \\ value";
+  int e1, e2, e3, e4, e5, r = 0;
+  char *tok1, *tok2, *tok3, *tok4;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE);
+  e1 = gd_error(D);
+
+  tok1 = gd_strtok(D, spec);
+  e2 = gd_error(D);
+  tok2 = gd_strtok(D, NULL);
+  e3 = gd_error(D);
+  tok3 = gd_strtok(D, NULL);
+  e4 = gd_error(D);
+  tok4 = gd_strtok(D, NULL);
+  e5 = gd_error(D);
+
+  gd_close(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
new file mode 100644
index 0000000..626de8d
--- /dev/null
+++ b/test/tok_quote.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2013 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General 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 *spec = "string STRING \"value\"";
+  int e1, e2, e3, e4, e5, r = 0;
+  char *tok1, *tok2, *tok3, *tok4;
+  DIRFILE *D;
+
+  rmdirfile();
+
+  D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE);
+  e1 = gd_error(D);
+
+  tok1 = gd_strtok(D, spec);
+  e2 = gd_error(D);
+  tok2 = gd_strtok(D, NULL);
+  e3 = gd_error(D);
+  tok3 = gd_strtok(D, NULL);
+  e4 = gd_error(D);
+  tok4 = gd_strtok(D, NULL);
+  e5 = gd_error(D);
+
+  gd_close(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
new file mode 100644
index 0000000..8e7a241
--- /dev/null
+++ b/test/trunc.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Truncating a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int fd, error, unlink_data, stat_format, r = 0;
+  struct stat buf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format, strlen(format));
+  close(fd);
+
+  close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_TRUNC | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  CHECKI(unlink_data, -1);
+
+  stat_format = stat(format, &buf);
+  CHECKI(stat_format, 0);
+  CHECK((buf.st_size > 0),buf.st_size,"%lli","%s",(long long)buf.st_size,"> 0");
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/trunc_dir.c b/test/trunc_dir.c
new file mode 100644
index 0000000..bd55c3a
--- /dev/null
+++ b/test/trunc_dir.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Truncating a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  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;
+  struct stat buf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format, strlen(format));
+  close(fd);
+
+  close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_TRUNC | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  CHECKI(unlink_data, -1);
+
+  stat_format = stat(format, &buf);
+  CHECKI(stat_format, 0);
+  CHECK((buf.st_size > 0),buf.st_size,"%lli","%s",(long long)buf.st_size,"> 0");
+
+  rmdir_sub = rmdir(subdir);
+  CHECKI(rmdir_sub, 0);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/trunc_rdonly.c b/test/trunc_rdonly.c
new file mode 100644
index 0000000..f0e1c0f
--- /dev/null
+++ b/test/trunc_rdonly.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Truncating a read-only dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.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 fd, error, unlink_data, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format, strlen(format));
+  close(fd);
+
+  close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666));
+
+  D = gd_open(filedir, GD_RDONLY | GD_TRUNC);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  CHECKI(unlink_data, 0);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_ACCMODE);
+  return r;
+}
diff --git a/test/trunc_rofs.c b/test/trunc_rofs.c
new file mode 100644
index 0000000..a707d78
--- /dev/null
+++ b/test/trunc_rofs.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2008-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Truncating a read-only dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  int error, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666));
+  close(open(data, O_CREAT | O_EXCL | O_WRONLY, 0666));
+  chmod(filedir, 0555);
+
+  /* ensure filesystem honours read-onlyness */
+  if (!unlink(data) || errno != EACCES) {
+    unlink(format);
+    rmdir(filedir);
+    return 77;
+  }
+
+  D = gd_open(filedir, GD_RDWR | GD_TRUNC);
+  error = gd_error(D);
+  gd_discard(D);
+
+  chmod(filedir, 0777);
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error, GD_E_TRUNC);
+  return r;
+}
diff --git a/test/trunc_truncsub.c b/test/trunc_truncsub.c
new file mode 100644
index 0000000..3294564
--- /dev/null
+++ b/test/trunc_truncsub.c
@@ -0,0 +1,70 @@
+/* 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
+ */
+/* Truncating a dirfile should succeed cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  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;
+  struct stat buf;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+  mkdir(subdir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format, strlen(format));
+  close(fd);
+
+  close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666));
+
+  D = gd_open(filedir, GD_RDWR | GD_TRUNC | GD_TRUNCSUB | GD_VERBOSE);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink_data = unlink(data);
+  CHECKI(unlink_data, -1);
+
+  stat_format = stat(format, &buf);
+  CHECKI(stat_format, 0);
+  CHECK((buf.st_size > 0),buf.st_size,"%lli","%s",(long long)buf.st_size,"> 0");
+
+  rmdir_sub = rmdir(subdir);
+  CHECKI(rmdir_sub, -1);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,GD_E_OK);
+  return r;
+}
diff --git a/test/unclude.c b/test/unclude.c
new file mode 100644
index 0000000..bec2d1d
--- /dev/null
+++ b/test/unclude.c
@@ -0,0 +1,80 @@
+/* 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 <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n";
+  const char *format1_data = "b CONST UINT8 11\n/INCLUDE format2\n";
+  const char *format2_data = "c CONST UINT8 11\n";
+  int fd, ret, error, unlink_format1, unlink_format2, r = 0;
+  unsigned int nfields, nfragments;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_uninclude(D, 1, 0);
+  error = gd_error(D);
+  nfields = gd_nfields(D);
+  nfragments = gd_nfragments(D);
+  gd_close(D);
+
+  unlink_format2 = unlink(format2);
+  unlink_format1 = unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(ret,0);
+  CHECKI(nfields,2);
+  CHECKI(nfragments,1);
+  CHECKI(unlink_format2,0);
+  CHECKI(unlink_format1,0);
+
+  return r;
+}
diff --git a/test/unclude_del.c b/test/unclude_del.c
new file mode 100644
index 0000000..7ff463a
--- /dev/null
+++ b/test/unclude_del.c
@@ -0,0 +1,80 @@
+/* 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 <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n";
+  const char *format1_data = "b CONST UINT8 11\n/INCLUDE format2\n";
+  const char *format2_data = "c CONST UINT8 11\n";
+  int fd, ret, error, unlink_format1, unlink_format2, r = 0;
+  unsigned int nfields, nfragments;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret = gd_uninclude(D, 2, 1);
+  error = gd_error(D);
+  nfields = gd_nfields(D);
+  nfragments = gd_nfragments(D);
+  gd_close(D);
+
+  unlink_format2 = unlink(format2);
+  unlink_format1 = unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(ret,0);
+  CHECKI(nfields,3);
+  CHECKI(nfragments,2);
+  CHECKI(unlink_format2,-1);
+  CHECKI(unlink_format1,0);
+
+  return r;
+}
diff --git a/test/unclude_move.c b/test/unclude_move.c
new file mode 100644
index 0000000..6231eed
--- /dev/null
+++ b/test/unclude_move.c
@@ -0,0 +1,82 @@
+/* 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 <stdio.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n";
+  const char *format1_data = "b CONST UINT8 11\n/INCLUDE format2\n";
+  const char *format2_data = "c CONST UINT8 11\n";
+  int fd, ret1, ret2, error1, error2, r = 0;
+  unsigned int nfields, nfragments;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  ret1 = gd_uninclude(D, 2, 0);
+  error1 = gd_error(D);
+  ret2 = gd_include(D, "format2", 0, 0);
+  error2 = gd_error(D);
+  nfields = gd_nfields(D);
+  nfragments = gd_nfragments(D);
+  gd_close(D);
+
+  unlink(format2);
+  unlink(format1);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1,0);
+  CHECKI(error2,0);
+  CHECKI(ret1,0);
+  CHECKI(ret2,2);
+  CHECKI(nfields,4);
+  CHECKI(nfragments,3);
+
+  return r;
+}
diff --git a/test/version_0.c b/test/version_0.c
new file mode 100644
index 0000000..172736a
--- /dev/null
+++ b/test/version_0.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 0 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/FRAMEOFFSET";
+  const char *format_data = "FRAMEOFFSET RAW c 8\na&b RAW c 8";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "FRAMEOFFSET", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+
+  CHECKI(v,0);
+  CHECKI(l,0);
+  CHECKI(e,0);
+
+  return r;
+}
diff --git a/test/version_0_write.c b/test/version_0_write.c
new file mode 100644
index 0000000..ffe8726
--- /dev/null
+++ b/test/version_0_write.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "FRAMEOFFSET RAW c 8\na&b RAW c 8";
+  int fd, e, q, c, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 0);
+  q = gd_rewrite_fragment(D, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e,0);
+  CHECKI(q,0);
+  CHECKI(c,0);
+
+  return r;
+}
diff --git a/test/version_1.c b/test/version_1.c
new file mode 100644
index 0000000..da67d69
--- /dev/null
+++ b/test/version_1.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 1 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/INCLUDE";
+  const char *format_data = "INCLUDE RAW c 8\nFRAMEOFFSET 1\na&b RAW c 8\n";
+  unsigned char c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "INCLUDE", 5, 0, 1, 0, GD_UINT8, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],32 + i);
+
+  /* Version 1 is forwards compatible with version 2 */
+  CHECKI(v,2);
+  CHECKI(l,2);
+  CHECKI(e,1);
+
+  return r;
+}
diff --git a/test/version_1_write.c b/test/version_1_write.c
new file mode 100644
index 0000000..d828f88
--- /dev/null
+++ b/test/version_1_write.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "INCLUDE RAW c 8\nFRAMEOFFSET 1\na&b RAW c 8\n";
+  int fd, e, q, c, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 1);
+  q = gd_rewrite_fragment(D, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e,1);
+  CHECKI(q,0);
+  CHECKI(c,1);
+
+  return r;
+}
diff --git a/test/version_2.c b/test/version_2.c
new file mode 100644
index 0000000..6ab2190
--- /dev/null
+++ b/test/version_2.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 2 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/INCLUDE";
+  const char *format_data =
+    "INCLUDE RAW c 8\n"
+    "a&b RAW c 8\n"
+    "m MULTIPLY INCLUDE INCLUDE\n";
+  uint16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "m", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],(40 + i) * (40 + i));
+
+  CHECKI(v,2);
+  CHECKI(l,2);
+  CHECKI(e,2);
+
+  return r;
+}
diff --git a/test/version_2_write.c b/test/version_2_write.c
new file mode 100644
index 0000000..84c239d
--- /dev/null
+++ b/test/version_2_write.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 =
+    "INCLUDE RAW c 8\n"
+    "a&b RAW c 8\n"
+    "m MULTIPLY INCLUDE INCLUDE\n";
+  int fd, e, q, c, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 2);
+  q = gd_rewrite_fragment(D, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e,2);
+  CHECKI(q,0);
+  CHECKI(c,2);
+
+  return r;
+}
diff --git a/test/version_3.c b/test/version_3.c
new file mode 100644
index 0000000..2f10c90
--- /dev/null
+++ b/test/version_3.c
@@ -0,0 +1,91 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 3 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/RAW";
+  const char *data = "dirfile/ENDIAN";
+  const char *format_data = "ENDIAN RAW c 8\nINCLUDE RAW\n";
+  const char *format_data1 = "m MULTIPLY ENDIAN ENDIAN\na&b RAW c 8\n";
+  uint16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data1, strlen(format_data1));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "m", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],(40 + i) * (40 + i));
+
+  /* Version 3 is forwards compatible with version 4 */
+  CHECKI(v,4);
+  CHECKI(l,4);
+  CHECKI(e,3);
+
+  return r;
+}
diff --git a/test/version_3_write.c b/test/version_3_write.c
new file mode 100644
index 0000000..66adccb
--- /dev/null
+++ b/test/version_3_write.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 *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;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data1, strlen(format_data1));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 3);
+  q = gd_rewrite_fragment(D, GD_ALL_FRAGMENTS);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+  gd_close(D);
+
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(e,3);
+  CHECKI(q,0);
+  CHECKI(c,3);
+
+  return r;
+}
diff --git a/test/version_4.c b/test/version_4.c
new file mode 100644
index 0000000..1be5a35
--- /dev/null
+++ b/test/version_4.c
@@ -0,0 +1,90 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 4 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/RAW";
+  const char *data = "dirfile/ENDIAN";
+  const char *format_data = "ENDIAN RAW c 8\nINCLUDE RAW\n";
+  const char *format_data1 = "VERSION PHASE ENDIAN 1\na&b RAW c 8\n";
+  uint16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data1, strlen(format_data1));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "VERSION", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],41 + i);
+
+  CHECKI(v,4);
+  CHECKI(l,4);
+  CHECKI(e,4);
+
+  return r;
+}
diff --git a/test/version_4_write.c b/test/version_4_write.c
new file mode 100644
index 0000000..16d8464
--- /dev/null
+++ b/test/version_4_write.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 *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;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data1, strlen(format_data1));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 4);
+  q = gd_rewrite_fragment(D, GD_ALL_FRAGMENTS);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  c = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+  gd_close(D);
+
+  unlink(format);
+  unlink(format1);
+  rmdir(filedir);
+
+  CHECKI(e,4);
+  CHECKI(q,0);
+  CHECKI(c,4);
+
+  return r;
+}
diff --git a/test/version_5.c b/test/version_5.c
new file mode 100644
index 0000000..9140ceb
--- /dev/null
+++ b/test/version_5.c
@@ -0,0 +1,91 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 5 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/a.r";
+  const char *format_data =
+    "/VERSION 5\n"
+#ifdef WORDS_BIGENDIAN
+    "/ENDIAN little\n"
+#else
+    "/ENDIAN big\n"
+#endif
+    "a.r RAW UINT8 8\n"
+    "ENCODING PHASE a.r 0\n";
+  uint16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "a.r", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+
+  CHECKI(v,5);
+  CHECKI(l,5);
+  CHECKI(e,5);
+
+  return r;
+}
diff --git a/test/version_5_strict.c b/test/version_5_strict.c
new file mode 100644
index 0000000..05882e9
--- /dev/null
+++ b/test/version_5_strict.c
@@ -0,0 +1,105 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* CheckStandards Version 5 strictness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int cb(gd_parser_data_t *pdata, void *ll)
+{
+  ((int*)ll)[pdata->linenum - 1] = 1;
+  return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 5\n"
+    "ENDIAN little\n"
+    "X<r RAW UINT8 8\n"
+    "/ENCODING raw\n"
+    "/REFERENCE ar\n"
+    "/PROTECT none\n"
+    "ar RAW UINT8 8\n";
+  uint16_t c[8];
+  int ll[7] = {0, 0, 0, 0, 0, 0, 0};
+  uint16_t d[8];
+  unsigned char data_data[256];
+  int fd, n, error, m, error2, i, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  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_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+  n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  m = gd_getdata(D, "FILEFRAM", 5, 0, 8, 0, GD_UINT16, d);
+  error2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(error2,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 7; ++i)
+    if ((i == 2 || i == 3 || i == 4 || i == 5)) {
+      CHECKIi(i,!ll[i],0);
+    } else
+      CHECKIi(i,ll[i],0);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+
+  CHECKI(m,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,d[i], 5 + i);
+
+  return r;
+}
diff --git a/test/version_5_write.c b/test/version_5_write.c
new file mode 100644
index 0000000..915b90b
--- /dev/null
+++ b/test/version_5_write.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 =
+    "/VERSION 5\n"
+    "/ENDIAN big\n"
+    "a.r RAW UINT8 8\n"
+    "ENCODING PHASE a.r 0\n";
+  int fd, e, q, c, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 5);
+  q = gd_rewrite_fragment(D, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e,5);
+  CHECKI(q,0);
+  CHECKI(c,5);
+
+  return r;
+}
diff --git a/test/version_6.c b/test/version_6.c
new file mode 100644
index 0000000..b7db38a
--- /dev/null
+++ b/test/version_6.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 6 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/a#r";
+  const char *format_data = "/VERSION 6\na\\#r RAW UINT8 8\n";
+  uint16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "a#r", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+
+  /* Version 6 is forward compatible with versions 7 and 8 */
+  CHECKI(v,6);
+  CHECKI(l,GD_DIRFILE_STANDARDS_VERSION);
+  CHECKI(e,6);
+
+  return r;
+}
diff --git a/test/version_6_strict.c b/test/version_6_strict.c
new file mode 100644
index 0000000..c9e1a59
--- /dev/null
+++ b/test/version_6_strict.c
@@ -0,0 +1,108 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Check Standards Version 6 strictness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int cb(gd_parser_data_t *pdata, void *ll)
+{
+  ((int*)ll)[pdata->linenum - 1] = 1;
+  return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 6\n"
+    "X<r RAW UINT8 8\n"
+    "X#r RAW COMPLEX128 8\n"
+    "X.r RAW UINT8 8\n"
+    "Xr POLYNOM INDEX 8 3 1 2\n"
+    "/ENCODING none\n"
+    "/REFERENCE ar\n"
+    "/PROTECT none\n"
+    "c CONST UINT8 3\n"
+    "ar RAW UINT8 8\n";
+  uint16_t c[8];
+  int ll[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+  uint16_t d[8];
+  unsigned char data_data[256];
+  int fd, n, error, m, error2, i, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  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_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+  n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  m = gd_getdata(D, "FILEFRAM", 5, 0, 8, 0, GD_UINT16, d);
+  error2 = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(error2, GD_E_BAD_CODE);
+
+  for (i = 0; i < 10; ++i) {
+    if (i == 1 || i == 2 || i == 3 || i == 4) {
+      CHECKIi(i,!ll[i],0);
+    } else if (i < 1 || i > 4) {
+      CHECKIi(i,ll[i],0);
+    }
+  }
+
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i],40 + i);
+
+  CHECKI(m,0);
+
+  return r;
+}
diff --git a/test/version_6_write.c b/test/version_6_write.c
new file mode 100644
index 0000000..44df61a
--- /dev/null
+++ b/test/version_6_write.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "/VERSION 6\n"
+    "b\\ c CONST UINT8 8\n"
+    "\"a \\#r\" RAW UINT8 b\\ c\n"
+    "/META \"a \\#r\" \\x64\\c\\157 PHASE \"a \\#r\" 0\n";
+  int fd, e, q, c, r = 0;
+  DIRFILE *D;
+  unsigned int s;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 6);
+  q = gd_rewrite_fragment(D, 0);
+  gd_close(D);
+
+  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);
+
+  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
new file mode 100644
index 0000000..109a578
--- /dev/null
+++ b/test/version_7.c
@@ -0,0 +1,84 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 7 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/ar";
+  const char *format_data = "/VERSION 7\nar RAW UINT8 8\nar/q SBIT ar 0 10\n";
+  uint16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "ar/q", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 + i);
+
+  /* Version 7 is forward compatible with version 8 */
+  CHECKI(v,7);
+  CHECKI(l,GD_DIRFILE_STANDARDS_VERSION);
+  CHECKI(e,7);
+
+  return r;
+}
diff --git a/test/version_7_strict.c b/test/version_7_strict.c
new file mode 100644
index 0000000..9919a02
--- /dev/null
+++ b/test/version_7_strict.c
@@ -0,0 +1,98 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Check Standards Version 6 strictness */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int cb(gd_parser_data_t *pdata, void *ll)
+{
+  ((int*)ll)[pdata->linenum - 1] = 1;
+  return GD_SYNTAX_IGNORE;
+}
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 7\n"
+    "X<r RAW UINT8 8\n"
+    "X.r RAW UINT8 8\n"
+    "X\\#r RAW COMPLEX128 8\n"
+    "Xr POLYNOM INDEX 8 3 1 2\n"
+    "ar RAW UINT8 8\n"
+    "ar/c CONST COMPLEX128 3;3\n";
+  uint16_t c[8];
+  int ll[7] = {0, 0, 0, 0, 0, 0, 0};
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  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_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+  n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+
+  for (i = 0; i < 7; ++i) {
+    if (i == 1 || i == 2) {
+      CHECKIi(i,!ll[i], 0);
+    } else if (i < 1 || i > 2) {
+      CHECKIi(i,ll[i],0);
+    }
+  }
+
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKUi(i,c[i],40 +i);
+
+  return r;
+}
diff --git a/test/version_7_write.c b/test/version_7_write.c
new file mode 100644
index 0000000..7bb038a
--- /dev/null
+++ b/test/version_7_write.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 = "/VERSION 7\nar RAW UINT8 8\nar/q SBIT ar 0 10\n";
+  int fd, e, q, c, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 7);
+  q = gd_rewrite_fragment(D, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e,7);
+  CHECKI(q,0);
+  CHECKI(c,7);
+
+  return r;
+}
diff --git a/test/version_8.c b/test/version_8.c
new file mode 100644
index 0000000..520d526
--- /dev/null
+++ b/test/version_8.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+/* Open a Standards Version 8 conformant dirfile */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 8\n"
+    "ar RAW UINT8 8\n"
+    "FRAMEOFFSET DIVIDE ar ar\n"
+    "r RECIP ar 1.\n";
+  double c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "r", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    CHECKFi(i,c[i],1. / (40 + i));
+
+  CHECKI(v,8);
+  CHECKI(l,GD_DIRFILE_STANDARDS_VERSION);
+  CHECKI(e,8);
+
+  return r;
+}
diff --git a/test/version_8_strict.c b/test/version_8_strict.c
new file mode 100644
index 0000000..2e48f12
--- /dev/null
+++ b/test/version_8_strict.c
@@ -0,0 +1,97 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int cb(gd_parser_data_t *pdata, void *ll)
+{
+  ((int*)ll)[pdata->linenum - 1] = 1;
+  return GD_SYNTAX_IGNORE;
+}
+
+#define NLINES 13
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 8\n"
+    "X<r RAW UINT8 8\n"
+    "X.r RAW UINT8 8\n"
+    "X\\#r RAW COMPLEX128 8\n"
+    "Xr POLYNOM INDEX 8 3 1 2\n"
+    "ar RAW UINT8 8\n"
+    "e RECIP 3. Xr\n"
+    "FRAMEOFFSET 3\n"
+    "FRAMEOFFSET RAW UINT8 3\n"
+    "/FRAMEOFFSET 3\n"
+    "e RECIP ar/c Xr\n"
+    "e DIVIDE ar Xr\n"
+    "ar/c CONST COMPLEX128 3;3\n";
+  uint16_t c[8];
+  int ll[NLINES];
+  unsigned char data_data[256];
+  int fd, i, n, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 16);
+  memset(ll, 0, NLINES * sizeof(int));
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+  n = gd_getdata(D, "ar", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+
+  for (i = 0; i < NLINES; ++i) {
+    if (i == 1 || i == 2 || i == 7 || i == 10 || i == 11) {
+      CHECKIi(i,ll[i], 1);
+    } else {
+      CHECKIi(i,ll[i],0);
+    }
+  }
+
+  CHECKI(n,8);
+
+  for (i = 0; i < n; ++i)
+    CHECKUi(i,c[i],16 +i);
+
+  return r;
+}
diff --git a/test/version_8_write.c b/test/version_8_write.c
new file mode 100644
index 0000000..e5217d5
--- /dev/null
+++ b/test/version_8_write.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+#include <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 =
+    "/VERSION 8\n"
+    "ar RAW UINT8 8\n"
+    "FRAMEOFFSET DIVIDE ar ar\n"
+    "r RECIP ar 1.\n";
+  int fd, e, q, c, r = 0;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  e = gd_dirfile_standards(D, 8);
+  q = gd_rewrite_fragment(D, 0);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  c = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  gd_close(D);
+
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(e,8);
+  CHECKI(q,0);
+  CHECKI(c,8);
+
+  return r;
+}
diff --git a/test/version_9.c b/test/version_9.c
new file mode 100644
index 0000000..b81e72a
--- /dev/null
+++ b/test/version_9.c
@@ -0,0 +1,89 @@
+/* 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 "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 *format = "dirfile/format";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 9\n"
+    "ar RAW UINT8 8\n"
+    "/HIDDEN ar\n"
+    "r WINDOW ar ar LT 0x2C\n";
+  double c[8];
+  unsigned char data_data[256];
+  int fd, i, n, error, v, l, e, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n = gd_getdata(D, "r", 5, 0, 1, 0, GD_FLOAT64, c);
+  error = gd_error(D);
+
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  l = gd_dirfile_standards(D, GD_VERSION_LATEST);
+  e = gd_dirfile_standards(D, GD_VERSION_EARLIEST);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+  CHECKI(n,8);
+
+  for (i = 0; i < 8; ++i)
+    if (i >= 4)
+      CHECKNANi(i,c[i]);
+    else
+      CHECKFi(i,c[i],(40 + i));
+
+  CHECKI(v,9);
+  CHECKI(l,GD_DIRFILE_STANDARDS_VERSION);
+  CHECKI(e,9);
+
+  return r;
+}
diff --git a/test/version_9_strict.c b/test/version_9_strict.c
new file mode 100644
index 0000000..8feefcc
--- /dev/null
+++ b/test/version_9_strict.c
@@ -0,0 +1,121 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int cb(gd_parser_data_t *pdata, void *ll)
+{
+  ((int*)ll)[pdata->linenum - 1] = 1;
+  return GD_SYNTAX_IGNORE;
+}
+
+#define NLINES 18
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format1 = "dirfile/format1";
+  const char *format2 = "dirfile/format2";
+  const char *data = "dirfile/ar";
+  const char *format_data =
+    "/VERSION 8\n"  /* 0 */
+    "/INCLUDE format1\n" /* 1 */
+    "w WINDOW INDEX INDEX SET 0x1\n"; /* 2 */
+  const char *format1_data =
+    "\n\n\n"
+    "/VERSION 9\n" /* 3 */
+    "/INCLUDE format2 A Z\n" /* 4 */
+    "/INCLUDE format2 A.Z\n" /* 5 */
+    "Xr RAW COMPLEX128 0xA\n" /* 6 */
+    "Xy POLYNOM INDEX 8 055 0xAE 2\n" /* 7 */
+    "ar WINDOW AdZ INDEX SET 0x1\n" /* 8 */
+    "AINDEXZ PHASE INDEX 0\n" /* 9 */
+    "/HIDDEN Xy\n"; /* 10 */
+  const char *format2_data =
+    "\n\n\n"
+    "\n\n\n\n\n\n\n\n"
+    "c RAW UINT8 1\n" /* 11 */
+    "/HIDDEN c\n" /* 12 */
+    "/REFERENCE c\n" /* 13 */
+    "/VERSION 8\n" /* 14 */
+    "d PHASE INDEX 0\n" /* 15 */
+    "d/c CONST FLOAT64 1\n" /* 16 */
+    "/META d d CONST FLOAT64 1\n"; /* 17 */
+  uint16_t c[8];
+  int ll[NLINES];
+  unsigned char data_data[256];
+  int fd, i, n, v, error, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 16);
+  memset(ll, 0, NLINES * sizeof(int));
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format1_data, strlen(format1_data));
+  close(fd);
+
+  fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format2_data, strlen(format2_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll);
+  error = gd_error(D);
+  v = gd_dirfile_standards(D, GD_VERSION_CURRENT);
+  n = gd_getdata(D, "ar", 4, 0, 8, 0, GD_UINT16, c);
+
+  gd_close(D);
+
+  unlink(data);
+  unlink(format);
+  unlink(format1);
+  unlink(format2);
+  rmdir(filedir);
+
+  CHECKI(error,0);
+
+  for (i = 0; i < NLINES; ++i) {
+    if (i == 2 || i == 5) {
+      CHECKIi(i,ll[i], 1);
+    } else {
+      CHECKIi(i,ll[i],0);
+    }
+  }
+
+  CHECKI(n,8);
+  CHECKI(v,9);
+
+  for (i = 0; i < n; ++i)
+    CHECKUi(i,c[i], (i & 1) ? 4 + i : 0);
+
+  return r;
+}
diff --git a/test/version_9_write.c b/test/version_9_write.c
new file mode 100644
index 0000000..e1918a8
--- /dev/null
+++ b/test/version_9_write.c
@@ -0,0 +1,104 @@
+/* Copyright (C) 2010-2011 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This file is part of the GetData project.
+ *
+ * GetData is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * GetData is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GetData; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#include "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format[] = {
+    "dirfile/format",
+    "dirfile/format1",
+    "dirfile/format2",
+    "dirfile/format3",
+    "dirfile/format4"
+  };
+  const char *data = "dirfile/ar";
+  const char *format_data[] = {
+    "/VERSION 8\n"
+      "/INCLUDE format1\n",
+    "\n\n\n\n\n"
+      "/VERSION 9\n"
+      "Xr RAW COMPLEX128 0xA\n"
+      "Xy POLYNOM INDEX 8 055 0xAE 2\n"
+      "ar WINDOW d INDEX SET 0x1\n"
+      "/ALIAS BINDEX INDEX\n"
+      "/ALIAS AINDEXYZ BINDEX\n"
+      "/INCLUDE format2 A Z\n"
+      "/ALIAS m AdYZ\n"
+      "/INCLUDE format4\n"
+      "/ALIAS z n\n"
+      "/ALIAS d z\n"
+      "/HIDDEN Xy\n",
+    "/INCLUDE format3 \"\" Y\n",
+    "/ALIAS d INDEX\n/HIDDEN d\n",
+    "/ALIAS n m\n"
+  };
+  uint16_t c[8];
+  unsigned char data_data[256];
+  int fd, i, error, n, v, h1, h2, r = 0;
+  DIRFILE *D;
+
+  memset(c, 0, 16);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  for (i = 0; i < 5; ++i) {
+    fd = open(format[i], O_CREAT | O_EXCL | O_WRONLY, 0666);
+    write(fd, format_data[i], strlen(format_data[i]));
+    close(fd);
+  }
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256);
+  close(fd);
+
+  D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
+  h1 = gd_hidden(D, "AdYZ");
+  gd_rewrite_fragment(D, GD_ALL_FRAGMENTS);
+  error = gd_error(D);
+  gd_close(D);
+
+  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");
+
+  gd_close(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
new file mode 100644
index 0000000..46d7cd7
--- /dev/null
+++ b/test/vlist.c
@@ -0,0 +1,79 @@
+/* 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 <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"
+    "data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_vector_list(D);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    if (strcmp(field_list[i], "data1") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data2") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data3") == 0)
+      continue;
+    else if (strcmp(field_list[i], "INDEX") == 0)
+      continue;
+
+    r = 1;
+  }
+
+  CHECKI(i,4);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/vlist_alias.c b/test/vlist_alias.c
new file mode 100644
index 0000000..6b47255
--- /dev/null
+++ b/test/vlist_alias.c
@@ -0,0 +1,83 @@
+/* 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 <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"
+    "/ALIAS alias1 data3\n"
+    "/ALIAS alias2 data4\n"
+    "data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_vector_list(D);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    if (strcmp(field_list[i], "data1") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data2") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data3") == 0)
+      continue;
+    else if (strcmp(field_list[i], "alias1") == 0)
+      continue;
+    else if (strcmp(field_list[i], "INDEX") == 0)
+      continue;
+
+    r = 1;
+  }
+
+  CHECKI(i,5);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/vlist_hidden.c b/test/vlist_hidden.c
new file mode 100644
index 0000000..c0c7fb0
--- /dev/null
+++ b/test/vlist_hidden.c
@@ -0,0 +1,69 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "data1 RAW UINT8 1\n"
+    "data2 RAW UINT8 1\n"
+    "/HIDDEN data2\n"
+    "data3 RAW UINT8 1\n"
+    "data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_vector_list(D);
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    if (strcmp(field_list[i], "data1") == 0)
+      continue;
+    else if (strcmp(field_list[i], "data3") == 0)
+      continue;
+    else if (strcmp(field_list[i], "INDEX") == 0)
+      continue;
+
+    r = 1;
+  }
+
+  CHECKI(i,3);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/vlist_invalid.c b/test/vlist_invalid.c
new file mode 100644
index 0000000..01c2219
--- /dev/null
+++ b/test/vlist_invalid.c
@@ -0,0 +1,46 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char **fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_vector_list(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+  CHECKI(error,GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/vlist_meta.c b/test/vlist_meta.c
new file mode 100644
index 0000000..9cf8853
--- /dev/null
+++ b/test/vlist_meta.c
@@ -0,0 +1,82 @@
+/* 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 <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"
+    "META parent data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_mvector_list(D, "parent");
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    int len = strlen(field_list[i]);
+    CHECKIi(i,len,5);
+
+    CHECKIi(i,field_list[i][0], 'd');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 't');
+    CHECKIi(i,field_list[i][3], 'a');
+
+    if (field_list[i][4] < '1' || field_list[i][4] > '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i,3);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/vlist_meta_hidden.c b/test/vlist_meta_hidden.c
new file mode 100644
index 0000000..5b0282a
--- /dev/null
+++ b/test/vlist_meta_hidden.c
@@ -0,0 +1,74 @@
+/* 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 "test.h"
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *format_data =
+    "parent RAW UINT8 1\n"
+    "META parent data1 LINTERP UINT8 1\n"
+    "META parent data2 LINTERP UINT8 1\n"
+    "/HIDDEN parent/data2\n"
+    "META parent data3 LINTERP UINT8 1\n"
+    "META parent data4 CONST UINT8 1\n";
+  int fd, i, error, r = 0;
+  const char **field_list;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  field_list = gd_mvector_list(D, "parent");
+
+  error = gd_error(D);
+  CHECKI(error,0);
+  CHECKPN(field_list);
+
+  for (i = 0; field_list[i]; ++i) {
+    int len = strlen(field_list[i]);
+    CHECKIi(i,len,5);
+
+    CHECKIi(i,field_list[i][0], 'd');
+    CHECKIi(i,field_list[i][1], 'a');
+    CHECKIi(i,field_list[i][2], 't');
+    CHECKIi(i,field_list[i][3], 'a');
+
+    if (field_list[i][4] != '1' && field_list[i][4] != '3') {
+      fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]);
+      r = 1;
+    }
+  }
+
+  CHECKI(i,2);
+
+  gd_close(D);
+  unlink(format);
+  rmdir(filedir);
+
+  return r;
+}
diff --git a/test/vlist_meta_invalid.c b/test/vlist_meta_invalid.c
new file mode 100644
index 0000000..8fb6930
--- /dev/null
+++ b/test/vlist_meta_invalid.c
@@ -0,0 +1,47 @@
+/* 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
+ */
+/* Requesting the number of fields from an invalid dirfile should fail cleanly */
+#include "test.h"
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(void)
+{
+  const char *filedir = "dirfile";
+  int error, r = 0;
+  DIRFILE *D;
+  const char **fl;
+
+  rmdirfile();
+  D = gd_open(filedir, GD_RDONLY);
+  fl = gd_mvector_list(D, "parent");
+  error = gd_error(D);
+  gd_close(D);
+
+  CHECKP(fl);
+
+  CHECKI(error,GD_E_BAD_DIRFILE);
+  return r;
+}
diff --git a/test/xz_get.c b/test/xz_get.c
new file mode 100644
index 0000000..1dc678a
--- /dev/null
+++ b/test/xz_get.c
@@ -0,0 +1,88 @@
+/* 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
new file mode 100644
index 0000000..a36d9ee
--- /dev/null
+++ b/test/xz_nframes.c
@@ -0,0 +1,90 @@
+/* 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
new file mode 100644
index 0000000..57b984e
--- /dev/null
+++ b/test/zzip_data.c
@@ -0,0 +1,93 @@
+/* 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 "test.h"
+
+int main(void)
+{
+#ifndef TEST_ZZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *testzip = "dirfile/test.zip";
+  const char *format_data =
+    "data RAW UINT16 8\n"
+    "/ENCODING zzip test\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+#ifdef USE_ZZIP
+  int i;
+#endif
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  chdir(filedir);
+  snprintf(command, 4096, "%s test data > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(data);
+
+#ifdef USE_ZZIP
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(testzip);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_ZZIP
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n,0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/zzip_get.c b/test/zzip_get.c
new file mode 100644
index 0000000..9c02bb5
--- /dev/null
+++ b/test/zzip_get.c
@@ -0,0 +1,91 @@
+/* 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 "test.h"
+
+int main(void)
+{
+#ifndef TEST_ZZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *rawzip = "dirfile/raw.zip";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+#ifdef USE_ZZIP
+  int i;
+#endif
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress */
+  chdir(filedir);
+  snprintf(command, 4096, "%s raw data > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(data);
+
+#ifdef USE_ZZIP
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(rawzip);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_ZZIP
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+#else
+  CHECKI(error, GD_E_UNKNOWN_ENCODING);
+  CHECKI(n,0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/zzip_get_get.c b/test/zzip_get_get.c
new file mode 100644
index 0000000..5fe5c1e
--- /dev/null
+++ b/test/zzip_get_get.c
@@ -0,0 +1,88 @@
+/* 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 "test.h"
+
+int main(void)
+{
+#if !defined USE_ZZIP || !defined TEST_ZZIP
+  return 77; /* skip test */
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *rawzip = "dirfile/raw.zip";
+  const char *format_data = "data RAW UINT16 8\n";
+  uint16_t c1[8], c2[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, i, n1, 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 */
+  chdir(filedir);
+  snprintf(command, 4096, "%s raw data > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(data);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1);
+  error1 = gd_error(D);
+  gd_close(D);
+
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+  n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2);
+  error2 = gd_error(D);
+  gd_close(D);
+
+  unlink(rawzip);
+  unlink(format);
+  rmdir(filedir);
+
+  CHECKI(error1, 0);
+  CHECKI(error2, 0);
+  CHECKI(n1, 8);
+  CHECKI(n2, 8);
+  for (i = 0; i < 8; ++i) {
+    CHECKIi(i,c1[i], 40 + i);
+    CHECKIi(i,c2[i], 40 + i);
+  }
+
+  return r;
+#endif
+}
diff --git a/test/zzip_nframes.c b/test/zzip_nframes.c
new file mode 100644
index 0000000..b98d3aa
--- /dev/null
+++ b/test/zzip_nframes.c
@@ -0,0 +1,93 @@
+/* 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 <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#ifndef TEST_ZZIP
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *rawzip = "dirfile/raw.zip";
+  const char *format_data = "data RAW UINT16 1\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int i, error, r = 0;
+  size_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (uint16_t)i;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256 * sizeof(uint16_t));
+  close(i);
+
+  /* compress */
+  chdir(filedir);
+  snprintf(command, 4096, "%s raw data > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(data);
+
+#ifdef USE_ZZIP
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(rawzip);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_ZZIP
+  CHECKI(error, 0);
+  CHECKI(n, 256);
+#else
+  CHECKI(error, GD_E_UNKNOWN_ENCODING);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/zzslim_get.c b/test/zzslim_get.c
new file mode 100644
index 0000000..a4208e3
--- /dev/null
+++ b/test/zzslim_get.c
@@ -0,0 +1,98 @@
+/* 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"
+
+int main(void)
+{
+#if !defined(TEST_ZZIP) || !defined(TEST_SLIM)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *dataslm = "dirfile/data.slm";
+  const char *testzip = "dirfile/test.zip";
+  const char *format_data =
+    "data RAW UINT16 8\n"
+    "/ENCODING zzslim test\n";
+  uint16_t c[8];
+  char command[4096];
+  uint16_t data_data[256];
+  int fd, n, error, r = 0;
+#ifdef USE_ZZSLIM
+  int i;
+#endif
+  DIRFILE *D;
+
+  memset(c, 0, 8);
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (fd = 0; fd < 256; ++fd)
+    data_data[fd] = (unsigned char)fd;
+
+  fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(fd, format_data, strlen(format_data));
+  close(fd);
+
+  fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(fd, data_data, 256 * sizeof(uint16_t));
+  close(fd);
+
+  /* compress, twice */
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIM, data);
+  if (gd_system(command))
+    return 1;
+  chdir(filedir);
+  snprintf(command, 4096, "%s test data.slm > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(dataslm);
+  unlink(data);
+
+#ifdef USE_ZZSLIM
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+  error = gd_error(D);
+
+  gd_close(D);
+
+  unlink(testzip);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_ZZSLIM
+  CHECKI(error, 0);
+  CHECKI(n, 8);
+  for (i = 0; i < 8; ++i)
+    CHECKIi(i,c[i], 40 + i);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n,0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/test/zzslim_nframes.c b/test/zzslim_nframes.c
new file mode 100644
index 0000000..31bb5bc
--- /dev/null
+++ b/test/zzslim_nframes.c
@@ -0,0 +1,98 @@
+/* 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 <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <inttypes.h>
+
+int main(void)
+{
+#if !defined(TEST_ZZIP) || !defined(TEST_SLIM)
+  return 77;
+#else
+  const char *filedir = "dirfile";
+  const char *format = "dirfile/format";
+  const char *data = "dirfile/data";
+  const char *dataslm = "dirfile/data.slm";
+  const char *rawzip = "dirfile/raw.zip";
+  const char *format_data = "data RAW UINT16 1\n/ENCODING zzslim\n";
+  char command[4096];
+  uint16_t data_data[256];
+  int i, error, r = 0;
+  size_t n;
+  DIRFILE *D;
+
+  rmdirfile();
+  mkdir(filedir, 0777);
+
+  for (i = 0; i < 256; ++i)
+    data_data[i] = (uint16_t)i;
+
+  i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
+  write(i, format_data, strlen(format_data));
+  close(i);
+
+  i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
+  write(i, data_data, 256 * sizeof(uint16_t));
+  close(i);
+
+  /* compress, twice */
+  snprintf(command, 4096, "%s -k %s > /dev/null", SLIM, data);
+  if (gd_system(command))
+    return 1;
+  chdir(filedir);
+  snprintf(command, 4096, "%s raw data.slm > /dev/null", ZIP);
+  if (gd_system(command))
+    return 1;
+  chdir("..");
+  unlink(dataslm);
+  unlink(data);
+
+#ifdef USE_ZZSLIM
+  D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
+#else
+  D = gd_open(filedir, GD_RDONLY);
+#endif
+  n = gd_nframes(D);
+  error = gd_error(D);
+  gd_close(D);
+
+  unlink(rawzip);
+  unlink(format);
+  rmdir(filedir);
+
+#ifdef USE_ZZSLIM
+  CHECKI(error, 0);
+  CHECKI(n, 256);
+#else
+  CHECKI(error, GD_E_UNSUPPORTED);
+  CHECKI(n, 0);
+#endif
+
+  return r;
+#endif
+}
diff --git a/util/Makefile.am b/util/Makefile.am
new file mode 100644
index 0000000..6b6db35
--- /dev/null
+++ b/util/Makefile.am
@@ -0,0 +1,39 @@
+# Copyright (C) 2008, 2010, 2014 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+
+if CC_WALL
+WALL=-Wall
+endif
+
+if CC_WEXTRA
+WEXTRA=-Wextra
+endif
+
+LDADD=../src/libgetdata.la
+AM_CPPFLAGS=${WALL} $(WEXTRA) -I$(top_srcdir)/src
+
+bin_PROGRAMS=checkdirfile dirfile2ascii
+checkdirfile_SOURCES=checkdirfile.c
+dirfile2ascii_SOURCES=dirfile2ascii.c
+
+clean-local:
+	rm -rf *~ 
diff --git a/util/Makefile.in b/util/Makefile.in
new file mode 100644
index 0000000..1fe7437
--- /dev/null
+++ b/util/Makefile.in
@@ -0,0 +1,752 @@
+# 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@
+bin_PROGRAMS = checkdirfile$(EXEEXT) dirfile2ascii$(EXEEXT)
+subdir = util
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
+	$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \
+	$(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \
+	$(top_srcdir)/m4/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/win32.m4 $(top_srcdir)/m4/version.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/gd_config.h \
+	$(top_builddir)/src/getdata.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_checkdirfile_OBJECTS = checkdirfile.$(OBJEXT)
+checkdirfile_OBJECTS = $(am_checkdirfile_OBJECTS)
+checkdirfile_LDADD = $(LDADD)
+checkdirfile_DEPENDENCIES = ../src/libgetdata.la
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+am_dirfile2ascii_OBJECTS = dirfile2ascii.$(OBJEXT)
+dirfile2ascii_OBJECTS = $(am_dirfile2ascii_OBJECTS)
+dirfile2ascii_LDADD = $(LDADD)
+dirfile2ascii_DEPENDENCIES = ../src/libgetdata.la
+AM_V_P = $(am__v_P_ 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 = $(checkdirfile_SOURCES) $(dirfile2ascii_SOURCES)
+DIST_SOURCES = $(checkdirfile_SOURCES) $(dirfile2ascii_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILDCC = @BUILDCC@
+BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@
+BZIP2_LDFLAGS = @BZIP2_LDFLAGS@
+BZIP2_LIBS = @BZIP2_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFINE_GD_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@
+FLIBS = @FLIBS@
+GD_DIRSEP = @GD_DIRSEP@
+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@
+NUMPY_CPPFLAGS = @NUMPY_CPPFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PERL_MAN3EXT = @PERL_MAN3EXT@
+PRINTF = @PRINTF@
+PRIVATE_LIBS = @PRIVATE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SEQ = @SEQ@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLIM_CPPFLAGS = @SLIM_CPPFLAGS@
+SLIM_LDFLAGS = @SLIM_LDFLAGS@
+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_gunzip = @path_gunzip@
+path_gzip = @path_gzip@
+path_slim = @path_slim@
+path_unslim = @path_unslim@
+path_unzip = @path_unzip@
+path_xz = @path_xz@
+path_zip = @path_zip@
+pdfdir = @pdfdir@
+perldir = @perldir@
+perlmandir = @perlmandir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Copyright (C) 2008, 2010, 2014 D. V. Wiebe
+#
+##########################################################################
+#
+# This file is part of the GetData project.
+#
+# GetData is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 2.1 of the License, or (at your
+# option) any later version.
+#
+# GetData is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GetData; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+AUTOMAKE_OPTIONS = foreign
+ at CC_WALL_TRUE@WALL = -Wall
+ at CC_WEXTRA_TRUE@WEXTRA = -Wextra
+LDADD = ../src/libgetdata.la
+AM_CPPFLAGS = ${WALL} $(WEXTRA) -I$(top_srcdir)/src
+checkdirfile_SOURCES = checkdirfile.c
+dirfile2ascii_SOURCES = dirfile2ascii.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign util/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p \
+	 || test -f $$p1 \
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' \
+	    -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' \
+	`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+checkdirfile$(EXEEXT): $(checkdirfile_OBJECTS) $(checkdirfile_DEPENDENCIES) $(EXTRA_checkdirfile_DEPENDENCIES) 
+	@rm -f checkdirfile$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(checkdirfile_OBJECTS) $(checkdirfile_LDADD) $(LIBS)
+
+dirfile2ascii$(EXEEXT): $(dirfile2ascii_OBJECTS) $(dirfile2ascii_DEPENDENCIES) $(EXTRA_dirfile2ascii_DEPENDENCIES) 
+	@rm -f dirfile2ascii$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dirfile2ascii_OBJECTS) $(dirfile2ascii_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/checkdirfile.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dirfile2ascii.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(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
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+	clean-binPROGRAMS clean-generic clean-libtool clean-local \
+	cscopelist-am ctags ctags-am distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-binPROGRAMS
+
+
+clean-local:
+	rm -rf *~ 
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/util/checkdirfile.c b/util/checkdirfile.c
new file mode 100644
index 0000000..a124f30
--- /dev/null
+++ b/util/checkdirfile.c
@@ -0,0 +1,247 @@
+/* Copyright (C) 2007-2010, 2012 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifdef HAVE_CONFIG_H
+#include "gd_config.h"
+#endif
+
+#ifndef HAVE_SNPRINTF
+#ifdef HAVE__SNPRINTF
+#define snprintf _snprintf
+#endif
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include "getdata.h"
+
+#ifndef PACKAGE_STRING
+#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION
+#endif
+
+static int callback(gd_parser_data_t *pdata, void* ne)
+{
+  char getdata_error[2048];
+  printf("  syntax error: %s\n", gd_error_string(pdata->dirfile,
+        getdata_error, 2048));
+
+  (*(int*)ne)++;
+
+  return GD_SYNTAX_IGNORE;
+}
+
+int main(int argc, char* argv[])
+{
+  DIRFILE* dirfile;
+  int e, i, j;
+  char getdata_error[2048];
+  off_t n;
+  int ne = 0;
+  unsigned int nfields = 0;
+  const char **flist, **mflist;
+
+  if (argc < 2 || !strcmp(argv[1], "--version") || !strcmp(argv[1], "--help")) {
+    printf("Usage:\n"
+        "  checkdirfile DIRFILE                 Check the DirFile database "
+        "DIRFILE for\n"
+        "                                         errors.\n"
+        "  checkdirfile [ --help | --version ]  Print this message and exit.\n"
+        "\n\n"
+        "This program is part of %s.\n"
+        "Copyright (C) 2008-2010, 2012  D. V. Wiebe\n"
+        "Please send reports of bugs and other communication to:\n\n  %s\n\n"
+        "This program comes with NO WARRANTY, not even for MERCHANTABILITY "
+        "or FITNESS\n"
+        "FOR A PARTICULAR PURPOSE. You may redistribute it under the terms of "
+        "the GNU\n"
+        "Lesser General Public License, either version 2.1 of the License, or "
+        "(at your\n"
+        "option) any later version.\n\n"
+        "You should have received a copy of the GNU Lesser General Public "
+        "License along\n"
+        "with this program; if not, write to the Free Software Foundation,"
+        "Inc.,\n"
+        "51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n",
+        PACKAGE_STRING, PACKAGE_BUGREPORT);
+    return 1;
+  }
+
+  /* open the dirfile */
+  puts("Checking syntax...");
+  dirfile = gd_cbopen(argv[1], GD_RDONLY, callback, &ne);
+
+  /* open error */
+  e = gd_error(dirfile);
+  if (e) {
+    if (e != GD_E_FORMAT) {
+      printf("  getdata error: %s\n", gd_error_string(dirfile, getdata_error,
+            2048));
+      gd_close(dirfile);
+      return 1;
+    }
+  }
+
+  if (ne > 0)
+    printf("  Found %i line%s with syntax errors.\n", ne, (ne == 1) ? "" : "s");
+  else {
+    int vers[GD_DIRFILE_STANDARDS_VERSION + 1];
+    int nvers = 0;
+    int first = -1;
+    int start = 1;
+
+    printf("  Syntax OK.\n\n");
+
+    for (i = 0; i <= GD_DIRFILE_STANDARDS_VERSION; ++i) {
+      if (gd_dirfile_standards(dirfile, i) == i) {
+        vers[i] = 1;
+        nvers++;
+      } else
+        vers[i] = 0;
+    }
+
+    if (nvers == 0) {
+      puts("WARNING: Dirfile conforms to no Standards Version.");
+    } else {
+      printf("Dirfile conforms to Standards %s ",
+          (nvers == 1) ? "Version" : "Versions");
+
+      for (i = 0; i <= GD_DIRFILE_STANDARDS_VERSION; ++i) {
+        if (vers[i]) {
+          if (first == -1)
+            first = i;
+        } else if (first != -1) {
+          if (!start)
+            fputs(", ", stdout);
+          else
+            start = 0;
+
+          if (first == i)
+            printf("%i", i);
+          else if (first + 1 == i)
+            printf("%i, %i", first, i);
+          else
+            printf("%i-%i", first, i);
+
+          first = -1;
+        }
+      }
+
+      if (first != -1) {
+        if (!start)
+          fputs(", ", stdout);
+
+        if (first == GD_DIRFILE_STANDARDS_VERSION)
+          printf("%i", GD_DIRFILE_STANDARDS_VERSION);
+        else if (first + 1 == GD_DIRFILE_STANDARDS_VERSION)
+          printf("%i, %i", first, GD_DIRFILE_STANDARDS_VERSION);
+        else
+          printf("%i-%i", first, GD_DIRFILE_STANDARDS_VERSION);
+
+        fputs(" (the latest version)", stdout);
+      }
+
+      puts("");
+    }
+
+  }
+
+  /* Check the validity of each field defined */
+  ne = 0;
+  puts("\nChecking fields...");
+  flist = gd_entry_list(dirfile, NULL, 0, GD_ENTRIES_HIDDEN |
+      GD_ENTRIES_NOALIAS);
+  for (i = 0; flist[i] != NULL; ++i) {
+    if (gd_validate(dirfile, flist[i])) {
+      printf("  getdata error checking %s: %s\n", flist[i],
+          gd_error_string(dirfile, getdata_error, 2048));
+      ne++;
+    }
+    nfields++;
+    mflist = gd_entry_list(dirfile, flist[i], 0, GD_ENTRIES_HIDDEN | 
+        GD_ENTRIES_NOALIAS);
+    for (j = 0; mflist[j] != NULL; ++j) {
+      char code[GD_MAX_LINE_LENGTH];
+      snprintf(code, GD_MAX_LINE_LENGTH, "%s/%s", flist[i], mflist[j]);
+      if (gd_validate(dirfile, code)) {
+        printf("  getdata error checking %s: %s\n", code,
+            gd_error_string(dirfile, getdata_error, 2048));
+        ne++;
+      }
+      nfields++;
+    }
+
+    mflist = gd_entry_list(dirfile, flist[i], GD_ALIAS_ENTRIES,
+        GD_ENTRIES_HIDDEN);
+    for (j = 0; mflist[j] != NULL; ++j) {
+      char code[GD_MAX_LINE_LENGTH];
+      snprintf(code, GD_MAX_LINE_LENGTH, "%s/%s", flist[i], mflist[j]);
+      if (gd_entry_type(dirfile, code) == GD_NO_ENTRY) {
+        if (gd_error(dirfile) == GD_E_BAD_CODE) {
+          printf("  dangling alias %s pointing to non-existent %s\n", code,
+              gd_alias_target(dirfile, code));
+        } else {
+          printf("  getdata error checking alias %s: %s\n", code,
+              gd_error_string(dirfile, getdata_error, 2048));
+        }
+        ne++;
+      }
+      nfields++;
+    }
+  }
+
+  /* look for dangling aliases */
+  flist = gd_entry_list(dirfile, NULL, GD_ALIAS_ENTRIES, GD_ENTRIES_HIDDEN);
+  for (i = 0; flist[i] != NULL; ++i) {
+    if (gd_entry_type(dirfile, flist[i]) == GD_NO_ENTRY) {
+      if (gd_error(dirfile) == GD_E_BAD_CODE) {
+        printf("  dangling alias %s pointing to non-existent %s\n", flist[i],
+            gd_alias_target(dirfile, flist[i]));
+      } else {
+        printf("  getdata error checking alias %s: %s\n", flist[i],
+            gd_error_string(dirfile, getdata_error, 2048));
+      }
+      ne++;
+    }
+    nfields++;
+  }
+
+  if (ne > 0)
+    printf("  Found %i problems in %u %s.\n", ne, nfields,
+        nfields > 1 ? "entries" : "entry");
+  else
+    printf("  No problems found in %u %s.\n", nfields,
+        nfields > 1 ? "entries" : "entry");
+
+  /* try to retrieve the number of frames in the dirfile */
+  puts("\nChecking frames...");
+  n = gd_nframes(dirfile);
+
+  if (gd_error(dirfile)) {
+    printf("  getdata error: %s\n", gd_error_string(dirfile, getdata_error,
+          2048));
+    gd_close(dirfile);
+    return 1;
+  }
+
+  printf("  Found %llu %s.\n", (unsigned long long)n,
+        n == 1 ? "frame" : "frames");
+
+  gd_close(dirfile);
+  return 0;
+}
diff --git a/util/dirfile2ascii.c b/util/dirfile2ascii.c
new file mode 100644
index 0000000..7c78f27
--- /dev/null
+++ b/util/dirfile2ascii.c
@@ -0,0 +1,538 @@
+/* Copyright (C) 2010, 2011 Matthew Truch
+ * Copyright (C) 2010, 2014 D. V. Wiebe
+ *
+ ***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifdef HAVE_CONFIG_H
+#include "gd_config.h"
+#endif
+
+#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
+#endif
+
+#define BUF_LEN GD_MAX_LINE_LENGTH
+#define F_LEN 16
+#define VALID_PRECISION_CHARS "#- +`I.0123456789"
+
+struct field
+{
+  char *name;
+  int type;
+  unsigned int spf;
+  union {
+    double *dbl;
+    int64_t *i64;
+    uint64_t *u64;
+  } u;
+  char format[F_LEN];
+  size_t n_read;
+};
+
+void version(void)
+{
+  printf("dirfile2ascii (%s)\n"
+      "Copyright (C) 2010, 2011, 2014 Matthew Truch and others\n\n"
+      "Please send reports of bugs and other communication to:\n  %s\n\n"
+      "This program comes with NO WARRANTY, not even for MERCHANTABILITY "
+      "or FITNESS\n"
+      "FOR A PARTICULAR PURPOSE. You may redistribute it under the terms of "
+      "the GNU\n"
+      "Lesser General Public License, either version 2.1 of the License, or "
+      "(at your\n"
+      "option) any later version.\n\n"
+      "You should have received a copy of the GNU Lesser General Public "
+      "License along\n"
+      "with this program; if not, write to the Free Software Foundation,"
+      "Inc.,\n"
+      "51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n",
+      PACKAGE_STRING, PACKAGE_BUGREPORT);
+  exit(-1);
+}
+
+void usage(char *exe)
+{
+  printf("Usage: %s [OPTION]... DIRFILE\n"
+      "                    [[-a|-A|-e|-E|-F|-g|-G|-o|-i|-u|-x|-X] FIELD]...\n"
+      "Dump specified fields from the dirfile DIRFILE as ASCII on stdout.\n\n"
+
+      "Mandatory arguments to long options are mandatory for short options "
+      "too.\n"
+#if 0
+      "  -b, --boxcar    boxcar average over skipped samples before output.  "
+      "Ignored\n"
+      "                    if --skip is not specified.\n"
+#endif
+      "  -d, --delimiter=D      separate columns by D (default: a single "
+      "space)\n"
+      "  -f, --first-frame=F-M  read from frame F to frame M (inclusive).\n"
+      "  -f, --first-frame=F:N  equivalent to --first-frame=F --num-frames=N\n"
+      "  -f, --first-frame=F    if F >= 0, start reading at frame F.  If F is "
+      "-1 and\n"
+      "                           --num-frames=N is specified, read the last N "
+      "frames.\n"
+      "                           If not specified, F = 0 is assumed.\n"
+      "  -n, --num-frames=N     read at most N frames.  If not specified, or "
+      "if N = 0,\n"
+      "                           all frames to the end of the dirfile are "
+      "read.\n"
+      "  -p, --precision=FMT    use FMT to format output.  FMT may contain any "
+      "of the\n"
+      "                           flag characters, a field width, and/or a "
+      "precision as\n"
+      "                           specified in printf(3).  It may NOT contain "
+      "a length\n"
+      "                           modifier.\n"
+      "  -q, --quiet            don't write verbose message to standard error "
+      "(the\n"
+      "                           default).\n"
+      "  -s, --skip=S           if S > 0, output only one sample for every S "
+      "frames.\n"
+      "  -v, --verbose          write verbosely to standard error.\n"
+      "  -z, --fill=STRING      print STRING to fill up columns which run past "
+      "the end\n"
+      "                           of their corresponding field.  The default "
+      "is to\n"
+      "                           fill floating point columns with \"NaN\" and "
+      "integer\n"
+      "                           columns with \"0\" (without quotation marks)."
+      "\n\n"
+
+      "Any number of fields may be specified.  Each specified field is printed "
+      "in a\n"
+      "separate column.  A field name may be preceded by a short option, one "
+      "of -a, -A,\n"
+      "-e, -E, -F, -g, -G, -o, -i, -u, -x, -X, indicating the conversion to be "
+      "used.\n"
+      "See printf(3) for the meaning of these conversion specifiers.  The "
+      "output flags,\n"
+      "width, and precision may be specified by --precision.  If no "
+      "conversion\n"
+      "specifier is given, %%f is used.\n\n"
+      "For conversion specifiers %%a, %%A, %%e, %%E, %%f, %%F, %%g, %%G, data "
+      "is read from the\n"
+      "dirfile as double precision floats.  For conversion specifier %%i, the "
+      "data is\n"
+      "read as 64-bit signed integers.  For conversion specifiers %%o, "
+      "%%u, %%x, %%X, the\n"
+      "data is read as 64-bit unsigned integers.\n", exe);
+  exit(-1);
+}
+
+int main (int argc, char **argv)
+{
+  char char_buffer[BUF_LEN];
+  char *tmp;
+  char *delimiter = " ";
+  char *precision = "";
+  char *zero = NULL;
+  char *dirfile_name = NULL;
+  DIRFILE *dirfile;
+  size_t nf = 0;
+  off64_t ff = 0;
+  size_t n_want;
+  unsigned int j;
+  unsigned int max_spf = 0;
+  unsigned int min_spf = INT_MAX;
+  int c, i;
+  int numfields = 0;
+  struct field fields[BUF_LEN];
+  int verbose = 0;
+  int interpolate = 0;
+  size_t skip = 0;
+  int skipping = 0;
+  size_t k, z;
+#if 0
+  int average = 0;
+#endif
+  int optind = 0;
+  const double NaN = NAN;
+  const struct option longopts[] = {
+#if 0
+    { "boxcar",      0, NULL, 'b' },
+#endif
+    { "delimieter",  1, NULL, 'd' },
+    { "fill",        1, NULL, 'z' },
+    { "first-frame", 1, NULL, 'f' },
+    { "help",        0, NULL, '?' },
+    { "num-frames",  1, NULL, 'n' },
+    { "precision",   1, NULL, 'p' },
+    { "quiet",       0, NULL, 'q' },
+    { "skip",        1, NULL, 's' },
+    { "verbose",     0, NULL, 'v' },
+    { "version",     0, NULL,  2  },
+    { 0,             0, 0,     0  }
+  };
+
+  /* handy things to know about conversion specifiers */
+#define READ_AS_DOUBLE 0x000
+#define READ_AS_INT    0x100
+#define READ_AS_UINT   0x200
+  struct {
+    int t;
+    const char* f;
+  } type_data[0x7f];
+  type_data[(int)'a'].t = READ_AS_DOUBLE;
+  type_data[(int)'a'].f = "a";
+  type_data[(int)'A'].t = READ_AS_DOUBLE;
+  type_data[(int)'A'].f = "A";
+  type_data[(int)'e'].t = READ_AS_DOUBLE;
+  type_data[(int)'e'].f = "e";
+  type_data[(int)'E'].t = READ_AS_DOUBLE;
+  type_data[(int)'E'].f = "E";
+  type_data[(int)'f'].t = READ_AS_DOUBLE;
+  type_data[(int)'f'].f = "f";
+  type_data[(int)'F'].t = READ_AS_DOUBLE;
+  type_data[(int)'F'].f = "F";
+  type_data[(int)'g'].t = READ_AS_DOUBLE;
+  type_data[(int)'g'].f = "g";
+  type_data[(int)'G'].t = READ_AS_DOUBLE;
+  type_data[(int)'G'].f = "G";
+  type_data[(int)'i'].t = READ_AS_INT;
+  type_data[(int)'i'].f = PRIi64;
+  type_data[(int)'o'].t = READ_AS_UINT;
+  type_data[(int)'o'].f = PRIo64;
+  type_data[(int)'u'].t = READ_AS_UINT;
+  type_data[(int)'u'].f = PRIu64;
+  type_data[(int)'x'].t = READ_AS_UINT;
+  type_data[(int)'x'].f = PRIx64;
+  type_data[(int)'X'].t = READ_AS_UINT;
+  type_data[(int)'X'].f = PRIX64;
+
+  while ((c = getopt_long(argc, argv,
+          "-f:n:d:x:X:g:G:e:E:a:A:F:i:o:p:s:u:z:bvqh?", longopts, &optind)) != -1)
+  {
+    switch (c) {
+      case 1: /* The case of no option */
+        if (dirfile_name == NULL) {
+          dirfile_name = optarg;
+        } else { /* Standard output field */
+          if (numfields >= BUF_LEN) {
+            fprintf(stderr, "Error: Too many fields!\n");
+            exit(-2);
+          }
+          fields[numfields].type = 'f';
+          fields[numfields].name = optarg;
+          numfields++;
+        }
+        break;
+      case 2:
+        version();
+        break;
+      case 'x': /* output field types */
+      case 'X':
+      case 'i':
+      case 'o':
+      case 'g':
+      case 'G':
+      case 'e':
+      case 'E':
+      case 'u':
+      case 'F':
+      case 'A':
+      case 'a':
+        if (numfields >= BUF_LEN) {
+          fprintf(stderr, "Error: Too many fields!\n");
+          exit(-2);
+        }
+        fields[numfields].type = c;
+        fields[numfields].name = optarg;
+        numfields++;
+        break;
+      case 'f': /* firstframe */
+        ff = (off64_t)strtoll(optarg, &tmp, 0);
+        if (tmp[0] == ':' && tmp[1] != '\0')
+          nf = (size_t)strtoll(&(tmp[1]), NULL, 0);
+        else if (tmp[0] == '-' && tmp[1] != '\0')
+          nf = (size_t)(strtoll(&(tmp[1]), NULL, 0) - ff);
+        break;
+      case 'n': /* numframes */
+        nf = (size_t)strtoll(optarg, NULL, 0);
+        break;
+      case 'p':
+        if (strlen(optarg) < (F_LEN - 6))
+          precision = optarg;
+        else
+          fprintf(stderr, "Ignoring exceedingly long -p argument (%s).\n",
+              optarg);
+        break;
+      case 'v':
+        verbose = 1;
+        break;
+      case 'q':
+        verbose = 0;
+        break;
+      case 'd':
+        delimiter = optarg;
+        break;
+      case 's':
+        skip = strtoll(optarg, NULL, 0);
+        break;
+      case 'z':
+        zero = optarg;
+        break;
+      case 'b':
+#if 0
+        average = 1;
+#endif
+        fprintf(stderr, "Warning: Ignoring -b found on command line.\n");
+        break;
+      case 'h':
+      case '?':
+      default:
+        usage(argv[0]);
+        break;
+    }
+  }
+
+  if (dirfile_name == NULL) {
+    fprintf(stderr, "Error: No dirfile specified.\n");
+    exit(-4);
+  }
+
+  if (numfields < 1) {
+    fprintf(stderr, "Error: At least one field must be specified.\n");
+    exit(-3);
+  }
+
+  if ((ff == -1) && (nf == 0)) {
+    fprintf(stderr, "Warning: Ignoring negative first frame with no frame "
+        "count given.\n");
+    ff = 0;
+  }
+
+  for (z = 0; z < strlen(precision); z++) {
+    if (strchr(VALID_PRECISION_CHARS, precision[z]) == NULL) {
+      fprintf(stderr,
+          "Error: Invalid character (%c) found in precision string (%s).\n", 
+          precision[z], precision);
+      exit(-5);
+    }
+  }
+
+  if (skip)
+    skipping = 1;
+  if (skip < 1)
+    skip = 1;
+
+  dirfile = gd_open(dirfile_name, GD_RDONLY);
+  if (gd_error(dirfile)) {
+    fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile, char_buffer,
+          BUF_LEN));
+    gd_close(dirfile);
+    exit(1);
+  }
+
+  if (nf == 0) {
+    nf = gd_nframes(dirfile) - ff;
+    if (gd_error(dirfile)) {
+      fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile,
+            char_buffer, BUF_LEN));
+      gd_close(dirfile);
+      exit(3);
+    }
+  }
+
+  if (ff == -1) {
+    ff = gd_nframes(dirfile) - nf;
+    if (gd_error(dirfile)) {
+      fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile,
+            char_buffer, BUF_LEN));
+      gd_close(dirfile);
+      exit(3);
+    }
+  }
+
+  /* Get spfs and sanity checks for all fields */
+  for (i = 0; i < numfields; i++) {
+    fields[i].spf = gd_spf(dirfile, fields[i].name);
+    if (gd_error(dirfile)) {
+      fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile,
+            char_buffer, BUF_LEN));
+      gd_close(dirfile);
+      exit(3);
+    }
+
+    if (max_spf && fields[i].spf != max_spf)
+      interpolate = 1;
+
+    if (fields[i].spf > max_spf)
+      max_spf = fields[i].spf;
+
+    if (fields[i].spf < min_spf)
+      min_spf = fields[i].spf;
+  }
+
+  if (interpolate && nf == 1 && min_spf == 1) {
+    fprintf(stderr, "Error: Interpolation required, "
+        "but at least one field has only 1 sample.\n");
+    exit(-6);
+  }
+
+  if (verbose) {
+    fprintf(stderr, "Reading %d field%s from %s\n", numfields,
+        (numfields > 1) ? "s" : "", dirfile_name);
+    fprintf(stderr, "First frame: %llu Number of frames: %zd\n",
+        (long long)ff, nf);
+  }
+
+  for (i = 0; i < numfields; i++) { /* Read in all the fields */
+    n_want = nf * fields[i].spf;
+
+    if (type_data[fields[i].type].t == READ_AS_DOUBLE) {
+      fields[i].u.dbl = (double *)malloc(sizeof(double) * n_want);
+      if (fields[i].u.dbl == NULL) {
+        perror("malloc");
+        gd_close(dirfile);
+        exit(4);
+      }
+
+      fields[i].n_read = gd_getdata(dirfile, fields[i].name, ff, 0, nf, 0,
+          GD_FLOAT64, fields[i].u.dbl);
+    } else if (type_data[fields[i].type].t == READ_AS_INT) {
+      fields[i].u.i64 = (int64_t *)malloc(sizeof(int64_t) * n_want);
+      if (fields[i].u.i64 == NULL) {
+        perror("malloc");
+        gd_close(dirfile);
+        exit(4);
+      }
+      fields[i].n_read = gd_getdata(dirfile, fields[i].name, ff, 0, nf, 0,
+          GD_INT64, fields[i].u.i64);
+    } else {
+      fields[i].u.u64 = (uint64_t *)malloc(sizeof(uint64_t) * n_want);
+      if (fields[i].u.u64 == NULL) {
+        perror("malloc");
+        gd_close(dirfile);
+        exit(4);
+      }
+      fields[i].n_read = gd_getdata(dirfile, fields[i].name, ff, 0, nf, 0,
+          GD_UINT64, fields[i].u.u64);
+    }
+
+    if (gd_error(dirfile)) {
+      fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile,
+            char_buffer, BUF_LEN));
+      gd_close(dirfile);
+      exit(5);
+    } else if (!zero && n_want > fields[i].n_read) {
+      if (verbose)
+        fprintf(stderr, "Short read on field %i, padding %zu frames\n",
+            i, n_want - fields[i].n_read);
+      if (type_data[fields[i].type].t == READ_AS_DOUBLE) {
+        for (k = fields[i].n_read; k < n_want; ++k)
+          fields[i].u.dbl[k] = NaN;
+      } else if (type_data[fields[i].type].t == READ_AS_INT) {
+        memset(fields[i].u.i64 + fields[i].n_read, 0,
+            (n_want - fields[i].n_read) * sizeof(int64_t));
+      } else {
+        memset(fields[i].u.u64 + fields[i].n_read, 0,
+            (n_want - fields[i].n_read) * sizeof(uint64_t));
+      }
+    }
+  }
+
+  /* Generate format string with precision */
+  for (i = 0; i < numfields; i++)
+    snprintf(fields[i].format, F_LEN, "%%%s%s", precision,
+        type_data[fields[i].type].f);
+
+  for (k = 0; k < nf; k += skip) {
+    for (j = 0; j < (skipping ? 1 : max_spf); j++) {
+      for (i = 0; i < numfields; i++) {
+        if (fields[i].spf == max_spf || skipping) {
+          if (zero && k * fields[i].spf + j >= fields[i].n_read)
+            printf("%s", zero);
+          else if (type_data[fields[i].type].t == READ_AS_DOUBLE)
+            printf(fields[i].format, fields[i].u.dbl[k * fields[i].spf + j]);
+          else if (type_data[fields[i].type].t == READ_AS_INT)
+            printf(fields[i].format, fields[i].u.i64[k * fields[i].spf + j]);
+          else
+            printf(fields[i].format, fields[i].u.u64[k * fields[i].spf + j]);
+        } else { /* need to interpolate: */
+          /*      formula is  y = y0 + (x-x0) * (y1-y0)/(x1-x0) */
+          /*                 val= y0 +  diff  *     slope       */
+          /* Note that if max_spfs isn't a multiple of all spfs then some of  */
+          /* the data will only be approximated (except at frame boundaries). */
+          unsigned int prev_samp, next_samp, offset;
+          double slope, diff, val;
+
+          prev_samp = (unsigned int)floor((double)j * (double)fields[i].spf /
+              (double)max_spf);
+          next_samp = prev_samp + 1;
+          diff = ((double)prev_samp + (double)(j % (max_spf / fields[i].spf)) /
+              (double)(max_spf / fields[i].spf)) - (double)prev_samp;
+
+          if (k == (nf - 1) && next_samp == fields[i].spf)
+            /* we're on ultimate sample, so use slope from previous set */
+            offset = 1;
+          else
+            offset = 0;
+
+          if (zero && k * fields[i].spf + j >= fields[i].n_read) {
+            printf("%s", zero);
+          } else if (type_data[fields[i].type].t == READ_AS_DOUBLE) {
+            slope = (fields[i].u.dbl[k * fields[i].spf + next_samp - offset] -
+                fields[i].u.dbl[k * fields[i].spf + prev_samp - offset]) /
+              ((double)next_samp - (double)prev_samp);
+            val = fields[i].u.dbl[k * fields[i].spf + prev_samp] + diff * slope;
+            printf(fields[i].format, val);
+          } else if (type_data[fields[i].type].t == READ_AS_INT) {
+            slope = ((double)fields[i].u.i64[k * fields[i].spf + next_samp
+                - offset] - (double)fields[i].u.i64[k * fields[i].spf
+                + prev_samp - offset]) / ((double)next_samp
+                  - (double)prev_samp);
+            val = (double)fields[i].u.i64[k * fields[i].spf + prev_samp] + diff
+              * slope;
+            printf(fields[i].format, (int64_t)val);
+          } else {
+            slope = ((double)fields[i].u.u64[k * fields[i].spf + next_samp
+                - offset] - (double)fields[i].u.u64[k * fields[i].spf
+                + prev_samp - offset]) / ((double)next_samp
+                  - (double)prev_samp);
+            val = (double)fields[i].u.u64[k * fields[i].spf + prev_samp] + diff
+              * slope;
+            printf(fields[i].format, (uint64_t)val);
+          }
+        }
+
+        if (i < (numfields - 1)) {
+          printf("%s", delimiter);
+        } else {
+          printf("\n");
+        }
+      }
+    }
+  }
+
+  gd_close(dirfile);
+  return 0;
+}

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