* 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 "strdb.h"
+#include "gmxpre.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "strdb.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "gmx_fatal.h"
-#include "smalloc.h"
-#include "string2.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
gmx_bool get_a_line(FILE *fp, char line[], int n)
{
if (fscanf(in, "%d", &nstr) != 1)
{
gmx_warning("File %s is empty", db);
- ffclose(in);
+ gmx_ffclose(in);
return 0;
}
snew(ptr, nstr);
#ifdef DEBUG
fprintf(stderr, "Have read: %s\n", buf);
#endif
- ptr[i] = strdup(buf);
+ ptr[i] = gmx_strdup(buf);
}
- ffclose(in);
+ gmx_ffclose(in);
*strings = ptr;
if (pret == NULL || sscanf(buf, "%d", &nstr) != 1)
{
gmx_warning("File is empty");
- ffclose(in);
+ gmx_ffclose(in);
return 0;
}
in = libopen(db);
nstr = fget_lines(in, strings);
- ffclose(in);
+ gmx_ffclose(in);
return nstr;
}
maxi += 50;
srenew(ptr, maxi);
}
- ptr[i] = strdup(buf);
+ ptr[i] = gmx_strdup(buf);
i++;
}
nstr = i;
- ffclose(in);
+ gmx_ffclose(in);
srenew(ptr, nstr);
*strings = ptr;