History log of /linux-master/Documentation/sphinx/parse-headers.pl
Revision Date Author Comments
# c25ce589 23-Nov-2020 Finn Behrens <me@kloenk.de>

tweewide: Fix most Shebang lines

Change every shebang which does not need an argument to use /usr/bin/env.
This is needed as not every distro has everything under /usr/bin,
sometimes not even bash.

Signed-off-by: Finn Behrens <me@kloenk.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 9303c9d5 24-Sep-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

docs: get rid of :c:type explicit declarations for structs

The :c:type:`foo` only works properly with structs before
Sphinx 3.x.

On Sphinx 3.x, structs should now be declared using the
.. c:struct, and referenced via :c:struct tag.

As we now have the automarkup.py macro, that automatically
convert:
struct foo

into cross-references, let's get rid of that, solving
several warnings when building docs with Sphinx 3.x.

Reviewed-by: André Almeida <andrealmeid@collabora.com> # blk-mq.rst
Reviewed-by: Takashi Iwai <tiwai@suse.de> # sound
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# a5989e29 20-Jun-2020 Alexander A. Klimov <grandmaster@al2klimov.de>

Replace HTTP links with HTTPS ones: Documentation/sphinx/parse-headers.pl

Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
For each line:
If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Link: https://lore.kernel.org/r/20200620075402.22347-1-grandmaster@al2klimov.de
Signed-off-by: Jonathan Corbet <corbet@lwn.net>


# f3821276 05-Jun-2018 Federico Vaga <federico.vaga@vaga.pv.it>

doc:sphinx: fix parse-header description

The description speaks about the option ``--man`` but it
does not exist. Instead, there is the option ``--usage``

$ ./Documentation/sphinx/parse-headers.pl --man
Unknown option: man
Usage:
parse_headers.pl [<options>] <C_FILE> <OUT_FILE> [<EXCEPTIONS_FILE>]

Where <options> can be: --debug, --help or --man.

Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>


# 32590819 25-Apr-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

MAINTAINERS & files: Canonize the e-mails I use at files

From now on, I'll start using my @kernel.org as my development e-mail.

As such, let's remove the entries that point to the old
mchehab@s-opensource.com at MAINTAINERS file.

For the files written with a copyright with mchehab@s-opensource,
let's keep Samsung on their names, using mchehab+samsung@kernel.org,
in order to keep pointing to my employer, with sponsors the work.

For the files written before I join Samsung (on July, 4 2013),
let's just use mchehab@kernel.org.

For bug reports, we can simply point to just kernel.org, as
this will reach my mchehab+samsung inbox anyway.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Brian Warner <brian.warner@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# c3396656 30-Nov-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

docs-rst: parse-headers.pl: cleanup the documentation

Keeping both rst and in-file documentation in sync can be harsh.

So, simplify the script's internal documntation to a bare minimum,
and add a mention to the ReST file with its full documentation.

This way, a quick help is still available at the command line,
while the complete one is maintained at the ReST format.

As we won't be using pad2rst anymore, do a cleanup at the ReST
file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>


# 327f5a75 17-Nov-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

parse-headers.pl: add documentation for this script

Provide a man page for parse-headers.pl, describing
how to use it.

The documentation on ReST format was generated via pod2rst:
http://search.cpan.org/~dowens/Pod-POM-View-Restructured-0.02/bin/pod2rst

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>


# 22c40033 31-Aug-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] docs-rst: parse-headers.pl: use the C domain for cross-references

Instead of keep using the normal reference, move to the C
domain ones. Using C domains everywhere will allow
cross-references between kAPI and uAPI docs.

Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# bcec7c21 31-Aug-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] docs-rst: parse-headers.pl: make debug a command line option

Add a parser for the --debug option, in order to allow
seeing what the parser is doing.

Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 999d998e 16-Aug-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

docs-rst: parse-heraders.pl: escape LaTeX characters

Let's escape the LaTeX characters, to avoid troubles when
outputing them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>


# fb6fc6c9 09-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: parse-headers: remove trailing spaces

The function that replace references add a "\ " at the end of
references, to avoid the ReST markup parser to not identify
them as references. That works fine except for the end of lines,
as a sequence of { '\', ' ', '\n' } characters makes Sphinx
to ignore the end of line. So, strip those escape/spaces at the
end of lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 153234c4 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: parse-headers: don't do substituition references

Add one extra escape character to avoid those warnings:
Documentation/linux_tv/videodev2.h.rst:6: WARNING: Inline substitution_reference start-string without end-string.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 526b8848 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: parse-headers: add an option to ignore enum symbols

At videodev2.h, we have hundreds of symbols that don't
currently have a reference yet. Let's ignore for how, while
we don't improve those cross-refs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 034e6c8e 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: parse-headers: better handle comments at the source code

We should not let comments to mangle with the symbols
parsing. Unfortunately, videodev2.h has lots of those
in the middle of enums and structs. So, we need to improve
our parser to discard them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 4ff916a0 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: parse-headers: fix multiline typedef handler

The typedef handler should do two things to be generic:
1) parse typedef enums;
2) accept both possible syntaxes:
typedef struct foo { .. } foo_t;
typedef struct { .. } foo_t;

Unfortunately, this is needed to parse some legacy DVB
files, like dvb/audio.h.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 6c4c7dad 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: parse-headers: better handle typedefs

When typedef is used on its multiline format, we need to
also parse enum and struct in the same line.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 9c80c745 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: parse-headers: be more formal about the valid symbols

Be more formal about the valid symbols that are expected by
the parser, to match what c language expects.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 9afe5112 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: fix parsing comments and '{' on a separate line

The dmx.h header has two things that causes the parser to
break while handling enums:
per-header enums and the '{' starts on a new line

Both makes the parser to get lexical marks to be detected
as if they were symbols.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 7d95fa8d 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-dst: parse-headers: highlight deprecated comments

When something is deprecated, highlight it, as we want it
to be clearer to the reader.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 6fe79d1e 07-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: parse-headers: improve delimiters to detect symbols

As we had to escape the symbols for the ReST markup to not do
the wrong thing, the logic to discover start/end of strings
are not trivial. Improve the end delimiter detection, in order
to highlight more occurrences of the strings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# dabf8be3 06-Jul-2016 Mauro Carvalho Chehab <mchehab@kernel.org>

doc-rst: add parse-headers.pl script

This script parses a header file and converts it into a
parsed-literal block, creating references for ioctls,
defines, typedefs, enums and structs.

It also allow an external file to modify the rules, in
order to fix the expressions.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>