[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241120060711.159783-1-rdunlap@infradead.org>
Date: Tue, 19 Nov 2024 22:07:11 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: linux-kernel@...r.kernel.org
Cc: Randy Dunlap <rdunlap@...radead.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Eric Biggers <ebiggers@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Jonathan Corbet <corbet@....net>,
linux-doc@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: [PATCH] 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@...radead.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Eric Biggers <ebiggers@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Jonathan Corbet <corbet@....net>
Cc: linux-doc@...r.kernel.org
Cc: linux-fsdevel@...r.kernel.org
---
Documentation/core-api/index.rst | 1 +
Documentation/core-api/parser.rst | 17 +++++++++++++++++
lib/parser.c | 5 +++--
3 files changed, 21 insertions(+), 2 deletions(-)
--- linux-next-20241118.orig/Documentation/core-api/index.rst
+++ linux-next-20241118/Documentation/core-api/index.rst
@@ -53,6 +53,7 @@ Library functionality that is used throu
floating-point
union_find
min_heap
+ parser
Low level entry and exit
========================
--- /dev/null
+++ linux-next-20241118/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:
--- linux-next-20241118.orig/lib/parser.c
+++ linux-next-20241118/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.
*/
Powered by blists - more mailing lists