Clean up gmxfio includes
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 2 Jul 2015 04:15:41 +0000 (07:15 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Thu, 2 Jul 2015 05:36:50 +0000 (08:36 +0300)
- Move xdr writing routines to gmxfio-xdr.h, to make it match the source
  file that implements them.  Include the new header where necessary.
- Remove gmx_fio_checktype() and replace with asserts in the xdr
  routines.
- Remove unnecessary gmxfio.h includes.  In particular, remove it from
  headers to not get it transitively to unrelated source files.
- Fix compilation that was broken by relying on transitively included
  headers (mostly cstringutil.h and futil.h) that no longer come through
  the transitive gmxfio.h.
- Some minor cleanup elsewhere, in particular hiding functions from
  headers and fixing a few uses of mismatching file open/close
  functions.

Change-Id: Ic5366a23a421cfec82a518caee772e2bb53e8303

86 files changed:
src/contrib/do_multiprot.c
src/gromacs/fileio/enxio.c
src/gromacs/fileio/enxio.h
src/gromacs/fileio/gmxfio-xdr.c
src/gromacs/fileio/gmxfio-xdr.h [new file with mode: 0644]
src/gromacs/fileio/gmxfio.c
src/gromacs/fileio/gmxfio.h
src/gromacs/fileio/mdoutf.c
src/gromacs/fileio/mtxio.c
src/gromacs/fileio/tngio.cpp
src/gromacs/fileio/tpxio.c
src/gromacs/fileio/tpxio.h
src/gromacs/fileio/trnio.c
src/gromacs/fileio/trnio.h
src/gromacs/fileio/trxio.c
src/gromacs/fileio/trxio.h
src/gromacs/fileio/xdrf.h
src/gromacs/fileio/xtcio.c
src/gromacs/fileio/xtcio.h
src/gromacs/gmxana/eigio.c
src/gromacs/gmxana/gmx_anaeig.c
src/gromacs/gmxana/gmx_angle.c
src/gromacs/gmxana/gmx_chi.c
src/gromacs/gmxana/gmx_clustsize.c
src/gromacs/gmxana/gmx_confrms.c
src/gromacs/gmxana/gmx_current.c
src/gromacs/gmxana/gmx_densmap.c
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.c
src/gromacs/gmxana/gmx_do_dssp.c
src/gromacs/gmxana/gmx_dos.c
src/gromacs/gmxana/gmx_dyecoupl.c
src/gromacs/gmxana/gmx_editconf.c
src/gromacs/gmxana/gmx_eneconv.c
src/gromacs/gmxana/gmx_enemat.c
src/gromacs/gmxana/gmx_energy.c
src/gromacs/gmxana/gmx_hydorder.c
src/gromacs/gmxana/gmx_mdmat.c
src/gromacs/gmxana/gmx_mindist.c
src/gromacs/gmxana/gmx_mk_angndx.c
src/gromacs/gmxana/gmx_morph.c
src/gromacs/gmxana/gmx_nmens.c
src/gromacs/gmxana/gmx_nmtraj.c
src/gromacs/gmxana/gmx_order.c
src/gromacs/gmxana/gmx_polystat.c
src/gromacs/gmxana/gmx_principal.c
src/gromacs/gmxana/gmx_rmsdist.c
src/gromacs/gmxana/gmx_rmsf.c
src/gromacs/gmxana/gmx_saltbr.c
src/gromacs/gmxana/gmx_sans.c
src/gromacs/gmxana/gmx_sorient.c
src/gromacs/gmxana/gmx_spatial.c
src/gromacs/gmxana/gmx_spol.c
src/gromacs/gmxana/gmx_traj.c
src/gromacs/gmxana/gmx_tune_pme.c
src/gromacs/gmxana/gmx_vanhove.c
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/gmx_xpm2ps.c
src/gromacs/gmxana/nrama.c
src/gromacs/gmxana/sfactor.c
src/gromacs/gmxlib/checkpoint.cpp
src/gromacs/gmxlib/txtdump.c
src/gromacs/gmxpreprocess/genconf.c
src/gromacs/gmxpreprocess/grompp.c
src/gromacs/gmxpreprocess/h_db.c
src/gromacs/gmxpreprocess/nm2type.c
src/gromacs/gmxpreprocess/readrot.c
src/gromacs/imd/imd.c
src/gromacs/legacyheaders/checkpoint.h
src/gromacs/mdlib/clincs.cpp
src/gromacs/mdlib/coupling.cpp
src/gromacs/mdlib/ebin.c
src/gromacs/mdlib/force.cpp
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/mdebin_bar.c
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/stat.cpp
src/gromacs/mdlib/tables.c
src/gromacs/mdlib/tpi.cpp
src/gromacs/selection/tests/toputils.cpp
src/gromacs/swap/swapcoords.cpp
src/gromacs/tools/convert_tpr.c
src/gromacs/tools/dump.c
src/gromacs/topology/symtab.cpp
src/gromacs/trajectoryanalysis/runnercommon.cpp
src/programs/mdrun/runner.cpp

index 80474afb71aa50254b82b340ac4b8a854b94cec7..dfd884995431d72b1bf18c42e5de0515cee9e615 100644 (file)
@@ -54,7 +54,6 @@
 #include "gbutil.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/gmxfio.h"
 
 typedef struct {
     int resnr; 
index c9b34b1da1f0538caabee990e9f9d6e0caaa1c46..892ef18119eead0d04ae0aa1f3f8f2fb5b73cc65 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,6 +42,7 @@
 #include <string.h>
 
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
 #include "gromacs/fileio/xdrf.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/math/vec.h"
@@ -387,8 +388,6 @@ void do_enxnms(ener_file_t ef, int *nre, gmx_enxnm_t **nms)
     int      file_version;
     int      i;
 
-    gmx_fio_checktype(ef->fio);
-
     xdr = gmx_fio_getxdr(ef->fio);
 
     if (!xdr_int(xdr, &magic))
@@ -777,7 +776,6 @@ ener_file_t open_enx(const char *fn, const char *mode)
     if (mode[0] == 'r')
     {
         ef->fio = gmx_fio_open(fn, mode);
-        gmx_fio_checktype(ef->fio);
         gmx_fio_setprecision(ef->fio, FALSE);
         do_enxnms(ef, &nre, &nms);
         snew(fr, 1);
@@ -798,7 +796,6 @@ ener_file_t open_enx(const char *fn, const char *mode)
         else
         {
             gmx_fio_rewind(ef->fio);
-            gmx_fio_checktype(ef->fio);
             gmx_fio_setprecision(ef->fio, TRUE);
             do_enxnms(ef, &nre, &nms);
             do_eheader(ef, &file_version, fr, nre, &bWrongPrecision, &bOK);
@@ -931,7 +928,6 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr)
         fr->e_size = fr->nre*sizeof(fr->ener[0].e)*4;
         /*d_size = fr->ndisre*(sizeof(real)*2);*/
     }
-    gmx_fio_checktype(ef->fio);
 
     if (!do_eheader(ef, &file_version, fr, -1, NULL, &bOK))
     {
index c8434ab2b53135cb6b2c2639b5b4f75f9f14509e..9120feabbad258f23a586638d1dea3628988285a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -37,7 +37,6 @@
 #ifndef GMX_FILEIO_ENXIO_H
 #define GMX_FILEIO_ENXIO_H
 
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xdr_datatype.h"
 #include "gromacs/legacyheaders/types/energy.h"
 #include "gromacs/legacyheaders/types/inputrec.h"
@@ -48,6 +47,7 @@ extern "C" {
 #endif
 
 struct gmx_groups_t;
+struct t_fileio;
 
 /**************************************************************
  * These are the base datatypes + functions for reading and
@@ -175,7 +175,7 @@ void free_enxframe(t_enxframe *ef);
 
 ener_file_t open_enx(const char *fn, const char *mode);
 
-t_fileio *enx_file_pointer(const ener_file_t ef);
+struct t_fileio *enx_file_pointer(const ener_file_t ef);
 
 void close_enx(ener_file_t ef);
 
index 6b9b5eb56238e67d5fa27868ab6db6ffd974b730..2c6f98fef3acc8945cfb6854ebdbc31a77315a77 100644 (file)
@@ -36,6 +36,9 @@
  */
 #include "gmxpre.h"
 
+#include "gmxfio-xdr.h"
+
+#include <assert.h>
 #include <stdio.h>
 #include <string.h>
 
 
 #include "gmxfio-impl.h"
 
+/* Enumerated for data types in files */
+enum {
+    eioREAL, eioFLOAT, eioDOUBLE, eioINT, eioINT64,
+    eioUCHAR, eioNUCHAR, eioUSHORT,
+    eioRVEC, eioNRVEC, eioIVEC, eioSTRING, eioNR
+};
+
 static const char *eioNames[eioNR] =
 {
     "REAL", "INT", "GMX_STE_T", "UCHAR", "NUCHAR", "USHORT", "RVEC", "NRVEC",
     "IVEC", "STRING"
 };
 
+XDR *gmx_fio_getxdr(t_fileio *fio)
+{
+    XDR *ret = NULL;
+    gmx_fio_lock(fio);
+    assert(fio->xdr != NULL);
+    ret = fio->xdr;
+    gmx_fio_unlock(fio);
+    return ret;
+}
+
 /* check the number of items given against the type */
 static void gmx_fio_check_nitem(int eio, int nitem, const char *file, int line)
 {
@@ -64,7 +84,6 @@ static void gmx_fio_check_nitem(int eio, int nitem, const char *file, int line)
     }
 }
 
-
 /* output a data type error. */
 static void gmx_fio_fe(t_fileio *fio, int eio, const char *desc,
                        const char *srcfile, int line)
@@ -92,6 +111,7 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio,
     double          d = 0;
     float           f = 0;
 
+    assert(fio->xdr != NULL);
     gmx_fio_check_nitem(eio, nitem, srcfile, line);
     switch (eio)
     {
diff --git a/src/gromacs/fileio/gmxfio-xdr.h b/src/gromacs/fileio/gmxfio-xdr.h
new file mode 100644 (file)
index 0000000..17c3fbc
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#ifndef GMX_FILEIO_GMXFIO_XDR_H
+#define GMX_FILEIO_GMXFIO_XDR_H
+
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct t_fileio;
+
+XDR *gmx_fio_getxdr(struct t_fileio *fio);
+/* Return the file pointer itself */
+
+gmx_bool gmx_fio_writee_string(struct t_fileio *fio, const char *item,
+                               const char *desc, const char *srcfile, int line);
+
+/* reading or writing, depending on the file's opening mode string */
+gmx_bool gmx_fio_doe_real(struct t_fileio *fio, real *item,
+                          const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_float(struct t_fileio *fio, float *item,
+                           const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_double(struct t_fileio *fio, double *item,
+                            const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_gmx_bool(struct t_fileio *fio, gmx_bool *item,
+                              const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_int(struct t_fileio *fio, int *item,
+                         const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_int64(struct t_fileio *fio, gmx_int64_t *item,
+                           const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_uchar(struct t_fileio *fio, unsigned char *item,
+                           const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_ushort(struct t_fileio *fio, unsigned short *item,
+                            const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_rvec(struct t_fileio *fio, rvec *item,
+                          const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_ivec(struct t_fileio *fio, ivec *item,
+                          const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_string(struct t_fileio *fio, char *item,
+                            const char *desc, const char *srcfile, int line);
+
+/* array reading & writing */
+gmx_bool gmx_fio_ndoe_real(struct t_fileio *fio, real *item, int n,
+                           const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_float(struct t_fileio *fio, float *item, int n,
+                            const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_double(struct t_fileio *fio, double *item, int n,
+                             const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_gmx_bool(struct t_fileio *fio, gmx_bool *item, int n,
+                               const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_int(struct t_fileio *fio, int *item, int n,
+                          const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_int64(struct t_fileio *fio, gmx_int64_t *item, int n,
+                            const char *desc, const char *srcfile,
+                            int line);
+gmx_bool gmx_fio_ndoe_uchar(struct t_fileio *fio, unsigned char *item, int n,
+                            const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_ushort(struct t_fileio *fio, unsigned short *item, int n,
+                             const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_rvec(struct t_fileio *fio, rvec *item, int n,
+                           const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_ivec(struct t_fileio *fio, ivec *item, int n,
+                           const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_string(struct t_fileio *fio, char *item[], int n,
+                             const char *desc, const char *srcfile, int line);
+
+
+
+/* convenience macros */
+#define gmx_fio_write_string(fio, item)         gmx_fio_writee_string(fio, item, (#item), __FILE__, __LINE__)
+
+#define gmx_fio_do_real(fio, item)              gmx_fio_doe_real(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_float(fio, item)             gmx_fio_doe_float(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_double(fio, item)            gmx_fio_doe_double(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_gmx_bool(fio, item)          gmx_fio_doe_gmx_bool(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_int(fio, item)               gmx_fio_doe_int(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_int64(fio, item)             gmx_fio_doe_int64(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_uchar(fio, item)             gmx_fio_doe_uchar(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_ushort(fio, item)            gmx_fio_doe_ushort(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_rvec(fio, item)              gmx_fio_doe_rvec(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_ivec(fio, item)              gmx_fio_doe_ivec(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_string(fio, item)            gmx_fio_doe_string(fio, item, (#item), __FILE__, __LINE__)
+
+
+#define gmx_fio_ndo_real(fio, item, n)              gmx_fio_ndoe_real(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_float(fio, item, n)             gmx_fio_ndoe_float(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_double(fio, item, n)            gmx_fio_ndoe_double(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_gmx_bool(fio, item, n)          gmx_fio_ndoe_gmx_bool(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_int(fio, item, n)               gmx_fio_ndoe_int(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_int64(fio, item, n)             gmx_fio_ndoe_int64(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_uchar(fio, item, n)             gmx_fio_ndoe_uchar(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_ushort(fio, item, n)            gmx_fio_ndoe_ushort(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_rvec(fio, item, n)              gmx_fio_ndoe_rvec(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_ivec(fio, item, n)              gmx_fio_ndoe_ivec(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_string(fio, item, n)            gmx_fio_ndoe_string(fio, item, n, (#item), __FILE__, __LINE__)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 6b000142439d2e8c9e10bc48e3a575d89d0915b2..3f92499313029947239e51cd79cfe8c08c540687 100644 (file)
@@ -685,17 +685,6 @@ int gmx_fio_get_output_file_positions(gmx_file_position_t **p_outputfiles,
 }
 
 
-void gmx_fio_checktype(t_fileio *fio)
-{
-    if (!ftp_is_xdr(fio->iFTP))
-    {
-        gmx_fatal(FARGS, "Can not read/write topologies to file type %s",
-                  ftp2ext(fio->iFTP));
-    }
-
-}
-
-
 void gmx_fio_setprecision(t_fileio *fio, gmx_bool bDouble)
 {
     gmx_fio_lock(fio);
@@ -874,20 +863,6 @@ FILE *gmx_fio_getfp(t_fileio *fio)
     return ret;
 }
 
-XDR *gmx_fio_getxdr(t_fileio* fio)
-{
-    XDR *ret = NULL;
-
-    gmx_fio_lock(fio);
-    if (fio->xdr)
-    {
-        ret = fio->xdr;
-    }
-    gmx_fio_unlock(fio);
-
-    return ret;
-}
-
 gmx_bool gmx_fio_getread(t_fileio* fio)
 {
     gmx_bool ret;
index 21116b765d90e85b01f288fbe6945ce675451b0a..dabf39c7eb9878ecb256bc38f9b9b8153bcf2a3f 100644 (file)
 #ifdef __cplusplus
 extern "C" {
 #endif
-/* types */
-
-/* Enumerated for data types in files */
-enum {
-    eioREAL, eioFLOAT, eioDOUBLE, eioINT, eioINT64,
-    eioUCHAR, eioNUCHAR, eioUSHORT,
-    eioRVEC, eioNRVEC, eioIVEC, eioSTRING, eioNR
-};
 
 typedef struct t_fileio t_fileio;
 
@@ -123,10 +115,6 @@ void gmx_fio_setdebug(t_fileio *fio, gmx_bool bDebug);
 gmx_bool gmx_fio_getread(t_fileio *fio);
 /* Return  whether read mode is on in fio  */
 
-
-void gmx_fio_checktype(t_fileio *fio);
-/* Check whether the fio is of a sane type */
-
 /***************************************************
  * FILE Operations
  ***************************************************/
@@ -159,7 +147,7 @@ FILE *gmx_fio_getfp(t_fileio *fio);
  * If you do not have it on some other platform you do not have largefile
  * support at all, and you can define it to int (or better, find out how to
  * enable large files).  */
-typedef struct
+typedef struct gmx_file_position_t
 {
     char          filename[STRLEN];
     gmx_off_t     offset;
@@ -199,93 +187,6 @@ int gmx_fio_get_file_md5(t_fileio *fio, gmx_off_t offset,
 int xtc_seek_time(t_fileio *fio, real time, int natoms, gmx_bool bSeekForwardOnly);
 
 
-/********************************************************
- * Read and write
- ********************************************************/
-
-
-gmx_bool gmx_fio_writee_string(t_fileio *fio, const char *item,
-                               const char *desc, const char *srcfile, int line);
-
-/* reading or writing, depending on the file's opening mode string */
-gmx_bool gmx_fio_doe_real(t_fileio *fio, real *item,
-                          const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_float(t_fileio *fio, float *item,
-                           const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_double(t_fileio *fio, double *item,
-                            const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_gmx_bool(t_fileio *fio, gmx_bool *item,
-                              const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_int(t_fileio *fio, int *item,
-                         const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_int64(t_fileio *fio, gmx_int64_t *item,
-                           const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_uchar(t_fileio *fio, unsigned char *item,
-                           const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_ushort(t_fileio *fio, unsigned short *item,
-                            const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_rvec(t_fileio *fio, rvec *item,
-                          const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_ivec(t_fileio *fio, ivec *item,
-                          const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_string(t_fileio *fio, char *item,
-                            const char *desc, const char *srcfile, int line);
-
-/* array reading & writing */
-gmx_bool gmx_fio_ndoe_real(t_fileio *fio, real *item, int n,
-                           const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_float(t_fileio *fio, float *item, int n,
-                            const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_double(t_fileio *fio, double *item, int n,
-                             const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_gmx_bool(t_fileio *fio, gmx_bool *item, int n,
-                               const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_int(t_fileio *fio, int *item, int n,
-                          const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_int64(t_fileio *fio, gmx_int64_t *item, int n,
-                            const char *desc, const char *srcfile,
-                            int line);
-gmx_bool gmx_fio_ndoe_uchar(t_fileio *fio, unsigned char *item, int n,
-                            const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_ushort(t_fileio *fio, unsigned short *item, int n,
-                             const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_rvec(t_fileio *fio, rvec *item, int n,
-                           const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_ivec(t_fileio *fio, ivec *item, int n,
-                           const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_string(t_fileio *fio, char *item[], int n,
-                             const char *desc, const char *srcfile, int line);
-
-
-
-/* convenience macros */
-#define gmx_fio_write_string(fio, item)         gmx_fio_writee_string(fio, item, (#item), __FILE__, __LINE__)
-
-#define gmx_fio_do_real(fio, item)              gmx_fio_doe_real(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_float(fio, item)             gmx_fio_doe_float(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_double(fio, item)            gmx_fio_doe_double(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_gmx_bool(fio, item)          gmx_fio_doe_gmx_bool(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_int(fio, item)               gmx_fio_doe_int(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_int64(fio, item)             gmx_fio_doe_int64(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_uchar(fio, item)             gmx_fio_doe_uchar(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_ushort(fio, item)            gmx_fio_doe_ushort(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_rvec(fio, item)              gmx_fio_doe_rvec(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_ivec(fio, item)              gmx_fio_doe_ivec(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_string(fio, item)            gmx_fio_doe_string(fio, item, (#item), __FILE__, __LINE__)
-
-
-#define gmx_fio_ndo_real(fio, item, n)              gmx_fio_ndoe_real(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_float(fio, item, n)             gmx_fio_ndoe_float(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_double(fio, item, n)            gmx_fio_ndoe_double(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_gmx_bool(fio, item, n)          gmx_fio_ndoe_gmx_bool(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_int(fio, item, n)               gmx_fio_ndoe_int(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_int64(fio, item, n)             gmx_fio_ndoe_int64(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_uchar(fio, item, n)             gmx_fio_ndoe_uchar(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_ushort(fio, item, n)            gmx_fio_ndoe_ushort(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_rvec(fio, item, n)              gmx_fio_ndoe_rvec(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_ivec(fio, item, n)              gmx_fio_ndoe_ivec(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_string(fio, item, n)            gmx_fio_ndoe_string(fio, item, n, (#item), __FILE__, __LINE__)
-
 #ifdef __cplusplus
 }
 #endif
index bda0a7ac85d842308719eefc8e965be0711ee060..5cab6d917ad171731e14da6092cc8dc34e2ea7a7 100644 (file)
@@ -37,6 +37,7 @@
 #include "mdoutf.h"
 
 #include "gromacs/domdec/domdec.h"
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/tngio.h"
 #include "gromacs/fileio/trajectory_writing.h"
 #include "gromacs/fileio/trnio.h"
index c36f464815f1b99c2fa8ad16dbab21183f60c9cf..ae9b15d9e8a79bda91737282740a5e521ccc6d8a 100644 (file)
@@ -44,7 +44,7 @@
  */
 
 #include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/xdrf.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/fatalerror.h"
@@ -86,7 +86,6 @@ void gmx_mtxio_write(const char *             filename,
                      gmx_sparsematrix_t *     sparse_matrix)
 {
     t_fileio   *fio;
-    XDR     *   xd;
     int         i, j, prec;
     gmx_bool    bDum  = TRUE;
     gmx_bool    bRead = FALSE;
@@ -98,8 +97,6 @@ void gmx_mtxio_write(const char *             filename,
     }
 
     fio = gmx_fio_open(filename, "w");
-    gmx_fio_checktype(fio);
-    xd = gmx_fio_getxdr(fio);
 
     /* Write magic number */
     i = GMX_MTXIO_MAGIC_NUMBER;
@@ -164,7 +161,6 @@ gmx_mtxio_read (const char *            filename,
                 gmx_sparsematrix_t **   sparse_matrix)
 {
     t_fileio   *fio;
-    XDR     *   xd;
     int         i, j, prec;
     gmx_bool    bDum  = TRUE;
     gmx_bool    bRead = TRUE;
@@ -172,8 +168,6 @@ gmx_mtxio_read (const char *            filename,
     size_t      sz;
 
     fio = gmx_fio_open(filename, "r");
-    gmx_fio_checktype(fio);
-    xd = gmx_fio_getxdr(fio);
 
     /* Read and check magic number */
     i = GMX_MTXIO_MAGIC_NUMBER;
index 417c246ca34101e15d794255fd61bd7feb2dd1d9..55d04721118a938d5869d18f31aa28a51bf12b29 100644 (file)
@@ -42,7 +42,6 @@
 #include "tng/tng_io.h"
 #endif
 
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/types/ifunc.h"
 #include "gromacs/math/units.h"
@@ -50,6 +49,7 @@
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/sysinfo.h"
index 085cd5c9afd8cff0aa8137a18a5a35c4ab6d9bb5..63f76d6f1c7a6aaf67a6bf6aa989b23f683f7cb7 100644 (file)
@@ -46,6 +46,7 @@
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/names.h"
@@ -3221,7 +3222,6 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx,
     int       idum = 0;
     real      rdum = 0;
 
-    gmx_fio_checktype(fio);
     gmx_fio_setdebug(fio, bDebugMode());
 
     /* XDR binary topology file */
@@ -3640,22 +3640,22 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     return ePBC;
 }
 
-/************************************************************
- *
- *  The following routines are the exported ones
- *
- ************************************************************/
-
-t_fileio *open_tpx(const char *fn, const char *mode)
+static t_fileio *open_tpx(const char *fn, const char *mode)
 {
     return gmx_fio_open(fn, mode);
 }
 
-void close_tpx(t_fileio *fio)
+static void close_tpx(t_fileio *fio)
 {
     gmx_fio_close(fio);
 }
 
+/************************************************************
+ *
+ *  The following routines are the exported ones
+ *
+ ************************************************************/
+
 void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK,
                     int *file_version, int *file_generation)
 {
index 0b3ca43e312d08841fb44c7c0725ea8f92664363..d85a8e3a0fea91241d0c8cf85b424637bf76850c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  *
  * The routines in the corresponding c-file tpxio.c
  * are based on the lower level routines in gmxfio.c
- * The integer file pointer returned from open_tpx
- * can also be used with the routines in gmxfio.h
  *
  **************************************************************/
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/legacyheaders/types/state.h"
 
@@ -85,18 +82,11 @@ typedef struct
  * These routines handle reading and writing of preprocessed
  * topology files in any of the following formats:
  * TPR : topology in XDR format, portable accross platforms
- * TRR : trajectory in XDR format (non compressed)
  *
  * Files are written in the precision with which the source are compiled,
  * but double and single precision can be read by either.
  */
 
-t_fileio *open_tpx(const char *fn, const char *mode);
-/* Return an file pointer corresponding to the file you have just opened */
-
-void close_tpx(t_fileio *fio);
-/*  Close the file corresponding to fio */
-
 void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK,
                     int *version, int *generation);
 /* Read the header from a tpx file and then close it again.
index f1eadbd5f3811673e013a443661438cf9ff76f49..5afef1afa2caf84c9f83232ef128017d399e5027 100644 (file)
@@ -41,6 +41,7 @@
 #include <string.h>
 
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/utility/fatalerror.h"
@@ -91,8 +92,6 @@ static gmx_bool do_trnheader(t_fileio *fio, gmx_bool bRead, t_trnheader *sh, gmx
 
     *bOK = TRUE;
 
-    gmx_fio_checktype(fio);
-
     if (!gmx_fio_do_int(fio, magic) || magic != GROMACS_MAGIC)
     {
         return FALSE;
index 57fb51bd6f6c849494d8f7a45f5438ac577c1ab0..3550790f912b067fc04bcb6963cf18b2334b8d92 100644 (file)
 #ifndef GMX_FILEIO_TRNIO_H
 #define GMX_FILEIO_TRNIO_H
 
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
 /**************************************************************
  *
  * These routines handle trr (trajectory) I/O, they read and
  *
  **************************************************************/
 
-#include "gromacs/fileio/gmxfio.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_fileio;
+
 typedef struct           /* This struct describes the order and the    */
                          /* sizes of the structs in a trjfile, sizes are given in bytes.       */
 {
@@ -82,13 +86,13 @@ typedef struct           /* This struct describes the order and the */
     int       fep_state; /* Current value of alchemical state */
 } t_trnheader;
 
-t_fileio *open_trn(const char *fn, const char *mode);
+struct t_fileio *open_trn(const char *fn, const char *mode);
 /* Open a trr / trr file */
 
-void close_trn(t_fileio *fio);
+void close_trn(struct t_fileio *fio);
 /* Close it */
 
-gmx_bool fread_trnheader(t_fileio *fio, t_trnheader *trn, gmx_bool *bOK);
+gmx_bool fread_trnheader(struct t_fileio *fio, t_trnheader *trn, gmx_bool *bOK);
 /* Read the header of a trn file. Return FALSE if there is no frame.
  * bOK will be FALSE when the header is incomplete.
  */
@@ -97,18 +101,18 @@ void read_trnheader(const char *fn, t_trnheader *header);
 /* Read the header of a trn file from fn, and close the file afterwards.
  */
 
-void fwrite_trn(t_fileio *fio, int step, real t, real lambda,
+void fwrite_trn(struct t_fileio *fio, int step, real t, real lambda,
                 rvec *box, int natoms, rvec *x, rvec *v, rvec *f);
 /* Write a trn frame to file fp, box, x, v, f may be NULL */
 
-gmx_bool fread_htrn(t_fileio *fio, t_trnheader *sh,
+gmx_bool fread_htrn(struct t_fileio *fio, t_trnheader *sh,
                     rvec *box, rvec *x, rvec *v, rvec *f);
 /* Extern read a frame except the header (that should be pre-read,
  * using routine read_trnheader, see above) from a trn file.
  * Return FALSE on error
  */
 
-gmx_bool fread_trn(t_fileio *fio, int *step, real *t, real *lambda,
+gmx_bool fread_trn(struct t_fileio *fio, int *step, real *t, real *lambda,
                    rvec *box, int *natoms, rvec *x, rvec *v, rvec *f);
 /* Read a trn frame, including the header from fp. box, x, v, f may
  * be NULL, in which case the data will be skipped over.
index 084b9325c39bca352f479da88a805a0752e0f8f6..8c296dcee574e0163a8d0e35d794817271742486 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/timecontrol.h"
 #include "gromacs/fileio/tngio.h"
index 0d32e364051a95bccbe9a4cecb6bae2050dc91e4..29a93693c9b70985c126b3c1c37b818632a1112b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,6 @@
 #define GMX_FILEIO_TRXIO_H
 
 #include "gromacs/fileio/filenm.h"
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/legacyheaders/oenv.h"
 #include "gromacs/legacyheaders/readinp.h"
@@ -53,6 +52,7 @@ extern "C" {
 
 struct gmx_mtop_t;
 struct t_atoms;
+struct t_fileio;
 struct t_topology;
 struct t_trxframe;
 
@@ -144,7 +144,7 @@ void close_trx(t_trxstatus *status);
 t_trxstatus *open_trx(const char *outfile, const char *filemode);
 /* Open a TRX file and return an allocated status pointer */
 
-t_fileio *trx_get_fileio(t_trxstatus *status);
+struct t_fileio *trx_get_fileio(t_trxstatus *status);
 /* get a fileio from a trxstatus */
 
 float trx_get_time_of_final_frame(t_trxstatus *status);
index dd2959e9863924c8b3f5e9ae6ebdffe0d0fcfba2..f58ffb9f5556d5aa6c7ad747639b798c7b52538e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -59,8 +59,6 @@
 extern "C" {
 #endif
 
-struct t_fileio;
-
 /* Read or write reduced precision *float* coordinates */
 int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision);
 
@@ -92,16 +90,6 @@ float xdr_xtc_get_last_frame_time(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bO
 
 int xdr_xtc_get_last_frame_number(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK);
 
-
-/* Defined in gmxfio.c.
- * TODO: It would be nice to decouple this header from t_fileio completely,
- * and not need the XDR struct in gmxfio.h, but that would require some
- * extra code that is not warranted for this single function.
- * Can be reconsidered if the file I/O gets refactored in the future.
- */
-XDR *gmx_fio_getxdr(struct t_fileio *fio);
-/* Return the file pointer itself */
-
 #ifdef __cplusplus
 }
 #endif
index 248146417a3c9b66342d7cf088c48563922c8f4c..a477f568d5658f2769fd52b2fa4a40e498eca232 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,6 +41,7 @@
 #include <string.h>
 
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
 #include "gromacs/fileio/xdrf.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/utility/fatalerror.h"
@@ -92,7 +93,7 @@ static void check_xtc_magic(int magic)
     }
 }
 
-int xtc_check(const char *str, gmx_bool bResult, const char *file, int line)
+static int xtc_check(const char *str, gmx_bool bResult, const char *file, int line)
 {
     if (!bResult)
     {
@@ -106,14 +107,7 @@ int xtc_check(const char *str, gmx_bool bResult, const char *file, int line)
     return 1;
 }
 
-void xtc_check_fat_err(const char *str, gmx_bool bResult, const char *file, int line)
-{
-    if (!bResult)
-    {
-        gmx_fatal(FARGS, "XTC read/write of %s failed, "
-                  "source file %s, line %d\n", str, file, line);
-    }
-}
+#define XTC_CHECK(s, b) xtc_check(s, b, __FILE__, __LINE__)
 
 static int xtc_header(XDR *xd, int *magic, int *natoms, int *step, real *time,
                       gmx_bool bRead, gmx_bool *bOK)
index 2c50fb89f0bc5300b79069b29f7e84593636ea39..1d173f8ea5708d1f1afbebb2c908b526012c2eab 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,6 @@
 #ifndef GMX_FILEIO_XTCIO_H
 #define GMX_FILEIO_XTCIO_H
 
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 extern "C" {
 #endif
 
+struct t_fileio;
+
 /* All functions return 1 if successful, 0 otherwise
  * bOK tells if a frame is not corrupted
  */
 
-t_fileio *open_xtc(const char *filename, const char *mode);
+struct t_fileio *open_xtc(const char *filename, const char *mode);
 /* Open a file for xdr I/O */
 
-void close_xtc(t_fileio *fio);
+void close_xtc(struct t_fileio *fio);
 /* Close the file for xdr I/O */
 
-int read_first_xtc(t_fileio *fio,
+int read_first_xtc(struct t_fileio *fio,
                    int *natoms, int *step, real *time,
                    matrix box, rvec **x, real *prec, gmx_bool *bOK);
 /* Open xtc file, read xtc file first time, allocate memory for x */
 
-int read_next_xtc(t_fileio *fio,
+int read_next_xtc(struct t_fileio *fio,
                   int natoms, int *step, real *time,
                   matrix box, rvec *x, real *prec, gmx_bool *bOK);
 /* Read subsequent frames */
 
-int write_xtc(t_fileio *fio,
+int write_xtc(struct t_fileio *fio,
               int natoms, int step, real time,
               matrix box, rvec *x, real prec);
 /* Write a frame to xtc file */
 
-int xtc_check(const char *str, gmx_bool bResult, const char *file, int line);
-#define XTC_CHECK(s, b) xtc_check(s, b, __FILE__, __LINE__)
-
-void xtc_check_fat_err(const char *str, gmx_bool bResult, const char *file, int line);
-#define XTC_CHECK_FAT_ERR(s, b) xtc_check_fat_err(s, b, __FILE__, __LINE__)
-
 #ifdef __cplusplus
 }
 #endif
index 8d65ffbc59ab3123577f8604cf5b7af5a2a8f26e..78649cc2f5e3b0d16bd692b92b68a666726a79e2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -50,12 +50,12 @@ void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
                        int *nvec, int **eignr,
                        rvec ***eigvec, real **eigval)
 {
-    t_trnheader head;
-    int         i, snew_size;
-    t_fileio   *status;
-    rvec       *x;
-    matrix      box;
-    gmx_bool    bOK;
+    t_trnheader        head;
+    int                i, snew_size;
+    struct t_fileio   *status;
+    rvec              *x;
+    matrix             box;
+    gmx_bool           bOK;
 
     *bDMR = FALSE;
 
@@ -145,10 +145,10 @@ void write_eigenvectors(const char *trnname, int natoms, real mat[],
                         int WriteXref, rvec *xref, gmx_bool bDMR,
                         rvec xav[], gmx_bool bDMA, real eigval[])
 {
-    t_fileio *trnout;
-    int       ndim, i, j, d, vec;
-    matrix    zerobox;
-    rvec     *x;
+    struct t_fileio *trnout;
+    int              ndim, i, j, d, vec;
+    matrix           zerobox;
+    rvec            *x;
 
     ndim = natoms*DIM;
     clear_mat(zerobox);
@@ -159,7 +159,7 @@ void write_eigenvectors(const char *trnname, int natoms, real mat[],
              (WriteXref == eWXR_YES) ? "reference, " : "",
              begin, end, trnname);
 
-    trnout = open_tpx(trnname, "w");
+    trnout = open_trn(trnname, "w");
     if (WriteXref == eWXR_YES)
     {
         /* misuse lambda: 0/1 mass weighted fit no/yes */
index 9f1ae46c1477189b0b37042259d419c287639b42..08441f75603d56c40d577ba27323d4bb782a83b9 100644 (file)
@@ -58,6 +58,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index abbe1f8820ac9b7402ce2afaa225a0f3ada17597..88304ed029ab441202a6c11e67934f7e0000ba37 100644 (file)
 static void dump_dih_trn(int nframes, int nangles, real **dih, const char *fn,
                          real *time)
 {
-    int       i, j, k, l, m, na;
-    t_fileio *trn;
-    rvec     *x;
-    matrix    box = {{2, 0, 0}, {0, 2, 0}, {0, 0, 2}};
+    int              i, j, k, l, m, na;
+    struct t_fileio *trn;
+    rvec            *x;
+    matrix           box = {{2, 0, 0}, {0, 2, 0}, {0, 0, 2}};
 
     na = (nangles*2);
     if ((na % 3) != 0)
index f4156186fa3f8d0b233aac097bfc8bca981cdd6e..7067df816010d366e954d8a2687b54288457f0c0 100644 (file)
@@ -57,6 +57,7 @@
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/topology/residuetypes.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 89f899f0ac18f5a10aa010bd562ccdd64f30bed7..6aa02a2a954c7c72a62ad51966df3d4a5ae902d6 100644 (file)
@@ -53,6 +53,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/index.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 1bcbd5a60eef6be3e787f7c03bda6008e6a5c44d..c8768b9227a0c2d8e6f4fb9b6ac885d079282b33 100644 (file)
@@ -53,6 +53,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 18bf3476474c90683535b240ebddfa94eaa26fb5..3a91e57165d3bba7b802ea5a227f7e553844a379 100644 (file)
@@ -50,6 +50,7 @@
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/statistics/statistics.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index ab355db0e64216bf996cf8258932bda4bc4e8cf2..b32b789d0550aabacd134728e15ff17294475857 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 9f387ae8d32db64c2ef6d2c5c4aced15c003e932..2cdf41e9feb09781c7465e8265f003240bcd00fa 100644 (file)
@@ -63,6 +63,7 @@
 #include "gromacs/random/random.h"
 #include "gromacs/statistics/statistics.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
index 7cc6e085e6c8260dbe810560bff6709a745da470..bfe6cfdbeb28c36be7436947984ccda4a47c2b15 100644 (file)
@@ -68,6 +68,7 @@
 #include "gromacs/topology/index.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 typedef struct {
index 38c6de63d1251708db48b0797bdba44a80e575f1..27748988b65e5a2f8a2937e0b56cc93202026f2b 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 static int strip_dssp(char *dsspfile, int nres,
index 52a7d9d61ef50703e1d77167b23039cee49b8b36..7592091e9b5253518470e14026979b8945646846 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,6 +44,7 @@
 #include "gromacs/correlationfunctions/integrate.h"
 #include "gromacs/fft/fft.h"
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxana/gmx_ana.h"
index 0513f8f8a63f76033f60ebbe177b1378fed0ff83..2f985fa6e5469bbc262807293270a8d2dbadceca 100644 (file)
@@ -45,6 +45,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/index.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 int gmx_dyecoupl(int argc, char *argv[])
@@ -227,7 +228,7 @@ int gmx_dyecoupl(int argc, char *argv[])
 
             if (bDatout)
             {
-                datfp = fopen(out_datfile, "w");
+                datfp = gmx_ffopen(out_datfile, "w");
             }
 
             if (bRKout)
index 76945173633be528722f8e33264e675c70b41eac..6013b75f8e50020b3f860bea8449af440f4cb31e 100644 (file)
@@ -58,7 +58,9 @@
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/atomprop.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 typedef struct
index 87cf30d294fd835cab5392848d06b881834344a6..f04541ca90d32da08676ddacd812a2173d2f2456 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index acd82d595146d35a43bb1c48f5f89ef207f218d4..69da88fb2986491aa76f1bb8f5b3694dcc406997 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 
index d2595be547c6a100667c660b0c29255d488ef3be..fc2b29bbf882e5de776018d9b4364b41f0bb6438 100644 (file)
@@ -43,6 +43,7 @@
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/correlationfunctions/autocorr.h"
 #include "gromacs/fileio/enxio.h"
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/xvgr.h"
index 37038b0af4cddef9acaec5e815272eeb6df09eab..603b111b429fa54b37f911a2645d3e913bc63dd5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,6 +52,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index d3a409ee28d6823409ca7449d7febf8935c8dc6a..5aeb6eb931c597adfe0557ad2501123de32a3cc6 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 3c96ffb2c6a82b075ee849989d73701b512c78ee..82d7394ad47fddbe9143152ce5d9d087b6d38cd2 100644 (file)
@@ -53,6 +53,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
index 04741c1c61b318a291f068ca32c81e0e6492afe9..048d7452fa013cf7a8737b9c4a8fde44ae882c4f 100644 (file)
@@ -42,6 +42,7 @@
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 12c4269589daa88511e37e17a34ddd0f80169641..f185477853954e7f90d42e959567d90fc21630b4 100644 (file)
@@ -46,6 +46,7 @@
 #include "gromacs/math/do_fit.h"
 #include "gromacs/topology/atoms.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 0d005fe5cd4088a62aa8771b52fd9b9b215106f8..ea0391982597ad6aed913f00b6e7d9e51d6e28be 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,6 +52,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 008e3cc58e16693fd223788d2d5a9dfa18c13ce2..b20d0778844c389b90b68678b1d42962bf22b333 100644 (file)
@@ -51,6 +51,7 @@
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 81323175247e429135131a1f26ae4a2be9789639..61293ef43294a29d6e964e27a3cdc2b06a58ff33 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 4f129e40cbf1739a489beebabf8530d080b2f0f0..d174119ac54301394b32234d7852457921f6a5ad 100644 (file)
@@ -51,6 +51,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
index 45adaa478390379a7790614709567b7c77062e74..5c2a808ae2f735ae1a3c41a50f062ba610edb3f4 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
index ea2fff5a00d969f13a6fc6289498138c19552b2c..ddb5957837066e2919cc092d2d79191810b7c32e 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
index afca0061548c0f4ff860f1c8959b880dd47e6de4..8cb4bf99a99de389b763652e94a38b28cbc79a9b 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
index 11d7f1565ad5438d17e253a76f93cbe4d466d5ae..cc4417213daa0cc39ce816d0227a35ca93273b60 100644 (file)
@@ -48,6 +48,7 @@
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index fdff37b0ad33d8e99053e0e2eb56944ee6de0814..4b08d681a26bfa03c1687c190bf22b80bbb21a03 100644 (file)
@@ -50,6 +50,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxomp.h"
index 9b0f9e20a55881976b3d86ea1866d5af652b5426..a12f14bfb80e3ffad06e1f3c240b4dad7684e8fd 100644 (file)
@@ -48,6 +48,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index beeaf0d0e86b14fdcef437a7f9e86c48d52d8d13..cb3217179bfbdb2c2853ff11426fdd2a63f54ae8 100644 (file)
@@ -47,6 +47,8 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 static const double bohr = 0.529177249;  /* conversion factor to compensate for VMD plugin conversion... */
index 559aa2aa69af0657f68e0663e100510d68e483e1..8c6c25034026515bf520b741e5d36cbf7769e676 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 4846401597228ce87a4b08388a20c9925e706140..a0993acb1f1b94af80f3b9d16b3fe23f92f4feaf 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index b293179c076f7ac79819bdeb8b1d4531dd6e2e4e..838b98e72b57d0c2c09e93493d483999df411c12 100644 (file)
@@ -61,6 +61,7 @@
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 /* Enum for situations that can occur during log file parsing, the
index fa3567f02f62724442f08d8b0ec34c42d6fffad1..595ada61aeb15b7e23c21920fb6975c7aa411b0c 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
index bd8077af8a836d97a65ef112c9898273e8ce05a1..43ce3e50b1c2d68eb5ef4e573309d120c19b4c29 100644 (file)
@@ -64,6 +64,7 @@
 #include "gromacs/random/random.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/utility/smalloc.h"
 
index 8bf2b4d83a474022fbfded24d71859efcfd38328..83f5523ed7a4d93194ab5b028daad3cbb7944caf 100644 (file)
@@ -48,6 +48,7 @@
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 5c40c6755958a681e8150f16ce0e92d62251655b..165fb75b230750ea630dc639f0789ceab7754515 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,6 +43,7 @@
 
 #include "gromacs/listed-forces/bonded.h"
 #include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index f5cf0eb7878e27e1e60371d08ce30f72ae49a36c..79c86b761c429d3e503533eb0cb9938af7678967 100644 (file)
@@ -38,7 +38,6 @@
 
 #include "sfactor.h"
 
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/strdb.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
@@ -50,6 +49,7 @@
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 607f94974a2caa82ae7c2e59b4b7e990cda42c75..75bbd5cef573b2a695a5cbd354cd4ed355d003f4 100644 (file)
@@ -54,6 +54,7 @@
 #include "buildinfo.h"
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
 #include "gromacs/fileio/xdr_datatype.h"
 #include "gromacs/fileio/xdrf.h"
 #include "gromacs/legacyheaders/copyrite.h"
index 606a8f4c071633e7f87afd24673067f5f40fd288..db4b587bbb4e8c791380b973f5c310e6cb2e9b68 100644 (file)
@@ -48,6 +48,7 @@
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 9f9a57ce8cda8b3f08e81d47b2aa7b9273ffca21..01c998a13871720ccfdd54ff5dc642cb40686123 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -50,6 +50,7 @@
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 77bb8515f94b3122cdc720da099644b0b9060bf1..6be2102a68672de0baea594e1bafdbca928adcd2 100644 (file)
@@ -49,7 +49,6 @@
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/enxio.h"
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/trxio.h"
index f630ae787608c69c80730c6cd01c4e4ce7aee2e2..b63fdde27aea356c25cb2d89dfbbea668c91e017 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/gmxpreprocess/fflibutil.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/cstringutil.h"
index 41882302acdcf05967b850243e6ed6fdc053f8ad..9f02a585bdf7220f9e3f355d5d9f1105696b612e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -55,6 +55,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
index 5d9715f60deebf0169695e9aee0b0b177e874c9f..bd10df6e198993f69472abeb9bad5ef8f0873a2f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,6 +41,7 @@
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 36eed9785030d2fd6042eab96251796b4c002001..a21df8058428b0880ec43ab0e049247ab04764a7 100644 (file)
@@ -61,6 +61,7 @@
 #endif
 
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/imd/imdsocket.h"
 #include "gromacs/legacyheaders/gmx_ga2la.h"
index c85a99fa2f3954303d804b8fc58892ffa340d3a7..dfe40adafdb4a9642b759cb91b07c9b864b7dfa0 100644 (file)
 #ifndef _checkpoint_h
 #define _checkpoint_h
 
-
 #include "gromacs/fileio/filenm.h"
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct gmx_file_position_t;
+struct t_fileio;
+
 /* the name of the environment variable to disable fsync failure checks with */
 #define GMX_IGNORE_FSYNC_FAILURE_ENV "GMX_IGNORE_FSYNC_FAILURE"
 
@@ -86,7 +87,7 @@ void read_checkpoint_state(const char *fn, int *simulation_part,
                            gmx_int64_t *step, double *t, t_state *state);
 
 /* Read everything that can be stored in t_trxframe from a checkpoint file */
-void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr);
+void read_checkpoint_trxframe(struct t_fileio *fp, t_trxframe *fr);
 
 /* Print the complete contents of checkpoint file fn to out */
 void list_checkpoint(const char *fn, FILE *out);
@@ -115,10 +116,10 @@ void read_checkpoint_part_and_step(const char  *filename,
  * \param[out] outputfiles      Pointer to array of output file names from the previous run. Pointer is allocated in this function.
  */
 void
-read_checkpoint_simulation_part_and_filenames(t_fileio             *fp,
-                                              int                  *simulation_part,
-                                              int                  *nfiles,
-                                              gmx_file_position_t **outputfiles);
+read_checkpoint_simulation_part_and_filenames(struct t_fileio             *fp,
+                                              int                         *simulation_part,
+                                              int                         *nfiles,
+                                              struct gmx_file_position_t **outputfiles);
 
 #ifdef __cplusplus
 }
index 3e0f68c0b44ce6326bebcbf8382c2b93d0a52857..8f1bf9150f323ad134bc9bdc5ccc44162570c472 100644 (file)
@@ -46,7 +46,6 @@
 #include <algorithm>
 
 #include "gromacs/domdec/domdec.h"
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/legacyheaders/constr.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
@@ -63,6 +62,7 @@
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/bitmask.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/utility/smalloc.h"
index d0169dcdc28d4af97d65db9e4a2e5d454520ac33..0a7d423ccf629ff5d1359c6da25030059f2749d9 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 8056f1f9bf252e0cec24df9997742506017fc105..0fa41a72f6f7716d173810a5d4aba0028f10fbc2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -46,6 +46,7 @@
 #include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index d11bf98797cb09c62decffaa535145f606e9740d..20ecfe36bdc27f6cb3586aed03692ddd9a9e0bcc 100644 (file)
@@ -67,6 +67,7 @@
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 91f5c5f0893e2bc917be75426565b569b69a5ee0..7de43327b5d2a1e5456f216aef92012ba9f20f47 100644 (file)
@@ -80,6 +80,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index e351275864fe06b0e57b0059d7084235b07b6086..c2a596d9b26d8ff5dafeee428a0d97b971d72f07 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,7 +43,6 @@
 #include <string.h>
 
 #include "gromacs/fileio/enxio.h"
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/legacyheaders/mdebin.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/utility/fatalerror.h"
index 1d044cc92354f29763314e1c4213f9830a91dab2..b1ab19dbcb9c575a318d87e152f66a3f964b1163 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -61,6 +61,7 @@
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 6a30e1f0347e375ce88fb2bad2e7af6955574453..08ae193dff8597e59a38d4a67692e55326eb7d27 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -40,7 +40,6 @@
 #include <string.h>
 
 #include "gromacs/domdec/domdec.h"
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/xtcio.h"
 #include "gromacs/legacyheaders/checkpoint.h"
index ad8e473cf7cfd90f1824d07de242f0471556dc5f..a6f3b202258c34933727e335b9a0528af29a2e12 100644 (file)
@@ -40,7 +40,6 @@
 
 #include <math.h>
 
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/legacyheaders/force.h"
 #include "gromacs/legacyheaders/macros.h"
@@ -50,6 +49,7 @@
 #include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index 744efd51af0e059380d0ab0a151029c74749ed85..7ca2eeae92c7f530b0d76c365a11a851df505520 100644 (file)
@@ -46,7 +46,6 @@
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxlib/conformation-utilities.h"
@@ -73,6 +72,7 @@
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index eff1e0c3560af5c52fd69eac7fbb3c92742a0655..26fb504dcdf318749f505c37aa4b78f48280198e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/topology/atoms.h"
 #include "gromacs/topology/topology.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
index 6d1d944600274446a79f1b2130c3a924d94811a1..6314bbedf8f20e32b9d0f51c95073deb91bd36f9 100644 (file)
@@ -49,6 +49,7 @@
 #include <time.h>
 
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/macros.h"
index 94e24ffe32832132bd41dd248c7fad02c89ebef2..ff2fd1044719719d083a14534f8da82df4c32f86 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/topology/index.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
@@ -349,7 +350,7 @@ int gmx_convert_tpr(int argc, char *argv[])
     };
 
     const char       *top_fn, *frame_fn;
-    t_fileio         *fp;
+    struct t_fileio  *fp;
     ener_file_t       fp_ener = NULL;
     t_trnheader       head;
     int               i;
index b3ac4582c84b94e1ebf2ed481e5f6fa16ee88e27..76dd6f7df7dac4bd19899a80646ec63caa663166 100644 (file)
@@ -206,7 +206,7 @@ static void list_top(const char *fn)
 
 static void list_trn(const char *fn)
 {
-    t_fileio       *fpread, *fpwrite;
+    t_fileio       *fpread;
     int             nframe, indent;
     char            buf[256];
     rvec           *x, *v, *f;
@@ -215,8 +215,6 @@ static void list_trn(const char *fn)
     gmx_bool        bOK;
 
     fpread  = open_trn(fn, "r");
-    fpwrite = open_tpx(NULL, "w");
-    gmx_fio_setdebug(fpwrite, TRUE);
 
     nframe = 0;
     while (fread_trnheader(fpread, &trn, &bOK))
@@ -269,7 +267,6 @@ static void list_trn(const char *fn)
         fprintf(stderr, "\nWARNING: Incomplete frame header: nr %d, t=%g\n",
                 nframe, trn.t);
     }
-    close_tpx(fpwrite);
     close_trn(fpread);
 }
 
index 678088f47842a79d9eacfc45b67dfead0d784115..07c11cdd42e6af41b8d3b6265d9303cfdbc4c418 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,6 +45,7 @@
 
 #include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 4d9513ed28d6268e8245c7eebea9125b1f535e7f..407682ed5cf6833e65284c49500aebabe9a10360 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -60,6 +60,7 @@
 #include "gromacs/selection/selectionfileoption.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
index 8a294358090c47285208b15a10224b5c39e55f24..a917c62ec581adecdcb06d00ab9b4d4d070b2a29 100644 (file)
@@ -83,6 +83,7 @@
 #include "gromacs/swap/swapcoords.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/smalloc.h"