summaryrefslogtreecommitdiff
path: root/lib/sbin/create_c_stuff.pl
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-05-20 16:53:20 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-05-20 16:53:20 +0000
commit198f32a7660442c2f7c0f83c2ad179e932074db8 (patch)
tree49e00822cb466dc3b8c3e1642424d430574100e8 /lib/sbin/create_c_stuff.pl
parent2e56de0aaa761f45dc3fb81fae41566c85c03db1 (diff)
Added AS for parameters. You can now have one name for a parameter as seen
by the user, and another name for the vaiable in your code. This will be particularly useful for avoiding conflicts when sharing parameters from other implementations. Syntax: [uses|extends] <type> <name> ["<description>"] AS <newname> Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2832 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/create_c_stuff.pl')
-rw-r--r--lib/sbin/create_c_stuff.pl21
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/sbin/create_c_stuff.pl b/lib/sbin/create_c_stuff.pl
index 99bb78c3..b7d15826 100644
--- a/lib/sbin/create_c_stuff.pl
+++ b/lib/sbin/create_c_stuff.pl
@@ -40,6 +40,8 @@ sub CreateParameterBindingFile
my $type = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E type"};
my $type_string = &get_c_type_string($type);
+ my $realname = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E realname"};
+
my $array_size = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E array_size"};
my $suffix = '';
@@ -49,7 +51,7 @@ sub CreateParameterBindingFile
$suffix = "[$array_size]";
}
- push(@data, " $type_string$parameter$suffix;");
+ push(@data, " $type_string$realname$suffix;");
}
# Some compilers don't like an empty structure.
@@ -186,24 +188,19 @@ sub CreateCStructureParameterHeader
my $array_size = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E array_size"};
my $suffix = '';
- my $prefix = '';
+ my $varprefix = '';
if($array_size)
{
- $prefix = '*';
+ $varprefix = '*';
$suffix = "[$array_size]";
}
- my $name = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E alias"};
-
- if(! $name)
- {
- $name = "$parameter";
- }
+ my $realname = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E realname"};
- push(@data, " $type_string $parameter$suffix;");
- push(@definition, " const $type_string $prefix$name = $structure.$parameter; \\");
- push(@use, " (void) ($name + 0); \\");
+ push(@data, " $type_string $realname$suffix;");
+ push(@definition, " const $type_string $varprefix$parameter = $structure.$realname; \\");
+ push(@use, " (void) ($parameter + 0); \\");
}
# Some compilers don't like an empty structure.