summaryrefslogtreecommitdiff
path: root/lib/sbin/CreateImplementationBindings.pl
diff options
context:
space:
mode:
authoreschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2013-01-18 02:02:00 +0000
committereschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2013-01-18 02:02:00 +0000
commit595ffe4dee1d88ed9b1998dbb4fcd2acf0484c2e (patch)
treeda8d3207b301ad4739188fcfd52943c3036d7e51 /lib/sbin/CreateImplementationBindings.pl
parentd3a8f469b7295c6833ae8ec62014e6c3f6f1b83e (diff)
Introduce OPTIONAL_IFACTIVE
Following up on a discussion on the Cactus developers mailing list, this patch introduces a third way of indicating a desired capability: in addition to REQUIRES and OPTIONAL there is OPTIONAL_IFACTIVE. This behaves like OPTIONAL, except that the capability relationship only exists if the thorn providing the capability is active. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4938 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateImplementationBindings.pl')
-rw-r--r--lib/sbin/CreateImplementationBindings.pl20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/sbin/CreateImplementationBindings.pl b/lib/sbin/CreateImplementationBindings.pl
index 64c45cad..af423aac 100644
--- a/lib/sbin/CreateImplementationBindings.pl
+++ b/lib/sbin/CreateImplementationBindings.pl
@@ -11,7 +11,7 @@ sub CreateImplementationBindings
{
my($bindings_dir, $rhparameter_db, $rhinterface_db, $configuration_db) = @_;
my($i, $start_dir, $thorn);
- my(@data, @thorns, @ancestors, @friends, @requires_thorns);
+ my(@data, @thorns, @ancestors, @friends, @requires_thorns, @activates_thorns);
if(! $build_dir)
{
@@ -87,6 +87,7 @@ sub CreateImplementationBindings
@ancestors = map { " \"$_\"," } split (' ', $rhinterface_db->{"IMPLEMENTATION \U$myimp\E ANCESTORS"});
@friends = map { " \"$_\"," } split (' ', $rhinterface_db->{"\U$thorn\E FRIEND"});
@requires_thorns = map { " \"$_\"," } split (' ', $configuration_db->{"\U$thorn\E REQUIRES THORNS"});
+ @activates_thorns = map { " \"$_\"," } split (' ', $configuration_db->{"\U$thorn\E ACTIVATES THORNS"});
@data = ();
push(@data, '#include <stdio.h>');
@@ -134,6 +135,17 @@ sub CreateImplementationBindings
$i++;
}
+ if (@activates_thorns)
+ {
+ push(@data, ' const char *activates_thorns[] =');
+ push(@data, ' {');
+ push(@data, @activates_thorns);
+ push(@data, ' 0,');
+ push(@data, ' };');
+ push(@data, '');
+ $i++;
+ }
+
push(@data, ' /*');
push(@data, ' * Should be able to do below with a constant initializer');
push(@data, ' * but sr8000 compiler doesn\'t like it.');
@@ -164,6 +176,12 @@ sub CreateImplementationBindings
push(@data, " attributes[$i].AttributeData.StringList = requires_thorns;");
$i++;
}
+ if (@activates_thorns)
+ {
+ push(@data, " attributes[$i].attribute = \"activates thorns\";");
+ push(@data, " attributes[$i].AttributeData.StringList = activates_thorns;");
+ $i++;
+ }
push(@data, " attributes[$i].attribute = 0;");
push(@data, " attributes[$i].AttributeData.StringList = 0;");
push(@data, '');