Documentation: core-api: add generic parser docbook
authorRandy Dunlap <rdunlap@infradead.org>
Wed, 20 Nov 2024 06:07:11 +0000 (22:07 -0800)
committerJonathan Corbet <corbet@lwn.net>
Wed, 11 Dec 2024 16:07:40 +0000 (09:07 -0700)
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
Documentation/core-api/index.rst
Documentation/core-api/parser.rst [new file with mode: 0644]
lib/parser.c

index 563b8fc0002f73bce2716096588f45f829d54dcf..998fd81a3f1121a84921b3749c1c7c922dea293d 100644 (file)
@@ -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 (file)
index 0000000..45750d0
--- /dev/null
@@ -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:
index f4eafb9d74e6f79ff25ed66b4fd47455d7b586f1..73e8f8e5be73ff671a64d2d96700cab01aa17bdb 100644 (file)
@@ -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.
  */