* VERSION 3.2.0
* Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
+ * Copyright (c) 2001-2013, The GROMACS development team,
* check out http://www.gromacs.org for more information.
* This program is free software; you can redistribute it and/or
break;
}
fprintf(stderr, " in file %s\n", infile);
- fprintf(stderr, "C-File: %s, line: %d\n", file, line);
+ fprintf(stderr, "source file: %s, line: %d\n", file, line);
exit(1);
}
#define ReadDlgErr(in, er, es) ReadDlgError(in, er, es, __FILE__, __LINE__)
-static void GetBuf(FILE *in, char *buf)
-{
- int rc;
-
- rc = fscanf(in, "%s", buf);
-}
-
static void ReadAccOpen(const char *infile, FILE *in)
{
char buf[STRLEN];
- GetBuf(in, buf);
+ fscanf(in, "%4s", buf);
if (strcmp(buf, "{") != 0)
{
ReadDlgErr(infile, eACCOEXP, buf);
{
char buf[STRLEN];
- GetBuf(in, buf);
+ fscanf(in, "%4s", buf);
if (strcmp(buf, "}") != 0)
{
ReadDlgErr(infile, eACCCEXP, buf);
buf[i] = '\0';
}
-static gmx_bool bNotAccClose(const char *buf)
+static bool bNotAccClose(const char *buf)
{
return (strcmp(buf, "}") != 0);
}
{
/* Special case */
edlg = edlgBN;
- fitem->bDef = TRUE;
+ fitem->bDef = true;
}
if (edlg == edlgNR+1)
{
{
FILE *in;
char buf[STRLEN];
- char *gmxlib;
- char newinfile[STRLEN];
t_fgrid *fgrid;
t_fgroup *fgroup;
int gridx, gridy;
in = libopen(infile);
- GetBuf(in, buf);
+ fscanf(in, "%6s", buf);
if (strcmp(buf, "grid") != 0)
{
ReadDlgErr(infile, eGRIDEXP, buf);
}
fgrid = NewFGrid();
- if ((fscanf(in, "%d%d", &gridx, &gridy)) != 2)
+ if ((fscanf(in, "%5d%5d", &gridx, &gridy)) != 2)
{
ReadDlgErr(infile, eNOVALS, "grid w,h");
}
fgrid->w = gridx;
fgrid->h = gridy;
ReadAccOpen(infile, in);
- GetBuf(in, buf);
+ fscanf(in, "%15s", buf);
while (bNotAccClose(buf))
{
if (strcmp(buf, "group") == 0)
fgroup = AddFGridFGroup(fgrid);
ReadQuoteString(infile, in, buf);
fgroup->name = strdup(buf);
- if ((fscanf(in, "%d%d%d%d", &fgroup->x, &fgroup->y, &fgroup->w, &fgroup->h)) != 4)
+ if ((fscanf(in, "%5d%5d%5d%5d", &fgroup->x, &fgroup->y, &fgroup->w, &fgroup->h)) != 4)
{
ReadDlgErr(infile, eNOVALS, "group x,y,w,h");
}
ReadDlgErr(infile, eTOOHIGH, buf);
}
ReadAccOpen(infile, in);
- GetBuf(in, buf);
+ fscanf(in, "%15s", buf);
while (bNotAccClose(buf))
{
AddFGroupFItem(fgroup, ScanFItem(infile, in, buf));
- GetBuf(in, buf);
+ fscanf(in, "%15s", buf);
}
}
else if (strcmp(buf, "simple") == 0)
{
fsimple = AddFGridFSimple(fgrid);
- if ((fscanf(in, "%d%d%d%d", &fsimple->x, &fsimple->y, &fsimple->w, &fsimple->h)) != 4)
+ if ((fscanf(in, "%5d%5d%5d%5d", &fsimple->x, &fsimple->y, &fsimple->w, &fsimple->h)) != 4)
{
ReadDlgErr(infile, eNOVALS, "simple x,y,w,h");
}
ReadDlgErr(infile, eTOOHIGH, "simple");
}
ReadAccOpen(infile, in);
- GetBuf(in, buf);
+ fscanf(in, "%15s", buf);
fsimple->fitem = ScanFItem(infile, in, buf);
ReadAccClose(infile, in);
}
- GetBuf(in, buf);
+ fscanf(in, "%15s", buf);
}
ffclose(in);