Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / fileio / strdb.c
index 41ad46533c510a457f73be8b084537c765a5d523..21f70b014f3f0f8a65529eeeb8789cc151e8410d 100644 (file)
  * 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)
 {
@@ -132,7 +130,7 @@ int get_strings(const char *db, char ***strings)
     if (fscanf(in, "%d", &nstr) != 1)
     {
         gmx_warning("File %s is empty", db);
-        ffclose(in);
+        gmx_ffclose(in);
         return 0;
     }
     snew(ptr, nstr);
@@ -145,9 +143,9 @@ int get_strings(const char *db, char ***strings)
 #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;
 
@@ -181,7 +179,7 @@ int fget_lines(FILE *in, char ***strings)
     if (pret == NULL  || sscanf(buf, "%d", &nstr) != 1)
     {
         gmx_warning("File is empty");
-        ffclose(in);
+        gmx_ffclose(in);
 
         return 0;
     }
@@ -204,7 +202,7 @@ int get_lines(const char *db, char ***strings)
 
     in   = libopen(db);
     nstr = fget_lines(in, strings);
-    ffclose(in);
+    gmx_ffclose(in);
 
     return nstr;
 }
@@ -226,11 +224,11 @@ int get_file(const char *db, char ***strings)
             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;