Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / h_db.c
index f81db3a1233d2b55d06ba18a1e9af4095ffefccb..85bacf8a3f95274892bf20cf8657dd963ad36ff4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <stdlib.h>
 #include <string.h>
-#include "string2.h"
-#include "sysstuff.h"
-#include "smalloc.h"
-#include "gromacs/fileio/futil.h"
-#include "symtab.h"
+
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/futil.h"
 #include "h_db.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "fflibutil.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-
-/* There are 11 types of adding hydrogens, numbered from
- * 1 thru 11. Each of these has a specific number of
- * control atoms, that determine how the hydrogens are added.
- * Here these number are given. Because arrays start at 0 an
- * extra dummy for index 0 is added
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/legacyheaders/macros.h"
+
+/* Number of control atoms for each 'add' type.
+ *
+ * There are 11 types of adding hydrogens, numbered from 1 thru
+ * 11. Each of these has a specific number of control atoms, that
+ * determine how the hydrogens are added.  Here these number are
+ * given. Because arrays start at 0, an extra dummy for index 0 is
+ * added.
  */
 const int ncontrol[] = { -1, 3, 3, 3, 3, 4, 3, 1, 3, 3, 1, 1 };
 #define maxcontrol asize(ncontrol)
@@ -108,14 +108,14 @@ void read_ab(char *line, const char *fn, t_hack *hack)
     }
     for (i = 0; (i < hack->nctl); i++)
     {
-        hack->a[i] = strdup(a[i]);
+        hack->a[i] = gmx_strdup(a[i]);
     }
     for (; i < 4; i++)
     {
         hack->a[i] = NULL;
     }
     hack->oname = NULL;
-    hack->nname = strdup(hn);
+    hack->nname = gmx_strdup(hn);
     hack->atom  = NULL;
     hack->cgnr  = NOTSET;
     hack->bXSet = FALSE;
@@ -161,8 +161,8 @@ static void read_h_db_file(const char *hfn, int *nahptr, t_hackblock **ah)
         }
         srenew(aah, nah+1);
         clear_t_hackblock(&aah[nah]);
-        aah[nah].name     = strdup(buf);
-        aah[nah].filebase = strdup(filebase);
+        aah[nah].name     = gmx_strdup(buf);
+        aah[nah].filebase = gmx_strdup(filebase);
 
         if (sscanf(line+n, "%d", &nab) == 1)
         {
@@ -189,7 +189,7 @@ static void read_h_db_file(const char *hfn, int *nahptr, t_hackblock **ah)
         }
         nah++;
     }
-    ffclose(in);
+    gmx_ffclose(in);
 
     /* Sort the list (necessary to be able to use bsearch */
     qsort(aah, nah, (size_t)sizeof(**ah), compaddh);