Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / h_db.c
index c3b10f6e2fa6af2e3deebc7debeab7ecdc4afd69..85bacf8a3f95274892bf20cf8657dd963ad36ff4 100644 (file)
@@ -1,59 +1,61 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        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,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * 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.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * 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 "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 "gmxfio.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)
@@ -106,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;
@@ -159,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)
         {
@@ -187,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);