mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
kernel-doc: add support to handle DEFINE_ variables
Improve the parser and output plugin to work with macros, adding support for the common pattern of using DEFINE_* to create variables. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <757a45100cfc493984574ff780aa9d90506eecb4.1765894964.git.mchehab+huawei@kernel.org>
This commit is contained in:
committed by
Jonathan Corbet
parent
1045ec382c
commit
bdd1cf8784
@@ -486,7 +486,7 @@ class RestFormat(OutputFormat):
|
||||
|
||||
self.lineprefix = " "
|
||||
|
||||
self.data += f"\n\n.. c:macro:: {name}\n\n{self.lineprefix}{full_proto}\n\n"
|
||||
self.data += f"\n\n.. c:macro:: {name}\n\n{self.lineprefix}``{full_proto}``\n\n"
|
||||
|
||||
self.print_lineno(ln)
|
||||
self.output_highlight(args.get('purpose', ''))
|
||||
@@ -801,13 +801,12 @@ class ManFormat(OutputFormat):
|
||||
|
||||
def out_var(self, fname, name, args):
|
||||
out_name = self.arg_name(args, name)
|
||||
prototype = args.other_stuff["var_type"]
|
||||
full_proto = args.other_stuff["full_proto"]
|
||||
|
||||
self.data += f'.TH "{self.modulename}" 9 "{out_name}" "{self.man_date}" "API Manual" LINUX' + "\n"
|
||||
|
||||
self.data += ".SH NAME\n"
|
||||
self.data += f"{prototype} \\- {args['purpose']}\n"
|
||||
self.data += f"{name} \\- {args['purpose']}\n"
|
||||
|
||||
self.data += ".SH SYNOPSIS\n"
|
||||
self.data += f"{full_proto}\n"
|
||||
|
||||
Reference in New Issue
Block a user