linux/tools/net/sunrpc/xdrgen/templates/C
Chuck Lever 6bc85baba4 xdrgen: Implement pass-through lines in specifications
XDR specification files can contain lines prefixed with '%' that
pass through unchanged to generated output. Traditional rpcgen
removes the '%' and emits the remainder verbatim, allowing direct
insertion of C includes, pragma directives, or other language-
specific content into the generated code.

Until now, xdrgen silently discarded these lines during parsing.
This prevented specifications from including necessary headers or
preprocessor directives that might be required for the generated
code to compile correctly.

The grammar now captures pass-through lines instead of ignoring
them. A new AST node type represents pass-through content, and
the AST transformer strips the leading '%' character. Definition
and source generators emit pass-through content in document order,
preserving the original placement within the specification.

This brings xdrgen closer to feature parity with traditional
rpcgen while maintaining the existing document-order processing
model.

Existing generated xdrgen source code has been regenerated.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2026-01-29 09:48:33 -05:00
..
constants
enum xdrgen: Add enum value validation to generated decoders 2026-01-26 10:10:58 -05:00
header_bottom
header_top
passthru xdrgen: Implement pass-through lines in specifications 2026-01-29 09:48:33 -05:00
pointer xdrgen: Don't generate unnecessary semicolon 2025-11-25 09:09:42 -05:00
program xdrgen: Emit a max_arg_sz macro 2026-01-26 10:10:58 -05:00
source_top xdrgen: Remove inclusion of nlm4.h header 2026-01-26 10:10:58 -05:00
struct xdrgen: Don't generate unnecessary semicolon 2025-11-25 09:09:42 -05:00
typedef xdrgen: Don't generate unnecessary semicolon 2025-11-25 09:09:42 -05:00
union xdrgen: Address some checkpatch whitespace complaints 2026-01-26 10:10:58 -05:00