Skip to content

Commit

Permalink
Documentation: core-api: add generic parser docbook
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Eric Biggers <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Jonathan Corbet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
rddunlap authored and Jonathan Corbet committed Dec 11, 2024
1 parent bc75094 commit 2888491
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions Documentation/core-api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Library functionality that is used throughout the kernel.
floating-point
union_find
min_heap
parser

Low level entry and exit
========================
Expand Down
17 changes: 17 additions & 0 deletions Documentation/core-api/parser.rst
Original file line number Diff line number Diff line change
@@ -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:
5 changes: 3 additions & 2 deletions lib/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 2888491

Please sign in to comment.