]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpcgen: add a C code generator for XDR protocol specs
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 19 Dec 2022 19:08:09 +0000 (14:08 -0500)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 3 Nov 2023 18:06:35 +0000 (14:06 -0400)
commit8ec79e5e149b3b373b11caee9b27873a55715f9c
tree80d31dfa03ec2d70b1dc9e4248136bd0dc1b7ebb
parent518af85344f53eff34eaf8e693a20daed44a715f
rpcgen: add a C code generator for XDR protocol specs

This implements a C code generator that emits code that is
(almost) identical to the classic 'rpcgen' program. The
key differences are:

 - Skip inlining of calls for struct fields
 - Skip K&R style function prototypes in headers
 - Use int64_t instead of quad_t for OS portability
 - Saner whitespace / indentation

The tests/demo.c and tests/demo.h files were created using
the traditional 'rpcgen' program, and then editted to cut
out the leading boilerplate, and the differences mentioned
above.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
build-aux/syntax-check.mk
scripts/rpcgen/rpcgen/generator.py [new file with mode: 0644]
scripts/rpcgen/tests/demo.c [new file with mode: 0644]
scripts/rpcgen/tests/demo.h [new file with mode: 0644]
scripts/rpcgen/tests/demo.x [new file with mode: 0644]
scripts/rpcgen/tests/meson.build
scripts/rpcgen/tests/test_generator.py [new file with mode: 0644]