diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-03-16 10:22:21 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-03-16 10:22:21 +0000 |
commit | 45b8089075c69bb56bd18cf3d9c2be0d643670fc (patch) | |
tree | 54adc4e332626c4bc2e25805d9ac6f49fa1c904e /src/IO | |
parent | c858e66dc88555daee0a821e310cb057c9f1b4d8 (diff) |
Added registration of new routine TriggerOutput which I don't want
to add but don't see how to avoid
git-svn-id: http://svn.cactuscode.org/flesh/trunk@399 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/IO')
-rw-r--r-- | src/IO/IOMethods.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/src/IO/IOMethods.c b/src/IO/IOMethods.c index 7179142d..73100b17 100644 --- a/src/IO/IOMethods.c +++ b/src/IO/IOMethods.c @@ -26,7 +26,8 @@ static int DummyOutputGH(cGH *GH); static int DummyOutputVarAs(cGH *GH, const char *var, const char *alias); -static int DummyTimeToOutput(cGH *GH, int); +static int DummyTriggerOutput(cGH *GH, int var); +static int DummyTimeToOutput(cGH *GH, int var); /************************************************************************ @@ -84,9 +85,10 @@ int CCTK_RegisterIOMethod(const char *name) handle = CCTK_NewHandle(&IOMethods, name, new_method); /* Initialise the IO method structure with dummy routines */ - new_method->OutputGH = DummyOutputGH; - new_method->OutputVarAs = DummyOutputVarAs; - new_method->TimeToOutput = DummyTimeToOutput; + new_method->OutputGH = DummyOutputGH; + new_method->OutputVarAs = DummyOutputVarAs; + new_method->TriggerOutput = DummyTriggerOutput; + new_method->TimeToOutput = DummyTimeToOutput; /* Remember how many methods there are */ num_methods++; @@ -223,9 +225,29 @@ int CCTK_RegisterIOMethodOutputVarAs(int handle, int (*func)(cGH *, return return_code; } +int CCTK_RegisterIOMethodTriggerOutput(int handle, int (*func)(cGH *, int)) +{ + int return_code; + struct IOMethod *method; + + /* Get the extension. */ + method = CCTK_GetHandledData(IOMethods, handle); + + if(method) + { + method->TriggerOutput = func; + return_code = 1; + } + else + { + return_code = 0; + } + + return return_code; +} /*@@ - @routine CCTK_RegisterIOMethodOutputVarAs + @routine CCTK_RegisterIOMethodTimeToOutput @date Sat March 6 1999 @author Gabrielle Allen @desc @@ -333,6 +355,11 @@ static int DummyOutputVarAs(cGH *GH, return 0; } +static int DummyTriggerOutput(cGH *GH, int var) +{ + return 0; +} + /************************************************************************ @@ -748,7 +775,7 @@ int CCTK_rfrTriggerAction(void *GH, int variable) if (method->TimeToOutput(GH, variable)) { /* And if so do call the output routine for the method */ - method->OutputVarAs(GH,fullvarname,varname); + method->TriggerOutput(GH,variable); nmethods++; } } |