From 81bd5b0d66c168d7d8317e7b0d67079819f07480 Mon Sep 17 00:00:00 2001 From: allen Date: Thu, 27 Dec 2001 19:14:29 +0000 Subject: New function to return IO method name from handle const char *CCTK_IOMethod (int handle) git-svn-id: http://svn.cactuscode.org/flesh/trunk@2533 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/IO/IOMethods.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/IO') diff --git a/src/IO/IOMethods.c b/src/IO/IOMethods.c index cd245cf0..02282f3f 100644 --- a/src/IO/IOMethods.c +++ b/src/IO/IOMethods.c @@ -118,6 +118,7 @@ int CCTKi_RegisterIOMethod (const char *thorn, const char *name) /* Initialise the I/O method structure with dummy routines */ new_method->implementation = CCTK_ThornImplementation (thorn); + new_method->name = name; new_method->OutputGH = DummyOutputGH; new_method->OutputVarAs = DummyOutputVarAs; new_method->TriggerOutput = DummyTriggerOutput; @@ -520,6 +521,34 @@ const char *CCTK_IOMethodImplementation (int handle) } + /*@@ + @routine CCTK_IOMethod + @date Thu Dec 27 2001 + @author Gabrielle Allen + @desc + Provide the IO Method name + @enddesc + @var handle + @vdesc handle of I/O method + @vtype int + @vio in + @endvar + + @returntype const char * + @returndesc + IO Method + @endreturndesc +@@*/ +const char *CCTK_IOMethod (int handle) +{ + struct IOMethod *method; + + method = (struct IOMethod *) Util_GetHandledData (IOMethods, handle); + + return (method ? method->name : NULL); +} + + /******************************************************************** ********************* Local Routines ************************* ********************************************************************/ -- cgit v1.2.3