Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Randy Dunlap and committed by
Jonathan Corbet
28884915 bc750944

+21 -2
+1
Documentation/core-api/index.rst
··· 53 53 floating-point 54 54 union_find 55 55 min_heap 56 + parser 56 57 57 58 Low level entry and exit 58 59 ========================
+17
Documentation/core-api/parser.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0+ 2 + 3 + ============== 4 + Generic parser 5 + ============== 6 + 7 + Overview 8 + ======== 9 + 10 + The generic parser is a simple parser for parsing mount options, 11 + filesystem options, driver options, subsystem options, etc. 12 + 13 + Parser API 14 + ========== 15 + 16 + .. kernel-doc:: lib/parser.c 17 + :export:
+3 -2
lib/parser.c
··· 275 275 * 276 276 * Description: Parse the string @str to check if matches wildcard 277 277 * pattern @pattern. The pattern may contain two types of wildcards: 278 - * '*' - matches zero or more characters 279 - * '?' - matches one character 278 + * 279 + * * '*' - matches zero or more characters 280 + * * '?' - matches one character 280 281 * 281 282 * Return: If the @str matches the @pattern, return true, else return false. 282 283 */