Skip to content
Snippets Groups Projects
kernel-doc 68.94 KiB
#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0

use warnings;
use strict;

## Copyright (c) 1998 Michael Zucchi, All Rights Reserved        ##
## Copyright (C) 2000, 1  Tim Waugh <twaugh@redhat.com>          ##
## Copyright (C) 2001  Simon Huggins                             ##
## Copyright (C) 2005-2012  Randy Dunlap                         ##
## Copyright (C) 2012  Dan Luedtke                               ##
## 								 ##
## #define enhancements by Armin Kuster <akuster@mvista.com>	 ##
## Copyright (c) 2000 MontaVista Software, Inc.			 ##
## 								 ##
## This software falls under the GNU General Public License.     ##
## Please read the COPYING file for more information             ##

# 18/01/2001 - 	Cleanups
# 		Functions prototyped as foo(void) same as foo()
# 		Stop eval'ing where we don't need to.
# -- huggie@earth.li

# 27/06/2001 -  Allowed whitespace after initial "/**" and
#               allowed comments before function declarations.
# -- Christian Kreibich <ck@whoop.org>

# Still to do:
# 	- add perldoc documentation
# 	- Look more closely at some of the scarier bits :)

# 26/05/2001 - 	Support for separate source and object trees.
#		Return error code.
# 		Keith Owens <kaos@ocs.com.au>

# 23/09/2001 - Added support for typedefs, structs, enums and unions
#              Support for Context section; can be terminated using empty line
#              Small fixes (like spaces vs. \s in regex)
# -- Tim Jansen <tim@tjansen.de>

# 25/07/2012 - Added support for HTML5
# -- Dan Luedtke <mail@danrl.de>

sub usage {
    my $message = <<"EOF";
Usage: $0 [OPTION ...] FILE ...

Read C language source or header FILEs, extract embedded documentation comments,
and print formatted documentation to standard output.

The documentation comments are identified by "/**" opening comment mark. See
Documentation/doc-guide/kernel-doc.rst for the documentation comment syntax.

Output format selection (mutually exclusive):
  -man			Output troff manual page format. This is the default.
  -rst			Output reStructuredText format.
  -none			Do not output documentation, only warnings.

Output format selection modifier (affects only ReST output):

  -sphinx-version	Use the ReST C domain dialect compatible with an
			specific Sphinx Version.
			If not specified, kernel-doc will auto-detect using
			the sphinx-build version found on PATH.

Output selection (mutually exclusive):
  -export		Only output documentation for symbols that have been
			exported using EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL()
                        in any input FILE or -export-file FILE.
  -internal		Only output documentation for symbols that have NOT been