From 2e473be1b9ea835f367635c770c130252fd835fe Mon Sep 17 00:00:00 2001 From: goodale Date: Wed, 20 Jan 1999 08:18:17 +0000 Subject: New library - libCactusBindings.a created by make.configuration. The sources for this are automatically generated by config_parser.pl and should contain everything needed to bind the flesh and the thorns. Specifically have six functions called from the flesh CCTK_BindingsParametersInitialise CCTK_BindingsParameterSet CCTK_BindingsParameterGet CCTK_BindingsVariablesInitialise CCTK_BindingsScheduleInitialise CCTK_BindingsScheduleRegister All the initialise ones are of type int ()(void) CCTK_ParameterSet is of type int ()(const char *, const char *) and takes a parameter specification and a parameter value, as taken from the parameter file, and sets the parameter accordingly. CCTK_BindingsParameterGet is of type int()(const char *, void **) and returns the value of a parameter - the rturn value corresponds to the type of the parameter. CCTK_BindingsScheduleRegister is of type int()(const char *) and will perform registration at, e.g. Startup, or RFR, or any other point we add in future. Thinking about it, it needs to also take a void * if it's going to do rfr init stuff - watch this space... 8-) The c source files for these are put in the $(TOP)/bindings directory by config.ccl, each subsystem in its own directory. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@82 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/sbin/config_parser.pl | 239 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 191 insertions(+), 48 deletions(-) (limited to 'lib/sbin/config_parser.pl') diff --git a/lib/sbin/config_parser.pl b/lib/sbin/config_parser.pl index 44f52442..2f70cc7d 100644 --- a/lib/sbin/config_parser.pl +++ b/lib/sbin/config_parser.pl @@ -26,50 +26,35 @@ if(! $cctk_home) $cachome =~ s:/$::g; } +if(! $bindings_dir) +{ + $bindings_dir = "$top/bindings"; +} + $activethorns = shift(@ARGV); if (! $activethorns) { - printf "Usage: config_parser [-top=] [-config_dir=] [-cctk_home=] ActiveThornList"; + printf "Usage: config_parser [-top=] [-config_dir=] [-cctk_home=] -bindings_dir= ActiveThornList"; exit; } +$sbin_dir = "$cctk_home/lib/sbin"; -#if (!-e "$cctk_home/lib/perl/thorn_utils.pl" ) { -# print <make.code.defn") || die "Cannot open make.code.defn"; + + print OUT "SRCS = \n"; + print OUT "SUBDIRS = Parameters Variables Schedule\n"; + + close OUT; + chdir $start_dir; +} + +sub CreateParameterBindings +{ + local($bindings_dir, $n_param_database, @rest) = @_; + local(%parameter_database); + local(%interface_database); + local($start_dir); + + %parameter_database = @rest[0..$n_param_database-1]; + %interface_database = @rest[$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 "Parameters") + { + mkdir("Parameters", 0755) || die "Unable to create Parameters directory"; + } + chdir "Parameters"; + + open (OUT, ">Bindings.c") || die "Cannot open Bindings.c"; + + print OUT <make.code.defn") || die "Cannot open ake.code.defn"; + + print OUT "SRCS = Bindings.c\n"; + + close OUT; + + chdir $start_dir; +} + + +sub CreateVariableBindings +{ + local($bindings_dir, %inteface_database) = @_; + + if(! -d $bindings_dir) + { + mkdir("$bindings_dir", 0755) || die "Unable to create $bindings_dir"; + } + $start_dir = `pwd`; + chdir $bindings_dir; + + if(! -d "Variables") + { + mkdir("Variables", 0755) || die "Unable to create Variables directory"; + } + chdir "Variables"; + + open (OUT, ">Bindings.c") || die "Cannot open Bindings.c"; + + print OUT <make.code.defn") || die "Cannot open make.code.defn"; + + print OUT "SRCS = Bindings.c\n"; + + close OUT; + + chdir $start_dir; +} + +sub CreateScheduleBindings +{ + local($bindings_dir) = @_; + + if(! -d $bindings_dir) + { + mkdir("$bindings_dir", 0755) || die "Unable to create $bindings_dir"; + } + $start_dir = `pwd`; + chdir $bindings_dir; + + if(! -d "Schedule") + { + mkdir("Schedule", 0755) || die "Unable to create Schedule directory"; + } + chdir "Schedule"; + + open (OUT, ">Bindings.c") || die "Cannot open Bindings.c"; + + print OUT <make.code.defn") || die "Cannot open make.code.defn"; + + print OUT "SRCS = Bindings.c\n"; + + close OUT; + + chdir $start_dir; +} -- cgit v1.2.3