diff options
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/pidl/idl.gram | 2 | ||||
-rw-r--r-- | source4/build/pidl/parser.pm | 44 |
2 files changed, 44 insertions, 2 deletions
diff --git a/source4/build/pidl/idl.gram b/source4/build/pidl/idl.gram index b354b9772a..adabbe41a6 100644 --- a/source4/build/pidl/idl.gram +++ b/source4/build/pidl/idl.gram @@ -17,7 +17,7 @@ module_header: '[' <commit> module_param(s? /,/) ']' }} | <error?> -module_param: identifier '(' text ')' +module_param: identifier '(' <commit> text ')' {{ "$item{identifier}" => "$item{text}" }} | <error> diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm index a10058a160..5bf5e4220f 100644 --- a/source4/build/pidl/parser.pm +++ b/source4/build/pidl/parser.pm @@ -14,6 +14,10 @@ use client; my %needed; my %structs; +my $if_uuid; +my $if_version; +my $if_endpoints; + sub pidl($) { print OUT shift; @@ -1281,7 +1285,31 @@ sub FunctionTable($) } pidl "\t{ NULL, 0, NULL, NULL }\n};\n\n"; - pidl "\nconst struct dcerpc_interface_table dcerpc_table_$interface->{NAME} = {\"$interface->{NAME}\", DCERPC_$uname\_UUID, DCERPC_$uname\_VERSION, $count, $interface->{NAME}\_calls};\n\n"; + my $endpoints; + + if (! defined $if_endpoints) { + $if_endpoints = $interface->{NAME}; + } + + pidl "static const struct dcerpc_endpoint_list $interface->{NAME}\_endpoints = {\n"; + my @e = split / /, $if_endpoints; + my $endpoint_count = $#e + 1; + pidl "\t$endpoint_count,\n"; + pidl "\t{ "; + for (my $i=0; $i < $#e; $i++) { + pidl "\"$e[$i]\", "; + } + pidl "\"$e[$#e]\" }\n"; + pidl "};\n\n"; + + pidl "\nconst struct dcerpc_interface_table dcerpc_table_$interface->{NAME} = {\n"; + pidl "\t\"$interface->{NAME}\",\n"; + pidl "\tDCERPC_$uname\_UUID,\n"; + pidl "\tDCERPC_$uname\_VERSION,\n"; + pidl "\t$count,\n"; + pidl "\t$interface->{NAME}\_calls,\n"; + pidl "\t&$interface->{NAME}\_endpoints\n"; + pidl "};\n\n"; } @@ -1389,6 +1417,17 @@ sub BuildNeeded($) } ##################################################################### +# parse the interface definitions +sub ModuleHeader($) +{ + my($h) = shift; + + $if_uuid = $h->{PROPERTIES}->{uuid}; + $if_version = $h->{PROPERTIES}->{version}; + $if_endpoints = $h->{PROPERTIES}->{endpoints}; +} + +##################################################################### # parse a parsed IDL structure back into an IDL file sub Parse($$) { @@ -1400,6 +1439,9 @@ sub Parse($$) pidl "/* parser auto-generated by pidl */\n\n"; pidl "#include \"includes.h\"\n\n"; foreach my $x (@{$idl}) { + ($x->{TYPE} eq "MODULEHEADER") && + ModuleHeader($x); + if ($x->{TYPE} eq "INTERFACE") { BuildNeeded($x); ParseInterface($x); |