diff options
author | Randy Dunlap <rdunlap@infradead.org> | 2024-11-19 22:07:11 -0800 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2024-12-11 09:07:40 -0700 |
commit | 28884915e6b14c9af4ddbb5f89d64edd863494c0 (patch) | |
tree | 3074268d27fae248842ee61a8d91fa085a85ad48 | |
parent | bc7509446b456d6649afa60fce9104d169e94de1 (diff) | |
download | lwn-28884915e6b14c9af4ddbb5f89d64edd863494c0.tar.gz lwn-28884915e6b14c9af4ddbb5f89d64edd863494c0.zip |
Documentation: core-api: add generic parser docbook
Add the simple generic parser to the core-api docbook.
It can be used for parsing all sorts of options throughout the kernel.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20241120060711.159783-1-rdunlap@infradead.org
-rw-r--r-- | Documentation/core-api/index.rst | 1 | ||||
-rw-r--r-- | Documentation/core-api/parser.rst | 17 | ||||
-rw-r--r-- | lib/parser.c | 5 |
3 files changed, 21 insertions, 2 deletions
diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst index 563b8fc0002f..998fd81a3f11 100644 --- a/Documentation/core-api/index.rst +++ b/Documentation/core-api/index.rst @@ -53,6 +53,7 @@ Library functionality that is used throughout the kernel. floating-point union_find min_heap + parser Low level entry and exit ======================== diff --git a/Documentation/core-api/parser.rst b/Documentation/core-api/parser.rst new file mode 100644 index 000000000000..45750d04b895 --- /dev/null +++ b/Documentation/core-api/parser.rst @@ -0,0 +1,17 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +============== +Generic parser +============== + +Overview +======== + +The generic parser is a simple parser for parsing mount options, +filesystem options, driver options, subsystem options, etc. + +Parser API +========== + +.. kernel-doc:: lib/parser.c + :export: diff --git a/lib/parser.c b/lib/parser.c index f4eafb9d74e6..73e8f8e5be73 100644 --- a/lib/parser.c +++ b/lib/parser.c @@ -275,8 +275,9 @@ EXPORT_SYMBOL(match_hex); * * Description: Parse the string @str to check if matches wildcard * pattern @pattern. The pattern may contain two types of wildcards: - * '*' - matches zero or more characters - * '?' - matches one character + * + * * '*' - matches zero or more characters + * * '?' - matches one character * * Return: If the @str matches the @pattern, return true, else return false. */ |