From 3aada37ae6324b1acda7c5a1c10bc16534c0c2a3 Mon Sep 17 00:00:00 2001 From: schnetter Date: Sun, 3 Feb 2008 19:09:41 +0000 Subject: Provide aliased functions to query the source tree and configuration ids git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@153 83718e91-0e4f-0410-abf4-91180603181f --- interface.ccl | 45 ++++++++++++++++++++++++++++++++++----------- src/id.cc | 16 +++++++++++++++- src/id.hh | 2 +- 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/interface.ccl b/interface.ccl index ac6d6a6..01d7a1f 100644 --- a/interface.ccl +++ b/interface.ccl @@ -9,6 +9,28 @@ USES INCLUDE HEADER: Publish.h +# Return a pointer to an unmodifiable C string +# which contains a unique ID for this configuration +CCTK_POINTER_TO_CONST \ +FUNCTION UniqueConfigID (CCTK_POINTER_TO_CONST IN cctkGH) + +PROVIDES FUNCTION UniqueConfigID \ + WITH Formaline_UniqueConfigID \ + LANGUAGE C + + + +# Return a pointer to an unmodifiable C string +# which contains a unique ID for this source tree +CCTK_POINTER_TO_CONST \ +FUNCTION UniqueSourceID (CCTK_POINTER_TO_CONST IN cctkGH) + +PROVIDES FUNCTION UniqueSourceID \ + WITH Formaline_UniqueSourceID \ + LANGUAGE C + + + # Return a pointer to an unmodifiable C string # which contains a unique ID for this build CCTK_POINTER_TO_CONST \ @@ -30,6 +52,18 @@ PROVIDES FUNCTION UniqueSimulationID \ LANGUAGE C + +# Return a pointer to an unmodifiable C string +# which contains a unique ID for this run +CCTK_POINTER_TO_CONST \ +FUNCTION UniqueRunID (CCTK_POINTER_TO_CONST IN cctkGH) + +PROVIDES FUNCTION UniqueRunID \ + WITH Formaline_UniqueRunID \ + LANGUAGE C + + + ############# # Publish API ############# @@ -130,14 +164,3 @@ USES FUNCTION PublishInt_Unregister USES FUNCTION PublishReal_Unregister USES FUNCTION PublishString_Unregister USES FUNCTION PublishTable_Unregister - - - -# Return a pointer to an unmodifiable C string -# which contains a unique ID for this run -CCTK_POINTER_TO_CONST \ -FUNCTION UniqueRunID (CCTK_POINTER_TO_CONST IN cctkGH) - -PROVIDES FUNCTION UniqueRunID \ - WITH Formaline_UniqueRunID \ - LANGUAGE C diff --git a/src/id.cc b/src/id.cc index 238f8eb..215870a 100644 --- a/src/id.cc +++ b/src/id.cc @@ -45,7 +45,7 @@ namespace Formaline // Configuration ID extern "C" char const config_id[]; - // Unique source ID + // Unique source tree ID extern "C" char const source_id[]; // Unique build ID @@ -200,6 +200,20 @@ namespace Formaline + extern "C" CCTK_POINTER_TO_CONST + Formaline_UniqueConfigID (CCTK_POINTER_TO_CONST const cctkGH_) + { + cGH const * const cctkGH = static_cast (cctkGH_); + return static_cast (get_config_id (cctkGH)); + } + + extern "C" CCTK_POINTER_TO_CONST + Formaline_UniqueSourceID (CCTK_POINTER_TO_CONST const cctkGH_) + { + cGH const * const cctkGH = static_cast (cctkGH_); + return static_cast (get_source_id (cctkGH)); + } + extern "C" CCTK_POINTER_TO_CONST Formaline_UniqueBuildID (CCTK_POINTER_TO_CONST const cctkGH_) { diff --git a/src/id.hh b/src/id.hh index 7cce95e..0cd5a6e 100644 --- a/src/id.hh +++ b/src/id.hh @@ -10,7 +10,7 @@ namespace Formaline char const * get_config_id (cGH const * const cctkGH); - // Get the unique source id + // Get the unique source tree id char const * get_source_id (cGH const * const cctkGH); -- cgit v1.2.3