Re: [Vala] Header file generation



On Mon, 2009-01-12 at 18:38 +0100, Philip Van Hoof wrote:
On Sun, 2009-01-11 at 14:14 +0100, Jürg Billeter wrote:
 * Minimize use of header files
   A more radical approach would be to not use header files where not
   necessary. The Vala compiler could insert required declarations at
   the top of each generated .c file and only use include directives for
   external libraries. This would lead to optimal rebuild performance at
   the cost of a bit larger .c files.

   We obviously still need to support generating header files to use
   libraries written in Vala. I would propose to add an option -H foo.h
   to valac to generate a single header file with the full public C API.

So let valac copy what would end up in -priv.h files into each .c file
being generated?

Well, the .c is not for human eyes nor hands to see nor modify, so
that's okay for me.

You kinda loose the capability of interfering from a manual .c file,
like I described in this example (although the particular example
wouldn't be affected): http://live.gnome.org/Vala/MultiImplementInC

I don't think that this would have a large effect when combining C and
Vala in the same library. The only difference is that you get one
instead of multiple .h files per valac invocation. If you want to be
able to access internal Vala methods from the C part, we can certainly
add a --header-internal option to generate a -priv.h file.

Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]