#include <boost/shared_ptr.hpp>
-#include <gmxfio.h>
-#include <smalloc.h>
-#include <statutil.h>
-#include <vec.h>
-#include <xvgr.h>
+#include "gromacs/legacyheaders/gmxfio.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/vec.h"
+#include "gromacs/legacyheaders/xvgr.h"
#include "gromacs/options/basicoptions.h"
#include "gromacs/analysisdata/dataframe.h"
}
else
{
- output_env_t oenv;
- snew(oenv, 1);
- output_env_init_default(oenv);
- boost::shared_ptr<output_env> oenvGuard(oenv, &output_env_done);
- oenv->time_unit = static_cast<time_unit_t>(_impl->settings.timeUnit() + 1);
- oenv->xvg_format =
- (_impl->settings.plotFormat() > 0
+ time_unit_t time_unit
+ = static_cast<time_unit_t>(_impl->settings.timeUnit() + 1);
+ xvg_format_t xvg_format
+ = (_impl->settings.plotFormat() > 0
? static_cast<xvg_format_t>(_impl->settings.plotFormat())
: exvgNONE);
+ output_env_t oenv;
+ output_env_init(&oenv, 0, NULL, time_unit, FALSE, xvg_format, 0, 0);
+ boost::shared_ptr<output_env> oenvGuard(oenv, &output_env_done);
_impl->fp = xvgropen(_impl->fnm.c_str(), _impl->title.c_str(),
_impl->xlabel.c_str(), _impl->ylabel.c_str(),
oenv);
#include "thread_mpi.h"
#endif
+struct output_env
+{
+ time_unit_t time_unit; /* the time unit, enum defined in oenv.h */
+ gmx_bool view; /* view of file requested */
+ xvg_format_t xvg_format; /* xvg output format, enum defined in oenv.h */
+ int verbosity; /* The level of verbosity for this program */
+ int debug_level; /* the debug level */
+ char *program_name; /* the program name */
+ char *cmd_line; /* the re-assembled command line */
+};
/* The source code in this file should be thread-safe.
Please keep it that way. */
******************************************************************/
/* read only time names */
-/* These must correspond to the time units type time_unit_t in statutil.h */
+/* These must correspond to the time units type time_unit_t in oenv.h */
static const real timefactors[] = { 0, 1e3, 1, 1e-3, 1e-6, 1e-9, 1e-12, 0 };
static const real timeinvfactors[] ={ 0, 1e-3, 1, 1e3, 1e6, 1e9, 1e12, 0 };
static const char *time_units_str[] = { NULL, "fs", "ps", "ns", "us",
/***** OUTPUT_ENV MEMBER FUNCTIONS ******/
-void output_env_init(output_env_t oenv, int argc, char *argv[],
+void output_env_init(output_env_t *oenvp, int argc, char *argv[],
time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format,
int verbosity, int debug_level)
{
int i;
int cmdlength=0;
char *argvzero=NULL;
+ output_env_t oenv;
+ snew(oenv, 1);
+ *oenvp = oenv;
oenv->time_unit = tmu;
oenv->view=view;
oenv->xvg_format = xvg_format;
}
-void output_env_init_default(output_env_t oenv)
+void output_env_init_default(output_env_t *oenvp)
{
- output_env_init(oenv, 0, NULL, time_ps, FALSE, exvgNONE, 0, 0);
+ output_env_init(oenvp, 0, NULL, time_ps, FALSE, exvgNONE, 0, 0);
}
#define FF(arg) ((Flags & arg)==arg)
- snew(*oenv, 1);
-
cmdlength = strlen(argv[0]);
/* Check for double arguments */
for (i=1; (i<*argc); i++)
get_pargs(argc,argv,npall,all_pa,FF(PCA_KEEP_ARGS));
/* set program name, command line, and default values for output options */
- output_env_init(*oenv, *argc, argv, (time_unit_t)nenum(time_units), bView,
+ output_env_init(oenv, *argc, argv, (time_unit_t)nenum(time_units), bView,
(xvg_format_t)nenum(xvg_format), verbose_level, debug_level);
if (bVersion) {
}
#endif
#endif
-
- /* Update oenv for parsed command line options settings. */
- (*oenv)->xvg_format = (xvg_format_t)nenum(xvg_format);
- (*oenv)->time_unit = (time_unit_t)nenum(time_units);
if (!(FF(PCA_QUIET) || bQuiet )) {
if (bHelp)
/* the xvg output formattings */
-struct output_env
-{
- time_unit_t time_unit; /* the time unit, enum defined in statuti.h */
- gmx_bool view; /* view of file requested */
- xvg_format_t xvg_format; /* xvg output format, enum defined in statutil.h */
- int verbosity; /* The level of verbosity for this program */
- int debug_level; /* the debug level */
-
- char *program_name; /* the program name */
- char *cmd_line; /* the re-assembled command line */
-};
-
-
-void output_env_init(output_env_t oenv, int argc, char *argv[],
+void output_env_init(output_env_t *oenvp, int argc, char *argv[],
time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format,
int verbosity, int debug_level);
/* initialize an output_env structure, setting the command line,
user requests direct viewing of graphs,
the graph formatting type, the verbosity, and debug level */
-void output_env_init_default(output_env_t oenv);
+void output_env_init_default(output_env_t *oenvp);
/* initialize an output_env structure, with reasonable default settings.
(the time unit is set to time_ps, which means no conversion). */
#include <string.h>
+#include "oenv.h"
#include "rmpbc.h"
#include "smalloc.h"
#include "statutil.h"
{
return;
}
- snew(_impl->_oenv, 1);
- output_env_init_default(_impl->_oenv);
- _impl->_oenv->time_unit
+ time_unit_t time_unit
= static_cast<time_unit_t>(_impl->_settings.timeUnit() + 1);
+ output_env_init(&_impl->_oenv, 0, NULL, time_unit, FALSE, exvgNONE, 0, 0);
int frflags = _impl->_settings.frflags();
frflags |= TRX_NEED_X;