From 7c0608011516d2167e6e5737530c5963a035d7dc Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Thu, 2 Jul 2015 07:15:41 +0300 Subject: [PATCH] Clean up gmxfio includes - 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 --- src/contrib/do_multiprot.c | 1 - src/gromacs/fileio/enxio.c | 8 +- src/gromacs/fileio/enxio.h | 6 +- src/gromacs/fileio/gmxfio-xdr.c | 22 ++- src/gromacs/fileio/gmxfio-xdr.h | 140 ++++++++++++++++++ src/gromacs/fileio/gmxfio.c | 25 ---- src/gromacs/fileio/gmxfio.h | 101 +------------ src/gromacs/fileio/mdoutf.c | 1 + src/gromacs/fileio/mtxio.c | 8 +- src/gromacs/fileio/tngio.cpp | 2 +- src/gromacs/fileio/tpxio.c | 18 +-- src/gromacs/fileio/tpxio.h | 12 +- src/gromacs/fileio/trnio.c | 3 +- src/gromacs/fileio/trnio.h | 20 ++- src/gromacs/fileio/trxio.c | 1 + src/gromacs/fileio/trxio.h | 6 +- src/gromacs/fileio/xdrf.h | 14 +- src/gromacs/fileio/xtcio.c | 14 +- src/gromacs/fileio/xtcio.h | 21 +-- src/gromacs/gmxana/eigio.c | 24 +-- src/gromacs/gmxana/gmx_anaeig.c | 1 + src/gromacs/gmxana/gmx_angle.c | 8 +- src/gromacs/gmxana/gmx_chi.c | 1 + src/gromacs/gmxana/gmx_clustsize.c | 1 + src/gromacs/gmxana/gmx_confrms.c | 1 + src/gromacs/gmxana/gmx_current.c | 1 + src/gromacs/gmxana/gmx_densmap.c | 1 + src/gromacs/gmxana/gmx_dipoles.cpp | 1 + src/gromacs/gmxana/gmx_disre.c | 1 + src/gromacs/gmxana/gmx_do_dssp.c | 1 + src/gromacs/gmxana/gmx_dos.c | 3 +- src/gromacs/gmxana/gmx_dyecoupl.c | 3 +- src/gromacs/gmxana/gmx_editconf.c | 2 + src/gromacs/gmxana/gmx_eneconv.c | 1 + src/gromacs/gmxana/gmx_enemat.c | 1 + src/gromacs/gmxana/gmx_energy.c | 1 + src/gromacs/gmxana/gmx_hydorder.c | 3 +- src/gromacs/gmxana/gmx_mdmat.c | 1 + src/gromacs/gmxana/gmx_mindist.c | 1 + src/gromacs/gmxana/gmx_mk_angndx.c | 1 + src/gromacs/gmxana/gmx_morph.c | 1 + src/gromacs/gmxana/gmx_nmens.c | 3 +- src/gromacs/gmxana/gmx_nmtraj.c | 1 + src/gromacs/gmxana/gmx_order.c | 1 + src/gromacs/gmxana/gmx_polystat.c | 1 + src/gromacs/gmxana/gmx_principal.c | 1 + src/gromacs/gmxana/gmx_rmsdist.c | 1 + src/gromacs/gmxana/gmx_rmsf.c | 1 + src/gromacs/gmxana/gmx_saltbr.c | 1 + src/gromacs/gmxana/gmx_sans.c | 1 + src/gromacs/gmxana/gmx_sorient.c | 1 + src/gromacs/gmxana/gmx_spatial.c | 2 + src/gromacs/gmxana/gmx_spol.c | 1 + src/gromacs/gmxana/gmx_traj.c | 1 + src/gromacs/gmxana/gmx_tune_pme.c | 1 + src/gromacs/gmxana/gmx_vanhove.c | 1 + src/gromacs/gmxana/gmx_wham.cpp | 1 + src/gromacs/gmxana/gmx_xpm2ps.c | 1 + src/gromacs/gmxana/nrama.c | 3 +- src/gromacs/gmxana/sfactor.c | 2 +- src/gromacs/gmxlib/checkpoint.cpp | 1 + src/gromacs/gmxlib/txtdump.c | 1 + src/gromacs/gmxpreprocess/genconf.c | 3 +- src/gromacs/gmxpreprocess/grompp.c | 1 - src/gromacs/gmxpreprocess/h_db.c | 3 +- src/gromacs/gmxpreprocess/nm2type.c | 3 +- src/gromacs/gmxpreprocess/readrot.c | 3 +- src/gromacs/imd/imd.c | 1 + src/gromacs/legacyheaders/checkpoint.h | 15 +- src/gromacs/mdlib/clincs.cpp | 2 +- src/gromacs/mdlib/coupling.cpp | 1 + src/gromacs/mdlib/ebin.c | 3 +- src/gromacs/mdlib/force.cpp | 1 + src/gromacs/mdlib/forcerec.cpp | 1 + src/gromacs/mdlib/mdebin_bar.c | 3 +- src/gromacs/mdlib/shellfc.cpp | 3 +- src/gromacs/mdlib/stat.cpp | 3 +- src/gromacs/mdlib/tables.c | 2 +- src/gromacs/mdlib/tpi.cpp | 2 +- src/gromacs/selection/tests/toputils.cpp | 3 +- src/gromacs/swap/swapcoords.cpp | 1 + src/gromacs/tools/convert_tpr.c | 3 +- src/gromacs/tools/dump.c | 5 +- src/gromacs/topology/symtab.cpp | 3 +- .../trajectoryanalysis/runnercommon.cpp | 3 +- src/programs/mdrun/runner.cpp | 1 + 86 files changed, 313 insertions(+), 265 deletions(-) create mode 100644 src/gromacs/fileio/gmxfio-xdr.h diff --git a/src/contrib/do_multiprot.c b/src/contrib/do_multiprot.c index 80474afb71..dfd8849954 100644 --- a/src/contrib/do_multiprot.c +++ b/src/contrib/do_multiprot.c @@ -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; diff --git a/src/gromacs/fileio/enxio.c b/src/gromacs/fileio/enxio.c index c9b34b1da1..892ef18119 100644 --- a/src/gromacs/fileio/enxio.c +++ b/src/gromacs/fileio/enxio.c @@ -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 #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)) { diff --git a/src/gromacs/fileio/enxio.h b/src/gromacs/fileio/enxio.h index c8434ab2b5..9120feabba 100644 --- a/src/gromacs/fileio/enxio.h +++ b/src/gromacs/fileio/enxio.h @@ -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); diff --git a/src/gromacs/fileio/gmxfio-xdr.c b/src/gromacs/fileio/gmxfio-xdr.c index 6b9b5eb562..2c6f98fef3 100644 --- a/src/gromacs/fileio/gmxfio-xdr.c +++ b/src/gromacs/fileio/gmxfio-xdr.c @@ -36,6 +36,9 @@ */ #include "gmxpre.h" +#include "gmxfio-xdr.h" + +#include #include #include @@ -46,12 +49,29 @@ #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 index 0000000000..17c3fbc60b --- /dev/null +++ b/src/gromacs/fileio/gmxfio-xdr.h @@ -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 diff --git a/src/gromacs/fileio/gmxfio.c b/src/gromacs/fileio/gmxfio.c index 6b00014243..3f92499313 100644 --- a/src/gromacs/fileio/gmxfio.c +++ b/src/gromacs/fileio/gmxfio.c @@ -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; diff --git a/src/gromacs/fileio/gmxfio.h b/src/gromacs/fileio/gmxfio.h index 21116b765d..dabf39c7eb 100644 --- a/src/gromacs/fileio/gmxfio.h +++ b/src/gromacs/fileio/gmxfio.h @@ -48,14 +48,6 @@ #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 diff --git a/src/gromacs/fileio/mdoutf.c b/src/gromacs/fileio/mdoutf.c index bda0a7ac85..5cab6d917a 100644 --- a/src/gromacs/fileio/mdoutf.c +++ b/src/gromacs/fileio/mdoutf.c @@ -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" diff --git a/src/gromacs/fileio/mtxio.c b/src/gromacs/fileio/mtxio.c index c36f464815..ae9b15d9e8 100644 --- a/src/gromacs/fileio/mtxio.c +++ b/src/gromacs/fileio/mtxio.c @@ -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; diff --git a/src/gromacs/fileio/tngio.cpp b/src/gromacs/fileio/tngio.cpp index 417c246ca3..55d0472111 100644 --- a/src/gromacs/fileio/tngio.cpp +++ b/src/gromacs/fileio/tngio.cpp @@ -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" diff --git a/src/gromacs/fileio/tpxio.c b/src/gromacs/fileio/tpxio.c index 085cd5c9af..63f76d6f1c 100644 --- a/src/gromacs/fileio/tpxio.c +++ b/src/gromacs/fileio/tpxio.c @@ -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) { diff --git a/src/gromacs/fileio/tpxio.h b/src/gromacs/fileio/tpxio.h index 0b3ca43e31..d85a8e3a0f 100644 --- a/src/gromacs/fileio/tpxio.h +++ b/src/gromacs/fileio/tpxio.h @@ -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,11 +43,8 @@ * * 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. diff --git a/src/gromacs/fileio/trnio.c b/src/gromacs/fileio/trnio.c index f1eadbd5f3..5afef1afa2 100644 --- a/src/gromacs/fileio/trnio.c +++ b/src/gromacs/fileio/trnio.c @@ -41,6 +41,7 @@ #include #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; diff --git a/src/gromacs/fileio/trnio.h b/src/gromacs/fileio/trnio.h index 57fb51bd6f..3550790f91 100644 --- a/src/gromacs/fileio/trnio.h +++ b/src/gromacs/fileio/trnio.h @@ -38,6 +38,10 @@ #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 @@ -53,12 +57,12 @@ * **************************************************************/ -#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. diff --git a/src/gromacs/fileio/trxio.c b/src/gromacs/fileio/trxio.c index 084b9325c3..8c296dcee5 100644 --- a/src/gromacs/fileio/trxio.c +++ b/src/gromacs/fileio/trxio.c @@ -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" diff --git a/src/gromacs/fileio/trxio.h b/src/gromacs/fileio/trxio.h index 0d32e36405..29a93693c9 100644 --- a/src/gromacs/fileio/trxio.h +++ b/src/gromacs/fileio/trxio.h @@ -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); diff --git a/src/gromacs/fileio/xdrf.h b/src/gromacs/fileio/xdrf.h index dd2959e986..f58ffb9f55 100644 --- a/src/gromacs/fileio/xdrf.h +++ b/src/gromacs/fileio/xdrf.h @@ -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 diff --git a/src/gromacs/fileio/xtcio.c b/src/gromacs/fileio/xtcio.c index 248146417a..a477f568d5 100644 --- a/src/gromacs/fileio/xtcio.c +++ b/src/gromacs/fileio/xtcio.c @@ -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 #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) diff --git a/src/gromacs/fileio/xtcio.h b/src/gromacs/fileio/xtcio.h index 2c50fb89f0..1d173f8ea5 100644 --- a/src/gromacs/fileio/xtcio.h +++ b/src/gromacs/fileio/xtcio.h @@ -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" @@ -47,37 +46,33 @@ 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 diff --git a/src/gromacs/gmxana/eigio.c b/src/gromacs/gmxana/eigio.c index 8d65ffbc59..78649cc2f5 100644 --- a/src/gromacs/gmxana/eigio.c +++ b/src/gromacs/gmxana/eigio.c @@ -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 */ diff --git a/src/gromacs/gmxana/gmx_anaeig.c b/src/gromacs/gmxana/gmx_anaeig.c index 9f1ae46c14..08441f7560 100644 --- a/src/gromacs/gmxana/gmx_anaeig.c +++ b/src/gromacs/gmxana/gmx_anaeig.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_angle.c b/src/gromacs/gmxana/gmx_angle.c index abbe1f8820..88304ed029 100644 --- a/src/gromacs/gmxana/gmx_angle.c +++ b/src/gromacs/gmxana/gmx_angle.c @@ -59,10 +59,10 @@ 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) diff --git a/src/gromacs/gmxana/gmx_chi.c b/src/gromacs/gmxana/gmx_chi.c index f4156186fa..7067df8160 100644 --- a/src/gromacs/gmxana/gmx_chi.c +++ b/src/gromacs/gmxana/gmx_chi.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_clustsize.c b/src/gromacs/gmxana/gmx_clustsize.c index 89f899f0ac..6aa02a2a95 100644 --- a/src/gromacs/gmxana/gmx_clustsize.c +++ b/src/gromacs/gmxana/gmx_clustsize.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_confrms.c b/src/gromacs/gmxana/gmx_confrms.c index 1bcbd5a60e..c8768b9227 100644 --- a/src/gromacs/gmxana/gmx_confrms.c +++ b/src/gromacs/gmxana/gmx_confrms.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_current.c b/src/gromacs/gmxana/gmx_current.c index 18bf347647..3a91e57165 100644 --- a/src/gromacs/gmxana/gmx_current.c +++ b/src/gromacs/gmxana/gmx_current.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_densmap.c b/src/gromacs/gmxana/gmx_densmap.c index ab355db0e6..b32b789d05 100644 --- a/src/gromacs/gmxana/gmx_densmap.c +++ b/src/gromacs/gmxana/gmx_densmap.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_dipoles.cpp b/src/gromacs/gmxana/gmx_dipoles.cpp index 9f387ae8d3..2cdf41e9fe 100644 --- a/src/gromacs/gmxana/gmx_dipoles.cpp +++ b/src/gromacs/gmxana/gmx_dipoles.cpp @@ -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" diff --git a/src/gromacs/gmxana/gmx_disre.c b/src/gromacs/gmxana/gmx_disre.c index 7cc6e085e6..bfe6cfdbeb 100644 --- a/src/gromacs/gmxana/gmx_disre.c +++ b/src/gromacs/gmxana/gmx_disre.c @@ -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 { diff --git a/src/gromacs/gmxana/gmx_do_dssp.c b/src/gromacs/gmxana/gmx_do_dssp.c index 38c6de63d1..27748988b6 100644 --- a/src/gromacs/gmxana/gmx_do_dssp.c +++ b/src/gromacs/gmxana/gmx_do_dssp.c @@ -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, diff --git a/src/gromacs/gmxana/gmx_dos.c b/src/gromacs/gmxana/gmx_dos.c index 52a7d9d61e..7592091e9b 100644 --- a/src/gromacs/gmxana/gmx_dos.c +++ b/src/gromacs/gmxana/gmx_dos.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_dyecoupl.c b/src/gromacs/gmxana/gmx_dyecoupl.c index 0513f8f8a6..2f985fa6e5 100644 --- a/src/gromacs/gmxana/gmx_dyecoupl.c +++ b/src/gromacs/gmxana/gmx_dyecoupl.c @@ -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) diff --git a/src/gromacs/gmxana/gmx_editconf.c b/src/gromacs/gmxana/gmx_editconf.c index 7694517363..6013b75f8e 100644 --- a/src/gromacs/gmxana/gmx_editconf.c +++ b/src/gromacs/gmxana/gmx_editconf.c @@ -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 diff --git a/src/gromacs/gmxana/gmx_eneconv.c b/src/gromacs/gmxana/gmx_eneconv.c index 87cf30d294..f04541ca90 100644 --- a/src/gromacs/gmxana/gmx_eneconv.c +++ b/src/gromacs/gmxana/gmx_eneconv.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_enemat.c b/src/gromacs/gmxana/gmx_enemat.c index acd82d5951..69da88fb29 100644 --- a/src/gromacs/gmxana/gmx_enemat.c +++ b/src/gromacs/gmxana/gmx_enemat.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_energy.c b/src/gromacs/gmxana/gmx_energy.c index d2595be547..fc2b29bbf8 100644 --- a/src/gromacs/gmxana/gmx_energy.c +++ b/src/gromacs/gmxana/gmx_energy.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_hydorder.c b/src/gromacs/gmxana/gmx_hydorder.c index 37038b0af4..603b111b42 100644 --- a/src/gromacs/gmxana/gmx_hydorder.c +++ b/src/gromacs/gmxana/gmx_hydorder.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_mdmat.c b/src/gromacs/gmxana/gmx_mdmat.c index d3a409ee28..5aeb6eb931 100644 --- a/src/gromacs/gmxana/gmx_mdmat.c +++ b/src/gromacs/gmxana/gmx_mdmat.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_mindist.c b/src/gromacs/gmxana/gmx_mindist.c index 3c96ffb2c6..82d7394ad4 100644 --- a/src/gromacs/gmxana/gmx_mindist.c +++ b/src/gromacs/gmxana/gmx_mindist.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_mk_angndx.c b/src/gromacs/gmxana/gmx_mk_angndx.c index 04741c1c61..048d7452fa 100644 --- a/src/gromacs/gmxana/gmx_mk_angndx.c +++ b/src/gromacs/gmxana/gmx_mk_angndx.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_morph.c b/src/gromacs/gmxana/gmx_morph.c index 12c4269589..f185477853 100644 --- a/src/gromacs/gmxana/gmx_morph.c +++ b/src/gromacs/gmxana/gmx_morph.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_nmens.c b/src/gromacs/gmxana/gmx_nmens.c index 0d005fe5cd..ea03919825 100644 --- a/src/gromacs/gmxana/gmx_nmens.c +++ b/src/gromacs/gmxana/gmx_nmens.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_nmtraj.c b/src/gromacs/gmxana/gmx_nmtraj.c index 008e3cc58e..b20d077884 100644 --- a/src/gromacs/gmxana/gmx_nmtraj.c +++ b/src/gromacs/gmxana/gmx_nmtraj.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_order.c b/src/gromacs/gmxana/gmx_order.c index 8132317524..61293ef432 100644 --- a/src/gromacs/gmxana/gmx_order.c +++ b/src/gromacs/gmxana/gmx_order.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_polystat.c b/src/gromacs/gmxana/gmx_polystat.c index 4f129e40cb..d174119ac5 100644 --- a/src/gromacs/gmxana/gmx_polystat.c +++ b/src/gromacs/gmxana/gmx_polystat.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_principal.c b/src/gromacs/gmxana/gmx_principal.c index 45adaa4783..5c2a808ae2 100644 --- a/src/gromacs/gmxana/gmx_principal.c +++ b/src/gromacs/gmxana/gmx_principal.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_rmsdist.c b/src/gromacs/gmxana/gmx_rmsdist.c index ea2fff5a00..ddb5957837 100644 --- a/src/gromacs/gmxana/gmx_rmsdist.c +++ b/src/gromacs/gmxana/gmx_rmsdist.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_rmsf.c b/src/gromacs/gmxana/gmx_rmsf.c index afca006154..8cb4bf99a9 100644 --- a/src/gromacs/gmxana/gmx_rmsf.c +++ b/src/gromacs/gmxana/gmx_rmsf.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_saltbr.c b/src/gromacs/gmxana/gmx_saltbr.c index 11d7f1565a..cc4417213d 100644 --- a/src/gromacs/gmxana/gmx_saltbr.c +++ b/src/gromacs/gmxana/gmx_saltbr.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_sans.c b/src/gromacs/gmxana/gmx_sans.c index fdff37b0ad..4b08d681a2 100644 --- a/src/gromacs/gmxana/gmx_sans.c +++ b/src/gromacs/gmxana/gmx_sans.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_sorient.c b/src/gromacs/gmxana/gmx_sorient.c index 9b0f9e20a5..a12f14bfb8 100644 --- a/src/gromacs/gmxana/gmx_sorient.c +++ b/src/gromacs/gmxana/gmx_sorient.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_spatial.c b/src/gromacs/gmxana/gmx_spatial.c index beeaf0d0e8..cb3217179b 100644 --- a/src/gromacs/gmxana/gmx_spatial.c +++ b/src/gromacs/gmxana/gmx_spatial.c @@ -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... */ diff --git a/src/gromacs/gmxana/gmx_spol.c b/src/gromacs/gmxana/gmx_spol.c index 559aa2aa69..8c6c250340 100644 --- a/src/gromacs/gmxana/gmx_spol.c +++ b/src/gromacs/gmxana/gmx_spol.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_traj.c b/src/gromacs/gmxana/gmx_traj.c index 4846401597..a0993acb1f 100644 --- a/src/gromacs/gmxana/gmx_traj.c +++ b/src/gromacs/gmxana/gmx_traj.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_tune_pme.c b/src/gromacs/gmxana/gmx_tune_pme.c index b293179c07..838b98e72b 100644 --- a/src/gromacs/gmxana/gmx_tune_pme.c +++ b/src/gromacs/gmxana/gmx_tune_pme.c @@ -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 diff --git a/src/gromacs/gmxana/gmx_vanhove.c b/src/gromacs/gmxana/gmx_vanhove.c index fa3567f02f..595ada61ae 100644 --- a/src/gromacs/gmxana/gmx_vanhove.c +++ b/src/gromacs/gmxana/gmx_vanhove.c @@ -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" diff --git a/src/gromacs/gmxana/gmx_wham.cpp b/src/gromacs/gmxana/gmx_wham.cpp index bd8077af8a..43ce3e50b1 100644 --- a/src/gromacs/gmxana/gmx_wham.cpp +++ b/src/gromacs/gmxana/gmx_wham.cpp @@ -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" diff --git a/src/gromacs/gmxana/gmx_xpm2ps.c b/src/gromacs/gmxana/gmx_xpm2ps.c index 8bf2b4d83a..83f5523ed7 100644 --- a/src/gromacs/gmxana/gmx_xpm2ps.c +++ b/src/gromacs/gmxana/gmx_xpm2ps.c @@ -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" diff --git a/src/gromacs/gmxana/nrama.c b/src/gromacs/gmxana/nrama.c index 5c40c67559..165fb75b23 100644 --- a/src/gromacs/gmxana/nrama.c +++ b/src/gromacs/gmxana/nrama.c @@ -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" diff --git a/src/gromacs/gmxana/sfactor.c b/src/gromacs/gmxana/sfactor.c index f5cf0eb787..79c86b761c 100644 --- a/src/gromacs/gmxana/sfactor.c +++ b/src/gromacs/gmxana/sfactor.c @@ -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" diff --git a/src/gromacs/gmxlib/checkpoint.cpp b/src/gromacs/gmxlib/checkpoint.cpp index 607f94974a..75bbd5cef5 100644 --- a/src/gromacs/gmxlib/checkpoint.cpp +++ b/src/gromacs/gmxlib/checkpoint.cpp @@ -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" diff --git a/src/gromacs/gmxlib/txtdump.c b/src/gromacs/gmxlib/txtdump.c index 606a8f4c07..db4b587bbb 100644 --- a/src/gromacs/gmxlib/txtdump.c +++ b/src/gromacs/gmxlib/txtdump.c @@ -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" diff --git a/src/gromacs/gmxpreprocess/genconf.c b/src/gromacs/gmxpreprocess/genconf.c index 9f9a57ce8c..01c998a138 100644 --- a/src/gromacs/gmxpreprocess/genconf.c +++ b/src/gromacs/gmxpreprocess/genconf.c @@ -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" diff --git a/src/gromacs/gmxpreprocess/grompp.c b/src/gromacs/gmxpreprocess/grompp.c index 77bb8515f9..6be2102a68 100644 --- a/src/gromacs/gmxpreprocess/grompp.c +++ b/src/gromacs/gmxpreprocess/grompp.c @@ -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" diff --git a/src/gromacs/gmxpreprocess/h_db.c b/src/gromacs/gmxpreprocess/h_db.c index f630ae7876..b63fdde27a 100644 --- a/src/gromacs/gmxpreprocess/h_db.c +++ b/src/gromacs/gmxpreprocess/h_db.c @@ -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 #include -#include "gromacs/fileio/gmxfio.h" #include "gromacs/gmxpreprocess/fflibutil.h" #include "gromacs/legacyheaders/macros.h" #include "gromacs/utility/cstringutil.h" diff --git a/src/gromacs/gmxpreprocess/nm2type.c b/src/gromacs/gmxpreprocess/nm2type.c index 41882302ac..9f02a585bd 100644 --- a/src/gromacs/gmxpreprocess/nm2type.c +++ b/src/gromacs/gmxpreprocess/nm2type.c @@ -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) diff --git a/src/gromacs/gmxpreprocess/readrot.c b/src/gromacs/gmxpreprocess/readrot.c index 5d9715f60d..bd10df6e19 100644 --- a/src/gromacs/gmxpreprocess/readrot.c +++ b/src/gromacs/gmxpreprocess/readrot.c @@ -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" diff --git a/src/gromacs/imd/imd.c b/src/gromacs/imd/imd.c index 36eed97850..a21df80584 100644 --- a/src/gromacs/imd/imd.c +++ b/src/gromacs/imd/imd.c @@ -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" diff --git a/src/gromacs/legacyheaders/checkpoint.h b/src/gromacs/legacyheaders/checkpoint.h index c85a99fa2f..dfe40adafd 100644 --- a/src/gromacs/legacyheaders/checkpoint.h +++ b/src/gromacs/legacyheaders/checkpoint.h @@ -38,15 +38,16 @@ #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 } diff --git a/src/gromacs/mdlib/clincs.cpp b/src/gromacs/mdlib/clincs.cpp index 3e0f68c0b4..8f1bf9150f 100644 --- a/src/gromacs/mdlib/clincs.cpp +++ b/src/gromacs/mdlib/clincs.cpp @@ -46,7 +46,6 @@ #include #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" diff --git a/src/gromacs/mdlib/coupling.cpp b/src/gromacs/mdlib/coupling.cpp index d0169dcdc2..0a7d423ccf 100644 --- a/src/gromacs/mdlib/coupling.cpp +++ b/src/gromacs/mdlib/coupling.cpp @@ -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" diff --git a/src/gromacs/mdlib/ebin.c b/src/gromacs/mdlib/ebin.c index 8056f1f9bf..0fa41a72f6 100644 --- a/src/gromacs/mdlib/ebin.c +++ b/src/gromacs/mdlib/ebin.c @@ -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" diff --git a/src/gromacs/mdlib/force.cpp b/src/gromacs/mdlib/force.cpp index d11bf98797..20ecfe36bd 100644 --- a/src/gromacs/mdlib/force.cpp +++ b/src/gromacs/mdlib/force.cpp @@ -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" diff --git a/src/gromacs/mdlib/forcerec.cpp b/src/gromacs/mdlib/forcerec.cpp index 91f5c5f089..7de43327b5 100644 --- a/src/gromacs/mdlib/forcerec.cpp +++ b/src/gromacs/mdlib/forcerec.cpp @@ -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" diff --git a/src/gromacs/mdlib/mdebin_bar.c b/src/gromacs/mdlib/mdebin_bar.c index e351275864..c2a596d9b2 100644 --- a/src/gromacs/mdlib/mdebin_bar.c +++ b/src/gromacs/mdlib/mdebin_bar.c @@ -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 #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" diff --git a/src/gromacs/mdlib/shellfc.cpp b/src/gromacs/mdlib/shellfc.cpp index 1d044cc923..b1ab19dbcb 100644 --- a/src/gromacs/mdlib/shellfc.cpp +++ b/src/gromacs/mdlib/shellfc.cpp @@ -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" diff --git a/src/gromacs/mdlib/stat.cpp b/src/gromacs/mdlib/stat.cpp index 6a30e1f034..08ae193dff 100644 --- a/src/gromacs/mdlib/stat.cpp +++ b/src/gromacs/mdlib/stat.cpp @@ -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 #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" diff --git a/src/gromacs/mdlib/tables.c b/src/gromacs/mdlib/tables.c index ad8e473cf7..a6f3b20225 100644 --- a/src/gromacs/mdlib/tables.c +++ b/src/gromacs/mdlib/tables.c @@ -40,7 +40,6 @@ #include -#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" diff --git a/src/gromacs/mdlib/tpi.cpp b/src/gromacs/mdlib/tpi.cpp index 744efd51af..7ca2eeae92 100644 --- a/src/gromacs/mdlib/tpi.cpp +++ b/src/gromacs/mdlib/tpi.cpp @@ -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" diff --git a/src/gromacs/selection/tests/toputils.cpp b/src/gromacs/selection/tests/toputils.cpp index eff1e0c356..26fb504dcd 100644 --- a/src/gromacs/selection/tests/toputils.cpp +++ b/src/gromacs/selection/tests/toputils.cpp @@ -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" diff --git a/src/gromacs/swap/swapcoords.cpp b/src/gromacs/swap/swapcoords.cpp index 6d1d944600..6314bbedf8 100644 --- a/src/gromacs/swap/swapcoords.cpp +++ b/src/gromacs/swap/swapcoords.cpp @@ -49,6 +49,7 @@ #include #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" diff --git a/src/gromacs/tools/convert_tpr.c b/src/gromacs/tools/convert_tpr.c index 94e24ffe32..ff2fd10447 100644 --- a/src/gromacs/tools/convert_tpr.c +++ b/src/gromacs/tools/convert_tpr.c @@ -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; diff --git a/src/gromacs/tools/dump.c b/src/gromacs/tools/dump.c index b3ac4582c8..76dd6f7df7 100644 --- a/src/gromacs/tools/dump.c +++ b/src/gromacs/tools/dump.c @@ -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); } diff --git a/src/gromacs/topology/symtab.cpp b/src/gromacs/topology/symtab.cpp index 678088f478..07c11cdd42 100644 --- a/src/gromacs/topology/symtab.cpp +++ b/src/gromacs/topology/symtab.cpp @@ -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" diff --git a/src/gromacs/trajectoryanalysis/runnercommon.cpp b/src/gromacs/trajectoryanalysis/runnercommon.cpp index 4d9513ed28..407682ed5c 100644 --- a/src/gromacs/trajectoryanalysis/runnercommon.cpp +++ b/src/gromacs/trajectoryanalysis/runnercommon.cpp @@ -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" diff --git a/src/programs/mdrun/runner.cpp b/src/programs/mdrun/runner.cpp index 8a29435809..a917c62ec5 100644 --- a/src/programs/mdrun/runner.cpp +++ b/src/programs/mdrun/runner.cpp @@ -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" -- 2.22.0