]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpcgen: define entrypoint for running new rpcgen impl
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 19 Dec 2022 19:11:33 +0000 (14:11 -0500)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 3 Nov 2023 18:06:35 +0000 (14:06 -0400)
commitac9e6ff649a4d68898bfedb37014de0cbb44e64e
tree73411209e50d20f563006c22b67eea10744d363b
parent40cbaa8fbee481386f73fb64dc6469160c0bc168
rpcgen: define entrypoint for running new rpcgen impl

The new program takes the form

  rpcgen [--mode source|header|repr] \
         [--header include] \
         xdr-file output-file

If '--mode' is not given it parses the XDR file but does not
generate anything, which is useful as a syntax check. The
'source' mode gives the '.c' file content, while 'header'
gives the '.h' file content. 'repr' gives a representation
of the abstract syntax tree, mostly useful for debugging
the parser.

If '--header' is given, it is added as a local #include ".."
statement in the output and is valid for either 'header'
or 'source' modes.

Either 'xdr-file' or 'output-file' can be omitted in which
case they default to stdin/stdout respectively.

This rpcgen program will directly include the 'config.h'
header in its output.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
scripts/rpcgen/main.py [new file with mode: 0755]