Fix malformed CUDA version macro check
[alexxy/gromacs.git] / include / oenv.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team,
6  * check out http://www.gromacs.org for more information.
7  * Copyright (c) 2012,2013, by the GROMACS development team, led by
8  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9  * others, as listed in the AUTHORS file in the top-level source
10  * directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38
39 #ifndef _oenv_h
40 #define _oenv_h
41 #include "visibility.h"
42 #include "typedefs.h"
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 #if 0 /* avoid screwing up indentation */
48 }
49 #endif
50
51
52 /* output_env member functions */
53
54 /* The output_env structure holds information about program name, cmd line,
55    default times, etc.
56
57    There are still legacy functions for the program name, and the command
58    line, but the output_env versions are now preferred.*/
59
60 typedef enum
61 {
62     timeNULL, time_fs, time_ps, time_ns, time_us, time_ms, time_s
63 } time_unit_t;
64 /* the time units. For the time being, ps means no conversion. */
65
66 typedef enum {
67     exvgNULL, exvgXMGRACE, exvgXMGR, exvgNONE
68 } xvg_format_t;
69 /* the xvg output formattings */
70
71
72 struct output_env
73 {
74     time_unit_t  time_unit;    /* the time unit, enum defined in statuti.h */
75     gmx_bool     view;         /* view of file requested */
76     xvg_format_t xvg_format;   /* xvg output format, enum defined in statutil.h */
77     int          verbosity;    /* The level of verbosity for this program */
78     int          debug_level;  /* the debug level */
79
80     char        *program_name; /* the program name */
81     char        *cmd_line;     /* the re-assembled command line */
82 };
83
84
85 void output_env_init(output_env_t oenv,  int argc, char *argv[],
86                      time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format,
87                      int verbosity, int debug_level);
88 /* initialize an output_env structure, setting the command line,
89    the default time value a gmx_boolean view that is set to TRUE when the
90    user requests direct viewing of graphs,
91    the graph formatting type, the verbosity, and debug level */
92
93 void output_env_init_default(output_env_t oenv);
94 /* initialize an output_env structure, with reasonable default settings.
95     (the time unit is set to time_ps, which means no conversion).  */
96
97 void output_env_done(output_env_t oenv);
98 /* free memory allocated for an output_env structure. */
99
100
101 int output_env_get_verbosity(const output_env_t oenv);
102 /* return the verbosity */
103
104 int output_env_get_debug_level(const output_env_t oenv);
105 /* return the debug level */
106
107 GMX_LIBGMX_EXPORT
108 const char *output_env_get_time_unit(const output_env_t oenv);
109 /* return time unit (e.g. ps or ns) */
110
111 GMX_LIBGMX_EXPORT
112 const char *output_env_get_time_label(const output_env_t oenv);
113 /* return time unit label (e.g. "Time (ps)") */
114
115 GMX_LIBGMX_EXPORT
116 const char *output_env_get_xvgr_tlabel(const output_env_t oenv);
117 /* retrun x-axis time label for xmgr */
118
119 GMX_LIBGMX_EXPORT
120 real output_env_get_time_factor(const output_env_t oenv);
121 /* return time conversion factor from ps (i.e. 1e-3 for ps->ns) */
122
123 GMX_LIBGMX_EXPORT
124 real output_env_get_time_invfactor(const output_env_t oenv);
125 /* return inverse time conversion factor to ps (i.e. 1e3 for ns->ps) */
126
127 GMX_LIBGMX_EXPORT
128 real output_env_conv_time(const output_env_t oenv, real time);
129 /* return converted time */
130
131 GMX_LIBGMX_EXPORT
132 void output_env_conv_times(const output_env_t oenv, int n, real *time);
133 /* convert array of times */
134
135 gmx_bool output_env_get_view(const output_env_t oenv);
136 /* Return TRUE when user requested viewing of the file */
137
138
139 GMX_LIBGMX_EXPORT
140 xvg_format_t output_env_get_xvg_format(const output_env_t oenv);
141 /* Returns enum (see above) for xvg output formatting */
142
143 const char *output_env_get_program_name(const output_env_t oenv);
144 /* return the program name */
145
146 const char *output_env_get_cmd_line(const output_env_t oenv);
147 /* return the command line */
148
149 const char *output_env_get_short_program_name(const output_env_t oenv);
150 /* get the short version (without path component) of the program name */
151
152
153
154 #ifdef __cplusplus
155 }
156 #endif
157
158 #endif