* 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 "gromacs/topology/atomprop.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include "gromacs/fileio/strdb.h"
-#include "gromacs/legacyheaders/atomprop.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/legacyheaders/index.h"
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/math/utilities.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
while (get_a_line(fp, line, STRLEN))
{
line_no++;
- if (sscanf(line, "%s %s %lf", resnm, atomnm, &pp) == 3)
+ if (sscanf(line, "%31s %31s %20lf", resnm, atomnm, &pp) == 3)
{
pp *= factor;
add_prop(ap, aps->restype, resnm, atomnm, pp, line_no);
gmx_atomprop_t gmx_atomprop_init(void)
{
gmx_atomprop *aps;
- int p;
snew(aps, 1);
real *value)
{
gmx_atomprop *ap = (gmx_atomprop*) aps;
- size_t i;
int j;
#define MAXQ 32
char atomname[MAXQ], resname[MAXQ];
}
if (isdigit(atomnm[0]))
{
+ int i;
/* put digit after atomname */
- for (i = 1; (i < min(MAXQ-1, strlen(atomnm))); i++)
+ for (i = 1; i < MAXQ-1 && atomnm[i] != '\0'; i++)
{
atomname[i-1] = atomnm[i];
}
return gmx_nint(ap->prop[epropElement].value[i]);
}
}
- return NOTSET;
+ return -1;
}