Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / fileio / xvgr.cpp
index 49081481faba437a3aa46fb7483e8211c691412c..fc65cf8d02b6dda047a9c1944512f82718df7fcb 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 "gromacs/fileio/xvgr.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "xvgr.h"
+
+#include "config.h"
 
-#include <string.h>
 #include <ctype.h>
+#include <string.h>
 #include <time.h>
 
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/oenv.h"
-
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
-#include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 
 gmx_bool output_env_get_print_xvgr_codes(const output_env_t oenv)
@@ -252,10 +250,12 @@ void xvgr_header(FILE *fp, const char *title, const char *xaxis,
             gmx::BinaryInformationSettings settings;
             settings.generatedByHeader(true);
             settings.linePrefix("# ");
-            gmx::printBinaryInformation(fp, gmx::getProgramContext(), settings);
+            gmx::printBinaryInformation(fp, output_env_get_program_context(oenv),
+                                        settings);
         }
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-        fprintf(fp, "# %s is part of G R O M A C S:\n#\n", ShortProgram());
+        fprintf(fp, "# %s is part of G R O M A C S:\n#\n",
+                output_env_get_program_display_name(oenv));
         bromacs(pukestr, 99);
         fprintf(fp, "# %s\n#\n", pukestr);
         fprintf(fp, "@    title \"%s\"\n", xvgrstr(title, oenv, buf, STRLEN));
@@ -535,17 +535,17 @@ static char *read_xvgr_string(const char *line)
         ptr1 = strchr(ptr0, '"');
         if (ptr1 != NULL)
         {
-            str            = strdup(ptr0);
+            str            = gmx_strdup(ptr0);
             str[ptr1-ptr0] = '\0';
         }
         else
         {
-            str = strdup("");
+            str = gmx_strdup("");
         }
     }
     else
     {
-        str = strdup("");
+        str = gmx_strdup("");
     }
 
     return str;