gdbus-codegen: Support for separate C header and code generation

gdbus-codegen's options only allow a simultaneous header and source
code generation.

A `--header` and `--body` options have been added along with the
`--output` option which allow separate C header and code
generation.

These options cannot be used in addition to the old options such
as `--generate-c-code`, `--generate-docbook` or
`--output-directory`.

These options have also been added to gdbus-codegen's documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=791015
This commit is contained in:
Iñigo Martínez
2018-01-04 14:18:07 +01:00
parent 6c3af1cdda
commit e4d68c7b3e
2 changed files with 96 additions and 12 deletions

View File

@@ -37,6 +37,9 @@
<arg><option>--generate-docbook</option> <replaceable>OUTFILES</replaceable></arg>
<arg><option>--pragma-once</option></arg>
<arg><option>--xml-files</option> <replaceable>FILE</replaceable></arg>
<arg><option>--header</option></arg>
<arg><option>--body</option></arg>
<arg><option>--output</option> <replaceable>OUTFILE</replaceable></arg>
<group choice="plain" rep="repeat">
<arg>
<option>--annotate</option>
@@ -262,6 +265,55 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>--header</option></term>
<listitem>
<para>
If this option is passed, it will generate the header code and write it to the disk by
using the path and file name provided by <option>--output</option>.
</para>
<para>
Using <option>--generate-c-code</option>, <option>--generate-docbook</option> or
<option>--output-directory</option> are not allowed to be used along with
<option>--header</option> and <option>--body</option> options, because these options
are used to generate only one file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--body</option></term>
<listitem>
<para>
If this option is passed, it will generate the source code and write it to the disk by
using the path and file name provided by <option>--output</option>.
</para>
<para>
Using <option>--generate-c-code</option>, <option>--generate-docbook</option> or
<option>--output-directory</option> are not allowed to be used along with
<option>--header</option> and <option>--body</option> options, because these options
are used to generate only one file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--output</option> <replaceable>OUTFILE</replaceable></term>
<listitem>
<para>
The full path where the header (<option>--header</option>) or the source code
(<option>--body</option>) will be written, using the path and filename provided by
<option>--output</option>. The full path could be something like
<literal>$($OUTFILE).{c,h}</literal>.
</para>
<para>
Using <option>--generate-c-code</option>, <option>--generate-docbook</option> or
<option>--output-directory</option> is not allowed along with
<option>--output</option>, because the latter is used to generate only one file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--annotate</option> <replaceable>ELEMENT</replaceable> <replaceable>KEY</replaceable> <replaceable>VALUE</replaceable></term>
<listitem>