diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-02-03 12:27:58 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-02-03 12:27:58 +0000 |
commit | 1a33b01d99a25b76a71671b5a199bb149ce2f3c8 (patch) | |
tree | 4d19e63bfacf05dbb13a08b41d649f41188d5a3e /src/util/StoreHandledData.c | |
parent | c526b140d4d81e628827de2c51cd37ef3aba4801 (diff) |
Added a function CCTK_GetHandleName to get the name associated with a handle.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@192 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util/StoreHandledData.c')
-rw-r--r-- | src/util/StoreHandledData.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/util/StoreHandledData.c b/src/util/StoreHandledData.c index f563d243..da530695 100644 --- a/src/util/StoreHandledData.c +++ b/src/util/StoreHandledData.c @@ -305,6 +305,48 @@ int CCTK_GetHandle(cHandledData *storage, const char *name, void **data) return handle; } + /*@@ + @routine CCTK_GetHandleName + @date Wed Feb 3 12:52:53 1999 + @author Tom Goodale + @desc + Gets the name associated with a handle. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ +char *CCTK_GetHandleName(cHandledData *storage, int handle) +{ + char *name; + + if(storage) + { + if((handle < storage->array_size)&& + (handle >= 0)&& + (storage->array[handle].in_use == TRUE)) + { + /* The data exists */ + name = storage->array[handle].name; + } + else + { + /* The data is non-existant. */ + name = NULL; + } + } + else + { + /* There is no data registered. */ + name = NULL; + } + + return name; +} + /*#define TEST_STOREHANDLEDDATA */ #ifdef TEST_STOREHANDLEDDATA |