diff options
author | goodale <goodale@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2000-09-17 17:42:15 +0000 |
---|---|---|
committer | goodale <goodale@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2000-09-17 17:42:15 +0000 |
commit | 06df674aaf1284add18916fdb3752d3fe0a01721 (patch) | |
tree | 0227fcfe73681ecfb3f7006435874a0654522923 | |
parent | 2acdc3755dd6a4e9c49cbb9211fc0824fef98e19 (diff) |
Made listener database local rather than being on the GH.
Tom
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@88 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a
-rw-r--r-- | src/GHExtension.c | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c index 46b010f..f06a9fd 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -17,16 +17,44 @@ #include <stdio.h> #include "cctk.h" -#include "util_String.h" #include "cctk_Parameters.h" + +#include "util_String.h" +#include "StoreNamedData.h" + #include "ioGH.h" static char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusBase_IOUtil_GHExtension_c) -/* local function prototypes */ +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/* database holding all registered listeners for file advertising */ +static pNamedData *listener_DB = NULL; + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ /*@@ @routine IOUtil_SetupGH @@ -193,8 +221,11 @@ int IOUtil_InitGH (cGH *GH) /* reset the flags array for the file reader */ myGH->do_inVars = NULL; +#if 0 + /* TG: Moved off GH */ /* initialize the file advertising listeners database */ myGH->listener_DB = NULL; +#endif return 0; } @@ -391,7 +422,6 @@ void IOUtil_ParseVarsForOutput (const char *var_list, char do_output []) int IOUtil_RegisterAdvertisedFileListener (cGH *GH, const char *listener, const IOUtil_AdvertisedFileListenerCallbacks_t *callbacks) { - ioGH *myGH; int retval = -1; IOUtil_AdvertisedFileListenerCallbacks_t *new_callbacks; @@ -403,8 +433,7 @@ int IOUtil_RegisterAdvertisedFileListener (cGH *GH, const char *listener, if (new_callbacks) { *new_callbacks = *callbacks; - myGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; - retval = StoreNamedData (&myGH->listener_DB, listener, new_callbacks); + retval = StoreNamedData (&listener_DB, listener, new_callbacks); if (retval) free (new_callbacks); } @@ -455,8 +484,7 @@ int IOUtil_AdvertiseFile (cGH *GH, const char *filename, /* get the listener database from IOUtil's GH extension */ - listener = ((ioGH *) - GH->extensions [CCTK_GHExtensionHandle ("IO")])->listener_DB; + listener = listener_DB; /* loop through all listeners' advertise() callbacks */ while (listener) |