diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-20 13:46:37 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-20 13:46:37 +0000 |
commit | 3b0db02df49091ee367c173f730a767a3f6a46cd (patch) | |
tree | c2f42ca58cb987488362d7bf98a401a726921c99 /lib/sbin/create_c_stuff.pl | |
parent | 1f10d3bd318ef12f514e79e46ff47413ed9f3622 (diff) |
Now creates an appropriate parameter bindings file for the public
parameters. Just commiting now in case I screw up the next bit of
generalising it to all parmeters. Will reorganise routiens and files too.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@90 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/create_c_stuff.pl')
-rw-r--r-- | lib/sbin/create_c_stuff.pl | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/lib/sbin/create_c_stuff.pl b/lib/sbin/create_c_stuff.pl index ea326016..bd3a9018 100644 --- a/lib/sbin/create_c_stuff.pl +++ b/lib/sbin/create_c_stuff.pl @@ -218,95 +218,5 @@ sub create_c_parameter_type_declaration } -#/*@@ -# @routine set_parameter_default -# @date Mon Jan 11 15:33:26 1999 -# @author Tom Goodale -# @desc -# Set the default value of a parameter -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -#@@*/ - -sub set_parameter_default -{ - local($implementation,$parameter, %parameter_database) = @_; - local($type, $type_string); - local($line, @lines); - local($default); - - $default = $parameter_database{"\U$implementation $parameter\E default"}; - $type = $parameter_database{"\U$implementation $parameter\E type"}; - - $type_string = &get_c_type_string($type); - - if($type_string eq "char *") - { - $line = " cctk_parameters->\U$implementation\E.\L$parameter\E = malloc((" - . length($default) . "-1)\*sizeof(char));"; - push(@lines, $line); - - $line = " if(cctk_parameters->\U$implementation\E.\L$parameter\E)"; - push(@lines, $line); - - $line = " strcpy(cctk_parameters->\U$implementation\E.\L$parameter\E, $default);"; - push(@lines, $line); - } - else - { - $line = " cctk_parameters->\U$implementation\E.\L$parameter\E = $default;"; - push(@lines, $line); - } - - return @lines; -} - -#/*@@ -# @routine get_c_type_string -# @date Mon Jan 11 15:33:50 1999 -# @author Tom Goodale -# @desc -# Returns the correct type string for a parameter -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -#@@*/ - -sub get_c_type_string -{ - local($type) = @_; - local($type_string); - - - if($type eq "KEYWORD" || - $type eq "STRING" || - $type eq "SENTENCE") - { - $type_string = "char *"; - } - elsif($type eq "LOGICAL" || - $type eq "INTEGER") - { - $type_string = "int "; - } - elsif($type eq "REAL") - { - $type_string = "Double "; - } - else - { - die("Unknown parameter type '$type'"); - } - - return $type_string; - -} 1; |