* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-#include "pdb2gmx.h"
+#include "gmxpre.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "pdb2gmx.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "typedefs.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "gromacs/utility/smalloc.h"
-#include "copyrite.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/confio.h"
-#include "symtab.h"
-#include "gromacs/math/vec.h"
#include "gromacs/commandline/pargs.h"
-#include "gromacs/utility/futil.h"
-#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/pdbio.h"
-#include "toputil.h"
-#include "h_db.h"
-#include "pgutil.h"
-#include "resall.h"
-#include "pdb2top.h"
-#include "ter_db.h"
-#include "gromacs/gmxlib/conformation-utilities.h"
-#include "genhydro.h"
-#include "readinp.h"
-#include "atomprop.h"
-#include "index.h"
-#include "fflibutil.h"
-#include "macros.h"
-
#include "gromacs/fileio/strdb.h"
-
-#include "hizzie.h"
-#include "specbond.h"
-#include "xlate.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/genhydro.h"
+#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hizzie.h"
+#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/specbond.h"
+#include "gromacs/gmxpreprocess/ter_db.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/gmxpreprocess/xlate.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
typedef struct {
char gmx[6];
static int read_pdball(const char *inf, const char *outf, char *title,
t_atoms *atoms, rvec **x,
int *ePBC, matrix box, gmx_bool bRemoveH,
- t_symtab *symtab, gmx_residuetype_t rt, const char *watres,
+ t_symtab *symtab, gmx_residuetype_t *rt, const char *watres,
gmx_atomprop_t aps, gmx_bool bVerbose)
/* Read a pdb file. (containing proteins) */
{
return pdba->nr;
}
-void find_nc_ter(t_atoms *pdba, int r0, int r1, int *r_start, int *r_end, gmx_residuetype_t rt)
+void find_nc_ter(t_atoms *pdba, int r0, int r1, int *r_start, int *r_end,
+ gmx_residuetype_t *rt)
{
int i;
const char *p_startrestype;
t_hackblock *ah;
t_symtab symtab;
gpp_atomtype_t atype;
- gmx_residuetype_t rt;
+ gmx_residuetype_t*rt;
const char *top_fn;
char fn[256], itp_fn[STRLEN], posre_fn[STRLEN], buf_fn[STRLEN];
char molname[STRLEN], title[STRLEN], quote[STRLEN];
chains[i].pdba->atom[j] = pdba_all.atom[pdb_ch[si].start+j];
snew(chains[i].pdba->atomname[j], 1);
*chains[i].pdba->atomname[j] =
- strdup(*pdba_all.atomname[pdb_ch[si].start+j]);
+ gmx_strdup(*pdba_all.atomname[pdb_ch[si].start+j]);
chains[i].pdba->pdbinfo[j] = pdba_all.pdbinfo[pdb_ch[si].start+j];
copy_rvec(pdbx[pdb_ch[si].start+j], chains[i].x[j]);
}
{
chains[i].pdba->resinfo[j] = pdba_all.resinfo[k+j];
snew(chains[i].pdba->resinfo[j].name, 1);
- *chains[i].pdba->resinfo[j].name = strdup(*pdba_all.resinfo[k+j].name);
+ *chains[i].pdba->resinfo[j].name = gmx_strdup(*pdba_all.resinfo[k+j].name);
/* make all chain identifiers equal to that of the chain */
chains[i].pdba->resinfo[j].chainid = pdb_ch[si].chainid;
}
printf("There are %d chains and %d blocks of water and "
"%d residues with %d atoms\n",
nch-nwaterchain, nwaterchain,
- pdba_all.resinfo[pdba_all.atom[natom-1].resind].nr, natom);
+ pdba_all.nres, natom);
printf("\n %5s %4s %6s\n", "chain", "#res", "#atoms");
for (i = 0; (i < nch); i++)
nincl++;
srenew(incls, nincl);
- incls[nincl-1] = strdup(itp_fn);
+ incls[nincl-1] = gmx_strdup(itp_fn);
itp_file = gmx_fio_fopen(itp_fn, "w");
}
else
srenew(mols, nmol+1);
if (cc->bAllWat)
{
- mols[nmol].name = strdup("SOL");
+ mols[nmol].name = gmx_strdup("SOL");
mols[nmol].nr = pdba->nres;
}
else
{
- mols[nmol].name = strdup(molname);
+ mols[nmol].name = gmx_strdup(molname);
mols[nmol].nr = 1;
}
nmol++;