The Samba-Bugzilla – Bug 10376
HEADER START/HEADER END to insert C code into the generated .h file
Last modified: 2016-07-27 22:22:37 UTC
Created attachment 9589 [details]
Patch to add HEADER START/HEADER END
In the LSA dissector, we currently have some functions defined in the .cnf file that aren't replacement dissectors for types, they're helper functions. We want to put the declarations of those functions into the generated .h file, so that the declarations and definitions will be checked against each other when the dissector is compiled, and so that other code importing the functions don't have to declare them.
Here's a patch to add HEADER START and HEADER END directives, with declarations to be inserted into the header file between them.
It also adds some checks for nesting of CODE and HEADER sections, and improves the "this is a generated file, don't edit it" comment at the beginning of the .c and .h files.
(Actually, we *do* need to edit the files, due to other Pidl bugs; I think I've filed at least some of them.)
This was fixed in 372b41eede4cfcedcea7fbe8370dd7ac2d015db2.