Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / gmxlib / readinp.c
index cd665652b46af74e6b86a895ab0cd93d140622d0..10a2c7cc366e2932d179af5824894e3de7b2d494 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/readinp.h"
 
 #include <stdio.h>
 #include <stdlib.h>
-#include "typedefs.h"
-#include "string2.h"
-#include "gromacs/fileio/futil.h"
-#include "smalloc.h"
-#include "readinp.h"
-#include "macros.h"
+
 #include "gromacs/fileio/gmxfio.h"
-#include "names.h"
-#include "warninp.h"
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/warninp.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 t_inpfile *read_inpfile(const char *fn, int *ninp,
                         warninp_t wi)
@@ -170,8 +170,8 @@ t_inpfile *read_inpfile(const char *fn, int *ninp,
                                 inp[nin-1].count      = 0;
                                 inp[nin-1].bObsolete  = FALSE;
                                 inp[nin-1].bSet       = FALSE;
-                                inp[nin-1].name       = strdup(lbuf);
-                                inp[nin-1].value      = strdup(rbuf);
+                                inp[nin-1].name       = gmx_strdup(lbuf);
+                                inp[nin-1].value      = gmx_strdup(rbuf);
                             }
                             else
                             {
@@ -186,7 +186,7 @@ t_inpfile *read_inpfile(const char *fn, int *ninp,
                                 {
                                     /* override */
                                     sfree(inp[found_index].value);
-                                    inp[found_index].value = strdup(rbuf);
+                                    inp[found_index].value = gmx_strdup(rbuf);
                                     sprintf(warn_buf,
                                             "Overriding existing parameter \"%s\" with value \"%s\"\n",
                                             lbuf, rbuf);
@@ -296,7 +296,7 @@ void replace_inp_entry(int ninp, t_inpfile *inp, const char *old_entry, const ch
                 fprintf(stderr, "Replacing old mdp entry '%s' by '%s'\n",
                         inp[i].name, new_entry);
                 sfree(inp[i].name);
-                inp[i].name = strdup(new_entry);
+                inp[i].name = gmx_strdup(new_entry);
             }
             else
             {
@@ -344,7 +344,7 @@ static int get_einp(int *ninp, t_inpfile **inp, const char *name)
         notfound = TRUE;
         i        = (*ninp)++;
         srenew(*inp, (*ninp));
-        (*inp)[i].name = strdup(name);
+        (*inp)[i].name = gmx_strdup(name);
         (*inp)[i].bSet = TRUE;
     }
     (*inp)[i].count = (*inp)[0].inp_count++;
@@ -377,7 +377,7 @@ int get_eint(int *ninp, t_inpfile **inp, const char *name, int def,
     if (ii == -1)
     {
         sprintf(buf, "%d", def);
-        (*inp)[(*ninp)-1].value = strdup(buf);
+        (*inp)[(*ninp)-1].value = gmx_strdup(buf);
 
         return def;
     }
@@ -407,7 +407,7 @@ gmx_int64_t get_eint64(int *ninp, t_inpfile **inp,
     if (ii == -1)
     {
         sprintf(buf, "%"GMX_PRId64, def);
-        (*inp)[(*ninp)-1].value = strdup(buf);
+        (*inp)[(*ninp)-1].value = gmx_strdup(buf);
 
         return def;
     }
@@ -436,7 +436,7 @@ double get_ereal(int *ninp, t_inpfile **inp, const char *name, double def,
     if (ii == -1)
     {
         sprintf(buf, "%g", def);
-        (*inp)[(*ninp)-1].value = strdup(buf);
+        (*inp)[(*ninp)-1].value = gmx_strdup(buf);
 
         return def;
     }
@@ -465,7 +465,7 @@ const char *get_estr(int *ninp, t_inpfile **inp, const char *name, const char *d
         if (def)
         {
             sprintf(buf, "%s", def);
-            (*inp)[(*ninp)-1].value = strdup(buf);
+            (*inp)[(*ninp)-1].value = gmx_strdup(buf);
         }
         else
         {
@@ -491,7 +491,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
 
     if (ii == -1)
     {
-        (*inp)[(*ninp)-1].value = strdup(defs[0]);
+        (*inp)[(*ninp)-1].value = gmx_strdup(defs[0]);
 
         return 0;
     }
@@ -524,7 +524,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
             fprintf(stderr, "%s\n", buf);
         }
 
-        (*inp)[ii].value = strdup(defs[0]);
+        (*inp)[ii].value = gmx_strdup(defs[0]);
 
         return 0;
     }