Part of effort to split up statutil.* into their component parts.
The most natural place could be utility/programinfo.h, but that would
require extra effort. With some C++ conversion, we could also
completely get rid of at least Program(), so did not want to go through
that now. copyrite.h already has GromacsVersion(), so this somehow
fits.
Change-Id: If82e0e924025ab782f090cb5b0542a6d01689d9e
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/stringutil.h"
+#include "copyrite.h"
#include "gmx_fatal.h"
#include "string2.h"
#include "smalloc.h"
-#include "statutil.h"
// Shell types, for completion stuff
enum {
#include <string.h>
#include <math.h>
+
+#include "copyrite.h"
#include "macros.h"
#include "sysstuff.h"
#include "smalloc.h"
#include <sys/locking.h>
#endif
+#include "copyrite.h"
#include "names.h"
#include "typedefs.h"
#include "smalloc.h"
-#include "statutil.h"
#include "txtdump.h"
#include "vec.h"
#include "network.h"
#include "gromacs/legacyheaders/vec.h"
#include "gromacs/fft/fft.h"
+#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/programinfo.h"
return _gmx_ver_string;
}
+const char *ShortProgram(void)
+{
+ try
+ {
+ // TODO: Use the display name once it doesn't break anything.
+ return gmx::ProgramInfo::getInstance().programName().c_str();
+ }
+ GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+}
+
+const char *Program(void)
+{
+ try
+ {
+ return gmx::ProgramInfo::getInstance().fullBinaryPath().c_str();
+ }
+ GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+}
+
+
extern void gmx_print_version_info_gpu(FILE *fp);
static void gmx_print_version_info(FILE *fp)
#include "gmx_fatal_collective.h"
#include "smalloc.h"
#include "gpu_utils.h"
-#include "statutil.h"
+#include "copyrite.h"
#include "gmx_detect_hardware.h"
#include "main.h"
#include "md_logging.h"
#include "typedefs.h"
#include "macros.h"
#include "network.h"
-#include "statutil.h"
+#include "copyrite.h"
#include "gmx_omp_nthreads.h"
#include "md_logging.h"
#include <errno.h>
#include <assert.h>
#include <stdio.h>
+
#include "typedefs.h"
#include "types/commrec.h"
#include "types/hw_info.h"
+#include "copyrite.h"
#include "gmx_cpuid.h"
#include "gmx_omp_nthreads.h"
#include "md_logging.h"
-#include "statutil.h"
#include "gmx_thread_affinity.h"
#include "thread_mpi/threads.h"
#endif
#include <cctype>
-#include <cmath>
#include <cstdlib>
-#include "sysstuff.h"
#include "macros.h"
#include "string2.h"
#include "smalloc.h"
#include "gromacs/fileio/timecontrol.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/programinfo.h"
#include "thread_mpi/threads.h"
/* The source code in this file should be thread-safe.
Please keep it that way. */
-/******************************************************************
- *
- * T R A J E C T O R Y S T U F F
- *
- ******************************************************************/
-
-/****************************************************************
- *
- * E X P O R T E D F U N C T I O N S
- *
- ****************************************************************/
-
-
-/* progam names, etc. */
-
-const char *ShortProgram(void)
-{
- try
- {
- // TODO: Use the display name once it doesn't break anything.
- return gmx::ProgramInfo::getInstance().programName().c_str();
- }
- GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-}
-
-const char *Program(void)
-{
- try
- {
- return gmx::ProgramInfo::getInstance().fullBinaryPath().c_str();
- }
- GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-}
-
-/* utility functions */
-
static void set_default_time_unit(const char *time_list[], gmx_bool bCanTime)
{
int i = 0;
time_list[0] = time_list[i];
}
-
static void set_default_xvg_format(const char *xvg_list[])
{
int i;
}
}
-/*************************************************************
- *
- * P A R S I N G S T U F F
- *
- *************************************************************/
-
static int add_parg(int npargs, t_pargs *pa, t_pargs *pa_add)
{
memcpy(&(pa[npargs]), pa_add, sizeof(*pa_add));
#include <sysstuff.h>
#include <string.h>
#include "smalloc.h"
-#include "statutil.h"
+#include "copyrite.h"
#include "string2.h"
#include "gmx_fatal.h"
#include "warninp.h"
extern "C" {
#endif
-/* Has to be a function, so we can get version number from autoconf */
+/* Has to be a function, so we can get version number from the build system */
const char *GromacsVersion(void);
+const char *Program(void);
+
+const char *ShortProgram(void);
+
/* For both bromacs() and cool_quote() you have to provide a pointer to
* a string of reasonable length (say 256) and the string length. This
* is necessary to make the routines threadsafe and avoid allocating
}
#endif
-/* LEGACY FUNCTIONS
-
- The program names, command lines, etc. are now also set in the output_env
- structure. That is now the preferred location, but the functions here
- are still available as legacy functions. Because they all act on inherently
- global informaion, their existence in a multi-threaded environment is not
- a real problem. */
-
-/* set the program name to the provided string, but note
- * that it must be a real file - we determine the library
- * directory from its location!
- */
-const char *Program(void);
-/* Id. without leading directory */
-const char *ShortProgram(void);
-
/*****************************************************
* Some command line parsing routines
*****************************************************/
#include <stdio.h>
+#include "copyrite.h"
#include "md_logging.h"
#include "gmx_fatal.h"
-#include "statutil.h"
#include "string2.h"
#include "common.h"
#include <config.h>
#endif
+#include "copyrite.h"
#include "maths.h"
#include "macros.h"
#include "bondf.h"
#include "typedefs.h"
#include "smalloc.h"
#include "sysstuff.h"
-#include "statutil.h"
+#include "copyrite.h"
#include "force.h"
#include "mdrun.h"
#include "md_logging.h"