summaryrefslogtreecommitdiff
path: root/lib/sbin/CreateImplementationBindings.pl
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-04 20:44:58 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-04 20:44:58 +0000
commit60b45d66a082bc7bf84575907723397ce52dff3a (patch)
tree95fed523a75f51e202828171fca81b1f290b37b7 /lib/sbin/CreateImplementationBindings.pl
parent3a49de09ea001f18d6e58d236c80e2b39a4b78d0 (diff)
Stuff for the ActiveThorns parameter.
Now need to specify ActiveThorns before any other parameters to list those thorns which are active. No parameters or startup or rfr routines are available from inactive thorns. Note that this isn't quite working yet but I hope to track it down by morning. In the meantime either don't update or be prepared for things to be slightly broken. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@645 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateImplementationBindings.pl')
-rw-r--r--lib/sbin/CreateImplementationBindings.pl71
1 files changed, 71 insertions, 0 deletions
diff --git a/lib/sbin/CreateImplementationBindings.pl b/lib/sbin/CreateImplementationBindings.pl
new file mode 100644
index 00000000..401b8394
--- /dev/null
+++ b/lib/sbin/CreateImplementationBindings.pl
@@ -0,0 +1,71 @@
+#/*@@
+# @file CreateImplementationBindings.pl
+# @date Sun Jul 4 17:09:54 1999
+# @author Tom Goodale
+# @desc
+#
+# @enddesc
+#@@*/
+
+sub CreateImplementationBindings
+{
+ local($bindings_dir, $n_param_database, @rest) = @_;
+ local(%parameter_database);
+ local(%interface_database);
+ local($start_dir);
+ local($thorn);
+ local(@data);
+
+ %parameter_database = @rest[0..(2*$n_param_database)-1];
+ %interface_database = @rest[2*$n_param_database..$#rest];
+
+ if(! -d $bindings_dir)
+ {
+ mkdir("$bindings_dir", 0755) || die "Unable to create $bindings_dir";
+ }
+ $start_dir = `pwd`;
+
+ chdir $bindings_dir;
+
+ if(! -d "Implementations")
+ {
+ mkdir("Implementations", 0755) || die "Unable to create Implementations directory";
+ }
+
+ if(! -d "include")
+ {
+ mkdir("include", 0755) || die "Unable to create include directory";
+ }
+
+ chdir "Implementations";
+
+ @data = ();
+
+ push(@data, "#include \"ActiveThorns.h\"\n\n");
+
+ push(@data, "int CCTK_BindingsImplementationsInitialise(void)\n{\n");
+
+ foreach $thorn (sort split(" ", $interface_database{"THORNS"}))
+ {
+ push(@data, " CCTK_RegisterThorn(\"$thorn\",\"" .
+ $interface_database{"\U$thorn\E IMPLEMENTS"} ."\");\n");
+ }
+
+ push(@data, "\n return 0;\n}\n");
+
+ &OutputFile(".", "ImplementationBindings.c", @data);
+
+
+ open (OUT, ">make.code.defn");
+ print OUT <<EOF;
+
+SRCS = ImplementationBindings.c
+
+EOF
+
+ close OUT;
+
+ chdir $_start_dir;
+}
+
+1;