Improve use of gmxpreprocess headers
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 2 Jan 2019 14:02:14 +0000 (15:02 +0100)
committerDavid van der Spoel <spoel@xray.bmc.uu.se>
Sun, 13 Jan 2019 18:10:01 +0000 (19:10 +0100)
Less use of typedef struct so that we can have more use of forward
declarations of types.

Less inclusion of headers from headers

Updated stdio.h to cstdio

Localized definition of t_nbparam to the single file it needs to be
in.

Change-Id: I92d2d4e1a9a1bc8062627af45dc606903254803c

51 files changed:
src/gromacs/gmxpreprocess/add_par.h
src/gromacs/gmxpreprocess/convparm.cpp
src/gromacs/gmxpreprocess/convparm.h
src/gromacs/gmxpreprocess/fflibutil.h
src/gromacs/gmxpreprocess/gen_ad.cpp
src/gromacs/gmxpreprocess/gen_ad.h
src/gromacs/gmxpreprocess/gen_vsite.cpp
src/gromacs/gmxpreprocess/gen_vsite.h
src/gromacs/gmxpreprocess/genhydro.cpp
src/gromacs/gmxpreprocess/genhydro.h
src/gromacs/gmxpreprocess/gpp_atomtype.cpp
src/gromacs/gmxpreprocess/gpp_atomtype.h
src/gromacs/gmxpreprocess/gpp_bond_atomtype.cpp
src/gromacs/gmxpreprocess/gpp_bond_atomtype.h
src/gromacs/gmxpreprocess/gpp_nextnb.cpp
src/gromacs/gmxpreprocess/gpp_nextnb.h
src/gromacs/gmxpreprocess/grompp-impl.h
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/h_db.cpp
src/gromacs/gmxpreprocess/h_db.h
src/gromacs/gmxpreprocess/hackblock.cpp
src/gromacs/gmxpreprocess/hackblock.h
src/gromacs/gmxpreprocess/hizzie.h
src/gromacs/gmxpreprocess/nm2type.cpp
src/gromacs/gmxpreprocess/nm2type.h
src/gromacs/gmxpreprocess/pdb2gmx.cpp
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/pdb2top.h
src/gromacs/gmxpreprocess/readir.h
src/gromacs/gmxpreprocess/resall.cpp
src/gromacs/gmxpreprocess/resall.h
src/gromacs/gmxpreprocess/specbond.cpp
src/gromacs/gmxpreprocess/specbond.h
src/gromacs/gmxpreprocess/ter_db.cpp
src/gromacs/gmxpreprocess/ter_db.h
src/gromacs/gmxpreprocess/tomorse.cpp
src/gromacs/gmxpreprocess/tomorse.h
src/gromacs/gmxpreprocess/topdirs.h
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/topio.h
src/gromacs/gmxpreprocess/toppush.cpp
src/gromacs/gmxpreprocess/toppush.h
src/gromacs/gmxpreprocess/topshake.cpp
src/gromacs/gmxpreprocess/topshake.h
src/gromacs/gmxpreprocess/toputil.cpp
src/gromacs/gmxpreprocess/toputil.h
src/gromacs/gmxpreprocess/vsite_parm.cpp
src/gromacs/gmxpreprocess/vsite_parm.h
src/gromacs/gmxpreprocess/x2top.cpp
src/gromacs/gmxpreprocess/xlate.cpp
src/gromacs/gmxpreprocess/xlate.h

index f96cf02a1ff468a85c0598e59cc84c5c97aba2c3..8fd883d4bff29c748670848659d7a43480d09357 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_ADD_PAR_H
 #define GMX_GMXPREPROCESS_ADD_PAR_H
 
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/pdb2top.h"
 #include "gromacs/utility/real.h"
 
+struct t_params;
+struct t_restp;
+
 void add_param(t_params *ps, int ai, int aj, const real *c, char *s);
 
 void add_imp_param(t_params *ps, int ai, int aj, int ak, int al,
index 91fd43c7ee732774b3c8d7985ad5e47b1b797e5b..ee73c32e20d6343fce04f1e0de9b0804cf266120 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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/compat/make_unique.h"
 #include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/topio.h"
 #include "gromacs/gmxpreprocess/toputil.h"
 #include "gromacs/math/functions.h"
index 78d84b296f39050fc1fa91fdec73b1e817fc458e..496d866d3d4eaca725a245a2be053f69b346e91e 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,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2019, 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.
 #ifndef GMX_GMXPREPROCESS_CONVPARM_H
 #define GMX_GMXPREPROCESS_CONVPARM_H
 
-#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/utility/real.h"
 
 struct gmx_mtop_t;
+struct t_molinfo;
+struct t_params;
 
 void convert_params(int atnr, t_params nbtypes[],
                     t_molinfo *mi,
index 6aeae89ce00fc9803fe5995d5f61a00e2b99960d..c608183a40c999a37370439bcb609e7ac3cb1038 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2018,2019, 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.
@@ -36,7 +36,7 @@
 #ifndef GMX_GMXPREPROCESS_FFLIBUTIL_H
 #define GMX_GMXPREPROCESS_FFLIBUTIL_H
 
-#include <stdio.h>
+#include <cstdio>
 
 #include <string>
 #include <vector>
index 464fc803486e2d971491a8c125a08adae3cc9809..c77553fb31b2d1c426bc8963ec4c8f57e726c86d 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
@@ -48,6 +48,8 @@
 
 #include "gromacs/fileio/confio.h"
 #include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/pgutil.h"
 #include "gromacs/gmxpreprocess/resall.h"
index 15d6e17dae5a09b9f2e08796c2fa478c5b3794a0..6be288a493b7cd8c0ad31e581b7bdafac69fbe25 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_GEN_AD_H
 #define GMX_GMXPREPROCESS_GEN_AD_H
 
-#include "gromacs/gmxpreprocess/gpp_nextnb.h"
-#include "gromacs/gmxpreprocess/resall.h"
-#include "gromacs/gmxpreprocess/toputil.h"
+struct t_atoms;
+struct t_excls;
+struct t_hackblock;
+struct t_nextnb;
+struct t_params;
+struct t_restp;
 
 void generate_excls(t_nextnb *nnb, int nrexcl, t_excls excls[]);
 void clean_excls(t_nextnb *nnb, int nrexcl, t_excls excls[]);
index 6e4c36802f833f3e8e7abf159e6475312a5f47d9..49f965d073070e13f3b42de1697a5053ad6c2b19 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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,8 @@
 #include "gromacs/gmxpreprocess/add_par.h"
 #include "gromacs/gmxpreprocess/fflibutil.h"
 #include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/resall.h"
 #include "gromacs/gmxpreprocess/toputil.h"
@@ -71,7 +73,8 @@
 #define OPENDIR     '[' /* starting sign for directive         */
 #define CLOSEDIR    ']' /* ending sign for directive           */
 
-typedef struct {
+struct t_vsiteconf
+{
     char       atomtype[MAXNAME];  /* Type for the XH3/XH2 atom */
     bool       isplanar;           /* If true, the atomtype above and the three connected
                                     * ones are in a planar geometry. The two next entries
@@ -80,7 +83,7 @@ typedef struct {
     int    nhydrogens;             /* number of connected hydrogens */
     char   nextheavytype[MAXNAME]; /* Type for the heavy atom bonded to XH2/XH3 */
     char   dummymass[MAXNAME];     /* The type of MNH* or MCH3* dummy mass to use */
-} t_vsiteconf;
+};
 
 
 /* Structure to represent average bond and angles values in vsite aromatic
@@ -88,22 +91,25 @@ typedef struct {
  * forcefield; many forcefields (like Amber, OPLS) have some inherent strain in
  * 5-rings (i.e. the sum of angles is !=540, but impropers keep it planar)
  */
-typedef struct {
+struct t_vsitetop
+{
     char resname[MAXNAME];
     int  nbonds;
     int  nangles;
-    struct vsitetop_bond {
+    struct vsitetop_bond
+    {
         char   atom1[MAXNAME];
         char   atom2[MAXNAME];
         float  value;
     } *bond; /* list of bonds */
-    struct vsitetop_angle {
+    struct vsitetop_angle
+    {
         char   atom1[MAXNAME];
         char   atom2[MAXNAME];
         char   atom3[MAXNAME];
         float  value;
     } *angle; /* list of angles */
-} t_vsitetop;
+};
 
 
 enum {
@@ -557,7 +563,7 @@ static int get_atype(int atom, t_atoms *at, int nrtp, t_restp rtp[],
     return type;
 }
 
-static int vsite_nm2type(const char *name, gpp_atomtype_t atype)
+static int vsite_nm2type(const char *name, gpp_atomtype *atype)
 {
     int tp;
 
@@ -861,7 +867,7 @@ static void calc_vsite3_param(real xd, real yd, real xi, real yi, real xj, real
 }
 
 
-static int gen_vsites_trp(gpp_atomtype_t atype, rvec *newx[],
+static int gen_vsites_trp(gpp_atomtype *atype, rvec *newx[],
                           t_atom *newatom[], char ***newatomname[],
                           int *o2n[], int *newvsite_type[], int *newcgnr[],
                           t_symtab *symtab, int *nadd, rvec x[], int *cgnr[],
@@ -1133,7 +1139,7 @@ static int gen_vsites_trp(gpp_atomtype_t atype, rvec *newx[],
 }
 
 
-static int gen_vsites_tyr(gpp_atomtype_t atype, rvec *newx[],
+static int gen_vsites_tyr(gpp_atomtype *atype, rvec *newx[],
                           t_atom *newatom[], char ***newatomname[],
                           int *o2n[], int *newvsite_type[], int *newcgnr[],
                           t_symtab *symtab, int *nadd, rvec x[], int *cgnr[],
@@ -1533,7 +1539,7 @@ static bool is_vsite(int vsite_type)
 
 static char atomnamesuffix[] = "1234";
 
-void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
+void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype *atype,
                t_atoms *at, t_symtab *symtab, rvec *x[],
                t_params plist[], int *vsite_type[], int *cgnr[],
                real mHmult, bool bVsiteAromatics,
index efa351924a0c2d2337daf34537a8a4f997c8edc7..a852a88fc9ef893fb7ea1983ce7a9e2f6a4a3f3d 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_GEN_VSITE_H
 #define GMX_GMXPREPROCESS_GEN_VSITE_H
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/utility/real.h"
 
+struct gpp_atomtype;
+struct t_atoms;
+struct t_params;
+struct t_restp;
+struct t_symtab;
+
 /* stuff for pdb2gmx */
 
-void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
-               t_atoms *at, struct t_symtab *symtab, rvec *x[],
+void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype *atype,
+               t_atoms *at, t_symtab *symtab, rvec *x[],
                t_params plist[], int *dummy_type[], int *cgnr[],
                real mHmult, bool bVSiteAromatics,
                const char *ffdir);
index e47c79e588eea88f19b76b731ce85a961b1e087e..abe0b48e947ee6f442fb4fdc12d2c1f254a05dc6 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,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gmxpreprocess/calch.h"
 #include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/pgutil.h"
 #include "gromacs/gmxpreprocess/resall.h"
 #include "gromacs/gmxpreprocess/ter_db.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/topology/atoms.h"
 #include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
index 79d0fd826d71b45babca039cf84105cb413b1394..b2ff682ab89867ef924c95076516b5bbc23a1f11 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_GENHYDRO_H
 #define GMX_GMXPREPROCESS_GENHYDRO_H
 
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/math/vectypes.h"
+
+struct t_atoms;
+struct t_hack;
+struct t_hackblock;
 
 int add_h(t_atoms **pdbaptr, rvec *xptr[],
           int nah, t_hackblock ah[],
index ca489fcb46992dff939904b2f3215be1526044b6..a5b905f6ef7051dbc2badc5686a91e4adebbc77e 100644 (file)
@@ -42,6 +42,7 @@
 #include <cmath>
 #include <cstring>
 
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/topdirs.h"
 #include "gromacs/gmxpreprocess/toputil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
-typedef struct gpp_atomtype {
+struct gpp_atomtype
+{
     int              nr;           /* The number of atomtypes          */
     t_atom          *atom;         /* Array of atoms                   */
     char          ***atomname;     /* Names of the atomtypes           */
     t_param         *nb;           /* Nonbonded force default params   */
     int             *bondatomtype; /* The bond_atomtype for each atomtype  */
     int             *atomnumber;   /* Atomic number, used for QM/MM        */
-} t_gpp_atomtype;
+};
 
-int get_atomtype_type(const char *str, gpp_atomtype_t ga)
+int get_atomtype_type(const char *str, gpp_atomtype *ga)
 {
     int i;
 
@@ -77,12 +79,12 @@ int get_atomtype_type(const char *str, gpp_atomtype_t ga)
     return NOTSET;
 }
 
-int get_atomtype_ntypes(gpp_atomtype_t ga)
+int get_atomtype_ntypes(gpp_atomtype *ga)
 {
     return ga->nr;
 }
 
-char *get_atomtype_name(int nt, gpp_atomtype_t ga)
+char *get_atomtype_name(int nt, gpp_atomtype *ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -92,7 +94,7 @@ char *get_atomtype_name(int nt, gpp_atomtype_t ga)
     return *(ga->atomname[nt]);
 }
 
-real get_atomtype_massA(int nt, gpp_atomtype_t ga)
+real get_atomtype_massA(int nt, gpp_atomtype *ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -102,7 +104,7 @@ real get_atomtype_massA(int nt, gpp_atomtype_t ga)
     return ga->atom[nt].m;
 }
 
-real get_atomtype_massB(int nt, gpp_atomtype_t ga)
+real get_atomtype_massB(int nt, gpp_atomtype *ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -112,7 +114,7 @@ real get_atomtype_massB(int nt, gpp_atomtype_t ga)
     return ga->atom[nt].mB;
 }
 
-real get_atomtype_qA(int nt, gpp_atomtype_t ga)
+real get_atomtype_qA(int nt, gpp_atomtype *ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -122,7 +124,7 @@ real get_atomtype_qA(int nt, gpp_atomtype_t ga)
     return ga->atom[nt].q;
 }
 
-real get_atomtype_qB(int nt, gpp_atomtype_t ga)
+real get_atomtype_qB(int nt, gpp_atomtype *ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -132,7 +134,7 @@ real get_atomtype_qB(int nt, gpp_atomtype_t ga)
     return ga->atom[nt].qB;
 }
 
-int get_atomtype_ptype(int nt, gpp_atomtype_t ga)
+int get_atomtype_ptype(int nt, gpp_atomtype *ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -152,7 +154,7 @@ int get_atomtype_batype(int nt, const gpp_atomtype* ga)
     return ga->bondatomtype[nt];
 }
 
-int get_atomtype_atomnumber(int nt, gpp_atomtype_t ga)
+int get_atomtype_atomnumber(int nt, gpp_atomtype *ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -162,7 +164,7 @@ int get_atomtype_atomnumber(int nt, gpp_atomtype_t ga)
     return ga->atomnumber[nt];
 }
 
-real get_atomtype_nbparam(int nt, int param, gpp_atomtype_t ga)
+real get_atomtype_nbparam(int nt, int param, gpp_atomtype *ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -175,9 +177,9 @@ real get_atomtype_nbparam(int nt, int param, gpp_atomtype_t ga)
     return ga->nb[nt].c[param];
 }
 
-gpp_atomtype_t init_atomtype()
+gpp_atomtype *init_atomtype()
 {
-    gpp_atomtype_t ga;
+    gpp_atomtype *ga;
 
     snew(ga, 1);
 
@@ -191,7 +193,7 @@ gpp_atomtype_t init_atomtype()
     return ga;
 }
 
-int set_atomtype(int nt, gpp_atomtype_t ga, t_symtab *tab,
+int set_atomtype(int nt, gpp_atomtype *ga, t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
                  int bondatomtype, int atomnumber)
 {
@@ -209,7 +211,7 @@ int set_atomtype(int nt, gpp_atomtype_t ga, t_symtab *tab,
     return nt;
 }
 
-int add_atomtype(gpp_atomtype_t ga, t_symtab *tab,
+int add_atomtype(gpp_atomtype *ga, t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
                  int bondatomtype, int atomnumber)
 {
@@ -239,7 +241,7 @@ int add_atomtype(gpp_atomtype_t ga, t_symtab *tab,
     }
 }
 
-void print_at (FILE * out, gpp_atomtype_t ga)
+void print_at (FILE * out, gpp_atomtype *ga)
 {
     int         i;
     t_atom     *atom = ga->atom;
@@ -258,7 +260,7 @@ void print_at (FILE * out, gpp_atomtype_t ga)
     fprintf (out, "\n");
 }
 
-void done_atomtype(gpp_atomtype_t ga)
+void done_atomtype(gpp_atomtype *ga)
 {
     sfree(ga->atom);
     sfree(ga->atomname);
@@ -269,7 +271,7 @@ void done_atomtype(gpp_atomtype_t ga)
     sfree(ga);
 }
 
-static int search_atomtypes(gpp_atomtype_t ga, int *n, int typelist[],
+static int search_atomtypes(gpp_atomtype *ga, int *n, int typelist[],
                             int thistype,
                             t_param param[], int ftype)
 {
@@ -326,7 +328,7 @@ static int search_atomtypes(gpp_atomtype_t ga, int *n, int typelist[],
 
 void renum_atype(t_params plist[], gmx_mtop_t *mtop,
                  int *wall_atomtype,
-                 gpp_atomtype_t ga, bool bVerbose)
+                 gpp_atomtype *ga, bool bVerbose)
 {
     int         i, j, k, l, mi, mj, nat, nrfp, ftype, ntype;
     t_atoms    *atoms;
@@ -437,7 +439,7 @@ void renum_atype(t_params plist[], gmx_mtop_t *mtop,
     sfree(typelist);
 }
 
-void copy_atomtype_atomtypes(gpp_atomtype_t ga, t_atomtypes *atomtypes)
+void copy_atomtype_atomtypes(gpp_atomtype *ga, t_atomtypes *atomtypes)
 {
     int i, ntype;
 
index 20af27744ec83cf8a0e647208ce773de2298aafc..38bc3c08245abc2eb068d16570d418f965f00209 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) 2011,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_GPP_ATOMTYPE_H
 #define GMX_GMXPREPROCESS_GPP_ATOMTYPE_H
 
-#include <stdio.h>
+#include <cstdio>
 
-#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/utility/real.h"
 
 struct gmx_mtop_t;
-
-typedef struct gpp_atomtype *gpp_atomtype_t;
-
-int get_atomtype_type(const char *str, gpp_atomtype_t at);
+struct gpp_atomtype;
+struct t_atom;
+struct t_atomtypes;
+struct t_param;
+struct t_params;
+struct t_symtab;
+
+int get_atomtype_type(const char *str, gpp_atomtype *at);
 /* Return atomtype corresponding to case-insensitive str
    or NOTSET if not found */
 
-int get_atomtype_ntypes(gpp_atomtype_t at);
+int get_atomtype_ntypes(gpp_atomtype *at);
 /* Return number of atomtypes */
 
-char *get_atomtype_name(int nt, gpp_atomtype_t at);
+char *get_atomtype_name(int nt, gpp_atomtype *at);
 /* Return name corresponding to atomtype nt, or NULL if not found */
 
-real get_atomtype_massA(int nt, gpp_atomtype_t at);
-real get_atomtype_massB(int nt, gpp_atomtype_t at);
-real get_atomtype_qA(int nt, gpp_atomtype_t at);
-real get_atomtype_qB(int nt, gpp_atomtype_t at);
-int get_atomtype_ptype(int nt, gpp_atomtype_t at);
+real get_atomtype_massA(int nt, gpp_atomtype *at);
+real get_atomtype_massB(int nt, gpp_atomtype *at);
+real get_atomtype_qA(int nt, gpp_atomtype *at);
+real get_atomtype_qB(int nt, gpp_atomtype *at);
+int get_atomtype_ptype(int nt, gpp_atomtype *at);
 int get_atomtype_batype(int nt, const gpp_atomtype* at);
-int get_atomtype_atomnumber(int nt, gpp_atomtype_t at);
+int get_atomtype_atomnumber(int nt, gpp_atomtype *at);
 
 /* Return the above variable for atomtype nt, or NOTSET if not found */
 
-real get_atomtype_nbparam(int nt, int param, gpp_atomtype_t at);
+real get_atomtype_nbparam(int nt, int param, gpp_atomtype *at);
 /* Similar to the previous but returns the paramth parameter or NOTSET */
 
-gpp_atomtype_t init_atomtype();
+gpp_atomtype *init_atomtype();
 /* Return a new atomtype structure */
 
-void done_atomtype(gpp_atomtype_t at);
+void done_atomtype(gpp_atomtype *at);
 /* Free the memory in the structure */
 
-int set_atomtype(int nt, gpp_atomtype_t at, struct t_symtab *tab,
+int set_atomtype(int nt, gpp_atomtype *at, t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
                  int bondatomtype, int atomnumber);
 /* Set the values of an existing atom type nt. Returns nt on success or
    NOTSET on error. */
 
-int add_atomtype(gpp_atomtype_t at, struct t_symtab *tab,
+int add_atomtype(gpp_atomtype *at, t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
                  int bondatomtype, int atomnumber);
 /* Add a complete new atom type to an existing atomtype structure. Returns
    the number of the atom type. */
 
-void print_at (FILE * out, gpp_atomtype_t at);
+void print_at (FILE * out, gpp_atomtype *at);
 /* Print an atomtype record to a text file */
 
 void renum_atype(t_params plist[], gmx_mtop_t *mtop,
                  int *wall_atomtype,
-                 gpp_atomtype_t at, bool bVerbose);
+                 gpp_atomtype *at, bool bVerbose);
 
-void copy_atomtype_atomtypes(gpp_atomtype_t atype, t_atomtypes *atypes);
+void copy_atomtype_atomtypes(gpp_atomtype *atype, t_atomtypes *atypes);
 /* Copy from one structure to another */
 
 #endif
index 48ac1c4f6739daa061a2e327c028e9756f6d689b..d6d7e99d901fb9bea592261cc6265e035d34274b 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) 2011,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017,2018,2019, 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.
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
 
-typedef struct {
+struct gpp_bond_atomtype
+{
     int              nr;       /* The number of atomtypes              */
     char          ***atomname; /* Names of the atomtypes               */
-} gpp_bond_atomtype;
+};
 
-int get_bond_atomtype_type(char *str, t_bond_atomtype at)
+int get_bond_atomtype_type(const char *str, gpp_bond_atomtype *at)
 {
-    gpp_bond_atomtype *ga = reinterpret_cast<gpp_bond_atomtype *>(at);
-
-    int                i;
-
-    for (i = 0; (i < ga->nr); i++)
+    for (int i = 0; (i < at->nr); i++)
     {
         /* Atom types are always case sensitive */
-        if (strcmp(str, *(ga->atomname[i])) == 0)
+        if (strcmp(str, *(at->atomname[i])) == 0)
         {
             return i;
         }
@@ -68,44 +65,38 @@ int get_bond_atomtype_type(char *str, t_bond_atomtype at)
     return NOTSET;
 }
 
-char *get_bond_atomtype_name(int nt, t_bond_atomtype at)
+char *get_bond_atomtype_name(int nt, gpp_bond_atomtype *at)
 {
-    gpp_bond_atomtype *ga = reinterpret_cast<gpp_bond_atomtype *>(at);
-
-    if ((nt < 0) || (nt >= ga->nr))
+    if ((nt < 0) || (nt >= at->nr))
     {
         return nullptr;
     }
 
-    return *(ga->atomname[nt]);
+    return *(at->atomname[nt]);
 }
 
-t_bond_atomtype init_bond_atomtype()
+gpp_bond_atomtype *init_bond_atomtype()
 {
     gpp_bond_atomtype *ga;
 
     snew(ga, 1);
 
-    return reinterpret_cast<t_bond_atomtype>(ga);
+    return ga;
 }
 
-void add_bond_atomtype(t_bond_atomtype at, t_symtab *tab,
+void add_bond_atomtype(gpp_bond_atomtype *at, t_symtab *tab,
                        char *name)
 {
-    gpp_bond_atomtype *ga = reinterpret_cast<gpp_bond_atomtype *>(at);
-
-    ga->nr++;
-    srenew(ga->atomname, ga->nr);
-    ga->atomname[ga->nr-1] = put_symtab(tab, name);
+    at->nr++;
+    srenew(at->atomname, at->nr);
+    at->atomname[at->nr-1] = put_symtab(tab, name);
 }
 
-void done_bond_atomtype(t_bond_atomtype *at)
+void done_bond_atomtype(gpp_bond_atomtype **at)
 {
-    gpp_bond_atomtype *ga = reinterpret_cast<gpp_bond_atomtype *>(*at);
-
-    sfree(ga->atomname);
-    ga->nr = 0;
-    sfree(ga);
+    sfree((*at)->atomname);
+    (*at)->nr = 0;
+    sfree(*at);
 
     *at = nullptr;
 }
index 4f0b6b26776adfadc235ed5bfe3e2604e08e7592..abd418f2e24ecafbc64d43b0a150cc384898cfb0 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) 2011,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018,2019, 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 research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef GMX_GMXPREPROCESS_GPP_BONDATOMTYPE_H
-#define GMX_GMXPREPROCESS_GPP_BONDATOMTYPE_H
+#ifndef GMX_GMXPREPROCESS_GPP_BOND_ATOMTYPE_H
+#define GMX_GMXPREPROCESS_GPP_BOND_ATOMTYPE_H
 
-#include <stdio.h>
+#include <cstdio>
 
-typedef struct gpp_bondatomtype *t_bond_atomtype;
+struct gpp_bond_atomtype;
+struct t_symtab;
 
-int get_bond_atomtype_type(char *str, t_bond_atomtype at);
+int get_bond_atomtype_type(const char *str, gpp_bond_atomtype *at);
 /* Return atomtype corresponding to case-insensitive str
    or NOTSET if not found */
 
-char *get_bond_atomtype_name(int nt, t_bond_atomtype at);
+char *get_bond_atomtype_name(int nt, gpp_bond_atomtype *at);
 /* Return name corresponding to atomtype nt, or NULL if not found */
 
-t_bond_atomtype init_bond_atomtype();
+gpp_bond_atomtype *init_bond_atomtype();
 /* Return a new atomtype structure */
 
-void done_bond_atomtype(t_bond_atomtype *at);
+void done_bond_atomtype(gpp_bond_atomtype **at);
 /* Free the memory in the structure */
 
-void add_bond_atomtype(t_bond_atomtype at, struct t_symtab *tab,
+void add_bond_atomtype(gpp_bond_atomtype *at, t_symtab *tab,
                        char *name);
 /* Add a complete new atom type to an existing atomtype structure */
 
index 1e445b6c990e50beebfe170239813853e8e07e00..66ef693a6bd379b3b3f1486f28ba593d65c8ec8f 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) 2011,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018,2019, 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 <cstdlib>
 
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/toputil.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/utility/fatalerror.h"
index 93f35d634a230d7f7feb1371403ec46cbfeb60be..569c079e8e96b4b58d4c150c1505e404a2c14099 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) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2019, 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.
 #ifndef GMX_GMXPREPROCESS_GPP_NEXTNB_H
 #define GMX_GMXPREPROCESS_GPP_NEXTNB_H
 
-#include "gromacs/gmxpreprocess/grompp-impl.h"
+struct t_blocka;
+struct t_params;
 
-typedef struct {
+struct t_nextnb
+{
     int nr;     /* nr atoms (0 <= i < nr) (atoms->nr)          */
     int nrex;   /* with nrex lists of neighbours               */
     /* respectively containing zeroth, first   */
@@ -48,7 +50,7 @@ typedef struct {
     int  **nrexcl; /* with (0 <= nrx < nrexcl[i][nre]) neigbours    */
     /* per list stored in one 2d array of lists        */
     int ***a;      /* like this: a[i][nre][nrx]                        */
-} t_nextnb;
+};
 
 void init_nnb(t_nextnb *nnb, int nr, int nrex);
 /* Initiate the arrays for nnb (see above) */
index d2e0ac62df461f5b1efd76290904353eb4f86226..bf4f03866d2859146554fc703387892793e2f33f 100644 (file)
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-struct t_block;
-struct t_blocka;
-
 #define MAXSLEN 32
 
-typedef struct {
-    bool     bSet;          /* Has this combination been set        */
-    real     c[4];          /* The non-bonded parameters            */
-} t_nbparam;
-/* The t_nbparam struct is used to temporary store the explicit
- * non-bonded parameter combinations, which will be copied to t_params.
- */
-
-typedef struct {
+struct t_param
+{
     int        a[MAXATOMLIST];   /* The atom list (eg. bonds: particle */
     /* i = a[0] (ai), j = a[1] (aj))   */
     real       c[MAXFORCEPARAM]; /* Force parameters (eg. b0 = c[0])   */
     char       s[MAXSLEN];       /* A string (instead of parameters),    *
                                   * read from the .rtp file in pdb2gmx   */
     const int &ai() const { return a[0]; }
-    int   &ai() { return a[0]; }
+    int       &ai() { return a[0]; }
     const int &aj() const { return a[1]; }
-    int   &aj() { return a[1]; }
+    int       &aj() { return a[1]; }
     const int &ak() const { return a[2]; }
-    int   &ak() { return a[2]; }
+    int       &ak() { return a[2]; }
     const int &al() const { return a[3]; }
-    int   &al() { return a[3]; }
+    int       &al() { return a[3]; }
     const int &am() const { return a[4]; }
-    int   &am() { return a[4]; }
+    int       &am() { return a[4]; }
 
     real      &c0() { return c[0]; }
     real      &c1() { return c[1]; }
     real      &c2() { return c[2]; }
-} t_param;
+};
 
-typedef struct {        // NOLINT (clang-analyzer-optin.performance.Padding)
+struct t_params
+{                       // NOLINT (clang-analyzer-optin.performance.Padding)
     int          nr;    /* The number of bonds in this record   */
     int          maxnr; /* The amount of elements in the array  */
     t_param     *param; /* Array of parameters (dim: nr or nr*nr) */
@@ -93,15 +84,16 @@ typedef struct {        // NOLINT (clang-analyzer-optin.performance.Padding)
 
     int        *cmap_types;   /* Store the five atomtypes followed by a number that identifies the type */
     int         nct;          /* Number of allocated elements in cmap_types */
+};
 
-} t_params;
-
-typedef struct {
+struct t_excls
+{
     int            nr;      /* The number of exclusions             */
     int           *e;       /* The excluded atoms                   */
-} t_excls;
+};
 
-typedef struct {
+struct t_molinfo
+{
     char            **name;
     int               nrexcl;       /* Number of exclusions per atom   */
     bool              excl_set;     /* Have exclusions been generated? */
@@ -111,12 +103,13 @@ typedef struct {
     t_block           mols;         /* Molecules                            */
     t_blocka          excls;        /* Exclusions                           */
     t_params          plist[F_NRE]; /* Parameters in old style              */
-} t_molinfo;
+};
 
-typedef struct {
+struct t_mols
+{
     char *name;
     int   nr;
-} t_mols;
+};
 
 bool is_int(double x);
 /* Returns TRUE when x is integer */
index 970ae5c1402faae5ddc0f521e3a7827c82cccb86..1f9da061a6a67b158b10aa4b4592130c1fa7c361 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
@@ -196,7 +196,7 @@ static void check_eg_vs_cg(gmx_mtop_t *mtop)
     }
 }
 
-static void check_cg_sizes(const char *topfn, const t_block *cgs, warninp_t wi)
+static void check_cg_sizes(const char *topfn, const t_block *cgs, warninp *wi)
 {
     int  maxsize, cg;
     char warn_buf[STRLEN];
@@ -224,7 +224,7 @@ static void check_cg_sizes(const char *topfn, const t_block *cgs, warninp_t wi)
     }
 }
 
-static void check_bonds_timestep(const gmx_mtop_t *mtop, double dt, warninp_t wi)
+static void check_bonds_timestep(const gmx_mtop_t *mtop, double dt, warninp *wi)
 {
     /* This check is not intended to ensure accurate integration,
      * rather it is to signal mistakes in the mdp settings.
@@ -381,7 +381,7 @@ static void check_vel(gmx_mtop_t *mtop, rvec v[])
 
 static void check_shells_inputrec(gmx_mtop_t *mtop,
                                   t_inputrec *ir,
-                                  warninp_t   wi)
+                                  warninp    *wi)
 {
     gmx_mtop_atomloop_all_t aloop;
     const t_atom           *atom;
@@ -499,12 +499,12 @@ static void
 new_status(const char *topfile, const char *topppfile, const char *confin,
            t_gromppopts *opts, t_inputrec *ir, gmx_bool bZero,
            bool bGenVel, bool bVerbose, t_state *state,
-           gpp_atomtype_t atype, gmx_mtop_t *sys,
+           gpp_atomtype *atype, gmx_mtop_t *sys,
            int *nmi, t_molinfo **mi, t_molinfo **intermolecular_interactions,
            t_params plist[],
            int *comb, double *reppow, real *fudgeQQ,
            gmx_bool bMorse,
-           warninp_t wi)
+           warninp *wi)
 {
     t_molinfo                  *molinfo = nullptr;
     std::vector<gmx_molblock_t> molblock;
@@ -820,7 +820,7 @@ static void read_posres(gmx_mtop_t *mtop, t_molinfo *molinfo, gmx_bool bTopB,
                         const char *fn,
                         int rc_scaling, int ePBC,
                         rvec com,
-                        warninp_t wi)
+                        warninp *wi)
 {
     gmx_bool           *hadAtom;
     rvec               *x, *v;
@@ -997,7 +997,7 @@ static void gen_posres(gmx_mtop_t *mtop, t_molinfo *mi,
                        const char *fnA, const char *fnB,
                        int rc_scaling, int ePBC,
                        rvec com, rvec comB,
-                       warninp_t wi)
+                       warninp *wi)
 {
     read_posres  (mtop, mi, FALSE, fnA, rc_scaling, ePBC, com, wi);
     /* It is safer to simply read the b-state posres rather than trying
@@ -1006,8 +1006,8 @@ static void gen_posres(gmx_mtop_t *mtop, t_molinfo *mi,
     read_posres(mtop, mi, TRUE, fnB, rc_scaling, ePBC, comB, wi);
 }
 
-static void set_wall_atomtype(gpp_atomtype_t at, t_gromppopts *opts,
-                              t_inputrec *ir, warninp_t wi)
+static void set_wall_atomtype(gpp_atomtype *at, t_gromppopts *opts,
+                              t_inputrec *ir, warninp *wi)
 {
     int  i;
     char warn_buf[STRLEN];
@@ -1197,7 +1197,7 @@ static void init_cmap_grid(gmx_cmap_t *cmap_grid, int ngrid, int grid_spacing)
 }
 
 
-static int count_constraints(const gmx_mtop_t *mtop, t_molinfo *mi, warninp_t wi)
+static int count_constraints(const gmx_mtop_t *mtop, t_molinfo *mi, warninp *wi)
 {
     int             count, count_mol, i;
     t_params       *plist;
@@ -1261,7 +1261,7 @@ static real calc_temp(const gmx_mtop_t *mtop,
 }
 
 static real get_max_reference_temp(const t_inputrec *ir,
-                                   warninp_t         wi)
+                                   warninp          *wi)
 {
     real         ref_t;
     int          i;
@@ -1298,7 +1298,7 @@ static real get_max_reference_temp(const t_inputrec *ir,
  */
 static void checkForUnboundAtoms(const gmx_moltype_t     *molt,
                                  gmx_bool                 bVerbose,
-                                 warninp_t                wi)
+                                 warninp                 *wi)
 {
     const t_atoms *atoms = &molt->atoms;
 
@@ -1356,7 +1356,7 @@ static void checkForUnboundAtoms(const gmx_moltype_t     *molt,
 /* Checks all moleculetypes for unbound atoms */
 static void checkForUnboundAtoms(const gmx_mtop_t     *mtop,
                                  gmx_bool              bVerbose,
-                                 warninp_t             wi)
+                                 warninp              *wi)
 {
     for (const gmx_moltype_t &molt : mtop->moltype)
     {
@@ -1456,7 +1456,7 @@ static bool haveDecoupledModeInMol(const gmx_moltype_t            &molt,
  */
 static void checkDecoupledModeAccuracy(const gmx_mtop_t *mtop,
                                        const t_inputrec *ir,
-                                       warninp_t         wi)
+                                       warninp          *wi)
 {
     /* We only have issues with decoupled modes with normal MD.
      * With stochastic dynamics equipartitioning is enforced strongly.
@@ -1542,7 +1542,7 @@ static void set_verlet_buffer(const gmx_mtop_t *mtop,
                               t_inputrec       *ir,
                               real              buffer_temp,
                               matrix            box,
-                              warninp_t         wi)
+                              warninp          *wi)
 {
     real                   rlist_1x1;
     int                    n_nonlin_vsite;
@@ -1689,7 +1689,7 @@ int gmx_grompp(int argc, char *argv[])
     t_gromppopts          *opts;
     int                    nmi;
     t_molinfo             *mi, *intermolecular_interactions;
-    gpp_atomtype_t         atype;
+    gpp_atomtype          *atype;
     int                    nvsite, comb;
     t_params              *plist;
     real                   fudgeQQ;
@@ -1700,7 +1700,7 @@ int gmx_grompp(int argc, char *argv[])
     gmx_bool               have_atomnumber;
     gmx_output_env_t      *oenv;
     gmx_bool               bVerbose = FALSE;
-    warninp_t              wi;
+    warninp               *wi;
     char                   warn_buf[STRLEN];
 
     t_filenm               fnm[] = {
@@ -2231,7 +2231,7 @@ int gmx_grompp(int argc, char *argv[])
         }
     }
 
-    struct pull_t *pull = nullptr;
+    pull_t *pull = nullptr;
 
     if (ir->bPull)
     {
index 71da9aece88da71844c2c2e3266763ae4fde770c..b968c5f3a73b7a573762b77ea017142f2c410ae7 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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 <vector>
 
 #include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/cstringutil.h"
index c8e2df6f044bdfe21e3e2a31225b150c80dd072c..2b8d8f6bfc0673045af82c595f8e2dfaffd6ca4f 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) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2019, 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.
 #ifndef GMX_GMXPREPROCESS_H_DB_H
 #define GMX_GMXPREPROCESS_H_DB_H
 
-#include <stdio.h>
+#include <cstdio>
 
-#include "gromacs/gmxpreprocess/hackblock.h"
+struct t_hack;
+struct t_hackblock;
 
 /* functions for the h-database */
 
index 7a300f1775292492726e6a193ed15a762e7b78c8..20ea7cb5a875c7adf10676f1d3c001099aebc492 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) 2011,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017,2018,2019, 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/gmxpreprocess/notset.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/topology/atoms.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
index c8553b6bcc79cf167cde293636cadac500c954b7..e13145274925357844d807f4b06a067652e31cf2 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_HACKBLOCK_H
 #define GMX_GMXPREPROCESS_HACKBLOCK_H
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/topology/symtab.h"
+#include <cstdio>
+
+#include "gromacs/topology/ifunc.h"
+
+struct t_atom;
 
 /* Used for reading .rtp/.tdb */
 /* ebtsBONDS must be the first, new types can be added to the end */
@@ -55,27 +57,30 @@ extern const int   btsNiatoms[ebtsNR];
    free/clear/copy/merge_t_* functions stay updated */
 
 /* BONDEDS */
-typedef struct {
+struct t_rbonded
+{
     char  *a[MAXATOMLIST]; /* atom names */
     char  *s;              /* optional define string which gets copied from
                               .rtp/.tdb to .top and will be parsed by cpp
                               during grompp */
-    bool match;            /* boolean to mark that the entry has been found */
+    bool     match;        /* boolean to mark that the entry has been found */
     char*   &ai() { return a[0]; }
     char*   &aj() { return a[1]; }
     char*   &ak() { return a[2]; }
     char*   &al() { return a[3]; }
     char*   &am() { return a[4]; }
-} t_rbonded;
+};
 
-typedef struct {
+struct t_rbondeds
+{
     int        type;     /* The type of bonded interaction */
     int        nb;       /* number of bondeds */
     t_rbonded *b;        /* bondeds */
-} t_rbondeds;
+};
 
 /* RESIDUES (rtp) */
-typedef struct {
+struct t_restp
+{
     char         *resname;
     /* The base file name this rtp entry was read from */
     char         *filebase;
@@ -91,10 +96,11 @@ typedef struct {
     bool          bRemoveDihedralIfWithImproper;
     /* list of bonded interactions to add */
     t_rbondeds    rb[ebtsNR];
-} t_restp;
+};
 
 /* Block to hack residues */
-typedef struct {
+struct t_hack
+{
     int      nr;      /* Number of atoms to hack    */
     char    *oname;   /* Old name                   */
     char    *nname;   /* New name                   */
@@ -116,9 +122,10 @@ typedef struct {
     char*      &aj() { return a[1]; }
     char*      &ak() { return a[2]; }
     char*      &al() { return a[3]; }
-} t_hack;
+};
 
-typedef struct {
+struct t_hackblock
+{
     char      *name;     /* Name of hack block (residue or terminus) */
     char      *filebase; /* The base file name this entry was read from */
     int        nhack;    /* Number of atoms to hack                  */
@@ -126,18 +133,7 @@ typedef struct {
     t_hack    *hack;     /* Hack list                                */
     /* list of bonded interactions to add */
     t_rbondeds rb[ebtsNR];
-} t_hackblock;
-
-typedef struct {
-    char *res1, *res2;
-    char *atom1, *atom2;
-    char *newres1, *newres2;
-    int   nbond1, nbond2;
-    real  length;
-} t_specbond;
-
-t_specbond *get_specbonds(int *nspecbond);
-void done_specbonds(int nsb, t_specbond sb[]);
+};
 
 void free_t_restp(int nrtp, t_restp **rtp);
 void free_t_hack(int nh, t_hack **h);
index 7de66843a9ac398fc317c642a1d07f86b7ec160d..4f70d6f49f64df4dc55565be8919d056ffd8852c 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,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2019, 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,9 @@
 #define GMX_GMXPREPROCESS_HIZZIE_H
 
 #include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atoms.h"
+#include "gromacs/utility/real.h"
+
+struct t_atoms;
 
 void set_histp(t_atoms *pdba, rvec *x, real angle, real distance);
 /* calculate HIStidine protonation state */
index a952ee5d1c85480fb647939768448bce0c49160a..836cec2227df606370d0c2698ef531d9e410ad50 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
@@ -49,6 +49,7 @@
 #include "gromacs/gmxpreprocess/fflibutil.h"
 #include "gromacs/gmxpreprocess/gpp_atomtype.h"
 #include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/pdb2top.h"
 #include "gromacs/gmxpreprocess/toppush.h"
@@ -190,8 +191,8 @@ static int match_str(const char *atom, const char *template_string)
     }
 }
 
-int nm2type(int nnm, t_nm2type nm2t[], struct t_symtab *tab, t_atoms *atoms,
-            gpp_atomtype_t atype, int *nbonds, t_params *bonds)
+int nm2type(int nnm, t_nm2type nm2t[], t_symtab *tab, t_atoms *atoms,
+            gpp_atomtype *atype, int *nbonds, t_params *bonds)
 {
     int      cur = 0;
 #define prev (1-cur)
index e86af8228d1382ea915687baf13d1be1f40a9479..d9973d57eede4253c2739ca0ad4349f5cae35fae 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,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2019, 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.
 #ifndef GMX_GMX_NM2TYPE_H
 #define GMX_GMX_NM2TYPE_H
 
-#include <stdio.h>
+#include <cstdio>
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/topology/atoms.h"
+struct gpp_atomtype;
+struct t_atoms;
+struct t_params;
+struct t_symtab;
 
-typedef struct {
+struct t_nm2type
+{
     char    *elem, *type;
     double   q, m;
     int      nbonds;
     char   **bond;
     double  *blen;
-} t_nm2type;
+};
 
 t_nm2type *rd_nm2type(const char *ffdir, int *nnm);
 /* Read the name 2 type database. nnm is the number of entries
@@ -59,8 +61,8 @@ t_nm2type *rd_nm2type(const char *ffdir, int *nnm);
 void dump_nm2type(FILE *fp, int nnm, t_nm2type nm2t[]);
 /* Dump the database for debugging. Can be reread by the program */
 
-int nm2type(int nnm, t_nm2type nm2t[], struct t_symtab *tab, t_atoms *atoms,
-            gpp_atomtype_t atype, int *nbonds, t_params *bond);
+int nm2type(int nnm, t_nm2type nm2t[], t_symtab *tab, t_atoms *atoms,
+            gpp_atomtype *atype, int *nbonds, t_params *bond);
 /* Try to determine the atomtype (force field dependent) for the atoms
  * with help of the bond list
  */
index 3173e36291ac56619422c7d108892c674ab75c14..db4ab8b0c5d3b33e7aa4a5776a700ead9b01369a 100644 (file)
@@ -56,7 +56,9 @@
 #include "gromacs/gmxlib/conformation-utilities.h"
 #include "gromacs/gmxpreprocess/fflibutil.h"
 #include "gromacs/gmxpreprocess/genhydro.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/hizzie.h"
 #include "gromacs/gmxpreprocess/pdb2top.h"
 #include "gromacs/gmxpreprocess/pgutil.h"
@@ -1967,7 +1969,7 @@ int pdb2gmx::run()
     check_occupancy(&pdba_all, inputConfFile_.c_str(), bVerbose_);
 
     /* Read atomtypes... */
-    gpp_atomtype_t atype = read_atype(ffdir_, &symtab);
+    gpp_atomtype *atype = read_atype(ffdir_, &symtab);
 
     /* read residue database */
     printf("Reading residue database... (%s)\n", forcefield_);
index 34d23a85c48ae3964a302d2cebe8465fec0e6126..b1a28cc15281110135f08533ff790a84ae768f19 100644 (file)
 #include "gromacs/gmxpreprocess/gen_ad.h"
 #include "gromacs/gmxpreprocess/gen_vsite.h"
 #include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/pgutil.h"
 #include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/specbond.h"
 #include "gromacs/gmxpreprocess/topdirs.h"
 #include "gromacs/gmxpreprocess/topio.h"
 #include "gromacs/gmxpreprocess/toputil.h"
@@ -673,7 +676,7 @@ void print_top_mols(FILE *out,
 void write_top(FILE *out, const char *pr, const char *molname,
                t_atoms *at, bool bRTPresname,
                int bts[], t_params plist[], t_excls excls[],
-               gpp_atomtype_t atype, int *cgnr, int nrexcl)
+               gpp_atomtype *atype, int *cgnr, int nrexcl)
 /* NOTE: nrexcl is not the size of *excl! */
 {
     if (at && atype && cgnr)
@@ -1502,7 +1505,7 @@ scrub_charge_groups(int *cgnr, int natoms)
 
 
 void pdb2top(FILE *top_file, const char *posre_fn, const char *molname,
-             t_atoms *atoms, rvec **x, gpp_atomtype_t atype, t_symtab *tab,
+             t_atoms *atoms, rvec **x, gpp_atomtype *atype, t_symtab *tab,
              int nrtp, t_restp rtp[],
              t_restp *restp, t_hackblock *hb,
              bool bAllowMissing,
index e20b973ffa4fbacd5836ef3ce17f55ad85171f9f..ea29fe1dedf4d212198d0e6f29343971d0a396e9 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_PDB2TOP_H
 #define GMX_GMXPREPROCESS_PDB2TOP_H
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
-#include "gromacs/gmxpreprocess/toputil.h"
+#include <cstdio>
+
+#include "gromacs/math/vectypes.h"
+
+struct gpp_atomtype;
+struct t_atoms;
+struct t_excls;
+struct t_hackblock;
+struct t_mols;
+struct t_params;
+struct t_resinfo;
+struct t_restp;
+struct t_ssbond;
+struct t_symtab;
 
 /* this *MUST* correspond to array in pdb2top.c */
 enum {
@@ -49,11 +59,6 @@ enum {
 };
 extern const char *hh[ehisNR];
 
-typedef struct {
-    int   res1, res2;
-    char *a1, *a2;
-} t_ssbond;
-
 void choose_ff(const char *ffsel,
                char *forcefield, int ff_maxlen,
                char *ffdir, int ffdir_maxlen);
@@ -101,12 +106,12 @@ void print_top_mols(FILE *out,
 void write_top(FILE *out, const char *pr, const char *molname,
                t_atoms *at, bool bRTPresname,
                int bts[], t_params plist[], t_excls excls[],
-               gpp_atomtype_t atype, int *cgnr, int nrexcl);
+               gpp_atomtype *atype, int *cgnr, int nrexcl);
 /* NOTE: nrexcl is not the size of *excl! */
 
 void pdb2top(FILE *top_file, const char *posre_fn, const char *molname,
              t_atoms *atoms, rvec **x,
-             gpp_atomtype_t atype, struct t_symtab *tab,
+             gpp_atomtype *atype, t_symtab *tab,
              int nrtp, t_restp rtp[],
              t_restp *restp, t_hackblock *hb,
              bool bAllowMissing,
index 963f16dddd44c91bfa0ba8e15a1142ff43c00dc6..e5508a3996fe65e6c391de7ca863cac1b55d9b7c 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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,8 @@
 #define GMX_GMXPREPROCESS_READIR_H
 
 #include "gromacs/fileio/readinp.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
@@ -51,6 +52,7 @@ struct gmx_mtop_t;
 struct gmx_output_env_t;
 struct pull_params_t;
 struct pull_t;
+struct t_blocka;
 struct t_grpopts;
 struct t_inpfile;
 struct t_inputrec;
index a2294135cd8ecc8c0901d482b601446a4f4f3e02..0c67d5abd66db8d37ab889c7291c104cfb1bf0a7 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
 #include <vector>
 
 #include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/topology/atoms.h"
 #include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/strdb.h"
 
-gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab)
+gpp_atomtype *read_atype(const char *ffdir, t_symtab *tab)
 {
     FILE                    *in;
     char                     buf[STRLEN], name[STRLEN];
     double                   m;
     int                      nratt = 0;
-    gpp_atomtype_t           at;
+    gpp_atomtype            *at;
     t_atom                  *a;
     t_param                 *nb;
 
@@ -106,7 +110,7 @@ gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab)
     return at;
 }
 
-static void print_resatoms(FILE *out, gpp_atomtype_t atype, t_restp *rtp)
+static void print_resatoms(FILE *out, gpp_atomtype *atype, t_restp *rtp)
 {
     int   j, tp;
     char *tpnm;
@@ -130,7 +134,7 @@ static void print_resatoms(FILE *out, gpp_atomtype_t atype, t_restp *rtp)
 }
 
 static bool read_atoms(FILE *in, char *line,
-                       t_restp *r0, t_symtab *tab, gpp_atomtype_t atype)
+                       t_restp *r0, t_symtab *tab, gpp_atomtype *atype)
 {
     int    i, j, cg, maxentries;
     char   buf[256], buf1[256];
@@ -294,7 +298,7 @@ static void print_resall_header(FILE *out, t_restp rtp[])
 }
 
 void print_resall(FILE *out, int nrtp, t_restp rtp[],
-                  gpp_atomtype_t atype)
+                  gpp_atomtype *atype)
 {
     int i, bt;
 
@@ -319,7 +323,7 @@ void print_resall(FILE *out, int nrtp, t_restp rtp[],
 }
 
 void read_resall(const char *rrdb, int *nrtpptr, t_restp **rtp,
-                 gpp_atomtype_t atype, t_symtab *tab,
+                 gpp_atomtype *atype, t_symtab *tab,
                  bool bAllowOverrideRTP)
 {
     FILE         *in;
index df7bc35f91e1fef859a627c7b0ba9eb97679c73a..8a59c0a7735d56dbdab258de402ea7be3a1ce347 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) 2010,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_RESALL_H
 #define GMX_GMXPREPROCESS_RESALL_H
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
+#include <cstdio>
+
+struct gpp_atomtype;
+struct t_restp;
+struct t_symtab;
 
 char *search_rtp(const char *key, int nrtp, t_restp rtp[]);
 /* Search for an entry in the rtp database, returns the rtp residue name.
@@ -53,16 +55,16 @@ t_restp *get_restp(const char *rtpname, int nrtp, t_restp rtp[]);
  * Generates a fatal error when rtpname is not found.
  */
 
-gpp_atomtype_t read_atype(const char *ffdir, struct t_symtab *tab);
+gpp_atomtype *read_atype(const char *ffdir, t_symtab *tab);
 /* read atom type database(s) */
 
 void read_resall(const char *resdb, int *nrtp, t_restp **rtp,
-                 gpp_atomtype_t atype, struct t_symtab *tab,
+                 gpp_atomtype *atype, t_symtab *tab,
                  bool bAllowOverrideRTP);
 /* read rtp database, append to the existing database */
 
 void print_resall(FILE *out, int nrtp, t_restp rtp[],
-                  gpp_atomtype_t atype);
+                  gpp_atomtype *atype);
 /* write rtp database */
 
 #endif
index a7e9ee784ac78f40d7a36002fe3dc04980a28838..e4f303244def680b2e1e5fd7561d1b7ab7354475 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/strdb.h"
 
+struct t_specbond
+{
+    char *res1, *res2;
+    char *atom1, *atom2;
+    char *newres1, *newres2;
+    int   nbond1, nbond2;
+    real  length;
+};
+
 bool yesno()
 {
     char c;
index fc0de3519f61b30fc6e46dedbd9487142be4da72..10eb17839fa6ee137aa41d66a8119589bea55f86 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_SPECBOND_H
 #define GMX_GMXPREPROCESS_SPECBOND_H
 
-#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/math/vectypes.h"
+
+struct t_atoms;
+struct t_specbond;
+
+struct t_ssbond
+{
+    int   res1, res2;
+    char *a1, *a2;
+};
 
 int mk_specbonds(t_atoms *pdba, rvec x[], bool bInteractive,
                  t_ssbond **specbonds, bool bVerbose);
 
+t_specbond *get_specbonds(int *nspecbond);
+void done_specbonds(int nsb, t_specbond sb[]);
+
 bool yesno();
 
 #endif
index eb2f80a06697fde2047234b2fa91658088b65664..866f8103688d61c79bd70b4db9def8cc8793cfd5 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,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
 
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/resall.h"
 #include "gromacs/gmxpreprocess/toputil.h"
@@ -90,7 +93,7 @@ static int find_kw(char *keyw)
 #define FATAL() gmx_fatal(FARGS, "Reading Termini Database: not enough items on line\n%s", line)
 
 static void read_atom(char *line, bool bAdd,
-                      char **nname, t_atom *a, gpp_atomtype_t atype, int *cgnr)
+                      char **nname, t_atom *a, gpp_atomtype *atype, int *cgnr)
 {
     int    nr, i;
     char   buf[5][30];
@@ -143,14 +146,14 @@ static void read_atom(char *line, bool bAdd,
     }
 }
 
-static void print_atom(FILE *out, t_atom *a, gpp_atomtype_t atype)
+static void print_atom(FILE *out, t_atom *a, gpp_atomtype *atype)
 {
     fprintf(out, "\t%s\t%g\t%g\n",
             get_atomtype_name(a->type, atype), a->m, a->q);
 }
 
 static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
-                         gpp_atomtype_t atype)
+                         gpp_atomtype *atype)
 {
     FILE *out;
     int   i, j, k, bt, nrepl, nadd, ndel;
@@ -247,7 +250,7 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
 
 static void read_ter_db_file(const char *fn,
                              int *ntbptr, t_hackblock **tbptr,
-                             gpp_atomtype_t atype)
+                             gpp_atomtype *atype)
 {
     char         filebase[STRLEN], *ptr;
     FILE        *in;
@@ -403,7 +406,7 @@ static void read_ter_db_file(const char *fn,
 }
 
 int read_ter_db(const char *ffdir, char ter,
-                t_hackblock **tbptr, gpp_atomtype_t atype)
+                t_hackblock **tbptr, gpp_atomtype *atype)
 {
     char   ext[STRLEN];
     int    ntb;
index 50ef9bf6caa071f6a32d80e113cb79243780c230..c30d616c6a5245793b83be0d4832c333b2cd56e7 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) 2011,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_TER_DB_H
 #define GMX_GMXPREPROCESS_TER_DB_H
 
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
-
+struct gpp_atomtype;
+struct t_hackblock;
 
 int read_ter_db(const char *ffdir, char ter,
-                t_hackblock **tbptr, gpp_atomtype_t atype);
+                t_hackblock **tbptr, gpp_atomtype *atype);
 /* Read database for N&C terminal hacking */
 
 t_hackblock **filter_ter(int nb, t_hackblock tb[],
index 7f732196be1a19afaf48cbde604a49deb33045aa..7cef8dfee78e671fbe6676ec1246204129d793ec 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,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
@@ -187,7 +187,7 @@ static real search_e_diss(int n2m, t_2morse t2m[], char *ai, char *aj)
     }
 }
 
-void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype_t atype)
+void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype *atype)
 {
     int       n2m;
     t_2morse *t2m;
index 7d94dc29c600d59133eb1431b15c3740bf402223..778e477cbcf27b6dcc08b236ef9a7a50f26d6c7a 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,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2019, 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.
 #ifndef GMX_GMXPREPROCESS_TOMORSE_H
 #define GMX_GMXPREPROCESS_TOMORSE_H
 
-#include <stdio.h>
+struct gpp_atomtype;
+struct t_molinfo;
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-
-void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype_t atype);
+void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype *atype);
 
 #endif
index 641d9114d7215fd2ee20c4bf2586880c50856091..e869439aca22ab153ae4757bb0e9b5de54244fe9 100644 (file)
@@ -85,10 +85,11 @@ enum class Directive : int
     Count
 };
 
-typedef struct tagDirStack {
+struct DirStack
+{
     Directive           d;
-    struct tagDirStack *prev;
-} DirStack;
+    DirStack           *prev;
+};
 
 int ifunc_index(Directive d, int type);
 
index 459f771cd0a21f7ca65c20353cf4c174beee04e9..c6b541c00cad74ec48b6be65e164b24f6ac92ba5 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/warninp.h"
 #include "gromacs/gmxpreprocess/gmxcpp.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
 #include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
 #include "gromacs/gmxpreprocess/gpp_nextnb.h"
 #include "gromacs/gmxpreprocess/grompp-impl.h"
 #define OPENDIR     '[' /* starting sign for directive */
 #define CLOSEDIR    ']' /* ending sign for directive   */
 
-static void free_nbparam(t_nbparam **param, int nr)
-{
-    int i;
-
-    assert(param);
-    for (i = 0; i < nr; i++)
-    {
-        assert(param[i]);
-        sfree(param[i]);
-    }
-    sfree(param);
-}
-
-static int copy_nbparams(t_nbparam **param, int ftype, t_params *plist, int nr)
-{
-    int i, j, f;
-    int nrfp, ncopy;
-
-    nrfp = NRFP(ftype);
-
-    ncopy = 0;
-    for (i = 0; i < nr; i++)
-    {
-        for (j = 0; j <= i; j++)
-        {
-            assert(param);
-            if (param[i][j].bSet)
-            {
-                for (f = 0; f < nrfp; f++)
-                {
-                    plist->param[nr*i+j].c[f] = param[i][j].c[f];
-                    plist->param[nr*j+i].c[f] = param[i][j].c[f];
-                }
-                ncopy++;
-            }
-        }
-    }
-
-    return ncopy;
-}
-
 static void gen_pairs(t_params *nbs, t_params *pairs, real fudge, int comb)
 {
     int     i, j, ntp, nrfp, nrfpA, nrfpB, nnn;
@@ -177,7 +137,7 @@ static void gen_pairs(t_params *nbs, t_params *pairs, real fudge, int comb)
     }
 }
 
-double check_mol(const gmx_mtop_t *mtop, warninp_t wi)
+double check_mol(const gmx_mtop_t *mtop, warninp *wi)
 {
     char     buf[256];
     int      i, ri, pt;
@@ -283,7 +243,7 @@ static void sum_q(const t_atoms *atoms, int numMols,
 }
 
 static void get_nbparm(char *nb_str, char *comb_str, int *nb, int *comb,
-                       warninp_t wi)
+                       warninp *wi)
 {
     int  i;
     char warn_buf[STRLEN];
@@ -329,7 +289,7 @@ static void get_nbparm(char *nb_str, char *comb_str, int *nb, int *comb,
 }
 
 static char ** cpp_opts(const char *define, const char *include,
-                        warninp_t wi)
+                        warninp *wi)
 {
     int         n, len;
     int         ncppopts = 0;
@@ -416,7 +376,7 @@ static void make_atoms_sys(const std::vector<gmx_molblock_t> &molblock,
 static char **read_topol(const char *infile, const char *outfile,
                          const char *define, const char *include,
                          t_symtab    *symtab,
-                         gpp_atomtype_t atype,
+                         gpp_atomtype *atype,
                          int         *nrmols,
                          t_molinfo   **molinfo,
                          t_molinfo   **intermolecular_interactions,
@@ -430,7 +390,7 @@ static char **read_topol(const char *infile, const char *outfile,
                          bool        bFEP,
                          bool        bZero,
                          bool        usingFullRangeElectrostatics,
-                         warninp_t       wi)
+                         warninp    *wi)
 {
     FILE                 *out;
     int                   i, sl, nb_funct;
@@ -448,7 +408,7 @@ static char **read_topol(const char *infile, const char *outfile,
     real                  fudgeLJ = -1;    /* Multiplication factor to generate 1-4 from LJ */
     bool                  bReadDefaults, bReadMolType, bGenPairs, bWarn_copy_A_B;
     double                qt = 0, qBt = 0; /* total charge */
-    t_bond_atomtype       batype;
+    gpp_bond_atomtype    *batype;
     int                   lastcg = -1;
     int                   dcatt  = -1, nmol_couple;
     /* File handling variables */
@@ -992,14 +952,14 @@ char **do_top(bool                          bVerbose,
               int                          *combination_rule,
               double                       *repulsion_power,
               real                         *fudgeQQ,
-              gpp_atomtype_t                atype,
+              gpp_atomtype                 *atype,
               int                          *nrmols,
               t_molinfo                   **molinfo,
               t_molinfo                   **intermolecular_interactions,
               const t_inputrec             *ir,
               std::vector<gmx_molblock_t>  *molblock,
               bool                         *ffParametrizedWithHBondConstraints,
-              warninp_t                     wi)
+              warninp                      *wi)
 {
     /* Tmpfile might contain a long path */
     const char *tmpfile;
@@ -1356,7 +1316,7 @@ static void generate_qmexcl_moltype(gmx_moltype_t *molt, const unsigned char *gr
     free(blink);
 } /* generate_qmexcl */
 
-void generate_qmexcl(gmx_mtop_t *sys, t_inputrec *ir, warninp_t wi, GmxQmmmMode qmmmMode)
+void generate_qmexcl(gmx_mtop_t *sys, t_inputrec *ir, warninp *wi, GmxQmmmMode qmmmMode)
 {
     /* This routine expects molt->molt[m].ilist to be of size F_NRE and ordered.
      */
index fd9c620cd533b44377782a02e042bc5dba1e807c..c3ec5d5ff35e5c802a4180fbb70394f7fc49880c 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,2015,2016,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2018,2019, 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.
 
 #include <vector>
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/utility/real.h"
 
 struct gmx_molblock_t;
 struct gmx_mtop_t;
+struct gpp_atomtype;
 struct t_gromppopts;
 struct t_inputrec;
+struct t_molinfo;
+struct t_params;
+struct t_symtab;
 struct warninp;
 enum struct GmxQmmmMode;
 typedef warninp *warninp_t;
@@ -59,12 +62,12 @@ char **do_top(bool                          bVerbose,
               const char                   *topppfile,
               t_gromppopts                 *opts,
               bool                          bZero,
-              struct t_symtab              *symtab,
+              t_symtab                     *symtab,
               t_params                      plist[],
               int                          *combination_rule,
               double                       *repulsion_power,
               real                         *fudgeQQ,
-              gpp_atomtype_t                atype,
+              gpp_atomtype                 *atype,
               int                          *nrmols,
               t_molinfo                   **molinfo,
               t_molinfo                   **intermolecular_interactions,
index 7b959406f61ce95416ae61e0d0d0f2c31409f9b0..6828bb0703b429ccdb205ebe07229a4458a8752c 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/fileio/warninp.h"
 #include "gromacs/gmxpreprocess/gpp_atomtype.h"
 #include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/gmxpreprocess/topdirs.h"
@@ -65,8 +66,8 @@
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
-void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype_t atype,
-                       warninp_t wi)
+void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype *atype,
+                       warninp *wi)
 {
     int   i, j, k = -1, nf;
     int   nr, nrfp;
@@ -190,7 +191,17 @@ void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype_t atyp
     }
 }
 
-static void realloc_nb_params(gpp_atomtype_t at,
+/*! \brief Used to temporarily store the explicit non-bonded parameter
+ * combinations, which will be copied to t_params. */
+struct t_nbparam
+{
+    //! Has this combination been set.
+    bool     bSet;
+    //! The non-bonded parameters
+    real     c[4];
+};
+
+static void realloc_nb_params(gpp_atomtype *at,
                               t_nbparam ***nbparam, t_nbparam ***pair)
 {
     /* Add space in the non-bonded parameters matrix */
@@ -204,6 +215,47 @@ static void realloc_nb_params(gpp_atomtype_t at,
     }
 }
 
+int copy_nbparams(t_nbparam **param, int ftype, t_params *plist, int nr)
+{
+    int i, j, f;
+    int nrfp, ncopy;
+
+    nrfp = NRFP(ftype);
+
+    ncopy = 0;
+    for (i = 0; i < nr; i++)
+    {
+        for (j = 0; j <= i; j++)
+        {
+            GMX_RELEASE_ASSERT(param, "Must have valid parameters");
+            if (param[i][j].bSet)
+            {
+                for (f = 0; f < nrfp; f++)
+                {
+                    plist->param[nr*i+j].c[f] = param[i][j].c[f];
+                    plist->param[nr*j+i].c[f] = param[i][j].c[f];
+                }
+                ncopy++;
+            }
+        }
+    }
+
+    return ncopy;
+}
+
+void free_nbparam(t_nbparam **param, int nr)
+{
+    int i;
+
+    GMX_RELEASE_ASSERT(param, "Must have valid parameters");
+    for (i = 0; i < nr; i++)
+    {
+        GMX_RELEASE_ASSERT(param[i], "Must have valid parameters");
+        sfree(param[i]);
+    }
+    sfree(param);
+}
+
 static void copy_B_from_A(int ftype, double *c)
 {
     int nrfpA, nrfpB, i;
@@ -218,10 +270,10 @@ static void copy_B_from_A(int ftype, double *c)
     }
 }
 
-void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
+void push_at (t_symtab *symtab, gpp_atomtype *at, gpp_bond_atomtype *bat,
               char *line, int nb_funct,
               t_nbparam ***nbparam, t_nbparam ***pair,
-              warninp_t wi)
+              warninp *wi)
 {
     typedef struct {
         const char *entry;
@@ -535,7 +587,7 @@ static void push_bondtype(t_params     *       bt,
                           int                  ftype,
                           bool                 bAllowRepeat,
                           const char *         line,
-                          warninp_t            wi)
+                          warninp             *wi)
 {
     int      nr   = bt->nr;
     int      nrfp = NRFP(ftype);
@@ -664,9 +716,9 @@ static void push_bondtype(t_params     *       bt,
 }
 
 void push_bt(Directive d, t_params bt[], int nral,
-             gpp_atomtype_t at,
-             t_bond_atomtype bat, char *line,
-             warninp_t wi)
+             gpp_atomtype *at,
+             gpp_bond_atomtype *bat, char *line,
+             warninp *wi)
 {
     const char *formal[MAXATOMLIST+1] = {
         "%s",
@@ -764,8 +816,8 @@ void push_bt(Directive d, t_params bt[], int nral,
 
 
 void push_dihedraltype(Directive d, t_params bt[],
-                       t_bond_atomtype bat, char *line,
-                       warninp_t wi)
+                       gpp_bond_atomtype *bat, char *line,
+                       warninp *wi)
 {
     const char  *formal[MAXATOMLIST+1] = {
         "%s",
@@ -932,9 +984,9 @@ void push_dihedraltype(Directive d, t_params bt[],
 }
 
 
-void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype_t atype,
+void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype *atype,
               char *pline, int nb_funct,
-              warninp_t wi)
+              warninp *wi)
 {
     /* swap the atoms */
     const char *form3 = "%*s%*s%*s%lf%lf%lf";
@@ -1059,9 +1111,9 @@ void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype_t atype,
 }
 
 void
-push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype_t at,
-              t_bond_atomtype bat, char *line,
-              warninp_t wi)
+push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype *at,
+              gpp_bond_atomtype *bat, char *line,
+              warninp *wi)
 {
     const char  *formal = "%s%s%s%s%s%s%s%s%n";
 
@@ -1210,7 +1262,7 @@ static void push_atom_now(t_symtab *symtab, t_atoms *at, int atomnr,
                           char *resnumberic,
                           char *resname, char *name, real m0, real q0,
                           int typeB, char *ctypeB, real mB, real qB,
-                          warninp_t wi)
+                          warninp *wi)
 {
     int           j, resind = 0, resnr;
     unsigned char ric;
@@ -1306,8 +1358,8 @@ static void push_cg(t_block *block, int *lastindex, int index, int a)
 }
 
 void push_atom(t_symtab *symtab, t_block *cgs,
-               t_atoms *at, gpp_atomtype_t atype, char *line, int *lastcg,
-               warninp_t wi)
+               t_atoms *at, gpp_atomtype *atype, char *line, int *lastcg,
+               warninp *wi)
 {
     int           nr, ptype;
     int           cgnumber, atomnr, type, typeB, nscan;
@@ -1386,7 +1438,7 @@ void push_atom(t_symtab *symtab, t_block *cgs,
 }
 
 void push_molt(t_symtab *symtab, int *nmol, t_molinfo **mol, char *line,
-               warninp_t wi)
+               warninp *wi)
 {
     char       type[STRLEN];
     int        nrexcl, i;
@@ -1516,10 +1568,10 @@ static bool default_nb_params(int ftype, t_params bt[], t_atoms *at,
 }
 
 static bool default_cmap_params(t_params bondtype[],
-                                t_atoms *at, gpp_atomtype_t atype,
+                                t_atoms *at, gpp_atomtype *atype,
                                 t_param *p, bool bB,
                                 int *cmap_type, int *nparam_def,
-                                warninp_t wi)
+                                warninp *wi)
 {
     int        i, nparam_found;
     int        ct;
@@ -1591,7 +1643,7 @@ static int natom_match(t_param *pi,
 }
 
 static bool default_params(int ftype, t_params bt[],
-                           t_atoms *at, gpp_atomtype_t atype,
+                           t_atoms *at, gpp_atomtype *atype,
                            t_param *p, bool bB,
                            t_param **param_def,
                            int *nparam_def)
@@ -1710,10 +1762,10 @@ static bool default_params(int ftype, t_params bt[],
 
 
 void push_bond(Directive d, t_params bondtype[], t_params bond[],
-               t_atoms *at, gpp_atomtype_t atype, char *line,
+               t_atoms *at, gpp_atomtype *atype, char *line,
                bool bBonded, bool bGenPairs, real fudgeQQ,
                bool bZero, bool *bWarn_copy_A_B,
-               warninp_t wi)
+               warninp *wi)
 {
     const char  *aaformat[MAXATOMLIST] = {
         "%d%d",
@@ -2118,8 +2170,8 @@ void push_bond(Directive d, t_params bondtype[], t_params bond[],
 }
 
 void push_cmap(Directive d, t_params bondtype[], t_params bond[],
-               t_atoms *at, gpp_atomtype_t atype, char *line,
-               warninp_t wi)
+               t_atoms *at, gpp_atomtype *atype, char *line,
+               warninp *wi)
 {
     const char *aaformat[MAXATOMLIST+1] =
     {
@@ -2212,7 +2264,7 @@ void push_cmap(Directive d, t_params bondtype[], t_params bond[],
 
 void push_vsitesn(Directive d, t_params bond[],
                   t_atoms *at, char *line,
-                  warninp_t wi)
+                  warninp *wi)
 {
     char   *ptr;
     int     type, ftype, j, n, ret, nj, a;
@@ -2321,7 +2373,7 @@ void push_vsitesn(Directive d, t_params bond[],
 
 void push_mol(int nrmols, t_molinfo mols[], char *pline, int *whichmol,
               int *nrcopies,
-              warninp_t wi)
+              warninp *wi)
 {
     char type[STRLEN];
 
@@ -2385,7 +2437,7 @@ void push_mol(int nrmols, t_molinfo mols[], char *pline, int *whichmol,
     }
 }
 
-void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp_t wi)
+void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp *wi)
 {
     int  i, j;
     int  n;
@@ -2432,7 +2484,7 @@ void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp_t wi)
     while (n == 1);
 }
 
-int add_atomtype_decoupled(t_symtab *symtab, gpp_atomtype_t at,
+int add_atomtype_decoupled(t_symtab *symtab, gpp_atomtype *at,
                            t_nbparam ***nbparam, t_nbparam ***pair)
 {
     t_atom  atom;
@@ -2524,7 +2576,7 @@ static void convert_pairs_to_pairsQ(t_params *plist,
     plist[F_LJ14].param = nullptr;
 }
 
-static void generate_LJCpairsNB(t_molinfo *mol, int nb_funct, t_params *nbp, warninp_t wi)
+static void generate_LJCpairsNB(t_molinfo *mol, int nb_funct, t_params *nbp, warninp *wi)
 {
     int       n, ntype, i, j, k;
     t_atom   *atom;
@@ -2604,7 +2656,7 @@ static void set_excl_all(t_blocka *excl)
 
 static void decouple_atoms(t_atoms *atoms, int atomtype_decouple,
                            int couple_lam0, int couple_lam1,
-                           const char *mol_name, warninp_t wi)
+                           const char *mol_name, warninp *wi)
 {
     int  i;
 
@@ -2647,7 +2699,7 @@ static void decouple_atoms(t_atoms *atoms, int atomtype_decouple,
 void convert_moltype_couple(t_molinfo *mol, int atomtype_decouple, real fudgeQQ,
                             int couple_lam0, int couple_lam1,
                             bool bCoupleIntra, int nb_funct, t_params *nbp,
-                            warninp_t wi)
+                            warninp *wi)
 {
     convert_pairs_to_pairsQ(mol->plist, fudgeQQ, &mol->atoms);
     if (!bCoupleIntra)
index a1e8baea18f1dc704c95051f74e28a65d4bb7bd6..798769271cc97082580ccf12a0857a4366639dfc 100644 (file)
 #ifndef GMX_GMXPREPROCESS_TOPPUSH_H
 #define GMX_GMXPREPROCESS_TOPPUSH_H
 
-#include "gromacs/fileio/warninp.h"
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
+#include "gromacs/utility/real.h"
 
 enum class Directive : int;
+struct gpp_atomtype;
+struct gpp_bond_atomtype;
+struct t_atoms;
+struct t_block;
+struct t_molinfo;
+struct t_nbparam;
+struct t_param;
+struct t_params;
+struct t_restp;
+struct warninp;
 
 namespace gmx
 {
@@ -50,62 +58,66 @@ struct ExclusionBlocks;
 } // namespace gmx
 
 void generate_nbparams(int comb, int funct, t_params plist[],
-                       gpp_atomtype_t atype,
-                       warninp_t wi);
+                       gpp_atomtype *atype,
+                       warninp *wi);
 
-void push_at (struct t_symtab *symtab, gpp_atomtype_t at,
-              t_bond_atomtype bat, char *line, int nb_funct,
+void push_at (struct t_symtab *symtab, gpp_atomtype *at,
+              gpp_bond_atomtype *bat, char *line, int nb_funct,
               t_nbparam ***nbparam, t_nbparam ***pair,
-              warninp_t wi);
+              warninp *wi);
 
 void push_bt(Directive d, t_params bt[], int nral,
-             gpp_atomtype_t at, t_bond_atomtype bat, char *line,
-             warninp_t wi);
+             gpp_atomtype *at, gpp_bond_atomtype *bat, char *line,
+             warninp *wi);
 
 void push_dihedraltype(Directive d, t_params bt[],
-                       t_bond_atomtype bat, char *line,
-                       warninp_t wi);
+                       gpp_bond_atomtype *bat, char *line,
+                       warninp *wi);
 
-void push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype_t at,
-                   t_bond_atomtype bat, char *line,
-                   warninp_t wi);
+void push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype *at,
+                   gpp_bond_atomtype *bat, char *line,
+                   warninp *wi);
 
-void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype_t atype,
+void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype *atype,
               char *plines, int nb_funct,
-              warninp_t wi);
+              warninp *wi);
 
 void push_atom(struct t_symtab *symtab,
                t_block         *cgs,
                t_atoms         *at,
-               gpp_atomtype_t   atype,
+               gpp_atomtype    *atype,
                char            *line,
                int             *lastcg,
-               warninp_t        wi);
+               warninp         *wi);
 
 void push_bond(Directive d, t_params bondtype[], t_params bond[],
-               t_atoms *at, gpp_atomtype_t atype, char *line,
+               t_atoms *at, gpp_atomtype *atype, char *line,
                bool bBonded, bool bGenPairs, real fudgeQQ,
                bool bZero, bool *bWarn_copy_A_B,
-               warninp_t wi);
+               warninp *wi);
 
 void push_cmap(Directive d, t_params bondtype[], t_params bond[],
-               t_atoms *at, gpp_atomtype_t atype, char *line,
-               warninp_t wi);
+               t_atoms *at, gpp_atomtype *atype, char *line,
+               warninp *wi);
 
 void push_vsitesn(Directive d, t_params bond[],
                   t_atoms *at, char *line,
-                  warninp_t wi);
+                  warninp *wi);
 
 void push_mol(int nrmols, t_molinfo mols[], char *pline,
               int *whichmol, int *nrcopies,
-              warninp_t wi);
+              warninp *wi);
 
 void push_molt(struct t_symtab *symtab, int *nmol, t_molinfo **mol, char *line,
-               warninp_t wi);
+               warninp *wi);
 
-void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp_t wi);
+void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp *wi);
 
-int add_atomtype_decoupled(struct t_symtab *symtab, gpp_atomtype_t at,
+int copy_nbparams(t_nbparam **param, int ftype, t_params *plist, int nr);
+
+void free_nbparam(t_nbparam **param, int nr);
+
+int add_atomtype_decoupled(struct t_symtab *symtab, gpp_atomtype *at,
                            t_nbparam ***nbparam, t_nbparam ***pair);
 /* Add an atom type with all parameters set to zero (no interactions).
  * Returns the atom type number.
@@ -116,7 +128,7 @@ void convert_moltype_couple(t_molinfo *mol, int atomtype_decouple,
                             int couple_lam0, int couple_lam1,
                             bool bCoupleIntra,
                             int nb_funct, t_params *nbp,
-                            warninp_t wi);
+                            warninp *wi);
 /* Setup mol such that the B-state has no interaction with the rest
  * of the system, but full interaction with itself.
  */
index cf48da1d8a85c6ac6e23df7959759edaec85fbba..93ae99953cd9df4b5d3a0bbc7773a30f04b85f0d 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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 <cctype>
 #include <cmath>
 
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/gmxpreprocess/topdirs.h"
index f232d5620698eb7cfc526a19be37c029e69adbe4..6573aed28c2563eae3495566efe75357eed565a2 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,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2019, 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,8 @@
 #ifndef GMX_GMXPREPROCESS_TOPSHAKE_H
 #define GMX_GMXPREPROCESS_TOPSHAKE_H
 
-#include "gromacs/gmxpreprocess/topio.h"
+struct t_atoms;
+struct t_params;
 
 void make_shake (t_params plist[], t_atoms *atoms, int nshake);
 
index 8fb8c15020b47df66511b056d8e5c0fde939fe1d..facc152e5a684eeedcf898f3669581f1f3dc03ba 100644 (file)
@@ -45,6 +45,7 @@
 #include <algorithm>
 
 #include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/topdirs.h"
 #include "gromacs/topology/block.h"
@@ -202,7 +203,7 @@ void done_mi(t_molinfo *mi)
 
 /* PRINTING STRUCTURES */
 
-static void print_bt(FILE *out, Directive d, gpp_atomtype_t at,
+static void print_bt(FILE *out, Directive d, gpp_atomtype *at,
                      int ftype, int fsubtype, t_params plist[],
                      bool bFullDih)
 {
@@ -430,7 +431,7 @@ static double get_residue_charge(const t_atoms *atoms, int at)
     return q;
 }
 
-void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
+void print_atoms(FILE *out, gpp_atomtype *atype, t_atoms *at, int *cgnr,
                  bool bRTPresname)
 {
     int         i, ri;
@@ -526,7 +527,7 @@ void print_bondeds(FILE *out, int natoms, Directive d,
                    int ftype, int fsubtype, t_params plist[])
 {
     t_symtab       stab;
-    gpp_atomtype_t atype;
+    gpp_atomtype  *atype;
     t_param       *param;
     t_atom        *a;
     int            i;
index 859554fefe30cccc0c695e9643c6adeee3561b92..e581c812728fc8e9b6a0a96dd8558e3d17ded134 100644 (file)
 #ifndef GMX_GMXPREPROCESS_TOPUTIL_H
 #define GMX_GMXPREPROCESS_TOPUTIL_H
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include <cstdio>
 
 enum class Directive : int;
+struct gpp_atomtype;
+struct t_atoms;
+struct t_blocka;
+struct t_excls;
+struct t_molinfo;
+struct t_param;
+struct t_params;
 
 /* UTILITIES */
 
@@ -69,7 +76,7 @@ void done_mi(t_molinfo *mi);
 void print_blocka(FILE *out, const char *szName, const char *szIndex,
                   const char *szA, t_blocka *block);
 
-void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
+void print_atoms(FILE *out, gpp_atomtype *atype, t_atoms *at, int *cgnr,
                  bool bRTPresname);
 
 void print_bondeds(FILE *out, int natoms, Directive d,
index 5caf15877da4e39969dd18ff7a594573ba03265b..9917af8b912eea1bf6b44bae60e687643e911a43 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,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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,8 @@
 #include <algorithm>
 
 #include "gromacs/gmxpreprocess/add_par.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/resall.h"
 #include "gromacs/gmxpreprocess/toputil.h"
@@ -390,7 +392,7 @@ static real get_angle(int nrang, t_mybonded angles[],
     return angle;
 }
 
-static char *get_atomtype_name_AB(t_atom *atom, gpp_atomtype_t atype)
+static char *get_atomtype_name_AB(t_atom *atom, gpp_atomtype *atype)
 {
     char *name;
 
@@ -414,7 +416,7 @@ static char *get_atomtype_name_AB(t_atom *atom, gpp_atomtype_t atype)
     return name;
 }
 
-static bool calc_vsite3_param(gpp_atomtype_t atype,
+static bool calc_vsite3_param(gpp_atomtype *atype,
                               t_param *param, t_atoms *at,
                               int nrbond, t_mybonded *bonds,
                               int nrang,  t_mybonded *angles )
@@ -552,7 +554,7 @@ static bool calc_vsite3fad_param(t_param *param,
     return bError;
 }
 
-static bool calc_vsite3out_param(gpp_atomtype_t atype,
+static bool calc_vsite3out_param(gpp_atomtype *atype,
                                  t_param *param, t_atoms *at,
                                  int nrbond, t_mybonded *bonds,
                                  int nrang,  t_mybonded *angles)
@@ -764,7 +766,7 @@ calc_vsite4fdn_param(t_param *param,
 
 
 
-int set_vsites(bool bVerbose, t_atoms *atoms, gpp_atomtype_t atype,
+int set_vsites(bool bVerbose, t_atoms *atoms, gpp_atomtype *atype,
                t_params plist[])
 {
     int             i, j, ftype;
index 682f97a54d314321c1c24a573a51487bef4f610b..986908ebaf363013bc9c4ee75740369bab8e6677 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_VSITE_PARM_H
 #define GMX_GMXPREPROCESS_VSITE_PARM_H
 
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-
+struct gpp_atomtype;
 struct gmx_moltype_t;
+struct t_atoms;
+struct t_params;
 
-int set_vsites(bool bVerbose, t_atoms *atoms,  gpp_atomtype_t atype,
+int set_vsites(bool bVerbose, t_atoms *atoms,  gpp_atomtype *atype,
                t_params plist[]);
 /* set parameters for virtual sites, return number of virtual sites */
 
index 44d90618613e6d2250c21102a0e319b002c1c367..568f88540ec4763f1fe647dc6ea64b44ee93b742 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,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/gmxpreprocess/gen_ad.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
 #include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/gmxpreprocess/nm2type.h"
 #include "gromacs/gmxpreprocess/notset.h"
 #include "gromacs/gmxpreprocess/pdb2top.h"
 #include "gromacs/gmxpreprocess/toppush.h"
+#include "gromacs/gmxpreprocess/toputil.h"
 #include "gromacs/listed-forces/bonded.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
@@ -174,10 +177,10 @@ static int *set_cgnr(t_atoms *atoms, bool bUsePDBcharge, real *qtot, real *mtot)
     return cgnr;
 }
 
-static gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
-                                    int *nbonds, int nnm, t_nm2type nm2t[])
+static gpp_atomtype *set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
+                                   int *nbonds, int nnm, t_nm2type nm2t[])
 {
-    gpp_atomtype_t atype;
+    gpp_atomtype  *atype;
     int            nresolved;
 
     atype = init_atomtype();
@@ -333,7 +336,7 @@ static void print_pl(FILE *fp, t_params plist[], int ftp, const char *name,
 }
 
 static void print_rtp(const char *filenm, const char *title, t_atoms *atoms,
-                      t_params plist[], gpp_atomtype_t atype, int cgnr[])
+                      t_params plist[], gpp_atomtype *atype, int cgnr[])
 {
     FILE *fp;
     int   i, tp;
@@ -396,7 +399,7 @@ int gmx_x2top(int argc, char *argv[])
     FILE              *fp;
     t_params           plist[F_NRE];
     t_excls           *excls;
-    gpp_atomtype_t     atype;
+    gpp_atomtype      *atype;
     t_nextnb           nnb;
     t_nm2type         *nm2t;
     t_mols             mymol;
index 4897e89f45b6d1e81380213c6349b72f609e22f9..9039f2468ab36b820fdade6975fd093f4662754d 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,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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 <vector>
 
 #include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/topology/residuetypes.h"
 #include "gromacs/topology/symtab.h"
index f11c17caee9537712f36de6f9dc57be224e12033..78b11b8c7006261505b79412ebec277dfcc70a8d 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,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
 #ifndef GMX_GMXPREPROCESS_XLATE_H
 #define GMX_GMXPREPROCESS_XLATE_H
 
-#include "gromacs/gmxpreprocess/hackblock.h"
-#include "gromacs/utility/basedefinitions.h"
-
 struct gmx_residuetype_t;
 struct t_atoms;
+struct t_restp;
 struct t_symtab;
 
 /* If bResname is true renames atoms based on residue names,
  * otherwise renames atoms based on rtp entry names.
  */
 void rename_atoms(const char* xlfile, const char *ffdir,
-                  struct t_atoms *atoms, struct t_symtab *symtab, const t_restp *restp,
-                  bool bResname, struct gmx_residuetype_t *rt, bool bReorderNum,
+                  t_atoms *atoms, t_symtab *symtab, const t_restp *restp,
+                  bool bResname, gmx_residuetype_t *rt, bool bReorderNum,
                   bool bVerbose);
 
 #endif