The Samba-Bugzilla – Attachment 9589 Details for
Bug 10376
HEADER START/HEADER END to insert C code into the generated .h file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to add HEADER START/HEADER END
patch (text/plain), 3.02 KB, created by
Guy Harris
on 2014-01-13 21:11:21 UTC
(
hide
)
Description:
Patch to add HEADER START/HEADER END
Filename:
MIME Type:
Creator:
Guy Harris
Created:
2014-01-13 21:11:21 UTC
Size:
3.02 KB
patch
obsolete
>Index: pidl/lib/Parse/Pidl/Wireshark/Conformance.pm >=================================================================== >--- pidl/lib/Parse/Pidl/Wireshark/Conformance.pm (revision 54708) >+++ pidl/lib/Parse/Pidl/Wireshark/Conformance.pm (working copy) >@@ -396,6 +396,7 @@ > my ($fh,$data,$f) = @_; > > my $incodeblock = 0; >+ my $inheaderblock = 0; > > my $ln = 0; > >@@ -407,9 +408,27 @@ > s/[\r\n]//g; > > if ($_ eq "CODE START") { >+ if ($incodeblock) { >+ warning({ FILE => $f, LINE => $ln }, >+ "CODE START inside CODE section"); >+ } >+ if ($inheaderblock) { >+ error({ FILE => $f, LINE => $ln }, >+ "CODE START inside HEADER section"); >+ return undef; >+ } > $incodeblock = 1; > next; >- } elsif ($incodeblock and $_ eq "CODE END") { >+ } elsif ($_ eq "CODE END") { >+ if (!$incodeblock) { >+ warning({ FILE => $f, LINE => $ln }, >+ "CODE END outside CODE section"); >+ } >+ if ($inheaderblock) { >+ error({ FILE => $f, LINE => $ln }, >+ "CODE END inside HEADER section"); >+ return undef; >+ } > $incodeblock = 0; > next; > } elsif ($incodeblock) { >@@ -419,6 +438,37 @@ > $data->{override} = "$_\n"; > } > next; >+ } elsif ($_ eq "HEADER START") { >+ if ($inheaderblock) { >+ warning({ FILE => $f, LINE => $ln }, >+ "HEADER START inside HEADER section"); >+ } >+ if ($incodeblock) { >+ error({ FILE => $f, LINE => $ln }, >+ "HEADER START inside CODE section"); >+ return undef; >+ } >+ $inheaderblock = 1; >+ next; >+ } elsif ($_ eq "HEADER END") { >+ if (!$inheaderblock) { >+ warning({ FILE => $f, LINE => $ln }, >+ "HEADER END outside HEADER section"); >+ } >+ if ($incodeblock) { >+ error({ FILE => $f, LINE => $ln }, >+ "CODE END inside HEADER section"); >+ return undef; >+ } >+ $inheaderblock = 0; >+ next; >+ } elsif ($inheaderblock) { >+ if (exists $data->{header}) { >+ $data->{header}.="$_\n"; >+ } else { >+ $data->{header} = "$_\n"; >+ } >+ next; > } > > my @fields = /([^ "]+|"[^"]+")/g; >Index: pidl/lib/Parse/Pidl/Wireshark/NDR.pm >=================================================================== >--- pidl/lib/Parse/Pidl/Wireshark/NDR.pm (revision 54708) >+++ pidl/lib/Parse/Pidl/Wireshark/NDR.pm (working copy) >@@ -930,6 +930,10 @@ > $self->RegisterInterface($x); > $self->RegisterInterfaceHandoff($x); > >+ if (exists ($self->{conformance}->{header})) { >+ $self->pidl_hdr($self->{conformance}->{header}); >+ } >+ > $self->pidl_hdr("#endif /* $define */"); > } > >@@ -1012,7 +1016,7 @@ > > my $notice = > "/* DO NOT EDIT >- This filter was automatically generated >+ This file was automatically generated by Pidl > from $idl_file and $cnf_file. > > Pidl is a perl based IDL compiler for DCE/RPC idl files. >@@ -1025,8 +1029,6 @@ > > "; > >- $self->pidl_hdr($notice); >- > $self->{res}->{headers} = "\n"; > $self->{res}->{headers} .= "#include \"config.h\"\n"; > >@@ -1075,7 +1077,7 @@ > } > $parser.=$self->{res}->{code}; > >- my $header = "/* autogenerated by pidl */\n\n"; >+ my $header = $notice; > $header.=$self->{res}->{hdr}; > > $self->CheckUsed($self->{conformance});
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10376
: 9589