diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-06-04 17:23:41 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-06-04 17:23:41 +0000 |
commit | 47676a9538cbca1be139f1b991c163b4eb7800e5 (patch) | |
tree | 207cbc920ca5982354be96de32486adf65c5679a /src/main/ActiveThorns.c | |
parent | f6fb7efbdde6322e2d1685313bad3e1b1256d8d9 (diff) |
Adding extra help so it gives you some idea of what thorns to activate if
you make a mistake in your ActiveThorns parameter.
Tom and Gab.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2217 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/ActiveThorns.c')
-rw-r--r-- | src/main/ActiveThorns.c | 111 |
1 files changed, 110 insertions, 1 deletions
diff --git a/src/main/ActiveThorns.c b/src/main/ActiveThorns.c index 3f5ed09d..d27a1472 100644 --- a/src/main/ActiveThorns.c +++ b/src/main/ActiveThorns.c @@ -66,6 +66,7 @@ static int ActivateThorn(const char *name); static int ActivateImp(const char *implementation, const char *thorn); static int CompareStrings(const void *string1, const void *string2); +static int JustPrintThornName(const char *key,void *input, void *dummy); /******************************************************************** ********************* Other Routine Prototypes ********************* @@ -555,6 +556,59 @@ void CCTK_FCALL CCTK_FNAME(CCTK_IsThornCompiled) /*@@ + @routine CCTK_IsImplementationCompiled + @date Sun June 3 2001 + @author Gabrielle Allen + @desc + Checks if a implementation is compiled in. + @enddesc + @calls + @calledby + @history + + @endhistory + @var name + @vdesc Name of implementation + @vtype const char * + @vio in + @vcomment + + @endvar + + @returntype int + @returndesc + 0 - not compiled + 1 - compiled + @endreturndesc +@@*/ +int CCTK_IsImplementationCompiled(const char *name) +{ + int retval; + t_sktree *node; + + /* Find the thorn */ + node = SKTreeFindNode(implist, name); + + retval = 0; + + if(node) + { + retval = 1; + } + + return retval; +} + +void CCTK_FCALL CCTK_FNAME(CCTK_IsImplementationCompiled) + (int *retval, ONE_FORTSTRING_ARG) +{ + ONE_FORTSTRING_CREATE(name) + *retval = CCTK_IsImplementationCompiled(name); + free(name); +} + + +/*@@ @routine CCTK_IsImplementationActive @date Sun Jul 4 17:46:56 1999 @author Tom Goodale @@ -1031,6 +1085,7 @@ int CCTKi_ActivateThorns(const char *thornlist) int result; t_sktree *impnode; t_sktree *temp; + t_sktree *impthornlist; struct IMPLEMENTATION *imp; int i; @@ -1061,6 +1116,17 @@ int CCTKi_ActivateThorns(const char *thornlist) { printf("Error: thorn %s doesn't exist\n", token); n_errors++; + /* Give some more help */ + if (CCTK_IsImplementationCompiled(token)) + { + impthornlist = CCTK_ImpThornList(token); + + printf(" Implementation %s does exist\n",token); + printf(" Provided by :"); + SKTreeTraverseInorder(impthornlist, + JustPrintThornName, NULL); + printf("\n"); + } } else if(CCTK_IsImplementationActive(this_imp)) { @@ -1134,7 +1200,18 @@ int CCTKi_ActivateThorns(const char *thornlist) if(Util_StrCmpi(imp1,imp2)) { printf("Error: required implementation %s not requested\n", imp2); - n_errors++; + n_errors++; + /* Give some more help */ + if (CCTK_IsImplementationCompiled(imp2)) + { + impthornlist = CCTK_ImpThornList(imp2); + + printf(" This implementation is compiled in\n"); + printf(" Provided by :"); + SKTreeTraverseInorder(impthornlist, + JustPrintThornName, NULL); + printf("\n"); + } } else { @@ -1149,6 +1226,17 @@ int CCTKi_ActivateThorns(const char *thornlist) { printf("Error: required implementation %s not requested\n", imp2); n_errors++; + /* Give some more help */ + if (CCTK_IsImplementationCompiled(imp2)) + { + impthornlist = CCTK_ImpThornList(imp2); + + printf(" This implementation is compiled in\n"); + printf(" Provided by :"); + SKTreeTraverseInorder(impthornlist, + JustPrintThornName, NULL); + printf("\n"); + } } } @@ -1465,3 +1553,24 @@ static int CompareStrings(const void *string1, const void *string2) { return Util_StrCmpi(*(const char **)string1, *(const char **)string2); } + + /*@@ + @routine JustPrintThornName + @date Mon Jun 4 19:05:45 2001 + @author Tom Goodale + @desc + Print the name of a thorn if it is passed from an sktree. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ +static int JustPrintThornName(const char *key, void *input, void *dummy) +{ + printf(" %s", key); + + return 0; +} |