summaryrefslogtreecommitdiff
path: root/src/main/FortranWrappers.c
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-09-18 18:13:08 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-09-18 18:13:08 +0000
commit31abe5aa5537c7f48a870fadb4c2aca8cdc6efd8 (patch)
tree5c87d88a0b93d881af3b5e2ec95a87c2ee724b16 /src/main/FortranWrappers.c
parent965da409e7b5af5f3ab323a3ab7c2353936cd2a5 (diff)
Routines to register and get Fortran Wrapper functions.
Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@954 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/FortranWrappers.c')
-rw-r--r--src/main/FortranWrappers.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/main/FortranWrappers.c b/src/main/FortranWrappers.c
new file mode 100644
index 00000000..e10baae9
--- /dev/null
+++ b/src/main/FortranWrappers.c
@@ -0,0 +1,60 @@
+ /*@@
+ @file FortranWrappers.c
+ @date Sat Sep 18 00:42:12 1999
+ @author Tom Goodale
+ @desc
+ File for dealing with fortran wrapper functions.
+ @enddesc
+ @@*/
+
+static char *rcsid = "$Header$";
+
+#include <stdlib.h>
+
+#include "cctk_FortranWrappers.h"
+
+#include "StoreNamedData.h"
+
+static pNamedData *registry = NULL;
+
+ /*@@
+ @routine CCTK_RegisterFortranWrapper
+ @date Sat Sep 18 00:51:21 1999
+ @author Tom Goodale
+ @desc
+ Registers a Fortran wrapper function.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+int CCTK_RegisterFortranWrapper(const char *name, int (*function)(void *, void *))
+{
+ int retcode;
+ retcode = StoreNamedData(&registry, name, (void *)function);
+
+ return retcode;
+}
+
+ /*@@
+ @routine CCTK_FortranWrapper
+ @date Sat Sep 18 00:51:57 1999
+ @author Tom Goodale
+ @desc
+ Gets a Fortran wrapper function.
+ (A function taking (void *,void *), and returning an int. )
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+int (*CCTK_FortranWrapper(const char *name))(void *, void *)
+{
+ return (int (*)(void *,void *))GetNamedData(registry, name);
+}