Merge release-5-0 into master
[alexxy/gromacs.git] / src / gromacs / gmxlib / oenv.cpp
index 01eda5251e052252720b8f6c50a5dea05c5a4e8a..d7fcc05037414e3762aaf20921bcf46151ce319d 100644 (file)
@@ -34,7 +34,9 @@
  * 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 "oenv.h"
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/oenv.h"
 
 #include "gromacs/utility/smalloc.h"
 
@@ -50,7 +52,6 @@ struct output_env
         view        = FALSE;
         xvg_format  = exvgNONE;
         verbosity   = 0;
-        debug_level = 0;
     }
 
     const gmx::ProgramContextInterface  &programContext;
@@ -63,8 +64,6 @@ struct output_env
     xvg_format_t                         xvg_format;
     /* The level of verbosity for this program */
     int                                  verbosity;
-    /* the debug level */
-    int                                  debug_level;
 };
 
 /* The source code in this file should be thread-safe.
@@ -95,7 +94,7 @@ static const char *time_units_xvgr[] = {
 void output_env_init(output_env_t *oenvp,
                      const gmx::ProgramContextInterface &context,
                      time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format,
-                     int verbosity, int debug_level)
+                     int verbosity)
 {
     try
     {
@@ -105,7 +104,6 @@ void output_env_init(output_env_t *oenvp,
         oenv->view        = view;
         oenv->xvg_format  = xvg_format;
         oenv->verbosity   = verbosity;
-        oenv->debug_level = debug_level;
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 }
@@ -131,11 +129,6 @@ int output_env_get_verbosity(const output_env_t oenv)
     return oenv->verbosity;
 }
 
-int output_env_get_debug_level(const output_env_t oenv)
-{
-    return oenv->debug_level;
-}
-
 const char *output_env_get_time_unit(const output_env_t oenv)
 {
     return time_units_str[oenv->time_unit];
@@ -202,42 +195,21 @@ xvg_format_t output_env_get_xvg_format(const output_env_t oenv)
     return oenv->xvg_format;
 }
 
-const char *output_env_get_program_name(const output_env_t oenv)
+const char *output_env_get_program_display_name(const output_env_t oenv)
 {
-    const char *programName = NULL;
+    const char *displayName = NULL;
 
     try
     {
-        programName = oenv->programContext.fullBinaryPath();
+        displayName = oenv->programContext.displayName();
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
-    return programName;
+    return displayName;
 }
 
-const char *output_env_get_short_program_name(const output_env_t oenv)
+const gmx::ProgramContextInterface &
+output_env_get_program_context(const output_env_t oenv)
 {
-    const char *programName = NULL;
-
-    try
-    {
-        // TODO: Use the display name once it doesn't break anything.
-        programName = oenv->programContext.programName();
-    }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-
-    return programName;
-}
-
-const char *output_env_get_cmd_line(const output_env_t oenv)
-{
-    const char *commandLine = NULL;
-
-    try
-    {
-        commandLine = oenv->programContext.commandLine();
-    }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-
-    return commandLine;
+    return oenv->programContext;
 }