diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-02-12 08:55:30 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-02-12 08:55:30 +0000 |
commit | c38485bf0661d6e765da02adf9072d0091b555ee (patch) | |
tree | d45fe5330e925b4d7fbdb96a10824183e545a0db /src/main/Groups.c | |
parent | dfddbd550a542f4832ba98eb1d8f46ff5570ad00 (diff) |
Added a function to get the name of a group given its number.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@239 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/Groups.c')
-rw-r--r-- | src/main/Groups.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/Groups.c b/src/main/Groups.c index cfb07de3..f2b0d37d 100644 --- a/src/main/Groups.c +++ b/src/main/Groups.c @@ -545,3 +545,22 @@ int CCTK_DecomposeGroupName(const char *fullname, char **implementation, char ** { return CCTK_SplitString(implementation, name, fullname, "::"); } + +char *CCTK_GetGroupName(int varnum) +{ + char *name; + int group; + + group = group_of_variable[varnum]; + + name = malloc((strlen(groups[group].implementation)+strlen(groups[group].name)+3)*sizeof(char)) + ; + sprintf(name, "%s::%s",groups[group].implementation, groups[group].name); + + return name; +} + +int CCTK_GetFirstVarNum(int group) +{ + return groups[group].variables[0].number; +} |