This uses the agreed format for forward declarations in #1490.
This removes the need to include residuetypes.h in any headers, and can
serve as a simple demonstration of the concept.
Change-Id: Ia82d4f96a1ea97e97e11e9840563f8beebe268c8
int nlongname = 0;
int chainnum, lastchainnum;
int lastresind, lastchainresind;
- gmx_residuetype_t rt;
+ gmx_residuetype_t*rt;
const char *p_restype;
const char *p_lastrestype;
t_dlist *mk_dlist(FILE *log,
t_atoms *atoms, int *nlist,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
- int maxchi, int r0, gmx_residuetype_t rt)
+ int maxchi, int r0, gmx_residuetype_t *rt)
{
int ires, i, j, k, ii;
t_dihatms atm, prev;
return j;
}
-static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
+static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
int nf, int maxchi, real **dih,
int nlist, t_dlist dlist[],
atom_id index[],
gmx_bool bDo_rt, bDo_oh, bDo_ot, bDo_jc;
real dt = 0, traj_t_ns;
output_env_t oenv;
- gmx_residuetype_t rt;
+ gmx_residuetype_t *rt;
atom_id isize, *index;
int ndih, nactdih, nf;
#include "../legacyheaders/oenv.h"
#include "../commandline/pargs.h"
#include "../topology/index.h"
-#include "../topology/residuetypes.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct gmx_residuetype_t;
+
/***********************************************
*
* A U T O C O R R E L A T I O N
t_dlist *mk_dlist(FILE *log,
t_atoms *atoms, int *nlist,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
- int maxchi, int r0, gmx_residuetype_t rt);
+ int maxchi, int r0, struct gmx_residuetype_t *rt);
void pr_dlist(FILE *fp, int nl, t_dlist dl[], real dt, int printtype,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bOmega, int maxchi);
}
static int get_atype(int atom, t_atoms *at, int nrtp, t_restp rtp[],
- gmx_residuetype_t rt)
+ gmx_residuetype_t *rt)
{
int type;
gmx_bool bNterm;
}
static real get_amass(int atom, t_atoms *at, int nrtp, t_restp rtp[],
- gmx_residuetype_t rt)
+ gmx_residuetype_t *rt)
{
real mass;
gmx_bool bNterm;
char **db;
int nvsiteconf, nvsitetop, cmplength;
gmx_bool isN, planarN, bFound;
- gmx_residuetype_t rt;
+ gmx_residuetype_t*rt;
t_vsiteconf *vsiteconflist;
/* pointer to a list of CH3/NH3/NH2 configuration entries.
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];
}
static int name2type(t_atoms *at, int **cgnr, gpp_atomtype_t atype,
- t_restp restp[], gmx_residuetype_t rt)
+ t_restp restp[], gmx_residuetype_t *rt)
{
int i, j, prevresind, resind, i0, prevcg, cg, curcg;
char *name;
}
#define NUM_CMAP_ATOMS 5
-static void gen_cmap(t_params *psb, t_restp *restp, t_atoms *atoms, gmx_residuetype_t rt)
+static void gen_cmap(t_params *psb, t_restp *restp, t_atoms *atoms, gmx_residuetype_t *rt)
{
int residx, i, j, k;
const char *ptr;
int *vsite_type;
int i, nmissat;
int bts[ebtsNR];
- gmx_residuetype_t rt;
+ gmx_residuetype_t*rt;
init_plist(plist);
gmx_residuetype_init(&rt);
void rename_atoms(const char *xlfile, const char *ffdir,
t_atoms *atoms, t_symtab *symtab, const t_restp *restp,
- gmx_bool bResname, gmx_residuetype_t rt, gmx_bool bReorderNum,
+ gmx_bool bResname, gmx_residuetype_t *rt, gmx_bool bReorderNum,
gmx_bool bVerbose)
{
FILE *fp;
#ifndef GMX_GMXPREPROCESS_XLATE_H
#define GMX_GMXPREPROCESS_XLATE_H
-#include "gromacs/topology/residuetypes.h"
+#include "gromacs/utility/basedefinitions.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct gmx_residuetype_t;
+struct t_atoms;
+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,
- t_atoms *atoms, struct t_symtab *symtab, const t_restp *restp,
- gmx_bool bResname, gmx_residuetype_t rt, gmx_bool bReorderNum,
+ struct t_atoms *atoms, struct t_symtab *symtab, const t_restp *restp,
+ gmx_bool bResname, struct gmx_residuetype_t *rt, gmx_bool bReorderNum,
gmx_bool bVerbose);
#ifdef __cplusplus
} aprop_t;
typedef struct gmx_atomprop {
- gmx_bool bWarned, bWarnVDW;
- aprop_t prop[epropNR];
- gmx_residuetype_t restype;
+ gmx_bool bWarned, bWarnVDW;
+ aprop_t prop[epropNR];
+ gmx_residuetype_t *restype;
} gmx_atomprop;
return i;
}
-static int get_prop_index(aprop_t *ap, gmx_residuetype_t restype,
+static int get_prop_index(aprop_t *ap, gmx_residuetype_t *restype,
char *resnm, char *atomnm,
gmx_bool *bExact)
{
return j;
}
-static void add_prop(aprop_t *ap, gmx_residuetype_t restype,
+static void add_prop(aprop_t *ap, gmx_residuetype_t *restype,
char *resnm, char *atomnm,
real p, int line)
{
void analyse(t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
{
- gmx_residuetype_t rt = NULL;
+ gmx_residuetype_t*rt = NULL;
char *resnm;
atom_id *aid;
const char ** restype;
const char gmx_residuetype_undefined[] = "Other";
-struct gmx_residuetype
+struct gmx_residuetype_t
{
int n;
char ** resname;
};
int
-gmx_residuetype_init(gmx_residuetype_t *prt)
+gmx_residuetype_init(gmx_residuetype_t **prt)
{
FILE * db;
char line[STRLEN];
char resname[STRLEN], restype[STRLEN], dum[STRLEN];
- struct gmx_residuetype *rt;
+ gmx_residuetype_t *rt;
snew(rt, 1);
*prt = rt;
}
int
-gmx_residuetype_destroy(gmx_residuetype_t rt)
+gmx_residuetype_destroy(gmx_residuetype_t *rt)
{
int i;
* p_restype is set to a pointer to the type name, or 'Other' if we did not find it.
*/
int
-gmx_residuetype_get_type(gmx_residuetype_t rt, const char * resname, const char ** p_restype)
+gmx_residuetype_get_type(gmx_residuetype_t *rt, const char * resname, const char ** p_restype)
{
int i, rc;
}
int
-gmx_residuetype_add(gmx_residuetype_t rt, const char *newresname, const char *newrestype)
+gmx_residuetype_add(gmx_residuetype_t *rt, const char *newresname, const char *newrestype)
{
int found;
const char * p_oldtype;
}
int
-gmx_residuetype_get_alltypes(gmx_residuetype_t rt,
+gmx_residuetype_get_alltypes(gmx_residuetype_t *rt,
const char *** p_typenames,
int * ntypes)
{
}
gmx_bool
-gmx_residuetype_is_protein(gmx_residuetype_t rt, const char *resnm)
+gmx_residuetype_is_protein(gmx_residuetype_t *rt, const char *resnm)
{
gmx_bool rc;
const char *p_type;
}
gmx_bool
-gmx_residuetype_is_dna(gmx_residuetype_t rt, const char *resnm)
+gmx_residuetype_is_dna(gmx_residuetype_t *rt, const char *resnm)
{
gmx_bool rc;
const char *p_type;
}
gmx_bool
-gmx_residuetype_is_rna(gmx_residuetype_t rt, const char *resnm)
+gmx_residuetype_is_rna(gmx_residuetype_t *rt, const char *resnm)
{
gmx_bool rc;
const char *p_type;
/* Return the size of the arrays */
int
-gmx_residuetype_get_size(gmx_residuetype_t rt)
+gmx_residuetype_get_size(gmx_residuetype_t *rt)
{
return rt->n;
}
* otherwise -1.
*/
int
-gmx_residuetype_get_index(gmx_residuetype_t rt, const char *resnm)
+gmx_residuetype_get_index(gmx_residuetype_t *rt, const char *resnm)
{
int i, rc;
/* Return the name of the residuetype with the given index, or
* NULL if not found. */
const char *
-gmx_residuetype_get_name(gmx_residuetype_t rt, int index)
+gmx_residuetype_get_name(gmx_residuetype_t *rt, int index)
{
if (index >= 0 && index < rt->n)
{
{
#endif
-typedef struct gmx_residuetype *gmx_residuetype_t;
+typedef struct gmx_residuetype_t gmx_residuetype_t;
int
-gmx_residuetype_init(gmx_residuetype_t *rt);
+gmx_residuetype_init(gmx_residuetype_t **rt);
int
-gmx_residuetype_destroy(gmx_residuetype_t rt);
+gmx_residuetype_destroy(gmx_residuetype_t *rt);
int
-gmx_residuetype_get_type(gmx_residuetype_t rt, const char *resname, const char **p_restype);
+gmx_residuetype_get_type(gmx_residuetype_t *rt, const char *resname, const char **p_restype);
int
-gmx_residuetype_add(gmx_residuetype_t rt, const char *newresname, const char *newrestype);
+gmx_residuetype_add(gmx_residuetype_t *rt, const char *newresname, const char *newrestype);
int
-gmx_residuetype_get_alltypes(gmx_residuetype_t rt,
+gmx_residuetype_get_alltypes(gmx_residuetype_t *rt,
const char ***p_typenames,
int *ntypes);
gmx_bool
-gmx_residuetype_is_protein(gmx_residuetype_t rt, const char *resnm);
+gmx_residuetype_is_protein(gmx_residuetype_t *rt, const char *resnm);
gmx_bool
-gmx_residuetype_is_dna(gmx_residuetype_t rt, const char *resnm);
+gmx_residuetype_is_dna(gmx_residuetype_t *rt, const char *resnm);
gmx_bool
-gmx_residuetype_is_rna(gmx_residuetype_t rt, const char *resnm);
+gmx_residuetype_is_rna(gmx_residuetype_t *rt, const char *resnm);
int
-gmx_residuetype_get_size(gmx_residuetype_t rt);
+gmx_residuetype_get_size(gmx_residuetype_t *rt);
int
-gmx_residuetype_get_index(gmx_residuetype_t rt, const char *resnm);
+gmx_residuetype_get_index(gmx_residuetype_t *rt, const char *resnm);
const char *
-gmx_residuetype_get_name(gmx_residuetype_t rt, int index);
+gmx_residuetype_get_name(gmx_residuetype_t *rt, int index);
#ifdef __cplusplus
}