diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-03-14 13:00:36 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-03-14 13:00:36 +0000 |
commit | 3e901df5b706b893d9cf672e8ee43ac3fcc415a2 (patch) | |
tree | 0dbf96af0190e46dfe4e32a88f06887d5692ac3f /src/main/CommandLine.c | |
parent | b1a447047fda75b35b43a11c6235fd356b854bcd (diff) |
Changed interface for CCTK_ParameterWalk() to return both a canonical name
and a pointer the parameter properties.
Replaced calls to CCTK_ParameterList() by CCTK_ParameterWalk() in CommandLine.c.
CCTK_ParameterList() is gone now.
Inserted a line
"Parameters of thorn 'BLA' providing implementation 'LABER':"
in the -O output. Should be easily filtered out for automatic postprocessing.
Option -o now prints out both "thorn::param" and "impl::param" as full names
for global/restricted parameters.
#ifdef'd out ParameterPTreeNodeAdd() in Parameters.c to fix a compiler
warning (unused static function).
Thomas
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1470 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/CommandLine.c')
-rw-r--r-- | src/main/CommandLine.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/src/main/CommandLine.c b/src/main/CommandLine.c index d9e2a789..6fec6745 100644 --- a/src/main/CommandLine.c +++ b/src/main/CommandLine.c @@ -37,7 +37,7 @@ char *compileDate(void); char *CCTK_FullVersion(void); int CCTK_CommandLine(char ***outargv); -static void CommandLinePrintParameter(cParamData *properties); +static void CommandLinePrintParameter(const cParamData *properties); static int redirectsubs; @@ -79,27 +79,24 @@ void CCTKi_CommandLineTestThornCompiled(const char *optarg) void CCTKi_CommandLineDescribeAllParameters(const char *optarg) { + int first; int n_thorns; int thorn; - int n_parameters; - char **parameterlist; - int parameter; const char *thornname; - const char *implementation; - cParamData *properties; + char *param; + const cParamData *properties; n_thorns = CCTK_NumCompiledThorns (); for(thorn = 0; thorn < n_thorns; thorn++) { thornname = CCTK_CompiledThorn (thorn); - implementation = CCTK_ThornImplementation(thornname); - CCTK_ParameterList(thornname, ¶meterlist, &n_parameters); + printf("\nParameters of thorn '%s' providing implementation '%s':\n", + thornname, CCTK_ThornImplementation(thornname)); - for(parameter = 0 ; parameter < n_parameters; parameter++) + first = 1; + while (CCTK_ParameterWalk (first, thornname, ¶m, &properties) == 0) { - properties = CCTK_ParameterData(parameterlist[parameter], thornname); - if(optarg) { switch(*optarg) @@ -114,19 +111,12 @@ void CCTKi_CommandLineDescribeAllParameters(const char *optarg) } else { - if(properties->scope == SCOPE_PRIVATE) - { - printf("%s::%s\n", thornname, parameterlist[parameter]); - } - else - { - printf("%s::%s\n", implementation, parameterlist[parameter]); - } + printf("%s\n", param); } - free(parameterlist[parameter]); + free(param); + first = 0; } - free(parameterlist); } /* CCTKi_BindingsParameterHelp(NULL,"%s",stdout);*/ @@ -138,7 +128,7 @@ void CCTKi_CommandLineDescribeParameter(const char *optarg) { char *thorn; char *param; - cParamData *properties; + const cParamData *properties; const char *cthorn; Util_SplitString(þ, ¶m, optarg, "::"); @@ -414,13 +404,20 @@ void CCTKi_CommandLineFinished(void) @endhistory @@*/ -static void CommandLinePrintParameter(cParamData *properties) +static void CommandLinePrintParameter(const cParamData *properties) { t_range *range; if(properties) { - printf("Parameter: %s::%s - \"%s\"\n", properties->thorn, properties->name, properties->description); + printf("Parameter: %s::%s", properties->thorn, properties->name); + if(properties->scope != SCOPE_PRIVATE) + { + printf(", %s::%s", CCTK_ThornImplementation(properties->thorn), + properties->name); + } + printf("\n"); + printf("Description: \"%s\"\n", properties->description); printf("Type: %s\n", cctk_parameter_type_names[properties->type-1]); printf("Default: %s\n", properties->defval); printf("Scope: %s\n", cctk_parameter_scopes[properties->scope-1]); |