Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_densorder.cpp
index 7d40b73a758cc7bbe84c69589dc77f1c0d2082be..79c9e68a11d717f66303fca84f06d02f018fd4d7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,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.
  * 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 "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <ctype.h>
 #include <math.h>
-#include "sysstuff.h"
 #include <string.h>
-#include "string2.h"
-#include "typedefs.h"
-#include "smalloc.h"
-#include "macros.h"
+
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gstat.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/commandline/pargs.h"
-#include "index.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/topology/index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "physics.h"
-#include "gromacs/fileio/matio.h"
+#include "gromacs/math/units.h"
 #include "dens_filter.h"
 #include "binsearch.h"
 #include "powerspect.h"
 #include "gmx_ana.h"
-#include "copyrite.h"
+#include "gromacs/legacyheaders/copyrite.h"
 
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/matio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/programinfo.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #ifdef GMX_DOUBLE
 #define FLOOR(x) ((int) floor(x))
@@ -302,7 +302,7 @@ static void outputfield(const char *fldfn, real ****Densmap,
     dim[2] = yslices;
     dim[3] = zslices;
 
-    fldH = ffopen(fldfn, "w");
+    fldH = gmx_ffopen(fldfn, "w");
     fwrite(dim, sizeof(int), 4, fldH);
     for (n = 0; n < tdim; n++)
     {
@@ -320,7 +320,7 @@ static void outputfield(const char *fldfn, real ****Densmap,
     }
     totdens /= (xslices*yslices*zslices*tdim);
     fprintf(stderr, "Total density [kg/m^3]  %8f", totdens);
-    ffclose(fldH);
+    gmx_ffclose(fldH);
 }
 
 static void filterdensmap(real ****Densmap, int xslices, int yslices, int zslices, int tblocks, int ftsize)
@@ -562,8 +562,8 @@ static void writesurftoxpms(t_interf ***surf1, t_interf ***surf2, int tblocks, i
         yticks[j] += bw;
     }
 
-    xpmfile1 = ffopen(outfiles[0], "w");
-    xpmfile2 = ffopen(outfiles[1], "w");
+    xpmfile1 = gmx_ffopen(outfiles[0], "w");
+    xpmfile2 = gmx_ffopen(outfiles[1], "w");
 
     max1 = max2 = 0.0;
     min1 = min2 = zbins*bwz;
@@ -602,8 +602,8 @@ static void writesurftoxpms(t_interf ***surf1, t_interf ***surf2, int tblocks, i
         write_xpm(xpmfile2, 3, numbuf, "Height", "x[nm]", "y[nm]", xbins, ybins, xticks, yticks, profile2, min2, max2, lo, hi, &maplevels);
     }
 
-    ffclose(xpmfile1);
-    ffclose(xpmfile2);
+    gmx_ffclose(xpmfile1);
+    gmx_ffclose(xpmfile2);
 
 
     sfree(profile1);
@@ -612,21 +612,23 @@ static void writesurftoxpms(t_interf ***surf1, t_interf ***surf2, int tblocks, i
     sfree(yticks);
 }
 
-static void writeraw(t_interf ***int1, t_interf ***int2, int tblocks, int xbins, int ybins, char **fnms)
+static void writeraw(t_interf ***int1, t_interf ***int2, int tblocks,
+                     int xbins, int ybins, char **fnms,
+                     const output_env_t oenv)
 {
     FILE *raw1, *raw2;
     int   i, j, n;
 
-    raw1 = ffopen(fnms[0], "w");
-    raw2 = ffopen(fnms[1], "w");
+    raw1 = gmx_ffopen(fnms[0], "w");
+    raw2 = gmx_ffopen(fnms[1], "w");
     try
     {
         gmx::BinaryInformationSettings settings;
         settings.generatedByHeader(true);
         settings.linePrefix("# ");
-        gmx::printBinaryInformation(raw1, gmx::ProgramInfo::getInstance(),
+        gmx::printBinaryInformation(raw1, output_env_get_program_context(oenv),
                                     settings);
-        gmx::printBinaryInformation(raw2, gmx::ProgramInfo::getInstance(),
+        gmx::printBinaryInformation(raw2, output_env_get_program_context(oenv),
                                     settings);
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
@@ -646,8 +648,8 @@ static void writeraw(t_interf ***int1, t_interf ***int2, int tblocks, int xbins,
         }
     }
 
-    ffclose(raw1);
-    ffclose(raw2);
+    gmx_ffclose(raw1);
+    gmx_ffclose(raw2);
 }
 
 
@@ -797,7 +799,7 @@ int gmx_densorder(int argc, char *argv[])
         {
             gmx_fatal(FARGS, "No or not correct number (2) of output-files: %d", nfxpm);
         }
-        writeraw(surf1, surf2, tblock, xslices, yslices, rawfiles);
+        writeraw(surf1, surf2, tblock, xslices, yslices, rawfiles, oenv);
     }