diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-13 22:48:03 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-13 22:48:03 +0000 |
commit | 8dc3521fe981b2eb6815c44bc9649dd62a5848dc (patch) | |
tree | c3829f481a658c72de463c6635019890579ad2e2 /src/main/SetParams.c | |
parent | 1e947263c8f387494c2b97f1820a82e06a711f30 (diff) |
Further work on parameters.
Will now read in and parse parameters.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@51 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/SetParams.c')
-rw-r--r-- | src/main/SetParams.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/main/SetParams.c b/src/main/SetParams.c index 4e7ca201..c9c190f2 100644 --- a/src/main/SetParams.c +++ b/src/main/SetParams.c @@ -11,6 +11,8 @@ #include <stdlib.h> #include <string.h> +#include "flesh.h" + static char *rcsid = "$Id$"; int CCTK_ExtractImplementation(char **imp, char **name, const char *parameter); @@ -113,8 +115,8 @@ int CCTK_ExtractImplementation(char **imp, char **name, const char *parameter) strncpy(*imp, parameter, (int)(position-parameter)); (*imp)[(int)(position-parameter)] = '\0'; - strncpy(*name, position+2, strlen(*imp)-(int)(position-parameter)-2); - (*name)[strlen(*imp)-(position-parameter)-2] = '\0'; + strncpy(*name, position+2, strlen(parameter)-(int)(position-parameter)-2); + (*name)[strlen(parameter)-(position-parameter)-2] = '\0'; retval = 0; } @@ -164,7 +166,29 @@ int CCTK_SetImplementationParameter(const char *imp, const char *name, const char *value) { + int n_thorns; + int thorn; + char **thornlist; + t_thorndata *thorndata; - return 1; + if((n_thorns = GetImplementationThorns(imp, þlist))) + { + for(thorn = 0; thorn < n_thorns; thorn++) + { + if(GetThornData(thornlist[thorn], þdata)) + { + thorndata->param_set(name, value); + } + } + } + else + { + if(GetThornData(imp, þdata)) + { + thorndata->param_set(name, value); + } + } + + return 0; } |