diff options
-rw-r--r-- | interface.ccl | 13 | ||||
-rw-r--r-- | src/announce.cc | 18 |
2 files changed, 29 insertions, 2 deletions
diff --git a/interface.ccl b/interface.ccl index 295f02e..c963e8f 100644 --- a/interface.ccl +++ b/interface.ccl @@ -9,9 +9,20 @@ USES INCLUDE HEADER: http_Content.h # Return a pointer to an unmodifiable C string +# which contains a unique ID for this build +CCTK_POINTER_TO_CONST \ +FUNCTION UniqueBuildID (CCTK_POINTER_TO_CONST IN cctkGH) + +PROVIDES FUNCTION UniqueBuildID \ + WITH Formaline_UniqueBuildID \ + LANGUAGE C + + + +# Return a pointer to an unmodifiable C string # which contains a unique ID for this simulation CCTK_POINTER_TO_CONST \ -FUNCTION UniqueSimulationID (CCTK_POINTER_TO_CONST IN cctkGH) +FUNCTION UniqueSimulationID (CCTK_POINTER_TO_CONST IN cctkGH) PROVIDES FUNCTION UniqueSimulationID \ WITH Formaline_UniqueSimulationID \ diff --git a/src/announce.cc b/src/announce.cc index e7ca287..3ebf384 100644 --- a/src/announce.cc +++ b/src/announce.cc @@ -38,7 +38,9 @@ # endif #endif -#include <unistd.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif #include "http_Content.h" @@ -119,6 +121,13 @@ namespace Formaline extern "C" CCTK_POINTER_TO_CONST + Formaline_UniqueBuildID (CCTK_POINTER_TO_CONST const cctkGH_) + { + cGH const * const cctkGH = static_cast<cGH const *> (cctkGH_); + return static_cast<CCTK_POINTER_TO_CONST> (build_id); + } + + extern "C" CCTK_POINTER_TO_CONST Formaline_UniqueSimulationID (CCTK_POINTER_TO_CONST const cctkGH_) { cGH const * const cctkGH = static_cast<cGH const *> (cctkGH_); @@ -436,6 +445,13 @@ namespace Formaline #endif { + char cwd [10000]; + getcwd (cwd, sizeof cwd); + cwd [sizeof cwd - 1] = '\0'; // just to be sure + stores.store ("current dir", cwd); + } + + { stores.store ("out dir", out_dir); } |